diff --git a/data/sql/updates/pending_db_world/rev_1731513769607437914.sql b/data/sql/updates/pending_db_world/rev_1731513769607437914.sql new file mode 100644 index 000000000..af98360ee --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1731513769607437914.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 45217 AND `ScriptName` = 'spell_ritual_of_power'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (45217, 'spell_ritual_of_power'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 3ed706720..bc2bbbde7 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -58,8 +58,9 @@ DoorData const doorData[] = ObjectData const creatureData[] = { - { NPC_SPIRIT_LYNX, DATA_SPIRIT_LYNX }, - { 0, 0 } + { NPC_SPIRIT_LYNX, DATA_SPIRIT_LYNX }, + { NPC_HARRISON_JONES, DATA_HARRISON_JONES }, + { 0, 0 } }; ObjectData const gameObjectData[] = diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 8896931d2..83a04cbf6 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -33,6 +33,7 @@ EndContentData */ #include "ScriptedGossip.h" #include "SpellInfo.h" #include "SpellScript.h" +#include "SpellScriptLoader.h" /*###### ## npc_forest_frog @@ -348,6 +349,11 @@ enum Events GONG_EVENT_11 = 11 }; +enum Actions +{ + ACTION_COMPLETE_EVENT_3 = 0, +}; + enum Waypoints { HARRISON_MOVE_1 = 860440, @@ -419,6 +425,15 @@ struct npc_harrison_jones : public ScriptedAI } } + void DoAction(int32 action) override + { + if (action == ACTION_COMPLETE_EVENT_3) + { + _gongEvent = GONG_EVENT_4; + _gongTimer = 0; + } + } + void UpdateAI(uint32 diff) override { if (_gongEvent) @@ -444,8 +459,6 @@ struct npc_harrison_jones : public ScriptedAI case GONG_EVENT_3: if (GameObject* gong = _instance->GetGameObject(DATA_STRANGE_GONG)) gong->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); - _gongEvent = GONG_EVENT_4; - _gongTimer = 105000; break; case GONG_EVENT_4: me->RemoveAura(SPELL_BANGING_THE_GONG); @@ -538,9 +551,27 @@ struct npc_harrison_jones : public ScriptedAI ObjectGuid uiTargetGUID; }; +class spell_ritual_of_power : public SpellScript +{ + PrepareSpellScript(spell_ritual_of_power); + + void OnEffect(SpellEffIndex /*effIndex*/) + { + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + if (Creature* creature = instance->GetCreature(DATA_HARRISON_JONES)) + creature->AI()->DoAction(ACTION_COMPLETE_EVENT_3); + } + + void Register() override + { + OnEffectLaunch += SpellEffectFn(spell_ritual_of_power::OnEffect, EFFECT_0, SPELL_EFFECT_SEND_EVENT); + } +}; + void AddSC_zulaman() { RegisterZulAmanCreatureAI(npc_forest_frog); new npc_zulaman_hostage(); RegisterZulAmanCreatureAI(npc_harrison_jones); + RegisterSpellScript(spell_ritual_of_power); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 86092f918..4da0ed8cd 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -37,7 +37,8 @@ enum DataTypes TYPE_RAND_VENDOR_2 = 9, DATA_STRANGE_GONG = 10, DATA_MASSIVE_GATE = 11, - DATA_HEXLORD_GATE = 12 + DATA_HEXLORD_GATE = 12, + DATA_HARRISON_JONES = 13 }; enum CreatureIds