diff options
author | Nyeriah <sarah.trysan@live.com> | 2014-09-04 03:18:34 -0300 |
---|---|---|
committer | Nyeriah <sarah.trysan@live.com> | 2014-09-04 03:18:34 -0300 |
commit | 816c8c1c7a698fddbec74cc693f8abc88f72e51e (patch) | |
tree | 7aeaed0b6ddcb523875e09d7e4a18258d05274c0 /src | |
parent | efccf18632c3b222934ac8ebbcce6b60bb488525 (diff) |
Scripts/Black Temple: Updates Najentus to BossAI and slight changes
Diffstat (limited to 'src')
3 files changed, 62 insertions, 81 deletions
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h index 32f427148b9..c03c8b97d20 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.h +++ b/src/server/scripts/Outland/BlackTemple/black_temple.h @@ -73,6 +73,7 @@ enum CreatureIds enum GameObjectIds { GO_NAJENTUS_GATE = 185483, + GO_NAJENTUS_SPINE = 185584, GO_SUPREMUS_GATE = 185882, GO_SHADE_OF_AKAMA_DOOR = 185478, GO_TERON_DOOR_1 = 185480, diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index f88dc1bb3c3..b9b654f8b95 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -90,8 +90,8 @@ public: struct boss_supremusAI : public BossAI { - boss_supremusAI(Creature* creature) : BossAI(creature, DATA_SUPREMUS) - { + boss_supremusAI(Creature* creature) : BossAI(creature, DATA_SUPREMUS) + { phase = 0; } @@ -219,11 +219,6 @@ class npc_volcano : public CreatureScript public: npc_volcano() : CreatureScript("npc_volcano") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_volcanoAI(creature); - } - struct npc_volcanoAI : public ScriptedAI { npc_volcanoAI(Creature* creature) : ScriptedAI(creature) @@ -245,7 +240,6 @@ public: void MoveInLineOfSight(Unit* /*who*/) override { } - void DoAction(int32 /*info*/) override { me->RemoveAura(SPELL_VOLCANIC_ERUPTION); @@ -261,6 +255,11 @@ public: else wait -= diff; } }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_volcanoAI(creature); + } }; void AddSC_boss_supremus() diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 64a6add9801..6425675219f 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -29,7 +29,7 @@ EndScriptData */ #include "Player.h" #include "SpellInfo.h" -enum Yells +enum Texts { SAY_AGGRO = 0, SAY_NEEDLE = 1, @@ -51,11 +51,6 @@ enum Spells }; -enum GameObjects -{ - GOBJECT_SPINE = 185584 -}; - enum Events { EVENT_BERSERK = 1, @@ -65,7 +60,7 @@ enum Events EVENT_SHIELD = 5 }; -enum Misc +enum EventGroups { GCD_CAST = 1, GCD_YELL = 2 @@ -76,30 +71,17 @@ class boss_najentus : public CreatureScript public: boss_najentus() : CreatureScript("boss_najentus") { } - CreatureAI* GetAI(Creature* creature) const override - { - return GetInstanceAI<boss_najentusAI>(creature); - } - - struct boss_najentusAI : public ScriptedAI + struct boss_najentusAI : public BossAI { - boss_najentusAI(Creature* creature) : ScriptedAI(creature) + boss_najentusAI(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS) { - instance = creature->GetInstanceScript(); + SpineTargetGUID = 0; } - InstanceScript* instance; - EventMap events; - - uint64 SpineTargetGUID; - void Reset() override { - events.Reset(); - + _Reset(); SpineTargetGUID = 0; - - instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, NOT_STARTED); } void KilledUnit(Unit* /*victim*/) override @@ -110,8 +92,7 @@ public: void JustDied(Unit* /*killer*/) override { - instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, DONE); - + _JustDied(); Talk(SAY_DEATH); } @@ -127,10 +108,8 @@ public: void EnterCombat(Unit* /*who*/) override { - instance->SetBossState(DATA_HIGH_WARLORD_NAJENTUS, IN_PROGRESS); - + _EnterCombat(); Talk(SAY_AGGRO); - DoZoneInCombat(); events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); events.ScheduleEvent(EVENT_YELL, 45000 + (rand32() % 76) * 1000, GCD_YELL); ResetTimer(); @@ -155,44 +134,40 @@ public: events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); } - void UpdateAI(uint32 diff) override + void ExecuteEvent(uint32 eventId) override { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) + switch (eventId) { - switch (eventId) - { - case EVENT_SHIELD: - DoCast(me, SPELL_TIDAL_SHIELD, true); - ResetTimer(45000); - break; - case EVENT_BERSERK: - Talk(SAY_ENRAGE); - DoCast(me, SPELL_BERSERK, true); - events.DelayEvents(15000, GCD_YELL); - break; - case EVENT_SPINE: - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); - if (!target) target = me->GetVictim(); - if (target) - { - DoCast(target, SPELL_IMPALING_SPINE, true); - SpineTargetGUID = target->GetGUID(); - //must let target summon, otherwise you cannot click the spine - target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30); - Talk(SAY_NEEDLE); - events.DelayEvents(1500, GCD_CAST); - events.DelayEvents(15000, GCD_YELL); - } - events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); - return; - } - case EVENT_NEEDLE: + case EVENT_SHIELD: + DoCast(me, SPELL_TIDAL_SHIELD, true); + ResetTimer(45000); + break; + case EVENT_BERSERK: + Talk(SAY_ENRAGE); + DoCast(me, SPELL_BERSERK, true); + events.DelayEvents(15000, GCD_YELL); + break; + case EVENT_SPINE: + {
+ Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
+
+ if (!target)
+ target = me->GetVictim();
+
+ if (target)
+ {
+ DoCast(target, SPELL_IMPALING_SPINE, true);
+ SpineTargetGUID = target->GetGUID();
+ //must let target summon, otherwise you cannot click the spine
+ target->SummonGameObject(GO_NAJENTUS_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation(), 0, 0, 0, 0, 30);
+ Talk(SAY_NEEDLE);
+ events.DelayEvents(1500, GCD_CAST);
+ events.DelayEvents(15000, GCD_YELL);
+ }
+ events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST);
+ return;
+ } + case EVENT_NEEDLE: { //DoCast(me, SPELL_NEEDLE_SPINE, true); std::list<Unit*> targets; @@ -203,18 +178,24 @@ public: events.DelayEvents(1500, GCD_CAST); return; } - case EVENT_YELL: - Talk(SAY_SPECIAL); - events.ScheduleEvent(EVENT_YELL, urand(25000, 100000), GCD_YELL); - events.DelayEvents(15000, GCD_YELL); - break; - } + case EVENT_YELL: + Talk(SAY_SPECIAL); + events.ScheduleEvent(EVENT_YELL, urand(25000, 100000), GCD_YELL); + events.DelayEvents(15000, GCD_YELL); + break; + default: + break; } - - DoMeleeAttackIfReady(); } + + private: + uint64 SpineTargetGUID; }; + CreatureAI* GetAI(Creature* creature) const override + { + return GetBlackTempleAI<boss_najentusAI>(creature); + } }; class go_najentus_spine : public GameObjectScript |