mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-24 03:45:13 -06:00
fix elemental shield equip gfx
This commit is contained in:
parent
210be91d4c
commit
22f6c5f31d
1 changed files with 28 additions and 8 deletions
|
|
@ -33,11 +33,13 @@ import content.region.kandarin.seers.quest.elementalworkshop2.ElementalWorkshop2
|
|||
import content.region.kandarin.seers.quest.elementalworkshop2.ElementalWorkshop2.Companion.mShieldEquip
|
||||
import core.game.world.update.flag.context.Graphics
|
||||
import core.api.*
|
||||
import core.game.container.impl.EquipmentContainer
|
||||
import core.game.interaction.IntType
|
||||
import core.game.interaction.InteractionListener
|
||||
import core.game.node.entity.npc.NPC
|
||||
import core.game.node.entity.player.Player
|
||||
import core.game.node.entity.skill.Skills
|
||||
import core.game.node.item.Item
|
||||
import core.game.node.scenery.SceneryBuilder
|
||||
import core.game.world.map.Location
|
||||
import core.game.world.map.RegionManager
|
||||
|
|
@ -1261,23 +1263,41 @@ class EW2Listeners : InteractionListener {
|
|||
|
||||
// equip graphics for helmets and shields. the shields should not technically show until the graphic finishes, but I can't find an easy way to do that.
|
||||
onEquip(Items.MIND_HELMET_9733) { player, _ ->
|
||||
sendGraphics(mHelmEquip, player.location)
|
||||
visualize(player, -1, mHelmEquip)
|
||||
return@onEquip true
|
||||
}
|
||||
|
||||
onEquip(Items.MIND_SHIELD_9731) { player, _ ->
|
||||
sendGraphics(Graphics(mShieldEquip,95), player.location)
|
||||
return@onEquip true
|
||||
onEquip(Items.MIND_SHIELD_9731) { player, node ->
|
||||
val currentShield = player.equipment[EquipmentContainer.SLOT_SHIELD]
|
||||
if (currentShield != null) {
|
||||
player.equipment.remove(currentShield)
|
||||
}
|
||||
visualize(player, -1, Graphics(mShieldEquip,95))
|
||||
runTask(player, 2) {
|
||||
val item = node.asItem()
|
||||
player.equipment.add(item, item.slot, true, true)
|
||||
player.inventory.add(currentShield)
|
||||
}
|
||||
return@onEquip false
|
||||
}
|
||||
|
||||
onEquip(Items.ELEMENTAL_HELMET_9729) { player, _ ->
|
||||
sendGraphics(eHelmEquip, player.location)
|
||||
visualize(player, -1, eHelmEquip)
|
||||
return@onEquip true
|
||||
}
|
||||
|
||||
onEquip(Items.ELEMENTAL_SHIELD_2890) { player, _ ->
|
||||
sendGraphics(Graphics(eShieldEquip,95), player.location)
|
||||
return@onEquip true
|
||||
onEquip(Items.ELEMENTAL_SHIELD_2890) { player, node ->
|
||||
val currentShield = player.equipment[EquipmentContainer.SLOT_SHIELD]
|
||||
if (currentShield != null) {
|
||||
player.equipment.remove(currentShield)
|
||||
}
|
||||
visualize(player, -1, Graphics(eShieldEquip,95))
|
||||
runTask(player, 2) {
|
||||
val item = node.asItem()
|
||||
player.equipment.add(item, item.slot, true, true)
|
||||
player.inventory.add(currentShield)
|
||||
}
|
||||
return@onEquip false
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue