From fcc7d9ff43d2b94b7d00a3ecbeffc6356dbdf39a Mon Sep 17 00:00:00 2001 From: James Monger Date: Sat, 24 Aug 2024 15:48:17 +0100 Subject: [PATCH] refactor(content): use queues for eating toad --- .../quest_chompybird/scripts/bloated_toad.rs2 | 11 +++++++ .../quest_chompybird/scripts/chompy_bird.rs2 | 29 +++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/data/src/scripts/quests/quest_chompybird/scripts/bloated_toad.rs2 b/data/src/scripts/quests/quest_chompybird/scripts/bloated_toad.rs2 index 02fb31527..9cfaa99f4 100644 --- a/data/src/scripts/quests/quest_chompybird/scripts/bloated_toad.rs2 +++ b/data/src/scripts/quests/quest_chompybird/scripts/bloated_toad.rs2 @@ -120,3 +120,14 @@ while (.huntnext = true) { // is damage random per-player or per-toad? ~.damage_self(calc(random(1) + 1)); } + +// The toad is being eaten by the Chompy +[ai_queue5,bloated_toad] +npc_delay(3); + +// TODO do we need to check that the Chompy is still there and eating the toad? +// should test on OSRS to confirm + +npc_say("!!Croak!!"); +npc_delay(2); +npc_del; diff --git a/data/src/scripts/quests/quest_chompybird/scripts/chompy_bird.rs2 b/data/src/scripts/quests/quest_chompybird/scripts/chompy_bird.rs2 index 5d5d94ee4..9684542fd 100644 --- a/data/src/scripts/quests/quest_chompybird/scripts/chompy_bird.rs2 +++ b/data/src/scripts/quests/quest_chompybird/scripts/chompy_bird.rs2 @@ -11,29 +11,22 @@ npc_sethuntmode(chompybird); } +// triggered by the .hunt config, the Chompy has found, and arrived at, the Bloated Toad [ai_queue4,chompy_bird] if (.npc_find(npc_coord, bloated_toad, 1, 1) = true) { - // TODO get delays, anims etc with OSRS - npc_say("Sqwark!"); + npc_sethuntmode(null); npc_facesquare(.npc_coord); - - .npc_delay(3); - - if (npc_finduid(npc_uid) = true & .npc_finduid(.npc_uid) = true) { - .npc_say("!!Croak!!"); - npc_say("Gobble!"); - - .npc_delay(2); - - if (.npc_finduid(.npc_uid) = true) { - .npc_del; - - // TODO how to set `%chompybird_progress = ^chompybird_chompy_ate_toad` for the player who spawned the toad? - // TODO clear hunt mode? - } - } + npc_queue(5, 0, 0); + .npc_queue(5, 0, 0); } +// the Chompy is eating the toad +[ai_queue5,chompy_bird] +npc_say("Sqwark!"); +npc_delay(3); +npc_say("Gobble!"); +npc_delay(2); + [opnpc4,chompy_bird_corpse] mes("You start plucking the chompy bird."); anim(human_pickupfloor, 0);