mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Scripts/UtgardePinnacle: cleanup InstanceScript
This commit is contained in:
@@ -58,19 +58,14 @@ enum Creatures
|
||||
NPC_STASIS_CONTROLLER = 26688
|
||||
};
|
||||
|
||||
struct Locations
|
||||
Position const moveLocs[] =
|
||||
{
|
||||
float x, y, z;
|
||||
};
|
||||
|
||||
struct Locations moveLocs[]=
|
||||
{
|
||||
{261.6f, -449.3f, 109.5f},
|
||||
{263.3f, -454.0f, 109.5f},
|
||||
{291.5f, -450.4f, 109.5f},
|
||||
{291.5f, -454.0f, 109.5f},
|
||||
{310.0f, -453.4f, 109.5f},
|
||||
{238.6f, -460.7f, 109.5f}
|
||||
{ 261.6f, -449.3f, 109.5f, 0.0f },
|
||||
{ 263.3f, -454.0f, 109.5f, 0.0f },
|
||||
{ 291.5f, -450.4f, 109.5f, 0.0f },
|
||||
{ 291.5f, -454.0f, 109.5f, 0.0f },
|
||||
{ 310.0f, -453.4f, 109.5f, 0.0f },
|
||||
{ 238.6f, -460.7f, 109.5f, 0.0f }
|
||||
};
|
||||
|
||||
enum Phase
|
||||
@@ -83,21 +78,20 @@ enum Phase
|
||||
PHASE_NONE
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ACTION_NEXT_PHASE,
|
||||
};
|
||||
|
||||
class boss_palehoof : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_palehoof() : CreatureScript("boss_palehoof") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
struct boss_palehoofAI : public BossAI
|
||||
{
|
||||
return new boss_palehoofAI(creature);
|
||||
}
|
||||
|
||||
struct boss_palehoofAI : public ScriptedAI
|
||||
{
|
||||
boss_palehoofAI(Creature* creature) : ScriptedAI(creature)
|
||||
boss_palehoofAI(Creature* creature) : BossAI(creature, DATA_GORTOK_PALEHOOF)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
uint32 uiArcingSmashTimer;
|
||||
@@ -108,10 +102,10 @@ public:
|
||||
uint8 AddCount;
|
||||
Phase Sequence[4];
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
_Reset();
|
||||
|
||||
/// There is a good reason to store them like this, we are going to shuffle the order.
|
||||
for (uint32 i = PHASE_FRENZIED_WORGEN; i < PHASE_GORTOK_PALEHOOF; ++i)
|
||||
Sequence[i] = Phase(i);
|
||||
@@ -129,32 +123,15 @@ public:
|
||||
|
||||
currentPhase = PHASE_NONE;
|
||||
|
||||
if (instance)
|
||||
for (uint8 i = DATA_FRENZIED_WORGEN; i <= DATA_FEROCIOUS_RHINO; ++i)
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetData64(i)))
|
||||
if (!temp->IsAlive())
|
||||
temp->Respawn();
|
||||
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE)))
|
||||
{
|
||||
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, NOT_STARTED);
|
||||
|
||||
Creature* temp = Unit::GetCreature((*me), instance->GetData64(DATA_NPC_FRENZIED_WORGEN));
|
||||
if (temp && !temp->IsAlive())
|
||||
temp->Respawn();
|
||||
|
||||
temp = Unit::GetCreature((*me), instance->GetData64(DATA_NPC_FEROCIOUS_RHINO));
|
||||
if (temp && !temp->IsAlive())
|
||||
temp->Respawn();
|
||||
|
||||
temp = Unit::GetCreature((*me), instance->GetData64(DATA_NPC_MASSIVE_JORMUNGAR));
|
||||
if (temp && !temp->IsAlive())
|
||||
temp->Respawn();
|
||||
|
||||
temp = Unit::GetCreature((*me), instance->GetData64(DATA_NPC_RAVENOUS_FURBOLG));
|
||||
if (temp && !temp->IsAlive())
|
||||
temp->Respawn();
|
||||
|
||||
GameObject* go = instance->instance->GetGameObject(instance->GetData64(DATA_GORTOK_PALEHOOF_SPHERE));
|
||||
if (go)
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,14 +162,9 @@ public:
|
||||
if (currentPhase != PHASE_GORTOK_PALEHOOF)
|
||||
return;
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
Creature* temp = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_ORB) : 0);
|
||||
if (temp && temp->IsAlive())
|
||||
temp->DisappearAndDie();
|
||||
|
||||
if (uiArcingSmashTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_ARCING_SMASH);
|
||||
@@ -217,12 +189,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
//Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, DONE);
|
||||
Creature* temp = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_ORB) : 0);
|
||||
if (temp && temp->IsAlive())
|
||||
temp->DisappearAndDie();
|
||||
_JustDied();
|
||||
//Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
@@ -230,28 +198,30 @@ public:
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void NextPhase()
|
||||
void DoAction(int32 actionId) OVERRIDE
|
||||
{
|
||||
if (actionId != ACTION_NEXT_PHASE)
|
||||
return;
|
||||
|
||||
if (currentPhase == PHASE_NONE)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
|
||||
instance->SetBossState(DATA_GORTOK_PALEHOOF, IN_PROGRESS);
|
||||
|
||||
me->SummonCreature(NPC_STASIS_CONTROLLER, moveLocs[5].x, moveLocs[5].y, moveLocs[5].z, 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
if (Creature* orb = me->SummonCreature(NPC_STASIS_CONTROLLER, moveLocs[5], TEMPSUMMON_CORPSE_DESPAWN))
|
||||
orb->CastSpell(me, SPELL_ORB_VISUAL, true);
|
||||
}
|
||||
|
||||
Phase move = PHASE_NONE;
|
||||
if (AddCount >= DUNGEON_MODE(2, 4))
|
||||
move = PHASE_GORTOK_PALEHOOF;
|
||||
else
|
||||
move = Sequence[AddCount++];
|
||||
//send orb to summon spot
|
||||
Creature* pOrb = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_ORB) : 0);
|
||||
if (pOrb && pOrb->IsAlive())
|
||||
{
|
||||
if (currentPhase == PHASE_NONE)
|
||||
pOrb->CastSpell(me, SPELL_ORB_VISUAL, true);
|
||||
pOrb->GetMotionMaster()->MovePoint(move, moveLocs[move].x, moveLocs[move].y, moveLocs[move].z);
|
||||
}
|
||||
|
||||
// send orb to summon spot
|
||||
if (Creature* orb = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_ORB)))
|
||||
if (orb->IsAlive())
|
||||
orb->GetMotionMaster()->MovePoint(move, moveLocs[move]);
|
||||
|
||||
currentPhase = move;
|
||||
}
|
||||
|
||||
@@ -263,6 +233,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetUtgardePinnacleAI<boss_palehoofAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
//ravenous furbolg's spells
|
||||
@@ -305,13 +279,12 @@ public:
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->IsAlive())
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
if (instance->GetBossState(DATA_GORTOK_PALEHOOF) == IN_PROGRESS)
|
||||
{
|
||||
Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (palehoof && palehoof->IsAlive())
|
||||
palehoof->AI()->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -360,12 +333,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
if (Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF)))
|
||||
palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
|
||||
}
|
||||
|
||||
void JustReachedHome() OVERRIDE
|
||||
@@ -418,13 +387,12 @@ public:
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->IsAlive())
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
if (instance->GetBossState(DATA_GORTOK_PALEHOOF) == IN_PROGRESS)
|
||||
{
|
||||
Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (palehoof && palehoof->IsAlive())
|
||||
palehoof->AI()->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -470,17 +438,13 @@ public:
|
||||
DoStartMovement(who);
|
||||
}
|
||||
if (instance)
|
||||
instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS);
|
||||
instance->SetBossState(DATA_GORTOK_PALEHOOF, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
if (Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF)))
|
||||
palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
|
||||
}
|
||||
|
||||
void JustReachedHome() OVERRIDE
|
||||
@@ -534,13 +498,12 @@ public:
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->IsAlive())
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
if (instance->GetBossState(DATA_GORTOK_PALEHOOF) == IN_PROGRESS)
|
||||
{
|
||||
Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (palehoof && palehoof->IsAlive())
|
||||
palehoof->AI()->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -590,12 +553,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
if (Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF)))
|
||||
palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
|
||||
}
|
||||
|
||||
void JustReachedHome() OVERRIDE
|
||||
@@ -654,13 +613,12 @@ public:
|
||||
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
|
||||
if (instance)
|
||||
if (instance->GetData(DATA_GORTOK_PALEHOOF_EVENT) == IN_PROGRESS)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->IsAlive())
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->Reset();
|
||||
}
|
||||
if (instance->GetBossState(DATA_GORTOK_PALEHOOF) == IN_PROGRESS)
|
||||
{
|
||||
Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (palehoof && palehoof->IsAlive())
|
||||
palehoof->AI()->Reset();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -711,12 +669,8 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
Creature* pPalehoof = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof)
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
}
|
||||
if (Creature* palehoof = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GORTOK_PALEHOOF)))
|
||||
palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
|
||||
}
|
||||
|
||||
void JustReachedHome() OVERRIDE
|
||||
@@ -767,52 +721,76 @@ public:
|
||||
|
||||
if (SummonTimer <= diff)
|
||||
{
|
||||
if (currentPhase<5&¤tPhase >= 0)
|
||||
uint8 nextBossId = 0;
|
||||
switch (currentPhase)
|
||||
{
|
||||
Creature* pNext = NULL;
|
||||
switch (currentPhase)
|
||||
{
|
||||
case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_FRENZIED_WORGEN) : 0); break;
|
||||
case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_RAVENOUS_FURBOLG) : 0); break;
|
||||
case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_MASSIVE_JORMUNGAR) : 0); break;
|
||||
case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_FEROCIOUS_RHINO) : 0); break;
|
||||
case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
if (pNext)
|
||||
{
|
||||
pNext->RemoveAurasDueToSpell(SPELL_FREEZE);
|
||||
pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
pNext->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
pNext->SetInCombatWithZone();
|
||||
pNext->Attack(pNext->SelectNearestTarget(100), true);
|
||||
|
||||
}
|
||||
currentPhase = PHASE_NONE;
|
||||
case PHASE_FRENZIED_WORGEN:
|
||||
nextBossId = DATA_FRENZIED_WORGEN;
|
||||
break;
|
||||
case PHASE_RAVENOUS_FURLBORG:
|
||||
nextBossId = DATA_RAVENOUS_FURBOLG;
|
||||
break;
|
||||
case PHASE_MASSIVE_JORMUNGAR:
|
||||
nextBossId = DATA_MASSIVE_JORMUNGAR;
|
||||
break;
|
||||
case PHASE_FEROCIOUS_RHINO:
|
||||
nextBossId = DATA_FEROCIOUS_RHINO;
|
||||
break;
|
||||
case PHASE_GORTOK_PALEHOOF:
|
||||
nextBossId = DATA_GORTOK_PALEHOOF;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
} else SummonTimer -= diff;
|
||||
|
||||
if (Creature* nextBoss = ObjectAccessor::GetCreature(*me, instance->GetData64(nextBossId)))
|
||||
{
|
||||
nextBoss->RemoveAurasDueToSpell(SPELL_FREEZE);
|
||||
nextBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1 | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
nextBoss->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
nextBoss->SetInCombatWithZone();
|
||||
nextBoss->Attack(nextBoss->SelectNearestTarget(100), true);
|
||||
}
|
||||
currentPhase = PHASE_NONE;
|
||||
|
||||
if (nextBossId == DATA_GORTOK_PALEHOOF)
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
else
|
||||
SummonTimer -= diff;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) OVERRIDE
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
if (id > 4)
|
||||
return;
|
||||
Creature* pNext = NULL;
|
||||
|
||||
uint8 nextBossId = 0;
|
||||
switch (id)
|
||||
{
|
||||
case PHASE_FRENZIED_WORGEN: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_FRENZIED_WORGEN) : 0); break;
|
||||
case PHASE_RAVENOUS_FURLBORG: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_RAVENOUS_FURBOLG) : 0); break;
|
||||
case PHASE_MASSIVE_JORMUNGAR: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_MASSIVE_JORMUNGAR) : 0); break;
|
||||
case PHASE_FEROCIOUS_RHINO: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_NPC_FEROCIOUS_RHINO) : 0); break;
|
||||
case PHASE_GORTOK_PALEHOOF: pNext = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0); break;
|
||||
default: break;
|
||||
case PHASE_FRENZIED_WORGEN:
|
||||
nextBossId = DATA_FRENZIED_WORGEN;
|
||||
break;
|
||||
case PHASE_RAVENOUS_FURLBORG:
|
||||
nextBossId = DATA_RAVENOUS_FURBOLG;
|
||||
break;
|
||||
case PHASE_MASSIVE_JORMUNGAR:
|
||||
nextBossId = DATA_MASSIVE_JORMUNGAR;
|
||||
break;
|
||||
case PHASE_FEROCIOUS_RHINO:
|
||||
nextBossId = DATA_FEROCIOUS_RHINO;
|
||||
break;
|
||||
case PHASE_GORTOK_PALEHOOF:
|
||||
nextBossId = DATA_GORTOK_PALEHOOF;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (pNext)
|
||||
DoCast(pNext, SPELL_ORB_CHANNEL, false);
|
||||
currentPhase = (Phase)id;
|
||||
|
||||
if (Creature* nextBoss = ObjectAccessor::GetCreature(*me, instance->GetData64(nextBossId)))
|
||||
DoCast(nextBoss, SPELL_ORB_CHANNEL, false);
|
||||
|
||||
currentPhase = Phase(id);
|
||||
SummonTimer = 5000;
|
||||
}
|
||||
};
|
||||
@@ -821,23 +799,25 @@ public:
|
||||
|
||||
class go_palehoof_sphere : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_palehoof_sphere() : GameObjectScript("go_palehoof_sphere") { }
|
||||
public:
|
||||
go_palehoof_sphere() : GameObjectScript("go_palehoof_sphere") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
|
||||
Creature* pPalehoof = Unit::GetCreature(*go, instance ? instance->GetData64(DATA_GORTOK_PALEHOOF) : 0);
|
||||
if (pPalehoof && pPalehoof->IsAlive())
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
CAST_AI(boss_palehoof::boss_palehoofAI, pPalehoof->AI())->NextPhase();
|
||||
Creature* palehoof = ObjectAccessor::GetCreature(*go, instance->GetData64(DATA_GORTOK_PALEHOOF));
|
||||
if (palehoof && palehoof->IsAlive())
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
palehoof->AI()->DoAction(ACTION_NEXT_PHASE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
me->SummonCreature(NPC_GRAUF, Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 3.0f);
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, NOT_STARTED);
|
||||
instance->SetBossState(DATA_SKADI_THE_RUTHLESS, NOT_STARTED);
|
||||
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
me->SetInCombatWithZone();
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, IN_PROGRESS);
|
||||
instance->SetBossState(DATA_SKADI_THE_RUTHLESS, IN_PROGRESS);
|
||||
instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
|
||||
me->GetMotionMaster()->MoveJump(Location[0].GetPositionX(), Location[0].GetPositionY(), Location[0].GetPositionZ(), 5.0f, 10.0f);
|
||||
me->SetWalk(false);
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
Talk(SAY_DEATH);
|
||||
Summons.DespawnAll();
|
||||
if (instance)
|
||||
instance->SetData(DATA_SKADI_THE_RUTHLESS_EVENT, DONE);
|
||||
instance->SetBossState(DATA_SKADI_THE_RUTHLESS, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
|
||||
@@ -74,7 +74,6 @@ enum Yells
|
||||
enum Creatures
|
||||
{
|
||||
NPC_ARTHAS = 29280, // Image of Arthas
|
||||
NPC_SVALA_SORROWGRAVE = 26668, // Svala after transformation
|
||||
NPC_RITUAL_CHANNELER = 27281,
|
||||
NPC_SPECTATOR = 26667,
|
||||
NPC_RITUAL_TARGET = 27327,
|
||||
@@ -82,11 +81,6 @@ enum Creatures
|
||||
NPC_SCOURGE_HULK = 26555
|
||||
};
|
||||
|
||||
enum GameObjects
|
||||
{
|
||||
GO_UTGARDE_MIRROR = 191745
|
||||
};
|
||||
|
||||
enum SvalaPhase
|
||||
{
|
||||
IDLE,
|
||||
@@ -101,191 +95,159 @@ enum Misc
|
||||
DATA_INCREDIBLE_HULK = 2043
|
||||
};
|
||||
|
||||
static const float spectatorWP[2][3] =
|
||||
Position const spectatorWP[2] =
|
||||
{
|
||||
{296.95f, -312.76f, 86.36f},
|
||||
{297.69f, -275.81f, 86.36f}
|
||||
{296.95f, -312.76f, 86.36f, 0.0f },
|
||||
{297.69f, -275.81f, 86.36f, 0.0f }
|
||||
};
|
||||
|
||||
static Position ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f };
|
||||
Position const ArthasPos = { 295.81f, -366.16f, 92.57f, 1.58f };
|
||||
|
||||
class boss_svala : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_svala() : CreatureScript("boss_svala") { }
|
||||
public:
|
||||
boss_svala() : CreatureScript("boss_svala") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_svalaAI(creature);
|
||||
}
|
||||
|
||||
struct boss_svalaAI : public ScriptedAI
|
||||
{
|
||||
boss_svalaAI(Creature* creature) : ScriptedAI(creature), summons(creature)
|
||||
struct boss_svalaAI : public BossAI
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
Phase = IDLE;
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_1, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RITUAL_STRIKE_EFF_2, true);
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
SummonList summons;
|
||||
SvalaPhase Phase;
|
||||
|
||||
Position pos;
|
||||
float x, y, z;
|
||||
|
||||
uint32 introTimer;
|
||||
uint8 introPhase;
|
||||
uint8 sacrePhase;
|
||||
|
||||
TempSummon* arthas;
|
||||
uint64 arthasGUID;
|
||||
|
||||
uint32 sinsterStrikeTimer;
|
||||
uint32 callFlamesTimer;
|
||||
uint32 sacrificeTimer;
|
||||
|
||||
bool sacrificed;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
sacrificed = false;
|
||||
SetCombatMovement(true);
|
||||
|
||||
summons.DespawnAll();
|
||||
me->RemoveAllAuras();
|
||||
|
||||
if (Phase > NORMAL)
|
||||
Phase = NORMAL;
|
||||
|
||||
me->SetDisableGravity(Phase == NORMAL);
|
||||
|
||||
introTimer = 1 * IN_MILLISECONDS;
|
||||
introPhase = 0;
|
||||
arthasGUID = 0;
|
||||
|
||||
if (instance)
|
||||
boss_svalaAI(Creature* creature) : BossAI(creature, DATA_SVALA_SORROWGRAVE)
|
||||
{
|
||||
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
|
||||
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
|
||||
Phase = IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
SvalaPhase Phase;
|
||||
|
||||
sinsterStrikeTimer = 7 * IN_MILLISECONDS;
|
||||
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
uint32 introTimer;
|
||||
uint8 introPhase;
|
||||
uint8 sacrePhase;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, IN_PROGRESS);
|
||||
}
|
||||
uint64 arthasGUID;
|
||||
|
||||
void JustSummoned(Creature* summon) OVERRIDE
|
||||
{
|
||||
if (summon->GetEntry() == NPC_RITUAL_CHANNELER)
|
||||
summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
|
||||
uint32 sinsterStrikeTimer;
|
||||
uint32 callFlamesTimer;
|
||||
uint32 sacrificeTimer;
|
||||
|
||||
summons.Summon(summon);
|
||||
}
|
||||
bool sacrificed;
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon) OVERRIDE
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) OVERRIDE
|
||||
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (Phase == IDLE && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 40))
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
Phase = INTRO;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (GameObject* mirror = GetClosestGameObjectWithEntry(me, GO_UTGARDE_MIRROR, 100.0f))
|
||||
mirror->SetGoState(GO_STATE_READY);
|
||||
|
||||
if (Creature* arthas = me->SummonCreature(NPC_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
arthasGUID = arthas->GetGUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) OVERRIDE
|
||||
{
|
||||
if (victim != me)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (Phase == SACRIFICING)
|
||||
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
|
||||
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
|
||||
|
||||
summons.DespawnAll();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, DONE);
|
||||
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) OVERRIDE
|
||||
{
|
||||
if (spell->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
|
||||
{
|
||||
Phase = NORMAL;
|
||||
_Reset();
|
||||
sacrificed = false;
|
||||
SetCombatMovement(true);
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true))
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
if (Phase > NORMAL)
|
||||
Phase = NORMAL;
|
||||
|
||||
me->SetDisableGravity(Phase == NORMAL);
|
||||
|
||||
introTimer = 1 * IN_MILLISECONDS;
|
||||
introPhase = 0;
|
||||
sacrePhase = 0;
|
||||
arthasGUID = 0;
|
||||
|
||||
instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (Phase == IDLE)
|
||||
return;
|
||||
|
||||
if (Phase == INTRO)
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
if (introTimer <= diff)
|
||||
{
|
||||
Creature* arthas = Unit::GetCreature(*me, arthasGUID);
|
||||
if (!arthas)
|
||||
return;
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
switch (introPhase)
|
||||
sinsterStrikeTimer = 7 * IN_MILLISECONDS;
|
||||
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) OVERRIDE
|
||||
{
|
||||
if (summon->GetEntry() == NPC_RITUAL_CHANNELER)
|
||||
summon->CastSpell(summon, SPELL_SUMMONED_VIS, true);
|
||||
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) OVERRIDE
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (Phase == IDLE && me->IsValidAttackTarget(who) && me->IsWithinDistInMap(who, 40))
|
||||
{
|
||||
Phase = INTRO;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
|
||||
mirror->SetGoState(GO_STATE_READY);
|
||||
|
||||
if (Creature* arthas = me->SummonCreature(NPC_ARTHAS, ArthasPos, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_SVALA_INTRO_0);
|
||||
++introPhase;
|
||||
introTimer = 8100;
|
||||
break;
|
||||
case 1:
|
||||
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
|
||||
++introPhase;
|
||||
introTimer = 10000;
|
||||
break;
|
||||
case 2:
|
||||
arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
|
||||
pos.Relocate(me);
|
||||
pos.m_positionZ += 8.0f;
|
||||
me->GetMotionMaster()->MoveTakeoff(0, pos);
|
||||
// spectators flee event
|
||||
if (instance)
|
||||
arthas->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
arthasGUID = arthas->GetGUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) OVERRIDE
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
if (Phase == SACRIFICING)
|
||||
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE);
|
||||
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_FLYDEATH);
|
||||
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spellInfo) OVERRIDE
|
||||
{
|
||||
if (spellInfo->Id == SPELL_RITUAL_STRIKE_EFF_1 && Phase != NORMAL && Phase != SVALADEAD)
|
||||
{
|
||||
Phase = NORMAL;
|
||||
SetCombatMovement(true);
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 300.0f, true))
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (Phase == IDLE)
|
||||
return;
|
||||
|
||||
if (Phase == INTRO)
|
||||
{
|
||||
if (introTimer <= diff)
|
||||
{
|
||||
Creature* arthas = ObjectAccessor::GetCreature(*me, arthasGUID);
|
||||
if (!arthas)
|
||||
return;
|
||||
|
||||
switch (introPhase)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_SVALA_INTRO_0);
|
||||
++introPhase;
|
||||
introTimer = 8100;
|
||||
break;
|
||||
case 1:
|
||||
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_1);
|
||||
++introPhase;
|
||||
introTimer = 10000;
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false);
|
||||
Position pos;
|
||||
pos.Relocate(me);
|
||||
pos.m_positionZ += 8.0f;
|
||||
me->GetMotionMaster()->MoveTakeoff(0, pos);
|
||||
// spectators flee event
|
||||
std::list<Creature*> lspectatorList;
|
||||
GetCreatureListWithEntryInGrid(lspectatorList, me, NPC_SPECTATOR, 100.0f);
|
||||
for (std::list<Creature*>::iterator itr = lspectatorList.begin(); itr != lspectatorList.end(); ++itr)
|
||||
@@ -294,257 +256,258 @@ public:
|
||||
{
|
||||
(*itr)->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
(*itr)->SetWalk(false);
|
||||
(*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0][0], spectatorWP[0][1], spectatorWP[0][2]);
|
||||
(*itr)->GetMotionMaster()->MovePoint(1, spectatorWP[0]);
|
||||
}
|
||||
}
|
||||
|
||||
++introPhase;
|
||||
introTimer = 4200;
|
||||
break;
|
||||
}
|
||||
++introPhase;
|
||||
introTimer = 4200;
|
||||
break;
|
||||
case 3:
|
||||
me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
|
||||
++introPhase;
|
||||
introTimer = 6200;
|
||||
break;
|
||||
case 4:
|
||||
me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
|
||||
arthas->InterruptNonMeleeSpells(true);
|
||||
me->RemoveAllAuras();
|
||||
me->UpdateEntry(NPC_SVALA_SORROWGRAVE);
|
||||
me->SetFacingToObject(arthas);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
++introPhase;
|
||||
introTimer = 3200;
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_SVALA_INTRO_1);
|
||||
++introPhase;
|
||||
introTimer = 10000;
|
||||
break;
|
||||
case 6:
|
||||
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
|
||||
++introPhase;
|
||||
introTimer = 7200;
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_SVALA_INTRO_2);
|
||||
me->SetFacingTo(1.58f);
|
||||
arthas->SetVisible(false);
|
||||
++introPhase;
|
||||
introTimer = 13800;
|
||||
break;
|
||||
case 8:
|
||||
pos.Relocate(me);
|
||||
pos.m_positionX = me->GetHomePosition().GetPositionX();
|
||||
pos.m_positionY = me->GetHomePosition().GetPositionY();
|
||||
pos.m_positionZ = 90.6065f;
|
||||
me->GetMotionMaster()->MoveLand(0, pos);
|
||||
me->SetDisableGravity(false, true);
|
||||
me->SetHover(true);
|
||||
++introPhase;
|
||||
introTimer = 3000;
|
||||
break;
|
||||
case 9:
|
||||
if (GameObject* mirror = GetClosestGameObjectWithEntry(me, GO_UTGARDE_MIRROR, 100.0f))
|
||||
mirror->SetGoState(GO_STATE_ACTIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
arthas->DespawnOrUnsummon();
|
||||
arthasGUID = 0;
|
||||
Phase = NORMAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
introTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Phase == NORMAL)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (sinsterStrikeTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SINSTER_STRIKE);
|
||||
sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
|
||||
}
|
||||
else
|
||||
sinsterStrikeTimer -= diff;
|
||||
|
||||
if (callFlamesTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_CALL_FLAMES);
|
||||
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
else callFlamesTimer -= diff;
|
||||
|
||||
if (!sacrificed)
|
||||
{
|
||||
if (HealthBelowPct(50))
|
||||
{
|
||||
if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
|
||||
|
||||
Talk(SAY_SACRIFICE_PLAYER);
|
||||
|
||||
DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
|
||||
|
||||
SetCombatMovement(false);
|
||||
|
||||
Phase = SACRIFICING;
|
||||
sacrePhase = 0;
|
||||
sacrificeTimer = 1 * IN_MILLISECONDS;
|
||||
|
||||
DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
|
||||
sacrificed = true;
|
||||
case 3:
|
||||
me->CastSpell(me, SPELL_SVALA_TRANSFORMING1, false);
|
||||
++introPhase;
|
||||
introTimer = 6200;
|
||||
break;
|
||||
case 4:
|
||||
me->CastSpell(me, SPELL_SVALA_TRANSFORMING2, false);
|
||||
arthas->InterruptNonMeleeSpells(true);
|
||||
me->RemoveAllAuras();
|
||||
me->UpdateEntry(NPC_SVALA_SORROWGRAVE);
|
||||
me->SetFacingToObject(arthas);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
++introPhase;
|
||||
introTimer = 3200;
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_SVALA_INTRO_1);
|
||||
++introPhase;
|
||||
introTimer = 10000;
|
||||
break;
|
||||
case 6:
|
||||
arthas->AI()->Talk(SAY_DIALOG_OF_ARTHAS_2);
|
||||
++introPhase;
|
||||
introTimer = 7200;
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_SVALA_INTRO_2);
|
||||
me->SetFacingTo(1.58f);
|
||||
arthas->SetVisible(false);
|
||||
++introPhase;
|
||||
introTimer = 13800;
|
||||
break;
|
||||
case 8:
|
||||
{
|
||||
Position pos;
|
||||
pos.Relocate(me);
|
||||
pos.m_positionX = me->GetHomePosition().GetPositionX();
|
||||
pos.m_positionY = me->GetHomePosition().GetPositionY();
|
||||
pos.m_positionZ = 90.6065f;
|
||||
me->GetMotionMaster()->MoveLand(0, pos);
|
||||
me->SetDisableGravity(false, true);
|
||||
me->SetHover(true);
|
||||
++introPhase;
|
||||
introTimer = 3000;
|
||||
break;
|
||||
}
|
||||
case 9:
|
||||
if (GameObject* mirror = ObjectAccessor::GetGameObject(*me, DATA_UTGARDE_MIRROR))
|
||||
mirror->SetGoState(GO_STATE_ACTIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
arthas->DespawnOrUnsummon();
|
||||
arthasGUID = 0;
|
||||
Phase = NORMAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
introTimer -= diff;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else //SACRIFICING
|
||||
{
|
||||
if (sacrificeTimer <= diff)
|
||||
if (Phase == NORMAL)
|
||||
{
|
||||
switch (sacrePhase)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (sinsterStrikeTimer <= diff)
|
||||
{
|
||||
case 0:
|
||||
// spawn ritual channelers
|
||||
if (instance)
|
||||
DoCastVictim(SPELL_SINSTER_STRIKE);
|
||||
sinsterStrikeTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS);
|
||||
}
|
||||
else
|
||||
sinsterStrikeTimer -= diff;
|
||||
|
||||
if (callFlamesTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_CALL_FLAMES);
|
||||
callFlamesTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
else
|
||||
callFlamesTimer -= diff;
|
||||
|
||||
if (!sacrificed)
|
||||
{
|
||||
if (HealthBelowPct(50))
|
||||
{
|
||||
if (Unit* sacrificeTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
|
||||
{
|
||||
instance->SetData64(DATA_SACRIFICED_PLAYER, sacrificeTarget->GetGUID());
|
||||
|
||||
Talk(SAY_SACRIFICE_PLAYER);
|
||||
|
||||
DoCast(sacrificeTarget, SPELL_RITUAL_PREPARATION);
|
||||
|
||||
SetCombatMovement(false);
|
||||
|
||||
Phase = SACRIFICING;
|
||||
sacrePhase = 0;
|
||||
sacrificeTimer = 1 * IN_MILLISECONDS;
|
||||
|
||||
DoCast(me, SPELL_RITUAL_OF_THE_SWORD);
|
||||
sacrificed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else // SACRIFICING
|
||||
{
|
||||
if (sacrificeTimer <= diff)
|
||||
{
|
||||
switch (sacrePhase)
|
||||
{
|
||||
case 0:
|
||||
// spawn ritual channelers
|
||||
DoCast(me, SPELL_RITUAL_CHANNELER_1, true);
|
||||
DoCast(me, SPELL_RITUAL_CHANNELER_2, true);
|
||||
DoCast(me, SPELL_RITUAL_CHANNELER_3, true);
|
||||
}
|
||||
++sacrePhase;
|
||||
sacrificeTimer = 2 * IN_MILLISECONDS;
|
||||
break;
|
||||
case 1:
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
|
||||
++sacrePhase;
|
||||
sacrificeTimer = 200;
|
||||
break;
|
||||
case 2:
|
||||
DoCast(me, SPELL_RITUAL_DISARM);
|
||||
++sacrePhase;
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
++sacrePhase;
|
||||
sacrificeTimer = 2 * IN_MILLISECONDS;
|
||||
break;
|
||||
case 1:
|
||||
me->StopMoving();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
DoCast(me, SPELL_RITUAL_STRIKE_TRIGGER, true);
|
||||
++sacrePhase;
|
||||
sacrificeTimer = 200;
|
||||
break;
|
||||
case 2:
|
||||
DoCast(me, SPELL_RITUAL_DISARM);
|
||||
++sacrePhase;
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
sacrificeTimer -= diff;
|
||||
}
|
||||
else sacrificeTimer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetUtgardePinnacleAI<boss_svalaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_ritual_channeler : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ritual_channeler() : CreatureScript("npc_ritual_channeler") { }
|
||||
public:
|
||||
npc_ritual_channeler() : CreatureScript("npc_ritual_channeler") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_ritual_channelerAI(creature);
|
||||
}
|
||||
|
||||
struct npc_ritual_channelerAI : public ScriptedAI
|
||||
{
|
||||
npc_ritual_channelerAI(Creature* creature) :ScriptedAI(creature)
|
||||
struct npc_ritual_channelerAI : public ScriptedAI
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
npc_ritual_channelerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
uint32 paralyzeTimer;
|
||||
InstanceScript* instance;
|
||||
uint32 paralyzeTimer;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
paralyzeTimer = 1600;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
paralyzeTimer = 1600;
|
||||
if (instance)
|
||||
if (IsHeroic())
|
||||
DoCast(me, SPELL_SHADOWS_IN_THE_DARK);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (paralyzeTimer <= diff)
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
{
|
||||
if (instance)
|
||||
if (Unit* victim = me->GetUnit(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (paralyzeTimer <= diff)
|
||||
{
|
||||
if (Player* victim = ObjectAccessor::GetPlayer(*me, instance->GetData64(DATA_SACRIFICED_PLAYER)))
|
||||
DoCast(victim, SPELL_PARALYZE, false);
|
||||
|
||||
paralyzeTimer = 200;
|
||||
paralyzeTimer = 200;
|
||||
}
|
||||
else
|
||||
paralyzeTimer -= diff;
|
||||
}
|
||||
else
|
||||
paralyzeTimer -= diff;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetUtgardePinnacleAI<npc_ritual_channelerAI>(creature);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class npc_spectator : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_spectator() : CreatureScript("npc_spectator") { }
|
||||
public:
|
||||
npc_spectator() : CreatureScript("npc_spectator") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_spectatorAI(creature);
|
||||
}
|
||||
|
||||
struct npc_spectatorAI : public ScriptedAI
|
||||
{
|
||||
npc_spectatorAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE { }
|
||||
|
||||
void MovementInform(uint32 motionType, uint32 pointId) OVERRIDE
|
||||
struct npc_spectatorAI : public ScriptedAI
|
||||
{
|
||||
if (motionType == POINT_MOTION_TYPE)
|
||||
npc_spectatorAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() OVERRIDE { }
|
||||
|
||||
void MovementInform(uint32 motionType, uint32 pointId) OVERRIDE
|
||||
{
|
||||
if (pointId == 1)
|
||||
me->GetMotionMaster()->MovePoint(2, spectatorWP[1][0], spectatorWP[1][1], spectatorWP[1][2]);
|
||||
else if (pointId == 2)
|
||||
me->DespawnOrUnsummon(1000);
|
||||
if (motionType == POINT_MOTION_TYPE)
|
||||
{
|
||||
if (pointId == 1)
|
||||
me->GetMotionMaster()->MovePoint(2, spectatorWP[1]);
|
||||
else if (pointId == 2)
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetUtgardePinnacleAI<npc_spectatorAI>(creature);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class RitualTargetCheck
|
||||
{
|
||||
public:
|
||||
explicit RitualTargetCheck(Unit* _caster) : caster(_caster) { }
|
||||
explicit RitualTargetCheck() { }
|
||||
|
||||
bool operator() (WorldObject* unit) const
|
||||
bool operator() (WorldObject* obj) const
|
||||
{
|
||||
if (InstanceScript* instance = caster->GetInstanceScript())
|
||||
if (instance->GetData64(DATA_SACRIFICED_PLAYER) == unit->GetGUID())
|
||||
if (InstanceScript* instance = obj->GetInstanceScript())
|
||||
if (instance->GetData64(DATA_SACRIFICED_PLAYER) == obj->GetGUID())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* caster;
|
||||
};
|
||||
|
||||
class spell_paralyze_pinnacle : public SpellScriptLoader
|
||||
@@ -558,7 +521,7 @@ class spell_paralyze_pinnacle : public SpellScriptLoader
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
unitList.remove_if(RitualTargetCheck(GetCaster()));
|
||||
unitList.remove_if(RitualTargetCheck());
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
@@ -635,7 +598,7 @@ class npc_scourge_hulk : public CreatureScript
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_scourge_hulkAI(creature);
|
||||
return GetUtgardePinnacleAI<npc_scourge_hulkAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -103,16 +103,10 @@ class boss_ymiron : public CreatureScript
|
||||
public:
|
||||
boss_ymiron() : CreatureScript("boss_ymiron") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
struct boss_ymironAI : public BossAI
|
||||
{
|
||||
return new boss_ymironAI(creature);
|
||||
}
|
||||
|
||||
struct boss_ymironAI : public ScriptedAI
|
||||
{
|
||||
boss_ymironAI(Creature* creature) : ScriptedAI(creature)
|
||||
boss_ymironAI(Creature* creature) : BossAI(creature, DATA_KING_YMIRON)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
for (int i = 0; i < 4; ++i)
|
||||
m_uiActiveOrder[i] = i;
|
||||
for (int i = 0; i < 3; ++i)
|
||||
@@ -122,9 +116,6 @@ public:
|
||||
m_uiActiveOrder[i] = m_uiActiveOrder[r];
|
||||
m_uiActiveOrder[r] = temp;
|
||||
}
|
||||
|
||||
m_uiActivedCreatureGUID = 0;
|
||||
m_uiOrbGUID = 0;
|
||||
}
|
||||
|
||||
bool m_bIsWalking;
|
||||
@@ -155,10 +146,9 @@ public:
|
||||
uint64 m_uiActivedCreatureGUID;
|
||||
uint64 m_uiOrbGUID;
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
_Reset();
|
||||
m_bIsWalking = false;
|
||||
m_bIsPause = false;
|
||||
m_bIsActiveWithBJORN = false;
|
||||
@@ -182,19 +172,14 @@ public:
|
||||
m_uiHealthAmountModifier = 1;
|
||||
m_uiHealthAmountMultipler = DUNGEON_MODE(20, 25);
|
||||
|
||||
DespawnBoatGhosts(m_uiActivedCreatureGUID);
|
||||
DespawnBoatGhosts(m_uiOrbGUID);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_KING_YMIRON_EVENT, NOT_STARTED);
|
||||
m_uiActivedCreatureGUID = 0;
|
||||
m_uiOrbGUID = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_KING_YMIRON_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* who, SpellInfo const* spell) OVERRIDE
|
||||
@@ -371,21 +356,17 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
DespawnBoatGhosts(m_uiActivedCreatureGUID);
|
||||
DespawnBoatGhosts(m_uiOrbGUID);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_KING_YMIRON_EVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) OVERRIDE
|
||||
void KilledUnit(Unit* who) OVERRIDE
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void DespawnBoatGhosts(uint64 m_uiCreatureGUID)
|
||||
void DespawnBoatGhosts(uint64& m_uiCreatureGUID)
|
||||
{
|
||||
if (m_uiCreatureGUID)
|
||||
if (Creature* temp = Unit::GetCreature(*me, m_uiCreatureGUID))
|
||||
@@ -395,14 +376,16 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return GetUtgardePinnacleAI<boss_ymironAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_kings_bane : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_kings_bane() : AchievementCriteriaScript("achievement_kings_bane")
|
||||
{
|
||||
}
|
||||
achievement_kings_bane() : AchievementCriteriaScript("achievement_kings_bane") { }
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target) OVERRIDE
|
||||
{
|
||||
|
||||
@@ -19,246 +19,235 @@
|
||||
#include "InstanceScript.h"
|
||||
#include "utgarde_pinnacle.h"
|
||||
|
||||
#define MAX_ENCOUNTER 4
|
||||
|
||||
/* Utgarde Pinnacle encounters:
|
||||
0 - Svala Sorrowgrave
|
||||
1 - Gortok Palehoof
|
||||
2 - Skadi the Ruthless
|
||||
3 - King Ymiron
|
||||
*/
|
||||
|
||||
enum GameObjects
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
ENTRY_SKADI_THE_RUTHLESS_DOOR = 192173,
|
||||
ENTRY_KING_YMIRON_DOOR = 192174,
|
||||
ENTRY_GORK_PALEHOOF_SPHERE = 188593
|
||||
{ GO_SKADI_THE_RUTHLESS_DOOR, DATA_SKADI_THE_RUTHLESS, DOOR_TYPE_PASSAGE, BOUNDARY_W },
|
||||
{ GO_KING_YMIRON_DOOR, DATA_KING_YMIRON, DOOR_TYPE_PASSAGE, BOUNDARY_N },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
};
|
||||
|
||||
class instance_utgarde_pinnacle : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_utgarde_pinnacle() : InstanceMapScript("instance_utgarde_pinnacle", 575) { }
|
||||
public:
|
||||
instance_utgarde_pinnacle() : InstanceMapScript(UPScriptName, 575) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
|
||||
{
|
||||
return new instance_pinnacle(map);
|
||||
}
|
||||
|
||||
struct instance_pinnacle : public InstanceScript
|
||||
{
|
||||
instance_pinnacle(Map* map) : InstanceScript(map) { }
|
||||
|
||||
uint64 uiSvalaSorrowgrave;
|
||||
uint64 uiGortokPalehoof;
|
||||
uint64 uiSkadiTheRuthless;
|
||||
uint64 uiKingYmiron;
|
||||
|
||||
uint64 uiSkadiTheRuthlessDoor;
|
||||
uint64 uiKingYmironDoor;
|
||||
uint64 uiGortokPalehoofSphere;
|
||||
|
||||
uint64 uiFrenziedWorgen;
|
||||
uint64 uiRavenousFurbolg;
|
||||
uint64 uiFerociousRhino;
|
||||
uint64 uiMassiveJormungar;
|
||||
uint64 uiPalehoofOrb;
|
||||
|
||||
uint64 uiSvala;
|
||||
uint64 uiSacrificedPlayer;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
std::string str_data;
|
||||
|
||||
void Initialize() OVERRIDE
|
||||
struct instance_utgarde_pinnacle_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
uiSvalaSorrowgrave = 0;
|
||||
uiGortokPalehoof = 0;
|
||||
uiSkadiTheRuthless = 0;
|
||||
uiKingYmiron = 0;
|
||||
|
||||
uiSkadiTheRuthlessDoor = 0;
|
||||
uiKingYmironDoor = 0;
|
||||
uiGortokPalehoofSphere = 0;
|
||||
|
||||
uiFrenziedWorgen = 0;
|
||||
uiRavenousFurbolg = 0;
|
||||
uiFerociousRhino = 0;
|
||||
uiMassiveJormungar = 0;
|
||||
uiPalehoofOrb = 0;
|
||||
|
||||
uiSvala = 0;
|
||||
uiSacrificedPlayer = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const OVERRIDE
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) OVERRIDE
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
instance_utgarde_pinnacle_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
case BOSS_SVALA_SORROWGRAVE: uiSvalaSorrowgrave = creature->GetGUID(); break;
|
||||
case BOSS_GORTOK_PALEHOOF: uiGortokPalehoof = creature->GetGUID(); break;
|
||||
case BOSS_SKADI_RUTHLESS: uiSkadiTheRuthless = creature->GetGUID(); break;
|
||||
case BOSS_KING_YMIRON: uiKingYmiron = creature->GetGUID(); break;
|
||||
case NPC_FRENZIED_WORGEN: uiFrenziedWorgen = creature->GetGUID(); break;
|
||||
case NPC_RAVENOUS_FURBOLG: uiRavenousFurbolg = creature->GetGUID(); break;
|
||||
case NPC_MASSIVE_JORMUNGAR: uiMassiveJormungar = creature->GetGUID(); break;
|
||||
case NPC_FEROCIOUS_RHINO: uiFerociousRhino = creature->GetGUID(); break;
|
||||
case NPC_SVALA: uiSvala = creature->GetGUID(); break;
|
||||
case NPC_PALEHOOF_ORB: uiPalehoofOrb = creature->GetGUID(); break;
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
SvalaSorrowgraveGUID = 0;
|
||||
GortokPalehoofGUID = 0;
|
||||
SkadiTheRuthlessGUID = 0;
|
||||
KingYmironGUID = 0;
|
||||
|
||||
UtgardeMirrorGUID = 0;
|
||||
GortokPalehoofSphereGUID = 0;
|
||||
|
||||
FrenziedWorgenGUID = 0;
|
||||
RavenousFurbolgGUID = 0;
|
||||
FerociousRhinoGUID = 0;
|
||||
MassiveJormungarGUID = 0;
|
||||
PalehoofOrbGUID = 0;
|
||||
|
||||
SvalaGUID = 0;
|
||||
SacrificedPlayerGUID = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) OVERRIDE
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
void OnCreatureCreate(Creature* creature) OVERRIDE
|
||||
{
|
||||
case ENTRY_SKADI_THE_RUTHLESS_DOOR:
|
||||
uiSkadiTheRuthlessDoor = go->GetGUID();
|
||||
if (m_auiEncounter[2] == DONE) HandleGameObject(0, true, go);
|
||||
break;
|
||||
case ENTRY_KING_YMIRON_DOOR:
|
||||
uiKingYmironDoor = go->GetGUID();
|
||||
if (m_auiEncounter[3] == DONE) HandleGameObject(0, true, go);
|
||||
break;
|
||||
case ENTRY_GORK_PALEHOOF_SPHERE:
|
||||
uiGortokPalehoofSphere = go->GetGUID();
|
||||
if (m_auiEncounter[1] == DONE)
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_SVALA_SORROWGRAVE:
|
||||
SvalaSorrowgraveGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_GORTOK_PALEHOOF:
|
||||
GortokPalehoofGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SKADI_THE_RUTHLESS:
|
||||
SkadiTheRuthlessGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_KING_YMIRON:
|
||||
KingYmironGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_FRENZIED_WORGEN:
|
||||
FrenziedWorgenGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_RAVENOUS_FURBOLG:
|
||||
RavenousFurbolgGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MASSIVE_JORMUNGAR:
|
||||
MassiveJormungarGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_FEROCIOUS_RHINO:
|
||||
FerociousRhinoGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SVALA:
|
||||
SvalaGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_PALEHOOF_ORB:
|
||||
PalehoofOrbGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) OVERRIDE
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_UTGARDE_MIRROR:
|
||||
UtgardeMirrorGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_GORTOK_PALEHOOF_SPHERE:
|
||||
GortokPalehoofSphereGUID = go->GetGUID();
|
||||
if (GetBossState(DATA_GORTOK_PALEHOOF) == DONE)
|
||||
{
|
||||
HandleGameObject(0, true, go);
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
break;
|
||||
case GO_SKADI_THE_RUTHLESS_DOOR:
|
||||
case GO_KING_YMIRON_DOOR:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go) OVERRIDE
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_SKADI_THE_RUTHLESS_DOOR:
|
||||
case GO_KING_YMIRON_DOOR:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData64(uint32 type, uint64 data) OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_SACRIFICED_PLAYER:
|
||||
SacrificedPlayerGUID = data;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE:
|
||||
return SvalaSorrowgraveGUID;
|
||||
case DATA_GORTOK_PALEHOOF:
|
||||
return GortokPalehoofGUID;
|
||||
case DATA_SKADI_THE_RUTHLESS:
|
||||
return SkadiTheRuthlessGUID;
|
||||
case DATA_KING_YMIRON:
|
||||
return KingYmironGUID;
|
||||
case DATA_FRENZIED_WORGEN:
|
||||
return FrenziedWorgenGUID;
|
||||
case DATA_RAVENOUS_FURBOLG:
|
||||
return RavenousFurbolgGUID;
|
||||
case DATA_MASSIVE_JORMUNGAR:
|
||||
return MassiveJormungarGUID;
|
||||
case DATA_FEROCIOUS_RHINO:
|
||||
return FerociousRhinoGUID;
|
||||
case DATA_GORTOK_ORB:
|
||||
return PalehoofOrbGUID;
|
||||
case DATA_GORTOK_PALEHOOF_SPHERE:
|
||||
return GortokPalehoofSphereGUID;
|
||||
case DATA_UTGARDE_MIRROR:
|
||||
return UtgardeMirrorGUID;
|
||||
case DATA_SVALA:
|
||||
return SvalaGUID;
|
||||
case DATA_SACRIFICED_PLAYER:
|
||||
return SacrificedPlayerGUID;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData() OVERRIDE
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "U P " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* str) OVERRIDE
|
||||
{
|
||||
if (!str)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'U' && dataHead2 == 'P')
|
||||
{
|
||||
for (uint32 i = 0; i < EncounterCount; ++i)
|
||||
{
|
||||
HandleGameObject(0, true, go);
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
void SetData(uint32 type, uint32 data) OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_GORTOK_PALEHOOF_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_SKADI_THE_RUTHLESS_EVENT:
|
||||
if (data == DONE)
|
||||
HandleGameObject(uiSkadiTheRuthlessDoor, true);
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_KING_YMIRON_EVENT:
|
||||
if (data == DONE)
|
||||
HandleGameObject(uiKingYmironDoor, true);
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
protected:
|
||||
uint64 SvalaSorrowgraveGUID;
|
||||
uint64 GortokPalehoofGUID;
|
||||
uint64 SkadiTheRuthlessGUID;
|
||||
uint64 KingYmironGUID;
|
||||
|
||||
void SetData64(uint32 type, uint64 data) OVERRIDE
|
||||
uint64 UtgardeMirrorGUID;
|
||||
uint64 GortokPalehoofSphereGUID;
|
||||
|
||||
uint64 FrenziedWorgenGUID;
|
||||
uint64 RavenousFurbolgGUID;
|
||||
uint64 FerociousRhinoGUID;
|
||||
uint64 MassiveJormungarGUID;
|
||||
|
||||
uint64 PalehoofOrbGUID;
|
||||
|
||||
uint64 SvalaGUID;
|
||||
uint64 SacrificedPlayerGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_SACRIFICED_PLAYER:
|
||||
uiSacrificedPlayer = data;
|
||||
break;
|
||||
}
|
||||
return new instance_utgarde_pinnacle_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const OVERRIDE
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE_EVENT: return m_auiEncounter[0];
|
||||
case DATA_GORTOK_PALEHOOF_EVENT: return m_auiEncounter[1];
|
||||
case DATA_SKADI_THE_RUTHLESS_EVENT: return m_auiEncounter[2];
|
||||
case DATA_KING_YMIRON_EVENT: return m_auiEncounter[3];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier) const OVERRIDE
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case DATA_SVALA_SORROWGRAVE: return uiSvalaSorrowgrave;
|
||||
case DATA_GORTOK_PALEHOOF: return uiGortokPalehoof;
|
||||
case DATA_SKADI_THE_RUTHLESS: return uiSkadiTheRuthless;
|
||||
case DATA_KING_YMIRON: return uiKingYmiron;
|
||||
case DATA_NPC_FRENZIED_WORGEN: return uiFrenziedWorgen;
|
||||
case DATA_NPC_RAVENOUS_FURBOLG: return uiRavenousFurbolg;
|
||||
case DATA_NPC_MASSIVE_JORMUNGAR: return uiMassiveJormungar;
|
||||
case DATA_NPC_FEROCIOUS_RHINO: return uiFerociousRhino;
|
||||
case DATA_NPC_ORB: return uiPalehoofOrb;
|
||||
case DATA_SVALA: return uiSvala;
|
||||
case DATA_GORTOK_PALEHOOF_SPHERE: return uiGortokPalehoofSphere;
|
||||
case DATA_SACRIFICED_PLAYER: return uiSacrificedPlayer;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData() OVERRIDE
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "U P " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
|
||||
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in) OVERRIDE
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
|
||||
|
||||
if (dataHead1 == 'U' && dataHead2 == 'P')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
m_auiEncounter[3] = data3;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_utgarde_pinnacle()
|
||||
|
||||
@@ -15,46 +15,64 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef DEF_PINNACLE_H
|
||||
#define DEF_PINNACLE_H
|
||||
#ifndef UTGARDE_PINNACLE_H_
|
||||
#define UTGARDE_PINNACLE_H_
|
||||
|
||||
enum Data
|
||||
#define UPScriptName "instance_utgarde_pinnacle"
|
||||
|
||||
uint32 const EncounterCount = 4;
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_SVALA_SORROWGRAVE_EVENT,
|
||||
DATA_GORTOK_PALEHOOF_EVENT,
|
||||
DATA_SKADI_THE_RUTHLESS_EVENT,
|
||||
DATA_KING_YMIRON_EVENT
|
||||
// Encounter States/Boss GUIDs
|
||||
DATA_SVALA_SORROWGRAVE = 0,
|
||||
DATA_GORTOK_PALEHOOF = 1,
|
||||
DATA_SKADI_THE_RUTHLESS = 2,
|
||||
DATA_KING_YMIRON = 3,
|
||||
|
||||
// Additional Data
|
||||
DATA_UTGARDE_MIRROR = 4,
|
||||
DATA_SVALA = 5,
|
||||
DATA_SACRIFICED_PLAYER = 6,
|
||||
|
||||
DATA_FRENZIED_WORGEN = 7,
|
||||
DATA_RAVENOUS_FURBOLG = 8,
|
||||
DATA_MASSIVE_JORMUNGAR = 9,
|
||||
DATA_FEROCIOUS_RHINO = 10,
|
||||
DATA_GORTOK_ORB = 11,
|
||||
DATA_GORTOK_PALEHOOF_SPHERE = 12
|
||||
};
|
||||
|
||||
enum Data64
|
||||
enum CreatureIds
|
||||
{
|
||||
DATA_SVALA,
|
||||
DATA_SVALA_SORROWGRAVE,
|
||||
DATA_GORTOK_PALEHOOF,
|
||||
DATA_SKADI_THE_RUTHLESS,
|
||||
DATA_NPC_GRAUF,
|
||||
DATA_KING_YMIRON,
|
||||
DATA_NPC_FRENZIED_WORGEN,
|
||||
DATA_NPC_RAVENOUS_FURBOLG,
|
||||
DATA_NPC_MASSIVE_JORMUNGAR,
|
||||
DATA_NPC_FEROCIOUS_RHINO,
|
||||
DATA_NPC_ORB,
|
||||
DATA_GORTOK_PALEHOOF_SPHERE,
|
||||
DATA_SACRIFICED_PLAYER
|
||||
NPC_SVALA_SORROWGRAVE = 26668,
|
||||
NPC_GORTOK_PALEHOOF = 26687,
|
||||
NPC_SKADI_THE_RUTHLESS = 26693,
|
||||
NPC_KING_YMIRON = 26861,
|
||||
|
||||
// Svala
|
||||
NPC_SVALA = 29281,
|
||||
|
||||
// Gortok Palehoof
|
||||
NPC_FRENZIED_WORGEN = 26683,
|
||||
NPC_RAVENOUS_FURBOLG = 26684,
|
||||
NPC_MASSIVE_JORMUNGAR = 26685,
|
||||
NPC_FEROCIOUS_RHINO = 26686,
|
||||
NPC_PALEHOOF_ORB = 26688
|
||||
};
|
||||
|
||||
enum CreatureID
|
||||
enum GameObjectIds
|
||||
{
|
||||
BOSS_SVALA_SORROWGRAVE = 26668,
|
||||
BOSS_GORTOK_PALEHOOF = 26687,
|
||||
BOSS_SKADI_RUTHLESS = 26693,
|
||||
BOSS_KING_YMIRON = 26861,
|
||||
NPC_FRENZIED_WORGEN = 26683,
|
||||
NPC_RAVENOUS_FURBOLG = 26684,
|
||||
NPC_MASSIVE_JORMUNGAR = 26685,
|
||||
NPC_FEROCIOUS_RHINO = 26686,
|
||||
NPC_SVALA = 29281,
|
||||
NPC_PALEHOOF_ORB = 26688
|
||||
GO_GORTOK_PALEHOOF_SPHERE = 188593,
|
||||
GO_UTGARDE_MIRROR = 191745,
|
||||
GO_SKADI_THE_RUTHLESS_DOOR = 192173,
|
||||
GO_KING_YMIRON_DOOR = 192174
|
||||
};
|
||||
|
||||
#endif
|
||||
template<class AI>
|
||||
AI* GetUtgardePinnacleAI(Creature* creature)
|
||||
{
|
||||
return GetInstanceAI<AI>(creature, UPScriptName);
|
||||
}
|
||||
|
||||
#endif // UTGARDE_PINNACLE_H_
|
||||
|
||||
Reference in New Issue
Block a user