*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -33,7 +33,7 @@ void SummonList::DespawnEntry(uint32 entry)
|
||||
{
|
||||
for(iterator i = begin(); i != end(); ++i)
|
||||
{
|
||||
if(Creature *summon = (Creature*)Unit::GetUnit(*m_creature, *i))
|
||||
if(Creature *summon = Unit::GetCreature(*m_creature, *i))
|
||||
{
|
||||
if(summon->GetEntry() == entry)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ void SummonList::DespawnAll()
|
||||
{
|
||||
for(iterator i = begin(); i != end(); ++i)
|
||||
{
|
||||
if(Creature *summon = (Creature*)Unit::GetUnit(*m_creature, *i))
|
||||
if(Creature *summon = Unit::GetCreature(*m_creature, *i))
|
||||
{
|
||||
summon->setDeathState(JUST_DIED);
|
||||
summon->RemoveCorpse();
|
||||
|
||||
@@ -365,7 +365,7 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
{
|
||||
if (Doctorguid)
|
||||
{
|
||||
if (Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid)))
|
||||
if(Creature* Doctor = Unit::GetCreature(*m_creature, Doctorguid))
|
||||
((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
|
||||
}
|
||||
}
|
||||
@@ -423,7 +423,7 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
|
||||
if (Doctorguid)
|
||||
{
|
||||
if (Creature* Doctor = ((Creature*)Unit::GetUnit((*m_creature), Doctorguid)))
|
||||
if(Creature* Doctor = Unit::GetCreature((*m_creature), Doctorguid))
|
||||
((npc_doctorAI*)Doctor->AI())->PatientDied(Coord);
|
||||
}
|
||||
}
|
||||
@@ -466,7 +466,7 @@ void npc_doctorAI::BeginEvent(Player* player)
|
||||
|
||||
void npc_doctorAI::PatientDied(Location* Point)
|
||||
{
|
||||
Player* player = ((Player*)Unit::GetUnit((*m_creature), Playerguid));
|
||||
Player* player = Unit::GetPlayer(Playerguid);
|
||||
if(player && ((player->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (player->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)))
|
||||
{
|
||||
PatientDiedCount++;
|
||||
@@ -500,7 +500,7 @@ void npc_doctorAI::PatientSaved(Creature* soldier, Player* player, Location* Poi
|
||||
std::list<uint64>::iterator itr;
|
||||
for(itr = Patients.begin(); itr != Patients.end(); ++itr)
|
||||
{
|
||||
if (Creature* Patient = ((Creature*)Unit::GetUnit((*m_creature), *itr)))
|
||||
if(Creature* Patient = Unit::GetCreature((*m_creature), *itr))
|
||||
Patient->setDeathState(JUST_DIED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
switch(i)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID && !Completed )
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -113,7 +113,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
|
||||
|
||||
if (PlayerGUID && !Completed)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_TOREK_ASSULT);
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -227,7 +227,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL);
|
||||
}
|
||||
|
||||
+2
-2
@@ -58,13 +58,13 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance
|
||||
FelOverseerCount = 0;
|
||||
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
Encounter[i] = false;
|
||||
Encounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
if(Encounter[i]) return true;
|
||||
if(Encounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ struct TRINITY_DLL_DECL mob_rizzle_sprysprocketAI : public ScriptedAI
|
||||
m_creature->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0);
|
||||
}
|
||||
//begin swimming and summon depth charges
|
||||
Player* player = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
SendText(MSG_ESCAPE_NOTICE, player);
|
||||
DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE);
|
||||
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_FLYING2 | MOVEMENTFLAG_SWIMMING);
|
||||
|
||||
@@ -316,7 +316,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -356,7 +356,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_A_CRY_FOR_SAY_HELP);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
Player* pWarrior = NULL;
|
||||
|
||||
if(PlayerGUID)
|
||||
pWarrior = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
pWarrior = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(!pWarrior)
|
||||
return;
|
||||
@@ -268,7 +268,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
{
|
||||
if (AffrayChallenger[i])
|
||||
{
|
||||
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
|
||||
if(pCreature) {
|
||||
if(pCreature->isAlive())
|
||||
{
|
||||
@@ -284,7 +284,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
|
||||
if (BigWill)
|
||||
{
|
||||
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
|
||||
if(pCreature) {
|
||||
if(pCreature->isAlive()) {
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
|
||||
@@ -329,7 +329,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
{
|
||||
if (AffrayChallenger[i])
|
||||
{
|
||||
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[i]);
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
|
||||
if((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i])
|
||||
{
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
|
||||
@@ -345,7 +345,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
|
||||
{
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature);
|
||||
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), AffrayChallenger[Wave]);
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[Wave]);
|
||||
if(pCreature && (pCreature->isAlive()))
|
||||
{
|
||||
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
@@ -371,7 +371,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
}
|
||||
else if (Wave >= 6 && EventBigWill && BigWill)
|
||||
{
|
||||
Creature* pCreature = (Creature*)Unit::GetUnit((*m_creature), BigWill);
|
||||
Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
|
||||
if (!pCreature || !pCreature->isAlive())
|
||||
{
|
||||
DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature);
|
||||
@@ -420,7 +420,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(!player)
|
||||
return;
|
||||
@@ -468,7 +468,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID && !Completed)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_ESCAPE);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ EndScriptData */
|
||||
|
||||
#define GETGO(obj, guid) GameObject* obj = GameObject::GetGameObject(*m_creature, guid)
|
||||
#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid)
|
||||
#define GETCRE(cre, guid) Creature* cre = (Creature*)Unit::GetUnit(*m_creature, guid)
|
||||
#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*m_creature, guid)
|
||||
#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth()
|
||||
|
||||
/************* Quotes and Sounds ***********************/
|
||||
@@ -522,9 +522,9 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
|
||||
if(Conversation[count].creature == ILLIDAN_STORMRAGE)
|
||||
creature = m_creature;
|
||||
else if(Conversation[count].creature == AKAMA)
|
||||
creature = ((Creature*)Unit::GetUnit((*m_creature), AkamaGUID));
|
||||
creature = (Unit::GetCreature((*m_creature), AkamaGUID));
|
||||
else if(Conversation[count].creature == MAIEV_SHADOWSONG)
|
||||
creature = ((Creature*)Unit::GetUnit((*m_creature), MaievGUID));
|
||||
creature = (Unit::GetCreature((*m_creature), MaievGUID));
|
||||
|
||||
if(creature)
|
||||
{
|
||||
|
||||
@@ -213,7 +213,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
|
||||
Creature* Essence;
|
||||
if(EssenceGUID)
|
||||
{
|
||||
Essence = (Creature*)Unit::GetUnit(*m_creature, EssenceGUID);
|
||||
Essence = Unit::GetCreature(*m_creature, EssenceGUID);
|
||||
if(!Essence)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
@@ -624,7 +624,7 @@ void npc_enslaved_soulAI::JustDied(Unit *killer)
|
||||
{
|
||||
if(ReliquaryGUID)
|
||||
{
|
||||
Creature* Reliquary = ((Creature*)Unit::GetUnit((*m_creature), ReliquaryGUID));
|
||||
Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID));
|
||||
if(Reliquary)
|
||||
((boss_reliquary_of_soulsAI*)Reliquary->AI())->SoulDeathCount++;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
{
|
||||
for(std::list<uint64>::iterator itr = Sorcerers.begin(); itr != Sorcerers.end(); ++itr)
|
||||
{
|
||||
if(Creature* Sorcerer = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
|
||||
if(Creature* Sorcerer = (Unit::GetCreature(*m_creature, *itr)))
|
||||
if(Sorcerer->isAlive())
|
||||
{
|
||||
Sorcerer->SetVisibility(VISIBILITY_OFF);
|
||||
@@ -248,7 +248,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
|
||||
{
|
||||
Creature* Channeler = NULL;
|
||||
Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr));
|
||||
Channeler = (Unit::GetCreature(*m_creature, *itr));
|
||||
|
||||
if (Channeler)
|
||||
{
|
||||
@@ -372,7 +372,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
}
|
||||
|
||||
for(std::list<uint64>::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
|
||||
if(Creature* Channeler = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
|
||||
if(Creature* Channeler = (Unit::GetCreature(*m_creature, *itr)))
|
||||
Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
|
||||
|
||||
void mob_ashtongue_channelerAI::JustDied(Unit* killer)
|
||||
{
|
||||
Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
|
||||
Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
|
||||
if(Shade && Shade->isAlive())
|
||||
((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount();
|
||||
else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama.");
|
||||
@@ -492,7 +492,7 @@ void mob_ashtongue_channelerAI::JustDied(Unit* killer)
|
||||
|
||||
void mob_ashtongue_sorcererAI::JustDied(Unit* killer)
|
||||
{
|
||||
Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
|
||||
Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
|
||||
if(Shade && Shade->isAlive())
|
||||
((boss_shade_of_akamaAI*)Shade->AI())->IncrementDeathCount(m_creature->GetGUID());
|
||||
else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama.");
|
||||
@@ -561,7 +561,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
|
||||
if(!ShadeGUID)
|
||||
return;
|
||||
|
||||
Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
|
||||
Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
|
||||
if(Shade)
|
||||
{
|
||||
pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
|
||||
@@ -618,7 +618,7 @@ struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI
|
||||
|
||||
if(ShadeGUID && !StartCombat)
|
||||
{
|
||||
Creature* Shade = ((Creature*)Unit::GetUnit((*m_creature), ShadeGUID));
|
||||
Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID));
|
||||
if(Shade && Shade->isAlive())
|
||||
{
|
||||
if(((boss_shade_of_akamaAI*)Shade->AI())->IsBanished)
|
||||
|
||||
@@ -268,7 +268,7 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
|
||||
if(CheckTimer < diff)
|
||||
{
|
||||
uint64 SupremusGUID = pInstance->GetData64(DATA_SUPREMUS);
|
||||
Creature* Supremus = ((Creature*)Unit::GetUnit((*m_creature), SupremusGUID));
|
||||
Creature* Supremus = (Unit::GetCreature((*m_creature), SupremusGUID));
|
||||
if(!Eruption && !((boss_supremusAI*)Supremus->AI())->Phase1)
|
||||
{
|
||||
Eruption = true;
|
||||
|
||||
@@ -82,7 +82,7 @@ struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI
|
||||
{
|
||||
DoZoneInCombat();
|
||||
|
||||
Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
|
||||
Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
|
||||
if((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode()))
|
||||
Despawn();
|
||||
}
|
||||
@@ -184,7 +184,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
|
||||
|
||||
if(CheckTeronTimer < diff)
|
||||
{
|
||||
Creature* Teron = ((Creature*)Unit::GetUnit((*m_creature), TeronGUID));
|
||||
Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID));
|
||||
if(!Teron || !Teron->isAlive() || Teron->IsInEvadeMode())
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
|
||||
bool GOHello_go_najentus_spine(Player *player, GameObject* _GO)
|
||||
{
|
||||
if(ScriptedInstance* pInstance = (ScriptedInstance*)_GO->GetInstanceData())
|
||||
if(Creature* Najentus = (Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
|
||||
if(Creature* Najentus = Unit::GetCreature(*_GO, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS)))
|
||||
if(((boss_najentusAI*)Najentus->AI())->RemoveImpalingSpine())
|
||||
{
|
||||
player->CastSpell(player, SPELL_CREATE_NAJENTUS_SPINE, true);
|
||||
|
||||
@@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
Creature* pMember = NULL;
|
||||
for(uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
if(pMember = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
|
||||
if(pMember = (Unit::GetCreature((*m_creature), Council[i])))
|
||||
{
|
||||
if(!pMember->isAlive())
|
||||
{
|
||||
@@ -232,7 +232,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
if(pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED);
|
||||
if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
|
||||
if(Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
|
||||
VoiceTrigger->AI()->EnterEvadeMode();
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW);
|
||||
|
||||
// Start the event for the Voice Trigger
|
||||
if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
|
||||
if(Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
|
||||
{
|
||||
((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->LoadCouncilGUIDs();
|
||||
((mob_blood_elf_council_voice_triggerAI*)VoiceTrigger->AI())->EventStarted = true;
|
||||
@@ -294,7 +294,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
if(Creature* VoiceTrigger = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
|
||||
if(Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))))
|
||||
VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE);
|
||||
}
|
||||
@@ -302,7 +302,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* pMember = ((Creature*)Unit::GetUnit(*m_creature, Council[DeathCount]));
|
||||
Creature* pMember = (Unit::GetCreature(*m_creature, Council[DeathCount]));
|
||||
if(pMember && pMember->isAlive())
|
||||
pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
++DeathCount;
|
||||
@@ -319,7 +319,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
{
|
||||
if(Council[i])
|
||||
{
|
||||
if(Creature* Member = ((Creature*)Unit::GetUnit((*m_creature), Council[i])))
|
||||
if(Creature* Member = (Unit::GetCreature((*m_creature), Council[i])))
|
||||
{
|
||||
// This is the evade/death check.
|
||||
if(Member->isAlive() && !Member->getVictim())
|
||||
@@ -364,7 +364,7 @@ struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
Creature* Controller = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
|
||||
Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL)));
|
||||
if(Controller)
|
||||
((mob_illidari_councilAI*)Controller->AI())->StartEvent(who);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
|
||||
|
||||
if (RingBossGUID)
|
||||
{
|
||||
Creature *boss = (Creature*)Unit::GetUnit(*m_creature,RingBossGUID);
|
||||
Creature *boss = Unit::GetCreature(*m_creature,RingBossGUID);
|
||||
if (boss && !boss->isAlive() && boss->isDead())
|
||||
{
|
||||
RingBossGUID = 0;
|
||||
@@ -229,7 +229,7 @@ struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI
|
||||
|
||||
for(uint8 i = 0; i < MOB_AMOUNT; i++)
|
||||
{
|
||||
Creature *mob = (Creature*)Unit::GetUnit(*m_creature,RingMobGUID[i]);
|
||||
Creature *mob = Unit::GetCreature(*m_creature,RingMobGUID[i]);
|
||||
if (mob && !mob->isAlive() && mob->isDead())
|
||||
{
|
||||
RingMobGUID[i] = 0;
|
||||
|
||||
@@ -382,7 +382,7 @@ void hyjalAI::Reset()
|
||||
return;
|
||||
|
||||
for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
|
||||
if(Creature* cr = ((Creature*)Unit::GetUnit(*m_creature, *itr)))
|
||||
if(Creature* cr = (Unit::GetCreature(*m_creature, *itr)))
|
||||
cr->SetVisibility(VISIBILITY_ON);
|
||||
|
||||
CreatureList.clear();*/
|
||||
@@ -748,7 +748,7 @@ void hyjalAI::DeSpawnVeins()
|
||||
if(!pInstance)return;
|
||||
if(Faction == 1)
|
||||
{
|
||||
Creature* pUnit=(Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE));
|
||||
Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE));
|
||||
if (!pUnit)return;
|
||||
hyjalAI* ai = ((hyjalAI*)pUnit->AI());
|
||||
if(!ai)return;
|
||||
@@ -760,7 +760,7 @@ void hyjalAI::DeSpawnVeins()
|
||||
}
|
||||
}else if (Faction)
|
||||
{
|
||||
Creature* pUnit=(Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_THRALL));
|
||||
Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL));
|
||||
if (!pUnit)return;
|
||||
hyjalAI* ai = ((hyjalAI*)pUnit->AI());
|
||||
if(!ai)return;
|
||||
|
||||
@@ -364,7 +364,7 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI
|
||||
//trigger taretha to run down outside
|
||||
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
|
||||
{
|
||||
if (Creature* Taretha = ((Creature*)Unit::GetUnit(*m_creature, TarethaGUID)))
|
||||
if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID)))
|
||||
((npc_escortAI*)(Taretha->AI()))->Start(false, false, true, PlayerGUID);
|
||||
}
|
||||
|
||||
@@ -826,7 +826,7 @@ bool GossipSelect_npc_taretha(Player *player, Creature *_Creature, uint32 sender
|
||||
|
||||
if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL))
|
||||
{
|
||||
Creature* Thrall = ((Creature*)Unit::GetUnit((*_Creature), ThrallGUID));
|
||||
Creature* Thrall = (Unit::GetCreature((*_Creature), ThrallGUID));
|
||||
if(Thrall)
|
||||
((npc_thrall_old_hillsbradAI*)Thrall->AI())->StartWP();
|
||||
}
|
||||
|
||||
+3
-3
@@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
|
||||
|
||||
if(RAdvisors[i])
|
||||
{
|
||||
pAdvisor = ((Creature*)Unit::GetUnit((*m_creature), RAdvisors[i]));
|
||||
pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i]));
|
||||
if(pAdvisor && !pAdvisor->isAlive())
|
||||
{
|
||||
pAdvisor->Respawn();
|
||||
@@ -205,7 +205,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, NOT_STARTED);
|
||||
pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE);
|
||||
|
||||
//support for quest 10944
|
||||
m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000);
|
||||
@@ -280,7 +280,7 @@ struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI
|
||||
for(uint8 i = 0; i < 4; ++i)
|
||||
if(Advisors[i])
|
||||
{
|
||||
Advisor = ((Creature*)Unit::GetUnit(*m_creature, Advisors[i]));
|
||||
Advisor = (Unit::GetCreature(*m_creature, Advisors[i]));
|
||||
if(Advisor)
|
||||
{
|
||||
if(Advisor->isAlive())
|
||||
|
||||
+2
-2
@@ -145,7 +145,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
|
||||
{
|
||||
for(uint8 i=0;i<2;i++)
|
||||
{
|
||||
Creature* mob = (Creature*)Unit::GetUnit(*m_creature,beams[i]);
|
||||
Creature* mob = Unit::GetCreature(*m_creature,beams[i]);
|
||||
if(mob)
|
||||
{
|
||||
mob->setDeathState(DEAD);
|
||||
@@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI
|
||||
DoScriptText(SAY_CLEAN_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED);
|
||||
pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE);
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -200,7 +200,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
{
|
||||
for(uint8 i = 0; i < 3; i++)
|
||||
{
|
||||
Creature *add = (Creature*)Unit::GetUnit(*m_creature,SpellBinderGUID[i]);
|
||||
Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i]);
|
||||
if (add && add->isAlive())
|
||||
{
|
||||
add->setDeathState(DEAD);
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED);
|
||||
pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE);
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
|
||||
+3
-3
@@ -67,7 +67,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
|
||||
uint64 StrangePool;
|
||||
|
||||
bool ShieldGeneratorDeactivated[4];
|
||||
bool Encounters[ENCOUNTERS];
|
||||
uint32 Encounters[ENCOUNTERS];
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
@@ -93,13 +93,13 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance
|
||||
ShieldGeneratorDeactivated[3] = false;
|
||||
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
Encounters[i] = false;
|
||||
Encounters[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
if(Encounters[i]) return true;
|
||||
if(Encounters[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI
|
||||
void JustDied(Unit *who)
|
||||
{
|
||||
for(std::list<uint64>::iterator i = Striders.begin(); i != Striders.end(); ++i)
|
||||
if(Creature *strider = (Creature*)Unit::GetUnit(*m_creature, *i))
|
||||
if(Creature *strider = Unit::GetCreature(*m_creature, *i))
|
||||
{
|
||||
strider->SetLootRecipient(NULL);
|
||||
strider->DealDamage(strider,strider->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
|
||||
@@ -50,7 +50,7 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI
|
||||
// Pure Virtual Functions
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(!player)
|
||||
return;
|
||||
@@ -339,7 +339,7 @@ struct TRINITY_DLL_DECL master_kelerun_bloodmournAI : public ScriptedAI
|
||||
if ( timer < diff ) {
|
||||
|
||||
Creature* paladinSpawn;
|
||||
paladinSpawn = ((Creature*)Unit::GetUnit((*m_creature), paladinGuid[paladinPhase]));
|
||||
paladinSpawn = (Unit::GetCreature((*m_creature), paladinGuid[paladinPhase]));
|
||||
if ( paladinSpawn ) {
|
||||
((npc_secondTrialAI*)paladinSpawn->AI())->Activate(m_creature->GetGUID());
|
||||
|
||||
@@ -439,7 +439,7 @@ void npc_secondTrialAI::JustDied(Unit* Killer) {
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Creature* Summoner;
|
||||
Summoner = ((Creature*)Unit::GetUnit((*m_creature), summonerGuid));
|
||||
Summoner = (Unit::GetCreature((*m_creature), summonerGuid));
|
||||
|
||||
if ( Summoner )
|
||||
((master_kelerun_bloodmournAI*)Summoner->AI())->SecondTrialKill();
|
||||
@@ -560,7 +560,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_UNEXPECTED_RESULT);
|
||||
}
|
||||
@@ -572,7 +572,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player)
|
||||
((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
|
||||
}
|
||||
@@ -676,7 +676,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
||||
{
|
||||
if (PlayerGUID && !Completed)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_POWERING_OUR_DEFENSES);
|
||||
}
|
||||
@@ -690,7 +690,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
||||
Completed = true;
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player)
|
||||
((Player*)player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -227,7 +227,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS);
|
||||
}
|
||||
|
||||
@@ -79,12 +79,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
|
||||
Reverberation_Timer= 60000+45000;
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED);
|
||||
GameObject* EncounterDoor = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_GRUULDOOR));
|
||||
if (EncounterDoor)
|
||||
EncounterDoor->SetGoState(0); // Open the encounter door
|
||||
}else error_log(ERROR_INST_DATA);
|
||||
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true);
|
||||
@@ -95,12 +90,7 @@ struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI
|
||||
DoScriptText(SAY_AGGRO, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS);
|
||||
GameObject* EncounterDoor = GameObject::GetGameObject(*m_creature, pInstance->GetData64(DATA_GRUULDOOR));
|
||||
if (EncounterDoor)
|
||||
EncounterDoor->SetGoState(1); //Close the encounter door, open it in JustDied/Reset
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit()
|
||||
|
||||
@@ -65,6 +65,44 @@ EndScriptData */
|
||||
#define SPELL_SPELLSHIELD 33054
|
||||
#define SPELL_BLAST_WAVE 33061
|
||||
|
||||
bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature)
|
||||
{
|
||||
if(!pInstance || !m_creature)
|
||||
return false;
|
||||
|
||||
uint64 MaulgarGUID = 0;
|
||||
uint64 KigglerGUID = 0;
|
||||
uint64 BlindeyeGUID = 0;
|
||||
uint64 OlmGUID = 0;
|
||||
uint64 KroshGUID = 0;
|
||||
|
||||
Creature* Maulgar = NULL;
|
||||
Creature* Kiggler = NULL;
|
||||
Creature* Blindeye = NULL;
|
||||
Creature* Olm = NULL;
|
||||
Creature* Krosh = NULL;
|
||||
|
||||
MaulgarGUID = pInstance->GetData64(DATA_MAULGAR);
|
||||
KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED);
|
||||
BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER);
|
||||
OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER);
|
||||
KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND);
|
||||
|
||||
Maulgar = ((Creature*)Unit::GetUnit((*m_creature), MaulgarGUID));
|
||||
Kiggler = ((Creature*)Unit::GetUnit((*m_creature), KigglerGUID));
|
||||
Blindeye = ((Creature*)Unit::GetUnit((*m_creature), BlindeyeGUID));
|
||||
Olm = ((Creature*)Unit::GetUnit((*m_creature), OlmGUID));
|
||||
Krosh = ((Creature*)Unit::GetUnit((*m_creature), KroshGUID));
|
||||
|
||||
if(!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh)
|
||||
return false;
|
||||
|
||||
if(!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//High King Maulgar AI
|
||||
struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
|
||||
{
|
||||
@@ -132,15 +170,8 @@ struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_DEATH, m_creature);
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if(CheckAllBossDied(pInstance, m_creature))
|
||||
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||
|
||||
GameObject* Door = NULL;
|
||||
Door = GameObject::GetGameObject((*m_creature), pInstance->GetData64(DATA_MAULGARDOOR));
|
||||
if(Door)
|
||||
Door->SetGoState(0);
|
||||
}
|
||||
}
|
||||
|
||||
void AddDeath()
|
||||
@@ -301,17 +332,20 @@ struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
Creature *Maulgar = NULL;
|
||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||
|
||||
if(Maulgar)
|
||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||
|
||||
if(CheckAllBossDied(pInstance, m_creature))
|
||||
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
@@ -402,17 +436,20 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
Creature *Maulgar = NULL;
|
||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||
|
||||
if(Maulgar)
|
||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||
|
||||
if(CheckAllBossDied(pInstance, m_creature))
|
||||
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
@@ -507,17 +544,20 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
Creature *Maulgar = NULL;
|
||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||
|
||||
if(Maulgar)
|
||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||
|
||||
if(CheckAllBossDied(pInstance, m_creature))
|
||||
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
@@ -602,17 +642,20 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if(pInstance)
|
||||
{
|
||||
Creature *Maulgar = NULL;
|
||||
Maulgar = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAR)));
|
||||
|
||||
if(Maulgar)
|
||||
((boss_high_king_maulgarAI*)Maulgar->AI())->AddDeath();
|
||||
|
||||
if(CheckAllBossDied(pInstance, m_creature))
|
||||
pInstance->SetData(DATA_MAULGAREVENT, DONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
@@ -35,17 +35,17 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
{
|
||||
instance_gruuls_lair(Map *map) : ScriptedInstance(map) {Initialize();};
|
||||
|
||||
bool Encounters[ENCOUNTERS];
|
||||
uint32 Encounters[ENCOUNTERS];
|
||||
|
||||
uint64 MaulgarEvent_Tank;
|
||||
uint64 KigglerTheCrazed;
|
||||
uint64 BlindeyeTheSeer;
|
||||
uint64 OlmTheSummoner;
|
||||
uint64 KroshFirehand;
|
||||
uint64 Maulgar;
|
||||
uint64 Maulgar;
|
||||
|
||||
uint64 MaulgarDoor;
|
||||
uint64 GruulDoor;
|
||||
uint64 MaulgarDoor;
|
||||
uint64 GruulDoor;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
@@ -54,20 +54,19 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
BlindeyeTheSeer = 0;
|
||||
OlmTheSummoner = 0;
|
||||
KroshFirehand = 0;
|
||||
Maulgar = 0;
|
||||
|
||||
MaulgarDoor = 0;
|
||||
GruulDoor = 0;
|
||||
Maulgar = 0;
|
||||
|
||||
MaulgarDoor = 0;
|
||||
GruulDoor = 0;
|
||||
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
Encounters[i] = false;
|
||||
Encounters[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
if(Encounters[i]) return true;
|
||||
if(Encounters[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -77,21 +76,24 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
switch(creature->GetEntry())
|
||||
{
|
||||
case 18835: KigglerTheCrazed = creature->GetGUID(); break;
|
||||
case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
|
||||
case 18834: OlmTheSummoner = creature->GetGUID(); break;
|
||||
case 18832: KroshFirehand = creature->GetGUID(); break;
|
||||
case 18831: Maulgar = creature->GetGUID();break;
|
||||
case 18836: BlindeyeTheSeer = creature->GetGUID(); break;
|
||||
case 18834: OlmTheSummoner = creature->GetGUID(); break;
|
||||
case 18832: KroshFirehand = creature->GetGUID(); break;
|
||||
case 18831: Maulgar = creature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnObjectCreate(GameObject* go)
|
||||
void OnObjectCreate(GameObject* go)
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case 184468: MaulgarDoor = go->GetGUID();break;
|
||||
case 184662: GruulDoor = go->GetGUID();break;
|
||||
}
|
||||
}
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case 184468:
|
||||
MaulgarDoor = go->GetGUID();
|
||||
if(Encounters[0] == DONE) HandleGameObject(NULL, true, go);
|
||||
break;
|
||||
case 184662: GruulDoor = go->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData64(uint32 type, uint64 data)
|
||||
{
|
||||
@@ -103,14 +105,14 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank;
|
||||
case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed;
|
||||
case DATA_BLINDEYETHESEER: return BlindeyeTheSeer;
|
||||
case DATA_OLMTHESUMMONER: return OlmTheSummoner;
|
||||
case DATA_KROSHFIREHAND: return KroshFirehand;
|
||||
case DATA_MAULGARDOOR: return MaulgarDoor;
|
||||
case DATA_GRUULDOOR: return GruulDoor;
|
||||
case DATA_MAULGAR: return Maulgar;
|
||||
case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank;
|
||||
case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed;
|
||||
case DATA_BLINDEYETHESEER: return BlindeyeTheSeer;
|
||||
case DATA_OLMTHESUMMONER: return OlmTheSummoner;
|
||||
case DATA_KROSHFIREHAND: return KroshFirehand;
|
||||
case DATA_MAULGARDOOR: return MaulgarDoor;
|
||||
case DATA_GRUULDOOR: return GruulDoor;
|
||||
case DATA_MAULGAR: return Maulgar;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -120,13 +122,16 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
switch(type)
|
||||
{
|
||||
case DATA_MAULGAREVENT:
|
||||
if(data == DONE) HandleGameObject(MaulgarDoor, true);
|
||||
Encounters[0] = data; break;
|
||||
case DATA_GRUULEVENT:
|
||||
if(data == IN_PROGRESS) HandleGameObject(GruulDoor, true);
|
||||
else HandleGameObject(GruulDoor, false);
|
||||
Encounters[1] = data; break;
|
||||
}
|
||||
|
||||
if(data == DONE)
|
||||
SaveToDB();
|
||||
if(data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type)
|
||||
@@ -134,13 +139,12 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
switch(type)
|
||||
{
|
||||
case DATA_MAULGAREVENT: return Encounters[0];
|
||||
case DATA_GRUULEVENT: return Encounters[1];
|
||||
case DATA_GRUULEVENT: return Encounters[1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const char* Save()
|
||||
const char* Save()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
std::ostringstream stream;
|
||||
@@ -173,6 +177,7 @@ struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_gruuls_lair(Map* map)
|
||||
{
|
||||
return new instance_gruuls_lair(map);
|
||||
|
||||
+4
-4
@@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
}
|
||||
for(int i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(who && channeler && !channeler->isInCombat())
|
||||
channeler->AI()->AttackStart(who);
|
||||
}
|
||||
@@ -138,7 +138,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
for(int i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(channeler && channeler->isAlive())
|
||||
return;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
int i;
|
||||
for(i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(channeler && channeler->GetGUID()==channeler1->GetGUID())
|
||||
break;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
for(int i=0; i<5; ++i)
|
||||
{
|
||||
Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
|
||||
Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
|
||||
if(!channeler || channeler->isDead())
|
||||
channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
|
||||
if(channeler)
|
||||
|
||||
+5
-5
@@ -127,7 +127,7 @@ struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI
|
||||
|
||||
if(flight) // phase 1 - the flight
|
||||
{
|
||||
Creature *Vazruden = (Creature*)Unit::GetUnit(*m_creature,VazrudenGUID);
|
||||
Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID);
|
||||
if(Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth())))
|
||||
{
|
||||
flight = false;
|
||||
@@ -279,8 +279,8 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI
|
||||
{
|
||||
if(summoned)
|
||||
{
|
||||
Creature *Nazan = (Creature*)Unit::GetUnit(*m_creature, NazanGUID);
|
||||
Creature *Vazruden = (Creature*)Unit::GetUnit(*m_creature, VazrudenGUID);
|
||||
Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID);
|
||||
Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID);
|
||||
if(Nazan || (Nazan = (Creature *)FindCreature(ENTRY_NAZAN, 5000, m_creature)))
|
||||
{
|
||||
Nazan->SetLootRecipient(NULL);
|
||||
@@ -381,8 +381,8 @@ struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI
|
||||
default: // adds do the job now
|
||||
if(check < diff)
|
||||
{
|
||||
Creature *Nazan = (Creature*)Unit::GetUnit(*m_creature, NazanGUID);
|
||||
Creature *Vazruden = (Creature*)Unit::GetUnit(*m_creature, VazrudenGUID);
|
||||
Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID);
|
||||
Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID);
|
||||
if(Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive())
|
||||
{
|
||||
if(Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim())
|
||||
|
||||
+1
-1
@@ -506,7 +506,7 @@ bool GOHello_go_Manticron_Cube(Player *player, GameObject* _GO)
|
||||
ScriptedInstance* pInstance =(ScriptedInstance*)_GO->GetInstanceData();
|
||||
if(!pInstance) return true;
|
||||
if(pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true;
|
||||
Creature *Magtheridon =(Creature*)Unit::GetUnit(*_GO, pInstance->GetData64(DATA_MAGTHERIDON));
|
||||
Creature *Magtheridon =Unit::GetCreature(*_GO, pInstance->GetData64(DATA_MAGTHERIDON));
|
||||
if(!Magtheridon || !Magtheridon->isAlive()) return true;
|
||||
|
||||
// if exhausted or already channeling return
|
||||
|
||||
+2
-2
@@ -335,7 +335,7 @@ struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI
|
||||
{
|
||||
if (pInstance->GetData64(DATA_NETHEKURSE))
|
||||
{
|
||||
Creature *pKurse = (Creature*)Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
|
||||
Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
|
||||
if (pKurse && m_creature->GetDistance(pKurse) < 45.0f)
|
||||
{
|
||||
((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonAggro();
|
||||
@@ -356,7 +356,7 @@ struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI
|
||||
return;
|
||||
if (pInstance->GetData64(DATA_NETHEKURSE))
|
||||
{
|
||||
Creature *pKurse = (Creature*)Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
|
||||
Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE));
|
||||
if (pKurse)
|
||||
((boss_grand_warlock_nethekurseAI*)pKurse->AI())->DoYellForPeonDeath();
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
|
||||
case 27:
|
||||
DoScriptText(SAY_ELF_COMPLETE, m_creature, player);
|
||||
// Award quest credit
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH,m_creature);
|
||||
break;
|
||||
@@ -335,7 +335,7 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI
|
||||
if (PlayerGUID)
|
||||
{
|
||||
// If NPC dies, player fails the quest
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->FailQuest(QUEST_ROAD_TO_FALCON_WATCH);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI
|
||||
{
|
||||
if( (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
|
||||
{
|
||||
Creature *pMidnight = (Creature*)Unit::GetUnit(*m_creature, Midnight);
|
||||
Creature *pMidnight = Unit::GetCreature(*m_creature, Midnight);
|
||||
if(pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
((boss_midnightAI*)(pMidnight->AI()))->Mount(m_creature);
|
||||
|
||||
@@ -211,7 +211,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
||||
AddGUID[i] = pCreature->GetGUID();
|
||||
break;
|
||||
case 1:
|
||||
pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
|
||||
pCreature = (Unit::GetCreature((*m_creature), AddGUID[i]));
|
||||
if (pCreature)
|
||||
{
|
||||
pCreature->Respawn();
|
||||
@@ -219,7 +219,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
|
||||
pCreature = (Unit::GetCreature((*m_creature), AddGUID[i]));
|
||||
if (!pCreature->IsInEvadeMode())
|
||||
pCreature->AI()->EnterEvadeMode();
|
||||
break;
|
||||
@@ -281,7 +281,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
|
||||
Creature* Temp = NULL;
|
||||
if (AddGUID[i])
|
||||
{
|
||||
Temp = (Creature*)Unit::GetUnit((*m_creature),AddGUID[i]);
|
||||
Temp = Unit::GetCreature((*m_creature),AddGUID[i]);
|
||||
if (Temp && Temp->isAlive())
|
||||
if (!Temp->getVictim() )
|
||||
Temp->AI()->AttackStart(m_creature->getVictim());
|
||||
@@ -392,7 +392,7 @@ struct TRINITY_DLL_DECL boss_moroes_guestAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
GuestGUID[0] = pInstance->GetData64(DATA_MOROES);
|
||||
Creature* Moroes = ((Creature*)Unit::GetUnit((*m_creature), GuestGUID[0]));
|
||||
Creature* Moroes = (Unit::GetCreature((*m_creature), GuestGUID[0]));
|
||||
if(Moroes)
|
||||
{
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
|
||||
@@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL mob_kilrekAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Terestian = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_TERESTIAN)));
|
||||
Creature* Terestian = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_TERESTIAN)));
|
||||
if(Terestian && !Terestian->getVictim())
|
||||
Terestian->AddThreat(who, 1.0f);
|
||||
}
|
||||
@@ -211,10 +211,9 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
|
||||
|
||||
if(pInstance)
|
||||
{
|
||||
Creature* Kilrek = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILREK)));
|
||||
|
||||
Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK)));
|
||||
// Respawn Kil'rek on aggro if Kil'rek is dead.
|
||||
if (!Kilrek || !Kilrek->isAlive())
|
||||
if (Kilrek && !Kilrek->isAlive())
|
||||
{
|
||||
Kilrek->Respawn();
|
||||
}
|
||||
@@ -270,7 +269,7 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI
|
||||
uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK);
|
||||
else ERROR_INST_DATA(m_creature);
|
||||
|
||||
Creature* Kilrek = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILREK)));
|
||||
Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK)));
|
||||
if(SummonKilrek && Kilrek)
|
||||
{
|
||||
Kilrek->Respawn();
|
||||
|
||||
@@ -217,7 +217,7 @@ struct TRINITY_DLL_DECL mob_titoAI : public ScriptedAI
|
||||
{
|
||||
if(DorotheeGUID)
|
||||
{
|
||||
Creature* Dorothee = ((Creature*)Unit::GetUnit((*m_creature), DorotheeGUID));
|
||||
Creature* Dorothee = (Unit::GetCreature((*m_creature), DorotheeGUID));
|
||||
if(Dorothee && Dorothee->isAlive())
|
||||
{
|
||||
((boss_dorotheeAI*)Dorothee->AI())->TitoDied = true;
|
||||
@@ -1079,7 +1079,7 @@ struct TRINITY_DLL_DECL boss_romuloAI : public ScriptedAI
|
||||
DoScriptText(SAY_ROMULO_AGGRO, m_creature);
|
||||
if(JulianneGUID)
|
||||
{
|
||||
Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
|
||||
Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
|
||||
if(Julianne && Julianne->getVictim())
|
||||
{
|
||||
m_creature->AddThreat(Julianne->getVictim(), 1.0f);
|
||||
@@ -1316,7 +1316,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(ResurrectTimer < diff)
|
||||
{
|
||||
Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
|
||||
Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
|
||||
if(Romulo && ((boss_romuloAI*)Romulo->AI())->IsFakingDeath)
|
||||
{
|
||||
DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
|
||||
@@ -1350,7 +1350,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(rand()%2 == 1 && SummonedRomulo)
|
||||
{
|
||||
Creature* Romulo = ((Creature*)Unit::GetUnit((*m_creature), RomuloGUID));
|
||||
Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
|
||||
if (Romulo && Romulo->isAlive() && !RomuloDead)
|
||||
DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
|
||||
}else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
|
||||
@@ -1370,7 +1370,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(ResurrectTimer < diff)
|
||||
{
|
||||
Creature* Julianne = ((Creature*)Unit::GetUnit((*m_creature), JulianneGUID));
|
||||
Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
|
||||
if(Julianne && ((boss_julianneAI*)Julianne->AI())->IsFakingDeath)
|
||||
{
|
||||
DoScriptText(SAY_ROMULO_RESURRECT, m_creature);
|
||||
|
||||
@@ -373,7 +373,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
if (Delrissa)
|
||||
{
|
||||
pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, 1);
|
||||
@@ -393,7 +393,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
if (Delrissa)
|
||||
Delrissa->AI()->KilledUnit(victim);
|
||||
}
|
||||
@@ -406,7 +406,7 @@ struct TRINITY_DLL_DECL boss_priestess_guestAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Delrissa = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)));
|
||||
if (Delrissa)
|
||||
{
|
||||
Group = ((boss_priestess_delrissaAI*)Delrissa->AI())->Adds;
|
||||
@@ -634,13 +634,13 @@ struct TRINITY_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_guestAI
|
||||
|
||||
/*void mob_fizzleAI::JustDied(Unit* killer)
|
||||
{
|
||||
if(Creature* Ellris = ((Creature*)Unit::GetUnit(*m_creature, EllrisGUID)))
|
||||
if(Creature* Ellris = (Unit::GetCreature(*m_creature, EllrisGUID)))
|
||||
((boss_ellris_duskhallowAI*)Ellris->AI())->ImpGUID = 0;
|
||||
}
|
||||
|
||||
void mob_fizzleAI::KilledUnit(Unit* victim)
|
||||
{
|
||||
if(Creature* Ellris = ((Creature*)Unit::GetUnit(*m_creature, EllrisGUID)))
|
||||
if(Creature* Ellris = (Unit::GetCreature(*m_creature, EllrisGUID)))
|
||||
((boss_ellris_duskhallowAI*)Ellris->AI())->KilledUnit(victim);
|
||||
}*/
|
||||
|
||||
@@ -1028,13 +1028,13 @@ struct TRINITY_DLL_DECL boss_garaxxasAI : public boss_priestess_guestAI
|
||||
|
||||
/*void mob_sliverAI::JustDied(Unit* killer)
|
||||
{
|
||||
if(Creature* Garaxxas = ((Creature*)Unit::GetUnit(*m_creature, GaraxxasGUID)))
|
||||
if(Creature* Garaxxas = (Unit::GetCreature(*m_creature, GaraxxasGUID)))
|
||||
((boss_garaxxasAI*)Garaxxas->AI())->SliverGUID = 0;
|
||||
}
|
||||
|
||||
void mob_sliverAI::KilledUnit(Unit* victim)
|
||||
{
|
||||
if(Creature* Garaxxas = ((Creature*)Unit::GetUnit(*m_creature, GaraxxasGUID)))
|
||||
if(Creature* Garaxxas = (Unit::GetCreature(*m_creature, GaraxxasGUID)))
|
||||
((boss_garaxxasAI*)Garaxxas->AI())->KilledUnit(victim);
|
||||
}*/
|
||||
|
||||
|
||||
@@ -174,8 +174,8 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
|
||||
//for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
|
||||
for(std::list<uint64>::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
|
||||
{
|
||||
//Creature* pCrystal = ((Creature*)Unit::GetUnit(*m_creature, FelCrystals[i]));
|
||||
Creature* pCrystal = ((Creature*)Unit::GetUnit(*m_creature, *itr));
|
||||
//Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i]));
|
||||
Creature* pCrystal = (Unit::GetCreature(*m_creature, *itr));
|
||||
if (pCrystal && pCrystal->isAlive())
|
||||
pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
@@ -342,7 +342,7 @@ struct TRINITY_DLL_DECL mob_fel_crystalAI : public ScriptedAI
|
||||
{
|
||||
if (ScriptedInstance* pInstance = ((ScriptedInstance*)m_creature->GetInstanceData()))
|
||||
{
|
||||
Creature* Selin = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_SELIN)));
|
||||
Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN)));
|
||||
if (Selin && Selin->isAlive())
|
||||
{
|
||||
if (((boss_selin_fireheartAI*)Selin->AI())->CrystalGUID == m_creature->GetGUID())
|
||||
|
||||
@@ -422,9 +422,9 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
|
||||
// Emote Ardonis and Pathaleon
|
||||
void Turn_to_Pathaleons_Image()
|
||||
{
|
||||
Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID);
|
||||
Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID);
|
||||
Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID);
|
||||
Creature *ardonis = Unit::GetCreature(*m_creature,ardonisGUID);
|
||||
Creature *pathaleon = Unit::GetCreature(*m_creature,pathaleonGUID);
|
||||
Player *player = Unit::GetPlayer(playerGUID);
|
||||
|
||||
if (!ardonis || !pathaleon || !player)
|
||||
return;
|
||||
@@ -450,7 +450,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
|
||||
{
|
||||
if (Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID))
|
||||
{
|
||||
Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID);
|
||||
Player *player = Unit::GetPlayer(playerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -507,7 +507,7 @@ struct TRINITY_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI
|
||||
|
||||
Unit *ardonis = Unit::GetUnit(*m_creature,ardonisGUID);
|
||||
Unit *pathaleon = Unit::GetUnit(*m_creature,pathaleonGUID);
|
||||
Player *player = (Player*)Unit::GetUnit(*m_creature,playerGUID);
|
||||
Player *player = Unit::GetPlayer(playerGUID);
|
||||
|
||||
if (!ardonis || !player)
|
||||
{
|
||||
@@ -915,14 +915,14 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(Q_ALMABTRIEB);
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
@@ -49,7 +49,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -114,7 +114,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {}
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
|
||||
if (withhead)
|
||||
SaySound(SAY_PLAYER_DEATH);
|
||||
else { //maybe possible when player dies from conflagration
|
||||
Creature *Head = (Creature*)Unit::GetUnit((*m_creature), headGUID);
|
||||
Creature *Head = Unit::GetCreature((*m_creature), headGUID);
|
||||
if (Head)
|
||||
((mob_headAI*)Head->AI())->SaySound(SAY_PLAYER_DEATH);
|
||||
}
|
||||
@@ -666,7 +666,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
|
||||
{
|
||||
if (Phase > 1) --Phase;
|
||||
else Phase = 1;
|
||||
Creature* Head = (Creature*)Unit::GetUnit((*m_creature), headGUID);
|
||||
Creature* Head = Unit::GetCreature((*m_creature), headGUID);
|
||||
if (Head && Head->isAlive())
|
||||
{
|
||||
((mob_headAI*)Head->AI())->Phase = Phase;
|
||||
@@ -697,7 +697,7 @@ void mob_headAI::Disappear()
|
||||
return;
|
||||
if (bodyGUID)
|
||||
{
|
||||
Creature *body = (Creature*)Unit::GetUnit((*m_creature), bodyGUID);
|
||||
Creature *body = Unit::GetCreature((*m_creature), bodyGUID);
|
||||
if(body && body->isAlive())
|
||||
{
|
||||
withbody = true;
|
||||
|
||||
@@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
|
||||
DoScriptText(SAY_JUST_EATEN, m_creature);
|
||||
if(PlayerGUID)
|
||||
{
|
||||
Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
Player* plr = Unit::GetPlayer(PlayerGUID);
|
||||
if(plr && plr->GetQuestStatus(10804) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
plr->KilledMonster(22131, m_creature->GetGUID());
|
||||
@@ -259,7 +259,7 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI
|
||||
Tapped = false;
|
||||
if(PlayerGUID)
|
||||
{
|
||||
Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
Player* plr = Unit::GetPlayer(PlayerGUID);
|
||||
if(plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
plr->KilledMonster(22316, m_creature->GetGUID());
|
||||
@@ -357,7 +357,7 @@ struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI
|
||||
{
|
||||
if(PlayerGUID)
|
||||
{
|
||||
Player* plr = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
Player* plr = Unit::GetPlayer(PlayerGUID);
|
||||
if(plr && plr->GetQuestStatus(11020) == QUEST_STATUS_INCOMPLETE)
|
||||
plr->KilledMonster(23209, m_creature->GetGUID());
|
||||
}
|
||||
@@ -701,7 +701,7 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI
|
||||
Illidan->SetVisibility(VISIBILITY_OFF);
|
||||
if(PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
DoScriptText(OVERLORD_SAY_1, m_creature, player);
|
||||
}
|
||||
ConversationTimer = 4200;
|
||||
@@ -869,7 +869,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_COILSKAR_ASSASSIN)
|
||||
DoScriptText(SAY_AGGRO2, m_creature, player);
|
||||
@@ -884,7 +884,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -953,7 +953,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
|
||||
void SummonAssassin()
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
Unit* CoilskarAssassin = m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
if( CoilskarAssassin )
|
||||
@@ -972,7 +972,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID && !Completed)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN);
|
||||
}
|
||||
@@ -1289,7 +1289,7 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI
|
||||
|
||||
if(TorlothAnim[AnimationCount].Creature == 1)
|
||||
{
|
||||
pCreature = ((Creature*)Unit::GetUnit(*m_creature, LordIllidanGUID));
|
||||
pCreature = (Unit::GetCreature(*m_creature, LordIllidanGUID));
|
||||
|
||||
if(!pCreature)
|
||||
return;
|
||||
@@ -1309,7 +1309,7 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI
|
||||
m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,8);
|
||||
break;
|
||||
case 5:
|
||||
if(Player* AggroTarget = ((Player*)Unit::GetUnit((*m_creature), AggroTargetGUID)))
|
||||
if(Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID)))
|
||||
{
|
||||
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, AggroTarget->GetGUID());
|
||||
m_creature->AddThreat(AggroTarget, 1);
|
||||
@@ -1317,7 +1317,7 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if(Player* AggroTarget = ((Player*)Unit::GetUnit((*m_creature), AggroTargetGUID)))
|
||||
if(Player* AggroTarget = (Unit::GetPlayer(AggroTargetGUID)))
|
||||
{
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->clearUnitState(UNIT_STAT_ROOT);
|
||||
@@ -1392,7 +1392,7 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI
|
||||
break;
|
||||
}
|
||||
|
||||
if(Creature* LordIllidan = ((Creature*)Unit::GetUnit(*m_creature, LordIllidanGUID)))
|
||||
if(Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID)))
|
||||
{
|
||||
DoScriptText(END_TEXT, LordIllidan, slayer);
|
||||
LordIllidan->AI()->EnterEvadeMode();
|
||||
@@ -1485,7 +1485,7 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI
|
||||
{
|
||||
if(PlayerGUID)
|
||||
{
|
||||
if(Player* pTarget = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID)))
|
||||
if(Player* pTarget = Unit::GetPlayer(PlayerGUID))
|
||||
{
|
||||
float x, y, z;
|
||||
pTarget->GetPosition(x,y,z);
|
||||
@@ -1510,7 +1510,7 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI
|
||||
|
||||
void CheckEventFail()
|
||||
{
|
||||
Player* pPlayer = ((Player*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(!pPlayer)
|
||||
return;
|
||||
@@ -1527,7 +1527,7 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI
|
||||
|
||||
for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++)
|
||||
{
|
||||
GroupMember = ((Player*)Unit::GetUnit((*m_creature), itr->guid));
|
||||
GroupMember = (Unit::GetPlayer(itr->guid));
|
||||
if(!GroupMember)
|
||||
continue;
|
||||
if(!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
|
||||
@@ -1553,7 +1553,7 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI
|
||||
{
|
||||
for(Group::member_citerator itr = members.begin(); itr!= members.end(); itr++)
|
||||
{
|
||||
GroupMember = ((Player*)Unit::GetUnit((*m_creature), itr->guid));
|
||||
GroupMember = Unit::GetPlayer(itr->guid);
|
||||
|
||||
if(GroupMember && GroupMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
@@ -1605,7 +1605,7 @@ struct TRINITY_DLL_DECL npc_lord_illidan_stormrageAI : public ScriptedAI
|
||||
void mob_illidari_spawnAI::JustDied(Unit *slayer)
|
||||
{
|
||||
m_creature->RemoveCorpse();
|
||||
if(Creature* LordIllidan = ((Creature*)Unit::GetUnit(*m_creature, LordIllidanGUID)))
|
||||
if(Creature* LordIllidan = (Unit::GetCreature(*m_creature, LordIllidanGUID)))
|
||||
if(LordIllidan)
|
||||
((npc_lord_illidan_stormrageAI*)LordIllidan->AI())->LiveCounter();
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ public:
|
||||
case 56: DoScriptText(WHISP21, m_creature, pTemp);
|
||||
if( PlayerGUID )
|
||||
{
|
||||
Unit* player = ((Creature*)Unit::GetUnit((*m_creature), PlayerGUID));
|
||||
Unit* player = (Unit::GetCreature((*m_creature), PlayerGUID));
|
||||
if( player && player->GetTypeId() == TYPEID_PLAYER )
|
||||
((Player*)player)->GroupEventHappens(10211,m_creature);
|
||||
}
|
||||
@@ -415,7 +415,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
|
||||
uint32 NextStep(uint32 Step)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
switch(Step)
|
||||
{
|
||||
@@ -449,7 +449,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
|
||||
if(Attack)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
m_creature->setFaction(14);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if(player)
|
||||
@@ -501,7 +501,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
m_creature->DeleteThreatList();
|
||||
m_creature->CombatStop();
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player)
|
||||
((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
@@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(!player)
|
||||
return;
|
||||
@@ -129,7 +129,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_PK);
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
|
||||
uint32 IntroStep(uint32 step)
|
||||
{
|
||||
Creature* Sacrolash = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
|
||||
Creature* Sacrolash = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH));
|
||||
switch (step)
|
||||
{
|
||||
case 0: DoPlaySoundToSet(m_creature,SOUND_INTRO); return 0;
|
||||
|
||||
@@ -360,7 +360,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -413,7 +413,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(Q_OOX17);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
if(Encounter[i])
|
||||
if(Encounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -48,7 +48,7 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
|
||||
uint8 KaelthasEventPhase;
|
||||
uint8 AlarEventPhase;
|
||||
|
||||
bool Encounters[ENCOUNTERS];
|
||||
uint32 Encounters[ENCOUNTERS];
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
@@ -64,13 +64,13 @@ struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance
|
||||
AlarEventPhase = 0;
|
||||
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
Encounters[i] = false;
|
||||
Encounters[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for(uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
if(Encounters[i]) return true;
|
||||
if(Encounters[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1255,7 +1255,7 @@ void flesh_tentacleAI::JustDied(Unit* killer)
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* Cthun = (Creature*)Unit::GetUnit(*m_creature, Parent);
|
||||
Creature* Cthun = Unit::GetCreature(*m_creature, Parent);
|
||||
|
||||
if (Cthun)
|
||||
((cthunAI*)(Cthun->AI()))->FleshTentcleKilled();
|
||||
|
||||
@@ -378,7 +378,7 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if(!player)
|
||||
return;
|
||||
@@ -421,7 +421,7 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player && !Completed)
|
||||
{
|
||||
if(((Player*)player)->GetTeam() == ALLIANCE)
|
||||
|
||||
@@ -46,7 +46,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -86,7 +86,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {}
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_HOMEWARD_BOUND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_CHASING_AME);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
@@ -95,8 +95,8 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_DEFIAS_BROTHERHOOD);
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
player->FailQuest(QUEST_DEFIAS_BROTHERHOOD);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
|
||||
switch(i)
|
||||
{
|
||||
@@ -308,7 +308,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
|
||||
case 26: DoScriptText(SAY_PROGRESS_6, m_creature, player);
|
||||
Completed = true;
|
||||
if(player)
|
||||
((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature);
|
||||
player->GroupEventHappens(QUEST_EFU, m_creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -317,9 +317,9 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI
|
||||
{
|
||||
if (PlayerGUID && !Completed)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player && !Completed)
|
||||
((Player*)player)->FailQuest(QUEST_EFU);
|
||||
player->FailQuest(QUEST_EFU);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
|
||||
{
|
||||
for(uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature *pCreature = ((Creature*)Unit::GetUnit((*m_creature), AddGUID[i]));
|
||||
Creature *pCreature = (Unit::GetCreature((*m_creature), AddGUID[i]));
|
||||
if(!pCreature || !pCreature->isAlive())
|
||||
{
|
||||
if(pCreature) pCreature->setDeathState(DEAD);
|
||||
|
||||
@@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL npc_zulaman_hostageAI : public ScriptedAI
|
||||
void Aggro(Unit *who) {}
|
||||
void JustDied(Unit *)
|
||||
{
|
||||
Player* player = (Player*)Unit::GetUnit(*m_creature, PlayerGUID);
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player) player->SendLoot(m_creature->GetGUID(), LOOT_CORPSE);
|
||||
}
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -116,7 +116,7 @@ bool AssistDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
{
|
||||
while (!m_assistants.empty())
|
||||
{
|
||||
Creature* assistant = (Creature*)Unit::GetUnit(m_owner, *m_assistants.begin());
|
||||
Creature* assistant = Unit::GetCreature(m_owner, *m_assistants.begin());
|
||||
m_assistants.pop_front();
|
||||
|
||||
if (assistant && assistant->CanAssistTo(&m_owner, victim))
|
||||
|
||||
+13
-1
@@ -2425,7 +2425,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack
|
||||
if (tmp > 0 && roll < (sum += tmp))
|
||||
{
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum);
|
||||
if(GetTypeId()!=TYPEID_PLAYER && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
|
||||
if(GetTypeId() == TYPEID_UNIT && (((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT))
|
||||
DEBUG_LOG ("RollMeleeOutcomeAgainst: CRIT DISABLED)");
|
||||
else
|
||||
return MELEE_HIT_CRIT;
|
||||
}
|
||||
|
||||
@@ -10646,6 +10648,16 @@ Unit* Unit::GetUnit(WorldObject& object, uint64 guid)
|
||||
return ObjectAccessor::GetUnit(object,guid);
|
||||
}
|
||||
|
||||
Player* Unit::GetPlayer(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::FindPlayer(guid);
|
||||
}
|
||||
|
||||
Creature* Unit::GetCreature(WorldObject& object, uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetCreature(object, guid);
|
||||
}
|
||||
|
||||
bool Unit::isVisibleForInState( Player const* u, bool inVisibleList ) const
|
||||
{
|
||||
return u->canSeeOrDetect(this, false, inVisibleList, false);
|
||||
|
||||
@@ -1495,6 +1495,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
void addFollower(FollowerReference* pRef) { m_FollowingRefManager.insertFirst(pRef); }
|
||||
void removeFollower(FollowerReference* /*pRef*/ ) { /* nothing to do yet */ }
|
||||
static Unit* GetUnit(WorldObject& object, uint64 guid);
|
||||
static Player* GetPlayer(uint64 guid);
|
||||
static Creature* GetCreature(WorldObject& object, uint64 guid);
|
||||
|
||||
MotionMaster* GetMotionMaster() { return &i_motionMaster; }
|
||||
|
||||
@@ -1647,5 +1649,20 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
uint32 m_reducedThreatPercent;
|
||||
uint64 m_misdirectionTargetGUID;
|
||||
};
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
template<class T>
|
||||
void RandomResizeList(std::list<T> &_list, uint32 _size)
|
||||
{
|
||||
while(_list.size() > _size)
|
||||
{
|
||||
typename std::list<T>::iterator itr = _list.begin();
|
||||
advance(itr, urand(0, _list.size() - 1));
|
||||
_list.erase(itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user