Convert Ahnkahet, Azjol-Nerub, Drak'tharon Keep, and Forge of Souls to the new format.
--HG-- branch : trunk
This commit is contained in:
@@ -46,224 +46,229 @@ enum Creatures
|
||||
NPC_RAPTOR_2 = 26628
|
||||
};
|
||||
|
||||
struct boss_dredAI : public ScriptedAI
|
||||
class boss_dred : public CreatureScript
|
||||
{
|
||||
boss_dredAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_dred() : CreatureScript("boss_dred") { }
|
||||
|
||||
struct boss_dredAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiBellowingRoarTimer;
|
||||
uint32 uiGrievousBiteTimer;
|
||||
uint32 uiManglingSlashTimer;
|
||||
uint32 uiFearsomeRoarTimer;
|
||||
uint32 uiPiercingSlashTimer;
|
||||
uint32 uiRaptorCallTimer;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
boss_dredAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance->SetData(DATA_DRED_EVENT,NOT_STARTED);
|
||||
pInstance->SetData(DATA_KING_DRED_ACHIEV, 0);
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uiBellowingRoarTimer = 33*IN_MILLISECONDS;
|
||||
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
|
||||
uiManglingSlashTimer = 18.5*IN_MILLISECONDS;
|
||||
uiFearsomeRoarTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiPiercingSlashTimer = 17*IN_MILLISECONDS;
|
||||
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
}
|
||||
uint32 uiBellowingRoarTimer;
|
||||
uint32 uiGrievousBiteTimer;
|
||||
uint32 uiManglingSlashTimer;
|
||||
uint32 uiFearsomeRoarTimer;
|
||||
uint32 uiPiercingSlashTimer;
|
||||
uint32 uiRaptorCallTimer;
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DRED_EVENT,IN_PROGRESS);
|
||||
}
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiBellowingRoarTimer < diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCastAOE(SPELL_BELLOWING_ROAR, false);
|
||||
uiBellowingRoarTimer = 40*IN_MILLISECONDS;
|
||||
} else uiBellowingRoarTimer -=diff;
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_DRED_EVENT,NOT_STARTED);
|
||||
pInstance->SetData(DATA_KING_DRED_ACHIEV, 0);
|
||||
}
|
||||
|
||||
if (uiGrievousBiteTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_GRIEVOUS_BITE ,false);
|
||||
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
|
||||
} else uiGrievousBiteTimer -=diff;
|
||||
|
||||
if (uiManglingSlashTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLING_SLASH,false);
|
||||
uiManglingSlashTimer = 20*IN_MILLISECONDS;
|
||||
} else uiManglingSlashTimer -=diff;
|
||||
|
||||
if (uiFearsomeRoarTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_FEARSOME_ROAR,false);
|
||||
uiFearsomeRoarTimer = urand(16*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
} else uiFearsomeRoarTimer -=diff;
|
||||
|
||||
if (uiPiercingSlashTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_PIERCING_SLASH,false);
|
||||
uiPiercingSlashTimer = 20*IN_MILLISECONDS;
|
||||
} else uiPiercingSlashTimer -=diff;
|
||||
|
||||
if (uiRaptorCallTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_RAPTOR_CALL,false);
|
||||
|
||||
float x,y,z;
|
||||
|
||||
me->GetClosePoint(x,y,z,me->GetObjectSize()/3,10.0f);
|
||||
me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILLISECONDS);
|
||||
|
||||
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiRaptorCallTimer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_DRED_EVENT,DONE);
|
||||
|
||||
if (IsHeroic() && pInstance->GetData(DATA_KING_DRED_ACHIEV) == 6)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_BETTER_OFF_DRED);
|
||||
uiBellowingRoarTimer = 33*IN_MILLISECONDS;
|
||||
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
|
||||
uiManglingSlashTimer = 18.5*IN_MILLISECONDS;
|
||||
uiFearsomeRoarTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiPiercingSlashTimer = 17*IN_MILLISECONDS;
|
||||
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_DRED_EVENT,IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiBellowingRoarTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_BELLOWING_ROAR, false);
|
||||
uiBellowingRoarTimer = 40*IN_MILLISECONDS;
|
||||
} else uiBellowingRoarTimer -=diff;
|
||||
|
||||
if (uiGrievousBiteTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_GRIEVOUS_BITE ,false);
|
||||
uiGrievousBiteTimer = 20*IN_MILLISECONDS;
|
||||
} else uiGrievousBiteTimer -=diff;
|
||||
|
||||
if (uiManglingSlashTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MANGLING_SLASH,false);
|
||||
uiManglingSlashTimer = 20*IN_MILLISECONDS;
|
||||
} else uiManglingSlashTimer -=diff;
|
||||
|
||||
if (uiFearsomeRoarTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_FEARSOME_ROAR,false);
|
||||
uiFearsomeRoarTimer = urand(16*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
} else uiFearsomeRoarTimer -=diff;
|
||||
|
||||
if (uiPiercingSlashTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_PIERCING_SLASH,false);
|
||||
uiPiercingSlashTimer = 20*IN_MILLISECONDS;
|
||||
} else uiPiercingSlashTimer -=diff;
|
||||
|
||||
if (uiRaptorCallTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_RAPTOR_CALL,false);
|
||||
|
||||
float x,y,z;
|
||||
|
||||
me->GetClosePoint(x,y,z,me->GetObjectSize()/3,10.0f);
|
||||
me->SummonCreature(RAND(NPC_RAPTOR_1,NPC_RAPTOR_2),x,y,z,0,TEMPSUMMON_DEAD_DESPAWN,1*IN_MILLISECONDS);
|
||||
|
||||
uiRaptorCallTimer = urand(20*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiRaptorCallTimer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_DRED_EVENT,DONE);
|
||||
|
||||
if (IsHeroic() && pInstance->GetData(DATA_KING_DRED_ACHIEV) == 6)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_BETTER_OFF_DRED);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_dredAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_dred(Creature* pCreature)
|
||||
class npc_drakkari_gutripper : public CreatureScript
|
||||
{
|
||||
return new boss_dredAI (pCreature);
|
||||
}
|
||||
public:
|
||||
npc_drakkari_gutripper() : CreatureScript("npc_drakkari_gutripper") { }
|
||||
|
||||
struct npc_drakkari_gutripperAI : public ScriptedAI
|
||||
{
|
||||
npc_drakkari_gutripperAI(Creature *c) : ScriptedAI(c)
|
||||
struct npc_drakkari_gutripperAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 GutRipTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
GutRipTimer = urand(10000,15000);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (GutRipTimer < diff)
|
||||
npc_drakkari_gutripperAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 GutRipTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCastVictim(SPELL_GUT_RIP,false);
|
||||
GutRipTimer = urand(10000,15000);
|
||||
}else GutRipTimer -=diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (GutRipTimer < diff)
|
||||
{
|
||||
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
|
||||
DoCastVictim(SPELL_GUT_RIP,false);
|
||||
GutRipTimer = urand(10000,15000);
|
||||
}else GutRipTimer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
|
||||
{
|
||||
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new npc_drakkari_gutripperAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_drakkari_gutripper(Creature* pCreature)
|
||||
class npc_drakkari_scytheclaw : public CreatureScript
|
||||
{
|
||||
return new npc_drakkari_gutripperAI (pCreature);
|
||||
}
|
||||
public:
|
||||
npc_drakkari_scytheclaw() : CreatureScript("npc_drakkari_scytheclaw") { }
|
||||
|
||||
struct npc_drakkari_scytheclawAI : public ScriptedAI
|
||||
{
|
||||
npc_drakkari_scytheclawAI(Creature *c) : ScriptedAI(c)
|
||||
struct npc_drakkari_scytheclawAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiRendTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiRendTimer < diff)
|
||||
npc_drakkari_scytheclawAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
uint32 uiRendTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCastVictim(SPELL_REND,false);
|
||||
uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
}else uiRendTimer -=diff;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiRendTimer < diff)
|
||||
{
|
||||
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
|
||||
DoCastVictim(SPELL_REND,false);
|
||||
uiRendTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
}else uiRendTimer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
if (IsHeroic() && pInstance->GetData(DATA_DRED_EVENT) == IN_PROGRESS && pInstance->GetData(DATA_KING_DRED_ACHIEV) < 6)
|
||||
{
|
||||
pInstance->SetData(DATA_KING_DRED_ACHIEV, pInstance->GetData(DATA_KING_DRED_ACHIEV) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new npc_drakkari_scytheclawAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_npc_drakkari_scytheclaw(Creature* pCreature)
|
||||
{
|
||||
return new npc_drakkari_scytheclawAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_dred()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_drakkari_gutripper";
|
||||
newscript->GetAI = &GetAI_npc_drakkari_gutripper;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_drakkari_scytheclaw";
|
||||
newscript->GetAI = &GetAI_npc_drakkari_scytheclaw;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_dred";
|
||||
newscript->GetAI = &GetAI_boss_dred;
|
||||
newscript->RegisterSelf();
|
||||
new npc_drakkari_gutripper;
|
||||
new npc_drakkari_scytheclaw;
|
||||
new boss_dred;
|
||||
}
|
||||
|
||||
@@ -63,157 +63,168 @@ static Position AddSpawnPoint = { -379.20, -816.76, 59.70 };
|
||||
static Position CrystalHandlerSpawnPoint = { -326.626343, -709.956604, 27.813314 };
|
||||
static Position AddDestinyPoint = { -379.314545, -772.577637, 28.58837 };
|
||||
|
||||
struct boss_novosAI : public Scripted_NoMovementAI
|
||||
class boss_novos : public CreatureScript
|
||||
{
|
||||
boss_novosAI(Creature *c) : Scripted_NoMovementAI(c), lSummons(me)
|
||||
public:
|
||||
boss_novos() : CreatureScript("boss_novos") { }
|
||||
|
||||
struct boss_novosAI : public Scripted_NoMovementAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiTimer;
|
||||
uint32 uiCrystalHandlerTimer;
|
||||
|
||||
bool bAchiev;
|
||||
|
||||
SummonList lSummons;
|
||||
|
||||
std::list<uint64> luiCrystals;
|
||||
|
||||
CombatPhase Phase;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = IDLE;
|
||||
luiCrystals.clear();
|
||||
bAchiev = true;
|
||||
me->CastStop();
|
||||
lSummons.DespawnAll();
|
||||
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
if (pInstance)
|
||||
boss_novosAI(Creature *c) : Scripted_NoMovementAI(c), lSummons(me)
|
||||
{
|
||||
pInstance->SetData(DATA_NOVOS_EVENT, NOT_STARTED);
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_1));
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_2));
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_3));
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_4));
|
||||
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
|
||||
{
|
||||
if (GameObject* pTemp = pInstance->instance->GetGameObject(*itr))
|
||||
pTemp->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
Phase = PHASE_1;
|
||||
uiCrystalHandlerTimer = 30*IN_MILLISECONDS;
|
||||
uiTimer = 1*IN_MILLISECONDS;
|
||||
DoCast(SPELL_ARCANE_FIELD);
|
||||
if (pInstance)
|
||||
{
|
||||
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
|
||||
{
|
||||
if (GameObject *pTemp = pInstance->instance->GetGameObject(*itr))
|
||||
pTemp->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
pInstance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
case PHASE_1:
|
||||
if (uiTimer <= diff)
|
||||
{
|
||||
Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
|
||||
pSummon->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
|
||||
//If spell is casted stops casting arcane field so no spell casting
|
||||
//DoCast(me, SPELL_SUMMON_MINIONS);
|
||||
uiTimer = 3*IN_MILLISECONDS;
|
||||
} else uiTimer -= diff;
|
||||
if (uiCrystalHandlerTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_NECRO_ADD, me);
|
||||
Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
|
||||
pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
|
||||
uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
} else uiCrystalHandlerTimer -= diff;
|
||||
break;
|
||||
case PHASE_2:
|
||||
if (uiTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST,SPELL_BLIZZARD,SPELL_FROSTBOLT,SPELL_WRATH_OF_MISERY),
|
||||
RAND(H_SPELL_ARCANE_BLAST,H_SPELL_BLIZZARD,H_SPELL_FROSTBOLT,H_SPELL_WRATH_OF_MISERY)));
|
||||
uiTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS);
|
||||
} else uiTimer -= diff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_NOVOS_EVENT, DONE);
|
||||
|
||||
if (IsHeroic() && bAchiev)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_OH_NOVOS);
|
||||
}
|
||||
lSummons.DespawnAll();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summon)
|
||||
{
|
||||
lSummons.Summon(summon);
|
||||
}
|
||||
|
||||
void RemoveCrystal()
|
||||
{
|
||||
if (!luiCrystals.empty())
|
||||
{
|
||||
if (pInstance)
|
||||
if (GameObject *pTemp = pInstance->instance->GetGameObject(luiCrystals.back()))
|
||||
pTemp->SetGoState(GO_STATE_READY);
|
||||
luiCrystals.pop_back();
|
||||
}
|
||||
if (luiCrystals.empty())
|
||||
uint32 uiTimer;
|
||||
uint32 uiCrystalHandlerTimer;
|
||||
|
||||
bool bAchiev;
|
||||
|
||||
SummonList lSummons;
|
||||
|
||||
std::list<uint64> luiCrystals;
|
||||
|
||||
CombatPhase Phase;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Phase = IDLE;
|
||||
luiCrystals.clear();
|
||||
bAchiev = true;
|
||||
me->CastStop();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Phase = PHASE_2;
|
||||
uiTimer = 1*IN_MILLISECONDS;
|
||||
}
|
||||
}
|
||||
lSummons.DespawnAll();
|
||||
|
||||
Unit* GetRandomTarget()
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_NOVOS_EVENT, NOT_STARTED);
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_1));
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_2));
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_3));
|
||||
luiCrystals.push_back(pInstance->GetData64(DATA_NOVOS_CRYSTAL_4));
|
||||
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
|
||||
{
|
||||
if (GameObject* pTemp = pInstance->instance->GetGameObject(*itr))
|
||||
pTemp->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
Phase = PHASE_1;
|
||||
uiCrystalHandlerTimer = 30*IN_MILLISECONDS;
|
||||
uiTimer = 1*IN_MILLISECONDS;
|
||||
DoCast(SPELL_ARCANE_FIELD);
|
||||
if (pInstance)
|
||||
{
|
||||
for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
|
||||
{
|
||||
if (GameObject *pTemp = pInstance->instance->GetGameObject(*itr))
|
||||
pTemp->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
pInstance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
switch (Phase)
|
||||
{
|
||||
case PHASE_1:
|
||||
if (uiTimer <= diff)
|
||||
{
|
||||
Creature *pSummon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE,CREATURE_HULKING_CORPSE,CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
|
||||
pSummon->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
|
||||
//If spell is casted stops casting arcane field so no spell casting
|
||||
//DoCast(me, SPELL_SUMMON_MINIONS);
|
||||
uiTimer = 3*IN_MILLISECONDS;
|
||||
} else uiTimer -= diff;
|
||||
if (uiCrystalHandlerTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_NECRO_ADD, me);
|
||||
Creature *pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20*IN_MILLISECONDS);
|
||||
pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint);
|
||||
uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
} else uiCrystalHandlerTimer -= diff;
|
||||
break;
|
||||
case PHASE_2:
|
||||
if (uiTimer <= diff)
|
||||
{
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST,SPELL_BLIZZARD,SPELL_FROSTBOLT,SPELL_WRATH_OF_MISERY),
|
||||
RAND(H_SPELL_ARCANE_BLAST,H_SPELL_BLIZZARD,H_SPELL_FROSTBOLT,H_SPELL_WRATH_OF_MISERY)));
|
||||
uiTimer = urand(1*IN_MILLISECONDS,3*IN_MILLISECONDS);
|
||||
} else uiTimer -= diff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_NOVOS_EVENT, DONE);
|
||||
|
||||
if (IsHeroic() && bAchiev)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_OH_NOVOS);
|
||||
}
|
||||
lSummons.DespawnAll();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summon)
|
||||
{
|
||||
lSummons.Summon(summon);
|
||||
}
|
||||
|
||||
void RemoveCrystal()
|
||||
{
|
||||
if (!luiCrystals.empty())
|
||||
{
|
||||
if (pInstance)
|
||||
if (GameObject *pTemp = pInstance->instance->GetGameObject(luiCrystals.back()))
|
||||
pTemp->SetGoState(GO_STATE_READY);
|
||||
luiCrystals.pop_back();
|
||||
}
|
||||
if (luiCrystals.empty())
|
||||
{
|
||||
me->CastStop();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Phase = PHASE_2;
|
||||
uiTimer = 1*IN_MILLISECONDS;
|
||||
}
|
||||
}
|
||||
|
||||
Unit* GetRandomTarget()
|
||||
{
|
||||
return SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
|
||||
return new boss_novosAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -223,105 +234,99 @@ enum CrystalHandlerSpells
|
||||
H_SPELL_FLASH_OF_DARKNESS = 59004
|
||||
};
|
||||
|
||||
struct mob_crystal_handlerAI : public ScriptedAI
|
||||
class mob_crystal_handler : public CreatureScript
|
||||
{
|
||||
mob_crystal_handlerAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
mob_crystal_handler() : CreatureScript("mob_crystal_handler") { }
|
||||
|
||||
struct mob_crystal_handlerAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiFlashOfDarknessTimer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
|
||||
CAST_AI(boss_novosAI,pNovos->AI())->RemoveCrystal();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiFlashOfDarknessTimer <= diff)
|
||||
mob_crystal_handlerAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS));
|
||||
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
|
||||
} else uiFlashOfDarknessTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != 0)
|
||||
return;
|
||||
if (Creature *pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
|
||||
if (Unit *pTarget = CAST_AI(boss_novosAI, pNovos->AI())->GetRandomTarget())
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
};
|
||||
|
||||
struct mob_novos_minionAI : public ScriptedAI
|
||||
{
|
||||
mob_novos_minionAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id !=0)
|
||||
return;
|
||||
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
|
||||
{
|
||||
CAST_AI(boss_novosAI, pNovos->AI())->bAchiev = false;
|
||||
if (Unit *pTarget = CAST_AI(boss_novosAI, pNovos->AI())->GetRandomTarget())
|
||||
AttackStart(pTarget);
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiFlashOfDarknessTimer;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
|
||||
CAST_AI(boss_novos::boss_novosAI,pNovos->AI())->RemoveCrystal();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiFlashOfDarknessTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS,H_SPELL_FLASH_OF_DARKNESS));
|
||||
uiFlashOfDarknessTimer = 5*IN_MILLISECONDS;
|
||||
} else uiFlashOfDarknessTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != 0)
|
||||
return;
|
||||
if (Creature *pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
|
||||
if (Unit *pTarget = CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->GetRandomTarget())
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new mob_crystal_handlerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_novos(Creature* pCreature)
|
||||
class mob_novos_minion : public CreatureScript
|
||||
{
|
||||
return new boss_novosAI (pCreature);
|
||||
}
|
||||
public:
|
||||
mob_novos_minion() : CreatureScript("mob_novos_minion") { }
|
||||
|
||||
CreatureAI* GetAI_mob_crystal_handler(Creature* pCreature)
|
||||
{
|
||||
return new mob_crystal_handlerAI (pCreature);
|
||||
}
|
||||
struct mob_novos_minionAI : public ScriptedAI
|
||||
{
|
||||
mob_novos_minionAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_mob_novos_minion(Creature* pCreature)
|
||||
{
|
||||
return new mob_novos_minionAI (pCreature);
|
||||
}
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id !=0)
|
||||
return;
|
||||
if (Creature* pNovos = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_NOVOS) : 0))
|
||||
{
|
||||
CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->bAchiev = false;
|
||||
if (Unit *pTarget = CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->GetRandomTarget())
|
||||
AttackStart(pTarget);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new mob_novos_minionAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_novos()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_novos";
|
||||
newscript->GetAI = &GetAI_boss_novos;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_crystal_handler";
|
||||
newscript->GetAI = &GetAI_mob_crystal_handler;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_novos_minion";
|
||||
newscript->GetAI = &GetAI_mob_novos_minion;
|
||||
newscript->RegisterSelf();
|
||||
new boss_novos;
|
||||
new mob_crystal_handler;
|
||||
new mob_novos_minion;
|
||||
}
|
||||
|
||||
@@ -64,196 +64,196 @@ enum CombatPhase
|
||||
GOING_SKELETAL
|
||||
};
|
||||
|
||||
struct boss_tharon_jaAI : public ScriptedAI
|
||||
class boss_tharon_ja : public CreatureScript
|
||||
{
|
||||
boss_tharon_jaAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_tharon_ja() : CreatureScript("boss_tharon_ja") { }
|
||||
|
||||
struct boss_tharon_jaAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiPhaseTimer;
|
||||
uint32 uiCurseOfLifeTimer;
|
||||
uint32 uiRainOfFireTimer;
|
||||
uint32 uiShadowVolleyTimer;
|
||||
uint32 uiEyeBeamTimer;
|
||||
uint32 uiLightningBreathTimer;
|
||||
uint32 uiPoisonCloudTimer;
|
||||
|
||||
CombatPhase Phase;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiPhaseTimer = 20*IN_MILLISECONDS;
|
||||
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
|
||||
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
Phase = SKELETAL;
|
||||
me->SetDisplayId(me->GetNativeDisplayId());
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_THARON_JA_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_THARON_JA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
switch (Phase)
|
||||
boss_tharon_jaAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
case SKELETAL:
|
||||
if (uiCurseOfLifeTimer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CURSE_OF_LIFE);
|
||||
uiCurseOfLifeTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiCurseOfLifeTimer -= diff;
|
||||
|
||||
if (uiShadowVolleyTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOW_VOLLEY);
|
||||
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
} else uiShadowVolleyTimer -= diff;
|
||||
|
||||
if (uiRainOfFireTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_RAIN_OF_FIRE);
|
||||
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
} else uiRainOfFireTimer -= diff;
|
||||
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoCast(SPELL_DECAY_FLESH);
|
||||
Phase = GOING_FLESH;
|
||||
uiPhaseTimer = 6*IN_MILLISECONDS;
|
||||
} else uiPhaseTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
case GOING_FLESH:
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),me);
|
||||
me->SetDisplayId(MODEL_FLESH);
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
|
||||
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
|
||||
pTemp->SetDisplayId(MODEL_SKELETON);
|
||||
}
|
||||
}
|
||||
uiPhaseTimer = 20*IN_MILLISECONDS;
|
||||
uiLightningBreathTimer = urand(3*IN_MILLISECONDS,4*IN_MILLISECONDS);
|
||||
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,8*IN_MILLISECONDS);
|
||||
uiPoisonCloudTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
|
||||
Phase = FLESH;
|
||||
} else uiPhaseTimer -= diff;
|
||||
break;
|
||||
case FLESH:
|
||||
if (uiLightningBreathTimer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_LIGHTNING_BREATH);
|
||||
uiLightningBreathTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
|
||||
} else uiLightningBreathTimer -= diff;
|
||||
|
||||
if (uiEyeBeamTimer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_EYE_BEAM);
|
||||
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,6*IN_MILLISECONDS);
|
||||
} else uiEyeBeamTimer -= diff;
|
||||
|
||||
if (uiPoisonCloudTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_POISON_CLOUD);
|
||||
uiPoisonCloudTimer = urand(10*IN_MILLISECONDS,12*IN_MILLISECONDS);
|
||||
} else uiPoisonCloudTimer -= diff;
|
||||
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoCast(SPELL_RETURN_FLESH);
|
||||
Phase = GOING_SKELETAL;
|
||||
uiPhaseTimer = 6*IN_MILLISECONDS;
|
||||
} else uiPhaseTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
case GOING_SKELETAL:
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), me);
|
||||
me->DeMorph();
|
||||
Phase = SKELETAL;
|
||||
uiPhaseTimer = 20*IN_MILLISECONDS;
|
||||
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
|
||||
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
|
||||
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
|
||||
pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
|
||||
pTemp->DeMorph();
|
||||
}
|
||||
}
|
||||
} else uiPhaseTimer -= diff;
|
||||
break;
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2),me);
|
||||
}
|
||||
uint32 uiPhaseTimer;
|
||||
uint32 uiCurseOfLifeTimer;
|
||||
uint32 uiRainOfFireTimer;
|
||||
uint32 uiShadowVolleyTimer;
|
||||
uint32 uiEyeBeamTimer;
|
||||
uint32 uiLightningBreathTimer;
|
||||
uint32 uiPoisonCloudTimer;
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH,me);
|
||||
CombatPhase Phase;
|
||||
|
||||
if (pInstance)
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
// clean morph on players
|
||||
Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers();
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player *pPlayer = i->getSource())
|
||||
pPlayer->DeMorph();
|
||||
// cast is not rewarding the achievement.
|
||||
// DoCast(SPELL_ACHIEVEMENT_CHECK);
|
||||
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);
|
||||
|
||||
pInstance->SetData(DATA_THARON_JA_EVENT, DONE);
|
||||
uiPhaseTimer = 20*IN_MILLISECONDS;
|
||||
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
|
||||
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
Phase = SKELETAL;
|
||||
me->SetDisplayId(me->GetNativeDisplayId());
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_THARON_JA_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_THARON_JA_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
switch (Phase)
|
||||
{
|
||||
case SKELETAL:
|
||||
if (uiCurseOfLifeTimer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_CURSE_OF_LIFE);
|
||||
uiCurseOfLifeTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiCurseOfLifeTimer -= diff;
|
||||
|
||||
if (uiShadowVolleyTimer < diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHADOW_VOLLEY);
|
||||
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
} else uiShadowVolleyTimer -= diff;
|
||||
|
||||
if (uiRainOfFireTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_RAIN_OF_FIRE);
|
||||
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
} else uiRainOfFireTimer -= diff;
|
||||
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoCast(SPELL_DECAY_FLESH);
|
||||
Phase = GOING_FLESH;
|
||||
uiPhaseTimer = 6*IN_MILLISECONDS;
|
||||
} else uiPhaseTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
case GOING_FLESH:
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_FLESH_1,SAY_FLESH_2),me);
|
||||
me->SetDisplayId(MODEL_FLESH);
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
|
||||
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
me->AddAura(SPELL_GIFT_OF_THARON_JA,pTemp);
|
||||
pTemp->SetDisplayId(MODEL_SKELETON);
|
||||
}
|
||||
}
|
||||
uiPhaseTimer = 20*IN_MILLISECONDS;
|
||||
uiLightningBreathTimer = urand(3*IN_MILLISECONDS,4*IN_MILLISECONDS);
|
||||
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,8*IN_MILLISECONDS);
|
||||
uiPoisonCloudTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
|
||||
Phase = FLESH;
|
||||
} else uiPhaseTimer -= diff;
|
||||
break;
|
||||
case FLESH:
|
||||
if (uiLightningBreathTimer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_LIGHTNING_BREATH);
|
||||
uiLightningBreathTimer = urand(6*IN_MILLISECONDS,7*IN_MILLISECONDS);
|
||||
} else uiLightningBreathTimer -= diff;
|
||||
|
||||
if (uiEyeBeamTimer < diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_EYE_BEAM);
|
||||
uiEyeBeamTimer = urand(4*IN_MILLISECONDS,6*IN_MILLISECONDS);
|
||||
} else uiEyeBeamTimer -= diff;
|
||||
|
||||
if (uiPoisonCloudTimer < diff)
|
||||
{
|
||||
DoCastAOE(SPELL_POISON_CLOUD);
|
||||
uiPoisonCloudTimer = urand(10*IN_MILLISECONDS,12*IN_MILLISECONDS);
|
||||
} else uiPoisonCloudTimer -= diff;
|
||||
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoCast(SPELL_RETURN_FLESH);
|
||||
Phase = GOING_SKELETAL;
|
||||
uiPhaseTimer = 6*IN_MILLISECONDS;
|
||||
} else uiPhaseTimer -= diff;
|
||||
DoMeleeAttackIfReady();
|
||||
break;
|
||||
case GOING_SKELETAL:
|
||||
if (uiPhaseTimer < diff)
|
||||
{
|
||||
DoScriptText(RAND(SAY_SKELETON_1,SAY_SKELETON_2), me);
|
||||
me->DeMorph();
|
||||
Phase = SKELETAL;
|
||||
uiPhaseTimer = 20*IN_MILLISECONDS;
|
||||
uiCurseOfLifeTimer = 1*IN_MILLISECONDS;
|
||||
uiRainOfFireTimer = urand(14*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
uiShadowVolleyTimer = urand(8*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr)
|
||||
{
|
||||
Unit *pTemp = Unit::GetUnit((*me),(*itr)->getUnitGuid());
|
||||
if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (pTemp->HasAura(SPELL_GIFT_OF_THARON_JA))
|
||||
pTemp->RemoveAura(SPELL_GIFT_OF_THARON_JA);
|
||||
pTemp->DeMorph();
|
||||
}
|
||||
}
|
||||
} else uiPhaseTimer -= diff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
{
|
||||
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2),me);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH,me);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
// clean morph on players
|
||||
Map::PlayerList const &PlayerList = pInstance->instance->GetPlayers();
|
||||
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player *pPlayer = i->getSource())
|
||||
pPlayer->DeMorph();
|
||||
pInstance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);
|
||||
|
||||
pInstance->SetData(DATA_THARON_JA_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_tharon_jaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_tharon_ja(Creature* pCreature)
|
||||
{
|
||||
return new boss_tharon_jaAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_tharon_ja()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_tharon_ja";
|
||||
newscript->GetAI = &GetAI_boss_tharon_ja;
|
||||
newscript->RegisterSelf();
|
||||
new boss_tharon_ja;
|
||||
}
|
||||
|
||||
@@ -54,143 +54,144 @@ enum Creatures
|
||||
|
||||
Position AddSpawnPoint = { -260.493011, -622.968018, 26.605301, 3.036870 };
|
||||
|
||||
struct boss_trollgoreAI : public ScriptedAI
|
||||
class boss_trollgore : public CreatureScript
|
||||
{
|
||||
boss_trollgoreAI(Creature *c) : ScriptedAI(c), lSummons(me)
|
||||
public:
|
||||
boss_trollgore() : CreatureScript("boss_trollgore") { }
|
||||
|
||||
struct boss_trollgoreAI : public ScriptedAI
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
uint32 uiConsumeTimer;
|
||||
uint32 uiAuraCountTimer;
|
||||
uint32 uiCrushTimer;
|
||||
uint32 uiInfectedWoundTimer;
|
||||
uint32 uiExplodeCorpseTimer;
|
||||
uint32 uiSpawnTimer;
|
||||
|
||||
bool bAchiev;
|
||||
|
||||
SummonList lSummons;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiConsumeTimer = 15*IN_MILLISECONDS;
|
||||
uiAuraCountTimer = 15.5*IN_MILLISECONDS;
|
||||
uiCrushTimer = urand(1*IN_MILLISECONDS,5*IN_MILLISECONDS);
|
||||
uiInfectedWoundTimer = urand(60*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
uiExplodeCorpseTimer = 3*IN_MILLISECONDS;
|
||||
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
|
||||
|
||||
bAchiev = IsHeroic();
|
||||
|
||||
lSummons.DespawnAll();
|
||||
|
||||
me->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_TROLLGORE_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiSpawnTimer <= diff)
|
||||
boss_trollgoreAI(Creature *c) : ScriptedAI(c), lSummons(me)
|
||||
{
|
||||
uint32 spawnNumber = urand(2,DUNGEON_MODE(3,5));
|
||||
for (uint8 i = 0; i < spawnNumber; ++i)
|
||||
DoSummon(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN);
|
||||
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
|
||||
} else uiSpawnTimer -= diff;
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
if (uiConsumeTimer <= diff)
|
||||
uint32 uiConsumeTimer;
|
||||
uint32 uiAuraCountTimer;
|
||||
uint32 uiCrushTimer;
|
||||
uint32 uiInfectedWoundTimer;
|
||||
uint32 uiExplodeCorpseTimer;
|
||||
uint32 uiSpawnTimer;
|
||||
|
||||
bool bAchiev;
|
||||
|
||||
SummonList lSummons;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoScriptText(SAY_CONSUME, me);
|
||||
DoCast(SPELL_CONSUME);
|
||||
uiConsumeTimer = 15*IN_MILLISECONDS;
|
||||
} else uiConsumeTimer -= diff;
|
||||
uiAuraCountTimer = 15.5*IN_MILLISECONDS;
|
||||
uiCrushTimer = urand(1*IN_MILLISECONDS,5*IN_MILLISECONDS);
|
||||
uiInfectedWoundTimer = urand(60*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
uiExplodeCorpseTimer = 3*IN_MILLISECONDS;
|
||||
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
|
||||
|
||||
if (bAchiev)
|
||||
{
|
||||
Aura *pConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
|
||||
if (pConsumeAura && pConsumeAura->GetStackAmount() > 9)
|
||||
bAchiev = false;
|
||||
bAchiev = IsHeroic();
|
||||
|
||||
lSummons.DespawnAll();
|
||||
|
||||
me->RemoveAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_TROLLGORE_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
if (uiCrushTimer <= diff)
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoCastVictim(SPELL_CRUSH);
|
||||
uiCrushTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiCrushTimer -= diff;
|
||||
DoScriptText(SAY_AGGRO, me);
|
||||
|
||||
if (uiInfectedWoundTimer <= diff)
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_TROLLGORE_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCastVictim(SPELL_INFECTED_WOUND);
|
||||
uiInfectedWoundTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
|
||||
} else uiInfectedWoundTimer -= diff;
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiExplodeCorpseTimer <= diff)
|
||||
{
|
||||
DoCast(SPELL_CORPSE_EXPLODE);
|
||||
DoScriptText(SAY_EXPLODE, me);
|
||||
uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS);
|
||||
} else uiExplodeCorpseTimer -= diff;
|
||||
if (uiSpawnTimer <= diff)
|
||||
{
|
||||
uint32 spawnNumber = urand(2,DUNGEON_MODE(3,5));
|
||||
for (uint8 i = 0; i < spawnNumber; ++i)
|
||||
DoSummon(RAND(NPC_DRAKKARI_INVADER_1,NPC_DRAKKARI_INVADER_2), AddSpawnPoint, 0, TEMPSUMMON_DEAD_DESPAWN);
|
||||
uiSpawnTimer = urand(30*IN_MILLISECONDS,40*IN_MILLISECONDS);
|
||||
} else uiSpawnTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
if (uiConsumeTimer <= diff)
|
||||
{
|
||||
DoScriptText(SAY_CONSUME, me);
|
||||
DoCast(SPELL_CONSUME);
|
||||
uiConsumeTimer = 15*IN_MILLISECONDS;
|
||||
} else uiConsumeTimer -= diff;
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
lSummons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (bAchiev)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_CONSUMPTION_JUNCTION);
|
||||
pInstance->SetData(DATA_TROLLGORE_EVENT, DONE);
|
||||
{
|
||||
Aura *pConsumeAura = me->GetAura(DUNGEON_MODE(SPELL_CONSUME_AURA,H_SPELL_CONSUME_AURA));
|
||||
if (pConsumeAura && pConsumeAura->GetStackAmount() > 9)
|
||||
bAchiev = false;
|
||||
}
|
||||
|
||||
if (uiCrushTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CRUSH);
|
||||
uiCrushTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiCrushTimer -= diff;
|
||||
|
||||
if (uiInfectedWoundTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_INFECTED_WOUND);
|
||||
uiInfectedWoundTimer = urand(25*IN_MILLISECONDS,35*IN_MILLISECONDS);
|
||||
} else uiInfectedWoundTimer -= diff;
|
||||
|
||||
if (uiExplodeCorpseTimer <= diff)
|
||||
{
|
||||
DoCast(SPELL_CORPSE_EXPLODE);
|
||||
DoScriptText(SAY_EXPLODE, me);
|
||||
uiExplodeCorpseTimer = urand(15*IN_MILLISECONDS,19*IN_MILLISECONDS);
|
||||
} else uiExplodeCorpseTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
DoScriptText(SAY_DEATH, me);
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
lSummons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (bAchiev)
|
||||
pInstance->DoCompleteAchievement(ACHIEV_CONSUMPTION_JUNCTION);
|
||||
pInstance->SetData(DATA_TROLLGORE_EVENT, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
{
|
||||
if (victim == me)
|
||||
return;
|
||||
DoScriptText(SAY_KILL, me);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
lSummons.push_back(summon->GetGUID());
|
||||
if (summon->AI())
|
||||
summon->AI()->AttackStart(me);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *GetAI(Creature *creature) const
|
||||
{
|
||||
lSummons.push_back(summon->GetGUID());
|
||||
if (summon->AI())
|
||||
summon->AI()->AttackStart(me);
|
||||
return new boss_trollgoreAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_trollgore(Creature* pCreature)
|
||||
{
|
||||
return new boss_trollgoreAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_trollgore()
|
||||
{
|
||||
Script *newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_trollgore";
|
||||
newscript->GetAI = &GetAI_boss_trollgore;
|
||||
newscript->RegisterSelf();
|
||||
new boss_trollgore;
|
||||
}
|
||||
|
||||
@@ -42,201 +42,203 @@ enum GameObjects
|
||||
GO_NOVOS_CRYSTAL_4 = 189302
|
||||
};
|
||||
|
||||
struct instance_drak_tharon : public ScriptedInstance
|
||||
class instance_drak_tharon : public InstanceMapScript
|
||||
{
|
||||
instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
public:
|
||||
instance_drak_tharon() : InstanceMapScript("instance_drak_tharon") { }
|
||||
|
||||
uint8 uiDredAchievCounter;
|
||||
|
||||
uint64 uiTrollgore;
|
||||
uint64 uiNovos;
|
||||
uint64 uiDred;
|
||||
uint64 uiTharonJa;
|
||||
|
||||
uint64 uiNovosCrystal1;
|
||||
uint64 uiNovosCrystal2;
|
||||
uint64 uiNovosCrystal3;
|
||||
uint64 uiNovosCrystal4;
|
||||
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
struct instance_drak_tharon_ScriptedInstance : public ScriptedInstance
|
||||
{
|
||||
uiTrollgore = 0;
|
||||
uiNovos = 0;
|
||||
uiDred = 0;
|
||||
uiTharonJa = 0;
|
||||
uiNovosCrystal1 = 0;
|
||||
uiNovosCrystal2 = 0;
|
||||
uiNovosCrystal3 = 0;
|
||||
uiNovosCrystal4 = 0;
|
||||
uiDredAchievCounter = 0;
|
||||
}
|
||||
instance_drak_tharon_ScriptedInstance(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
uint8 uiDredAchievCounter;
|
||||
|
||||
return false;
|
||||
}
|
||||
uint64 uiTrollgore;
|
||||
uint64 uiNovos;
|
||||
uint64 uiDred;
|
||||
uint64 uiTharonJa;
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_NOVOS_CRYSTAL_1:
|
||||
uiNovosCrystal1 = pGo->GetGUID();
|
||||
break;
|
||||
case GO_NOVOS_CRYSTAL_2:
|
||||
uiNovosCrystal2 = pGo->GetGUID();
|
||||
break;
|
||||
case GO_NOVOS_CRYSTAL_3:
|
||||
uiNovosCrystal3 = pGo->GetGUID();
|
||||
break;
|
||||
case GO_NOVOS_CRYSTAL_4:
|
||||
uiNovosCrystal4 = pGo->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
uint64 uiNovosCrystal1;
|
||||
uint64 uiNovosCrystal2;
|
||||
uint64 uiNovosCrystal3;
|
||||
uint64 uiNovosCrystal4;
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case NPC_TROLLGORE:
|
||||
uiTrollgore = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_NOVOS:
|
||||
uiNovos = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_KING_DRED:
|
||||
uiDred = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_THARON_JA:
|
||||
uiTharonJa = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_TROLLGORE: return uiTrollgore;
|
||||
case DATA_NOVOS: return uiNovos;
|
||||
case DATA_DRED: return uiDred;
|
||||
case DATA_THARON_JA: return uiTharonJa;
|
||||
case DATA_NOVOS_CRYSTAL_1: return uiNovosCrystal1;
|
||||
case DATA_NOVOS_CRYSTAL_2: return uiNovosCrystal2;
|
||||
case DATA_NOVOS_CRYSTAL_3: return uiNovosCrystal3;
|
||||
case DATA_NOVOS_CRYSTAL_4: return uiNovosCrystal4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_TROLLGORE_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_NOVOS_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_DRED_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_THARON_JA_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
|
||||
case DATA_KING_DRED_ACHIEV:
|
||||
uiDredAchievCounter = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_TROLLGORE_EVENT: return m_auiEncounter[0];
|
||||
case DATA_NOVOS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_DRED_EVENT: return m_auiEncounter[2];
|
||||
case DATA_THARON_JA_EVENT: return m_auiEncounter[3];
|
||||
case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
std::string str_data;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D K " << 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)
|
||||
{
|
||||
if (!in)
|
||||
void Initialize()
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
uiTrollgore = 0;
|
||||
uiNovos = 0;
|
||||
uiDred = 0;
|
||||
uiTharonJa = 0;
|
||||
uiNovosCrystal1 = 0;
|
||||
uiNovosCrystal2 = 0;
|
||||
uiNovosCrystal3 = 0;
|
||||
uiNovosCrystal4 = 0;
|
||||
uiDredAchievCounter = 0;
|
||||
}
|
||||
|
||||
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 == 'D' && dataHead2 == 'K')
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
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;
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* pGo, bool /*add*/)
|
||||
{
|
||||
switch(pGo->GetEntry())
|
||||
{
|
||||
case GO_NOVOS_CRYSTAL_1:
|
||||
uiNovosCrystal1 = pGo->GetGUID();
|
||||
break;
|
||||
case GO_NOVOS_CRYSTAL_2:
|
||||
uiNovosCrystal2 = pGo->GetGUID();
|
||||
break;
|
||||
case GO_NOVOS_CRYSTAL_3:
|
||||
uiNovosCrystal3 = pGo->GetGUID();
|
||||
break;
|
||||
case GO_NOVOS_CRYSTAL_4:
|
||||
uiNovosCrystal4 = pGo->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch(pCreature->GetEntry())
|
||||
{
|
||||
case NPC_TROLLGORE:
|
||||
uiTrollgore = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_NOVOS:
|
||||
uiNovos = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_KING_DRED:
|
||||
uiDred = pCreature->GetGUID();
|
||||
break;
|
||||
case NPC_THARON_JA:
|
||||
uiTharonJa = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_TROLLGORE: return uiTrollgore;
|
||||
case DATA_NOVOS: return uiNovos;
|
||||
case DATA_DRED: return uiDred;
|
||||
case DATA_THARON_JA: return uiTharonJa;
|
||||
case DATA_NOVOS_CRYSTAL_1: return uiNovosCrystal1;
|
||||
case DATA_NOVOS_CRYSTAL_2: return uiNovosCrystal2;
|
||||
case DATA_NOVOS_CRYSTAL_3: return uiNovosCrystal3;
|
||||
case DATA_NOVOS_CRYSTAL_4: return uiNovosCrystal4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_TROLLGORE_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_NOVOS_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_DRED_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_THARON_JA_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
|
||||
case DATA_KING_DRED_ACHIEV:
|
||||
uiDredAchievCounter = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_TROLLGORE_EVENT: return m_auiEncounter[0];
|
||||
case DATA_NOVOS_EVENT: return m_auiEncounter[1];
|
||||
case DATA_DRED_EVENT: return m_auiEncounter[2];
|
||||
case DATA_THARON_JA_EVENT: return m_auiEncounter[3];
|
||||
case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::string str_data;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "D K " << 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)
|
||||
{
|
||||
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 == 'D' && dataHead2 == 'K')
|
||||
{
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData(InstanceMap *map) const
|
||||
{
|
||||
return new instance_drak_tharon_ScriptedInstance(map);
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_drak_tharon(Map* pMap)
|
||||
{
|
||||
return new instance_drak_tharon(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_drak_tharon()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_drak_tharon";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon;
|
||||
newscript->RegisterSelf();
|
||||
new instance_drak_tharon;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user