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