aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2015-02-13 22:37:30 +0100
committerjoschiwald <joschiwald.trinity@gmail.com>2015-02-13 22:37:30 +0100
commit2478bbcdb8f44c575714ae2f45aeef4a37556fc2 (patch)
tree711c4f29c3e78c803c034f0f06a0eeaf2d9d77a2 /src
parent6dfc35d13c7a6c85ae3a12a6751203869d5e8279 (diff)
parentca60ae6d199339a4d83857d040d97f474116cc16 (diff)
Merge pull request #14144 from Rushor/ZulAman
Scripts/ZulAman: Enable Script for Gazakroth
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp81
1 files changed, 42 insertions, 39 deletions
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index 01ac3920082..1a98c081570 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -689,54 +689,57 @@ class boss_alyson_antille : public CreatureScript
}
};
-struct boss_gazakrothAI : public boss_hexlord_addAI
+class boss_gazakroth : public CreatureScript
{
- boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature)
- {
- Initialize();
- }
-
- void Initialize()
- {
- firebolt_timer = 2000;
- }
+ public:
- uint32 firebolt_timer;
+ boss_gazakroth() : CreatureScript("boss_gazakroth") { }
+
+ struct boss_gazakrothAI : public boss_hexlord_addAI
+ {
+ boss_gazakrothAI(Creature* creature) : boss_hexlord_addAI(creature)
+ {
+ Initialize();
+ }
- void Reset() override
- {
- Initialize();
- boss_hexlord_addAI::Reset();
- }
+ void Initialize()
+ {
+ firebolt_timer = 2 * IN_MILLISECONDS;
+ }
+
+ void Reset() override
+ {
+ Initialize();
+ boss_hexlord_addAI::Reset();
+ }
- void AttackStart(Unit* who) override
- {
- if (!who)
- return;
+ void AttackStart(Unit* who) override
+ {
+ AttackStartCaster(who, 20.0f);
+ }
- if (who->isTargetableForAttack())
- {
- if (me->Attack(who, false))
+ void UpdateAI(uint32 diff) override
{
- me->GetMotionMaster()->MoveChase(who, 20);
- me->AddThreat(who, 0.0f);
+ if (!UpdateVictim())
+ return;
+
+ if (firebolt_timer <= diff)
+ {
+ DoCastVictim(SPELL_FIREBOLT, false);
+ firebolt_timer = 0.7 * IN_MILLISECONDS;
+ } else firebolt_timer -= diff;
+
+ boss_hexlord_addAI::UpdateAI(diff);
}
- }
- }
- void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim())
- return;
+ private:
+ uint32 firebolt_timer;
+ };
- if (firebolt_timer <= diff)
+ CreatureAI* GetAI(Creature* creature) const override
{
- DoCastVictim(SPELL_FIREBOLT, false);
- firebolt_timer = 700;
- } else firebolt_timer -= diff;
-
- boss_hexlord_addAI::UpdateAI(diff);
- }
+ return GetInstanceAI<boss_gazakrothAI>(creature);
+ }
};
class boss_lord_raadan : public CreatureScript
@@ -1062,7 +1065,7 @@ void AddSC_boss_hex_lord_malacrass()
{
new boss_hexlord_malacrass();
new boss_thurg();
- // new boss_gazakroth();
+ new boss_gazakroth();
new boss_lord_raadan();
new boss_darkheart();
new boss_slither();