From 7e80d8e6bb1784d8cf588beb6af20ec7dad01fd6 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Wed, 21 Feb 2024 07:41:06 +0100 Subject: [PATCH] fix(Scripts/TerokkarForest): fix behaviour of skull piles in Skettis (#18371) * initial * fix * include ancient skull pile * fix * fix with debug * finalise --- .../pending_db_world/skullpile-spawn-time.sql | 9 +++++++++ .../scripts/Outland/zone_terokkar_forest.cpp | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 data/sql/updates/pending_db_world/skullpile-spawn-time.sql diff --git a/data/sql/updates/pending_db_world/skullpile-spawn-time.sql b/data/sql/updates/pending_db_world/skullpile-spawn-time.sql new file mode 100644 index 000000000..4c357a4da --- /dev/null +++ b/data/sql/updates/pending_db_world/skullpile-spawn-time.sql @@ -0,0 +1,9 @@ +-- +UPDATE `gameobject` SET `spawntimesecs` = 300 WHERE `id` = 185913 AND `guid` IN (14146, 14147, 14217, 14227, 14694, 14731, 14989); +UPDATE `gameobject` SET `spawntimesecs` = 900 WHERE `id` = 185928 AND `guid` = 14141; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 185928 AND `source_type` = 1; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(185928, 1, 0, 1, 62, 0, 100, 0, 8687, 1, 0, 0, 0, 0, 134, 41004, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Terokk summon'), +(185928, 1, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Terokk summon - linked close gossip'), +(185928, 1, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 900, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Terokk summon - despawn'); diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index b9a183576..b24b227e8 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -632,24 +632,33 @@ public: return true; } - void SendActionMenu(Player* player, GameObject* /*go*/, uint32 action) + void SendActionMenu(Player* player, GameObject* go, uint32 action) { switch (action) { case GOSSIP_ACTION_INFO_DEF + 1: - player->CastSpell(player, SPELL_SUMMON_GEZZARAK_THE_HUNTRESS, false); + _result = player->CastSpell(player, SPELL_SUMMON_GEZZARAK_THE_HUNTRESS, false); break; case GOSSIP_ACTION_INFO_DEF + 2: - player->CastSpell(player, SPELL_SUMMON_DARKSCREECHER_AKKARAI, false); + _result = player->CastSpell(player, SPELL_SUMMON_DARKSCREECHER_AKKARAI, false); break; case GOSSIP_ACTION_INFO_DEF + 3: - player->CastSpell(player, SPELL_SUMMON_KARROG, false); + _result = player->CastSpell(player, SPELL_SUMMON_KARROG, false); break; case GOSSIP_ACTION_INFO_DEF + 4: - player->CastSpell(player, SPELL_SUMMON_VAKKIZ_THE_WINDRAGER, false); + _result = player->CastSpell(player, SPELL_SUMMON_VAKKIZ_THE_WINDRAGER, false); + break; + default: + _result = SPELL_CAST_OK; break; } + if (_result == SPELL_CAST_OK) + { + go->DespawnOrUnsummon(); + } } +private: + SpellCastResult _result; }; /*######