mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Fix pt 1 - jewelry half
This commit is contained in:
parent
e4a465a082
commit
31bd7af2b5
1 changed files with 13 additions and 5 deletions
|
|
@ -17,6 +17,7 @@ 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.*
|
||||
|
||||
|
|
@ -260,17 +261,24 @@ enum class EnchantedJewellery(
|
|||
if (isSlayerRing(item)) {
|
||||
if (isEquipped) {
|
||||
// Remove it now, but only addItemOrDrop the gem after the teleport has procced
|
||||
removeItem(player, item, Container.INVENTORY)
|
||||
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)")
|
||||
}
|
||||
// Not equipped -> can replace fluently
|
||||
replaceSlot(player, item.slot, Item(Items.ENCHANTED_GEM_4155), item)
|
||||
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)")
|
||||
}
|
||||
// Not slayer ring
|
||||
if (isCrumble) {
|
||||
val removeFrom = if (isEquipped) Container.EQUIPMENT else Container.INVENTORY
|
||||
removeItem(player, item, removeFrom)
|
||||
if (removeItem(player, item, removeFrom)) {
|
||||
return@queueScript stopExecuting(player)
|
||||
}
|
||||
log(this.javaClass, Log.ERR, "Error crumbling jewelry")
|
||||
}
|
||||
} else {
|
||||
replaceJewellery(player, item, nextJewellery, isEquipped)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue