Scripts/Black Temple: Updates Najentus to BossAI and slight changes

This commit is contained in:
Nyeriah
2014-09-04 03:18:34 -03:00
parent efccf18632
commit 816c8c1c7a
3 changed files with 62 additions and 81 deletions

View File

@@ -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,

View File

@@ -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()

View File

@@ -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
struct boss_najentusAI : public BossAI
{
return GetInstanceAI<boss_najentusAI>(creature);
}
struct boss_najentusAI : public ScriptedAI
{
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