Merge branch 'neit-audit-bugfix' into 'master'

Quick bugfix patch for Jatizso audit

See merge request 2009scape/2009scape!139
This commit is contained in:
Ceikry
2021-07-10 19:59:52 +00:00
2 changed files with 10 additions and 9 deletions
@@ -28,10 +28,10 @@ class TowerGuardDialogue(player: Player? = null) : DialoguePlugin(player) {
1 -> playerl(FacialExpression.HALF_THINKING, "No need to shout.").also { stage++ } 1 -> playerl(FacialExpression.HALF_THINKING, "No need to shout.").also { stage++ }
2 -> npc(FacialExpression.NEUTRAL, "I'M SORRY I'VE BEEN SHOUTING","INSULTS SO LONG I CAN'T HELP IT!").also { stage++ } 2 -> npc(FacialExpression.NEUTRAL, "I'M SORRY I'VE BEEN SHOUTING","INSULTS SO LONG I CAN'T HELP IT!").also { stage++ }
3 -> playerl(FacialExpression.HALF_THINKING, "Who are you insulting?").also { stage++ } 3 -> playerl(FacialExpression.HALF_THINKING, "Who are you insulting?").also { stage++ }
4 -> npc(FacialExpression.NEUTRAL, "THE TOWER IN NEITIZNOT.","THEY SHOUT INSULTS BACK.").also { stage++ } 4 -> npc(FacialExpression.NEUTRAL, "THE TOWER IN ${if(npc.id == NPCs.GUARD_5489) "NEITIZNOT" else "JATIZSO"}.","THEY SHOUT INSULTS BACK.").also { stage++ }
5 -> playerl(FacialExpression.ASKING, "Err, why?" ).also { stage++ } 5 -> playerl(FacialExpression.ASKING, "Err, why?" ).also { stage++ }
6 -> npc(FacialExpression.NEUTRAL, "THE KING TELLS US TO.").also { stage++ } 6 -> npc(FacialExpression.NEUTRAL, "THE ${if(npc.id == NPCs.GUARD_5489) "KING" else "BURGHER"} TELLS US TO.").also { stage++ }
7 -> playerl(FacialExpression.HALF_THINKING, "Your King is a strange person.").also { stage++ } 7 -> playerl(FacialExpression.HALF_THINKING, "Your ${if(npc.id == NPCs.GUARD_5489) "King" else "Burgher"} is a strange person.").also { stage++ }
8 -> options("Can I watch? I'm curious.", "Oh well, I'd better get going.").also { stage++ } 8 -> options("Can I watch? I'm curious.", "Oh well, I'd better get going.").also { stage++ }
9 -> when(buttonId){ 9 -> when(buttonId){
1 -> playerl(FacialExpression.ASKING, "Can I watch? I'm curious.").also { stage++ } 1 -> playerl(FacialExpression.ASKING, "Can I watch? I'm curious.").also { stage++ }
@@ -19,6 +19,7 @@ class JatizsoListeners : InteractionListener() {
val WEST_GATE_ZONE = ZoneBorders(2386,3797,2390,3801) val WEST_GATE_ZONE = ZoneBorders(2386,3797,2390,3801)
val SOUTH_GAE_ZONE = ZoneBorders(2411,3795,2414,3799) val SOUTH_GAE_ZONE = ZoneBorders(2411,3795,2414,3799)
val BELL = 21394 val BELL = 21394
val TOWER_GUARDS = intArrayOf(NPCs.GUARD_5490, NPCs.GUARD_5489)
val GUARDS = intArrayOf(NPCs.GUARD_5491, NPCs.GUARD_5492) val GUARDS = intArrayOf(NPCs.GUARD_5491, NPCs.GUARD_5492)
val KING_CHEST = intArrayOf(21299,21300) val KING_CHEST = intArrayOf(21299,21300)
val LINES = arrayOf( val LINES = arrayOf(
@@ -75,15 +76,15 @@ class JatizsoListeners : InteractionListener() {
return@on true return@on true
} }
on(GUARDS, NPC, "watch-shouting"){player, node -> on(TOWER_GUARDS, NPC, "watch-shouting"){player, _ ->
val local = ContentAPI.findLocalNPC(player, node.id) val local = ContentAPI.findLocalNPC(player, NPCs.GUARD_5489)
ContentAPI.lock(player, 200) ContentAPI.lock(player, 200)
ContentAPI.face(local!!, Location.create(2371, 3801, 2)) ContentAPI.face(local!!, Location.create(2371, 3801, 2))
local.asNpc().isRespawn = false local.asNpc().isRespawn = false
ContentAPI.submitIndividualPulse(player, object : Pulse(4){ ContentAPI.submitIndividualPulse(player, object : Pulse(4){
var id = node.id var id = NPCs.GUARD_5489
var counter = 0 var counter = 0
val other = ContentAPI.findLocalNPC(player, getOther(node.id)) val other = ContentAPI.findLocalNPC(player, getOther(NPCs.GUARD_5489))
override fun start() { override fun start() {
other?.isRespawn = false other?.isRespawn = false
@@ -92,12 +93,12 @@ class JatizsoListeners : InteractionListener() {
override fun pulse(): Boolean { override fun pulse(): Boolean {
val npc = ContentAPI.findLocalNPC(player, id) ?: return false val npc = ContentAPI.findLocalNPC(player, id) ?: return false
val index = when(id){ val index = when(id){
node.id -> 0 NPCs.GUARD_5489 -> 0
else -> 1 else -> 1
} }
if(index == 1 && counter == 5) return true if(index == 1 && counter == 5) return true
ContentAPI.sendChat(npc, LINES[index][counter]) ContentAPI.sendChat(npc, LINES[index][counter])
if(npc.id != node.id) counter++ if(npc.id != NPCs.GUARD_5489) counter++
id = getOther(id) id = getOther(id)
return false return false
} }