From 816c8c1c7a698fddbec74cc693f8abc88f72e51e Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Thu, 4 Sep 2014 03:18:34 -0300 Subject: Scripts/Black Temple: Updates Najentus to BossAI and slight changes --- .../scripts/Outland/BlackTemple/black_temple.h | 1 + .../scripts/Outland/BlackTemple/boss_supremus.cpp | 15 ++- .../Outland/BlackTemple/boss_warlord_najentus.cpp | 127 +++++++++------------ 3 files changed, 62 insertions(+), 81 deletions(-) (limited to 'src') 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(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 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(creature); + } }; class go_najentus_spine : public GameObjectScript -- cgit v1.2.3