mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Compare commits
1 commit
d826e4bcce
...
8337670660
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8337670660 |
2 changed files with 8 additions and 17 deletions
|
|
@ -17,7 +17,6 @@ import core.game.world.update.flag.context.Animation
|
|||
import core.game.world.update.flag.context.Graphics
|
||||
import org.rs09.consts.Items
|
||||
import core.game.world.GameWorld.Pulser
|
||||
import core.tools.Log
|
||||
import org.rs09.consts.Sounds
|
||||
import java.util.*
|
||||
|
||||
|
|
@ -261,24 +260,17 @@ enum class EnchantedJewellery(
|
|||
if (isSlayerRing(item)) {
|
||||
if (isEquipped) {
|
||||
// Remove it now, but only addItemOrDrop the gem after the teleport has procced
|
||||
if (removeItem(player, item, Container.EQUIPMENT)) {
|
||||
return@queueScript delayScript(player, 1)
|
||||
}
|
||||
log(this.javaClass, Log.ERR, "Error replacing slayer ring with enchanted gem (removeItem from equipment)")
|
||||
removeItem(player, item, Container.INVENTORY)
|
||||
return@queueScript delayScript(player, 1)
|
||||
}
|
||||
// Not equipped -> can replace fluently
|
||||
if (replaceSlot(player, item.slot, Item(Items.ENCHANTED_GEM_4155), item) == item) {
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
log(this.javaClass, Log.ERR, "Error replacing slayer ring with enchanted gem (replaceSlot)")
|
||||
replaceSlot(player, item.slot, Item(Items.ENCHANTED_GEM_4155), item)
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
// Not slayer ring
|
||||
if (isCrumble) {
|
||||
val removeFrom = if (isEquipped) Container.EQUIPMENT else Container.INVENTORY
|
||||
if (removeItem(player, item, removeFrom)) {
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
log(this.javaClass, Log.ERR, "Error crumbling jewelry")
|
||||
removeItem(player, item, removeFrom)
|
||||
}
|
||||
} else {
|
||||
replaceJewellery(player, item, nextJewellery, isEquipped)
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ fun replaceSlot(player: Player, slot: Int, item: Item, currentItem: Item? = null
|
|||
}
|
||||
|
||||
if (cont.remove(currentItem, slot, true)) {
|
||||
return cont.replace(item, slot) ?: currentItem
|
||||
return cont.replace(item, slot)
|
||||
}
|
||||
|
||||
PlayerMonitor.log(player, LogType.DUPE_ALERT, "Potential slot-replacement-based dupe attempt, slot: $slot, item: $item")
|
||||
|
|
@ -413,9 +413,8 @@ fun replaceSlot(player: Player, slot: Int, item: Item, currentItem: Item? = null
|
|||
Container.INVENTORY -> Container.EQUIPMENT
|
||||
else -> Container.INVENTORY
|
||||
}
|
||||
if (removeItem(player, currentItem, other)) {
|
||||
return cont.replace(item, slot) ?: currentItem
|
||||
}
|
||||
if (removeItem(player, currentItem, other))
|
||||
return cont.replace(item, slot)
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue