mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Fixed a warrior's guild dupe
This commit is contained in:
parent
c7acb9c0e7
commit
fc35807cf0
3 changed files with 44 additions and 2 deletions
|
|
@ -80754,7 +80754,7 @@
|
|||
"name": "Defensive shield",
|
||||
"weight": "3.6",
|
||||
"archery_ticket_price": "0",
|
||||
"two_handed": "true",
|
||||
"two_handed": "false",
|
||||
"id": "8856",
|
||||
"bonuses": "0,0,0,-6,-2,8,9,7,0,8,0,0,0,0,0",
|
||||
"equipment_slot": "5"
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public final class CatapultRoom extends MapZone implements Plugin<Object> {
|
|||
/**
|
||||
* The target location.
|
||||
*/
|
||||
private static final Location TARGET = Location.create(2842, 3545, 1);
|
||||
public static final Location TARGET = Location.create(2842, 3545, 1);
|
||||
|
||||
/**
|
||||
* The shield item id.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package rs09.game.content.activity.wguild
|
||||
|
||||
import core.game.component.Component
|
||||
import core.game.container.impl.EquipmentContainer
|
||||
import core.game.content.activity.wguild.catapult.CatapultRoom
|
||||
import core.game.node.item.Item
|
||||
import org.rs09.consts.Items
|
||||
import rs09.game.interaction.InteractionListener
|
||||
|
||||
class WGuildListeners : InteractionListener() {
|
||||
override fun defineListeners() {
|
||||
onEquip(Items.DEFENSIVE_SHIELD_8856){player, node ->
|
||||
if (node is Item) {
|
||||
if (player.location != CatapultRoom.TARGET) {
|
||||
player.packetDispatch.sendMessage("You may not equip this shield outside the target area in the Warrior's Guild.")
|
||||
return@onEquip false
|
||||
}
|
||||
if (player.equipment[EquipmentContainer.SLOT_WEAPON] != null) {
|
||||
player.dialogueInterpreter.sendDialogue(
|
||||
"You will need to make sure your sword hand is free to equip this",
|
||||
"shield."
|
||||
)
|
||||
return@onEquip false
|
||||
}
|
||||
|
||||
player.interfaceManager.hideTabs(2, 3, 5, 6, 7, 11, 12)
|
||||
player.interfaceManager.openTab(4, Component(411))
|
||||
player.interfaceManager.setViewedTab(4)
|
||||
player.interfaceManager.open(Component(410))
|
||||
return@onEquip true
|
||||
}
|
||||
|
||||
return@onEquip false
|
||||
}
|
||||
|
||||
onUnequip(Items.DEFENSIVE_SHIELD_8856){player, _ ->
|
||||
player.interfaceManager.restoreTabs()
|
||||
player.interfaceManager.openTab(4, Component(387))
|
||||
return@onUnequip true
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue