fix(Scripts/ZulAman): speed up gong event (#20547)

This commit is contained in:
Jelle Meeus
2024-11-13 20:10:36 +01:00
committed by GitHub
parent d6b2529557
commit f011a849dc
4 changed files with 41 additions and 5 deletions
@@ -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');
@@ -58,8 +58,9 @@ DoorData const doorData[] =
ObjectData const creatureData[] = ObjectData const creatureData[] =
{ {
{ NPC_SPIRIT_LYNX, DATA_SPIRIT_LYNX }, { NPC_SPIRIT_LYNX, DATA_SPIRIT_LYNX },
{ 0, 0 } { NPC_HARRISON_JONES, DATA_HARRISON_JONES },
{ 0, 0 }
}; };
ObjectData const gameObjectData[] = ObjectData const gameObjectData[] =
@@ -33,6 +33,7 @@ EndContentData */
#include "ScriptedGossip.h" #include "ScriptedGossip.h"
#include "SpellInfo.h" #include "SpellInfo.h"
#include "SpellScript.h" #include "SpellScript.h"
#include "SpellScriptLoader.h"
/*###### /*######
## npc_forest_frog ## npc_forest_frog
@@ -348,6 +349,11 @@ enum Events
GONG_EVENT_11 = 11 GONG_EVENT_11 = 11
}; };
enum Actions
{
ACTION_COMPLETE_EVENT_3 = 0,
};
enum Waypoints enum Waypoints
{ {
HARRISON_MOVE_1 = 860440, 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 void UpdateAI(uint32 diff) override
{ {
if (_gongEvent) if (_gongEvent)
@@ -444,8 +459,6 @@ struct npc_harrison_jones : public ScriptedAI
case GONG_EVENT_3: case GONG_EVENT_3:
if (GameObject* gong = _instance->GetGameObject(DATA_STRANGE_GONG)) if (GameObject* gong = _instance->GetGameObject(DATA_STRANGE_GONG))
gong->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE); gong->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
_gongEvent = GONG_EVENT_4;
_gongTimer = 105000;
break; break;
case GONG_EVENT_4: case GONG_EVENT_4:
me->RemoveAura(SPELL_BANGING_THE_GONG); me->RemoveAura(SPELL_BANGING_THE_GONG);
@@ -538,9 +551,27 @@ struct npc_harrison_jones : public ScriptedAI
ObjectGuid uiTargetGUID; 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() void AddSC_zulaman()
{ {
RegisterZulAmanCreatureAI(npc_forest_frog); RegisterZulAmanCreatureAI(npc_forest_frog);
new npc_zulaman_hostage(); new npc_zulaman_hostage();
RegisterZulAmanCreatureAI(npc_harrison_jones); RegisterZulAmanCreatureAI(npc_harrison_jones);
RegisterSpellScript(spell_ritual_of_power);
} }
@@ -37,7 +37,8 @@ enum DataTypes
TYPE_RAND_VENDOR_2 = 9, TYPE_RAND_VENDOR_2 = 9,
DATA_STRANGE_GONG = 10, DATA_STRANGE_GONG = 10,
DATA_MASSIVE_GATE = 11, DATA_MASSIVE_GATE = 11,
DATA_HEXLORD_GATE = 12 DATA_HEXLORD_GATE = 12,
DATA_HARRISON_JONES = 13
}; };
enum CreatureIds enum CreatureIds