*Use dynamic cast for script cast.
--HG-- branch : trunk
This commit is contained in:
@@ -491,7 +491,7 @@ void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float x, float y, float z, float
|
||||
return;
|
||||
}
|
||||
|
||||
((Player*)pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
CAST_PLR(pUnit)->TeleportTo(pUnit->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
}
|
||||
|
||||
void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "InstanceData.h"
|
||||
|
||||
#define USE_DYNAMIC_CAST
|
||||
#ifdef USE_DYNAMIC_CAST
|
||||
#define CAST_PLR(a) (dynamic_cast<Player*>(a))
|
||||
#define CAST_CRE(a) (dynamic_cast<Creature*>(a))
|
||||
#else
|
||||
#define CAST_PLR(a) (static_cast<Player*>(a))
|
||||
#define CAST_CRE(a) (static_cast<Creature*>(a))
|
||||
#endif
|
||||
|
||||
class ScriptedInstance;
|
||||
|
||||
class SummonList : private std::list<uint64>
|
||||
|
||||
@@ -107,7 +107,7 @@ bool ItemUse_item_attuned_crystal_cores(Player *player, Item* _Item, SpellCastTa
|
||||
targets.getUnitTarget()->GetEntry() == 24972 && targets.getUnitTarget()->isDead() &&
|
||||
(player->GetQuestStatus(11524) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11525) == QUEST_STATUS_INCOMPLETE) )
|
||||
{
|
||||
((Creature*)targets.getUnitTarget())->RemoveCorpse();
|
||||
CAST_CRE(targets.getUnitTarget())->RemoveCorpse();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ bool ItemUse_item_muiseks_vessel(Player *player, Item* _Item, SpellCastTargets c
|
||||
if( uTarget && uTarget->GetTypeId()==TYPEID_UNIT && uTarget->isDead() &&
|
||||
(uTarget->GetEntry()==cEntry || uTarget->GetEntry()==cEntry2 || uTarget->GetEntry()==cEntry3 || uTarget->GetEntry()==cEntry4) )
|
||||
{
|
||||
((Creature*)uTarget)->RemoveCorpse();
|
||||
CAST_CRE(uTarget)->RemoveCorpse();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -463,7 +463,7 @@ bool ItemUse_item_yehkinyas_bramble(Player *player, Item* _Item, SpellCastTarget
|
||||
// cast only on corpse 5307 or 5308
|
||||
(unit_target->GetEntry()==5307 || unit_target->GetEntry()==5308) )
|
||||
{
|
||||
((Creature*)unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
|
||||
CAST_CRE(unit_target)->RemoveCorpse(); // remove corpse for cancelling second use
|
||||
return false; // all ok
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,12 +361,12 @@ struct TRINITY_DLL_DECL npc_injured_patientAI : public ScriptedAI
|
||||
{
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804)
|
||||
{
|
||||
if((((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
|
||||
if((CAST_PLR(caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (CAST_PLR(caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))
|
||||
{
|
||||
if (Doctorguid)
|
||||
{
|
||||
if(Creature* Doctor = Unit::GetCreature(*m_creature, Doctorguid))
|
||||
((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, ((Player*)caster), Coord);
|
||||
((npc_doctorAI*)Doctor->AI())->PatientSaved(m_creature, CAST_PLR(caster), Coord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
|
||||
switch(m_creature->GetEntry())
|
||||
{
|
||||
case ENTRY_SHAYA:
|
||||
if (((Player*)pCaster)->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE)
|
||||
if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
|
||||
{
|
||||
@@ -684,7 +684,7 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
|
||||
}
|
||||
break;
|
||||
case ENTRY_ROBERTS:
|
||||
if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE)
|
||||
if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
|
||||
{
|
||||
@@ -701,7 +701,7 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
|
||||
}
|
||||
break;
|
||||
case ENTRY_DOLF:
|
||||
if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE)
|
||||
if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
|
||||
{
|
||||
@@ -718,7 +718,7 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
|
||||
}
|
||||
break;
|
||||
case ENTRY_KORJA:
|
||||
if (((Player*)pCaster)->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE)
|
||||
if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
|
||||
{
|
||||
@@ -735,7 +735,7 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
|
||||
}
|
||||
break;
|
||||
case ENTRY_DG_KEL:
|
||||
if (((Player*)pCaster)->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE)
|
||||
if (CAST_PLR(pCaster)->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1)
|
||||
{
|
||||
@@ -755,7 +755,7 @@ struct TRINITY_DLL_DECL npc_garments_of_questsAI : public npc_escortAI
|
||||
|
||||
//give quest credit, not expect any special quest objectives
|
||||
if (bCanRun)
|
||||
((Player*)pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
|
||||
CAST_PLR(pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ struct TRINITY_DLL_DECL npc_ravenholdtAI : public ScriptedAI
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
if( ((Player*)who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
|
||||
if( CAST_PLR(who)->GetQuestStatus(6681) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(who)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID() );
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who) { }
|
||||
|
||||
@@ -75,7 +75,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
|
||||
DoScriptText(SAY_PROGRESS_9, m_creature, player);
|
||||
Completed = true;
|
||||
if(player)
|
||||
((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE);
|
||||
CAST_PLR(player)->FailQuest(QUEST_SUNKEN_TREASURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
|
||||
DoScriptText(SAY_WIN, m_creature, player);
|
||||
Completed = true;
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature);
|
||||
break;
|
||||
case 21:
|
||||
DoScriptText(SAY_END, m_creature, player);
|
||||
@@ -114,7 +114,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI
|
||||
if (PlayerGUID && !Completed)
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_TOREK_ASSULT);
|
||||
CAST_PLR(player)->FailQuest(QUEST_TOREK_ASSULT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
|
||||
|
||||
case 21:{
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature);
|
||||
|
||||
break; }
|
||||
}
|
||||
@@ -229,7 +229,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL);
|
||||
CAST_PLR(player)->FailQuest(QUEST_FREEDOM_TO_RUUL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -279,7 +279,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
return;
|
||||
}
|
||||
if(!Shaffar->isInCombat())
|
||||
((Creature*)Shaffar)->AI()->AttackStart(who);
|
||||
CAST_CRE(Shaffar)->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature *summoned)
|
||||
@@ -291,7 +291,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI
|
||||
{
|
||||
Unit *Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
|
||||
if(Shaffar)
|
||||
((boss_nexusprince_shaffarAI*)(((Creature*)Shaffar)->AI()))->RemoveBeaconFromList(m_creature);
|
||||
((boss_nexusprince_shaffarAI*)(CAST_CRE(Shaffar)->AI()))->RemoveBeaconFromList(m_creature);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -55,7 +55,7 @@ struct TRINITY_DLL_DECL mobs_spitelashesAI : public ScriptedAI
|
||||
{
|
||||
if( !spellhit &&
|
||||
Hitter->GetTypeId() == TYPEID_PLAYER &&
|
||||
((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
|
||||
CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE &&
|
||||
(Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826) )
|
||||
{
|
||||
spellhit=true;
|
||||
|
||||
@@ -240,7 +240,7 @@ struct TRINITY_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI
|
||||
{
|
||||
if(!who || (!who->isAlive())) return;
|
||||
|
||||
if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && ((Player*)who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
|
||||
if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
|
||||
{
|
||||
PlayerGUID = who->GetGUID();
|
||||
EventInProgress = true;
|
||||
@@ -447,7 +447,7 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI
|
||||
if(Mercenary)
|
||||
{
|
||||
DoScriptText(SAY_MERCENARY_4, Mercenary);
|
||||
((Creature*)Mercenary)->AI()->AttackStart(m_creature);
|
||||
CAST_CRE(Mercenary)->AI()->AttackStart(m_creature);
|
||||
AttackStart(Mercenary);
|
||||
}
|
||||
}break;
|
||||
|
||||
@@ -1776,7 +1776,7 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
|
||||
if(CheckTimer < diff)
|
||||
{
|
||||
GETUNIT(Illidan, IllidanGUID);
|
||||
if(!Illidan || ((Creature*)Illidan)->IsInEvadeMode())
|
||||
if(!Illidan || CAST_CRE(Illidan)->IsInEvadeMode())
|
||||
{
|
||||
m_creature->SetVisibility(VISIBILITY_OFF);
|
||||
m_creature->setDeathState(JUST_DIED);
|
||||
|
||||
@@ -338,7 +338,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
|
||||
Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000);
|
||||
if(control)
|
||||
{
|
||||
((Player*)Ghost)->Possess(control);
|
||||
CAST_PLR(Ghost)->Possess(control);
|
||||
Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL,
|
||||
false);
|
||||
}*/
|
||||
|
||||
@@ -272,7 +272,7 @@ struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI
|
||||
{
|
||||
Member = Unit::GetUnit((*m_creature), Council[i]);
|
||||
if(Member && Member->isAlive())
|
||||
((Creature*)Member)->AI()->AttackStart(target);
|
||||
CAST_CRE(Member)->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -854,7 +854,7 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
|
||||
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( ((Player*)who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
float Radius = 10.0;
|
||||
if( m_creature->IsWithinDistInMap(who, Radius) )
|
||||
|
||||
@@ -61,7 +61,7 @@ struct TRINITY_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Killer)->KilledMonster(19995, m_creature->GetGUID());
|
||||
CAST_PLR(Killer)->KilledMonster(19995, m_creature->GetGUID());
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_mobs_bladespire_ogre(Creature *_Creature)
|
||||
@@ -261,8 +261,8 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
|
||||
{
|
||||
DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
|
||||
//TODO: Move the below to updateAI and run if this statement == true
|
||||
((Player*)who)->KilledMonster(21511, m_creature->GetGUID());
|
||||
((Player*)who)->RemoveAurasDueToSpell(36904);
|
||||
CAST_PLR(who)->KilledMonster(21511, m_creature->GetGUID());
|
||||
CAST_PLR(who)->RemoveAurasDueToSpell(36904);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI
|
||||
case 0:
|
||||
spawnCreatureID = 17681;
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
|
||||
CAST_PLR(Killer)->KilledMonster(spawnCreatureID, m_creature->GetGUID());
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
|
||||
@@ -57,7 +57,7 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
|
||||
if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
DoCast(who,16472);
|
||||
((Player*)who)->AreaExploredOrEventHappens(4866);
|
||||
CAST_PLR(who)->AreaExploredOrEventHappens(4866);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI
|
||||
}
|
||||
|
||||
if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
|
||||
GainSoulCharge(((Player*)victim));
|
||||
GainSoulCharge(CAST_PLR(victim));
|
||||
}
|
||||
|
||||
void GainSoulCharge(Player* victim)
|
||||
|
||||
@@ -1000,8 +1000,8 @@ void hyjalAI::WaypointReached(uint32 i)
|
||||
Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid);
|
||||
if(Dummy)
|
||||
{
|
||||
((hyjalAI*)((Creature*)Dummy)->AI())->DoMassTeleport = true;
|
||||
((hyjalAI*)((Creature*)Dummy)->AI())->MassTeleportTimer = 20000;
|
||||
((hyjalAI*)CAST_CRE(Dummy)->AI())->DoMassTeleport = true;
|
||||
((hyjalAI*)CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000;
|
||||
Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c)
|
||||
|
||||
void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if(done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && ((Creature*)done_by)->isPet()))
|
||||
if(done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && CAST_CRE(done_by)->isPet()))
|
||||
{
|
||||
damageTaken += damage;
|
||||
if(pInstance)
|
||||
|
||||
+2
-2
@@ -536,7 +536,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI
|
||||
Unit *SpitfireTotem = Unit::GetUnit( *m_creature, CREATURE_SPITFIRE_TOTEM );
|
||||
if( SpitfireTotem )
|
||||
{
|
||||
((Creature*)SpitfireTotem)->AI()->AttackStart( m_creature->getVictim() );
|
||||
CAST_CRE(SpitfireTotem)->AI()->AttackStart( m_creature->getVictim() );
|
||||
}
|
||||
Spitfire_Timer = 60000;
|
||||
}else Spitfire_Timer -= diff;
|
||||
@@ -655,7 +655,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI
|
||||
Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000);
|
||||
if( Cyclone )
|
||||
{
|
||||
((Creature*)Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
|
||||
CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f);
|
||||
Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Cyclone->setFaction(m_creature->getFaction());
|
||||
Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true);
|
||||
|
||||
+2
-2
@@ -672,7 +672,7 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
}
|
||||
}
|
||||
if(((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->InCombat == false || ((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->Phase != 2 || Vashj->isDead())
|
||||
if(((boss_lady_vashjAI*)CAST_CRE(Vashj)->AI())->InCombat == false || ((boss_lady_vashjAI*)CAST_CRE(Vashj)->AI())->Phase != 2 || Vashj->isDead())
|
||||
{
|
||||
//call Unsummon()
|
||||
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
@@ -827,7 +827,7 @@ struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI
|
||||
//check if vashj is death
|
||||
Unit *Vashj = NULL;
|
||||
Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ));
|
||||
if(!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && ((boss_lady_vashjAI*)((Creature*)Vashj)->AI())->Phase != 3))
|
||||
if(!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && ((boss_lady_vashjAI*)CAST_CRE(Vashj)->AI())->Phase != 3))
|
||||
{
|
||||
//remove
|
||||
m_creature->setDeathState(DEAD);
|
||||
|
||||
@@ -57,7 +57,7 @@ struct TRINITY_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI
|
||||
void DamageTaken(Unit *done_by, uint32 &damage)
|
||||
{
|
||||
if( done_by->GetTypeId() == TYPEID_PLAYER )
|
||||
if( damage >= m_creature->GetHealth() && ((Player*)done_by)->GetQuestStatus(11180) == QUEST_STATUS_INCOMPLETE )
|
||||
if( damage >= m_creature->GetHealth() && CAST_PLR(done_by)->GetQuestStatus(11180) == QUEST_STATUS_INCOMPLETE )
|
||||
m_creature->CastSpell(done_by,SPELL_SUMMON_RESTLESS_APPARITION,false);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ struct TRINITY_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI
|
||||
{
|
||||
if(m_creature->GetEntry() != 29519)
|
||||
if(killer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)killer)->KilledMonster(29519,m_creature->GetGUID());
|
||||
CAST_PLR(killer)->KilledMonster(29519,m_creature->GetGUID());
|
||||
}
|
||||
|
||||
void AddEquipp()
|
||||
@@ -367,12 +367,12 @@ bool GOHello_go_acherus_soul_prison(Player *player, GameObject* _GO)
|
||||
Unit* prison_anchor = finder->FindNearestCreature(29521, 15);
|
||||
if(!prison_anchor) return false;
|
||||
|
||||
uint64 owner = ((npc_unworthy_initiate_anchorAI*)((Creature*)prison_anchor)->AI())->GetTarget();
|
||||
uint64 owner = ((npc_unworthy_initiate_anchorAI*)CAST_CRE(prison_anchor)->AI())->GetTarget();
|
||||
|
||||
Creature* prisoner = Creature::GetCreature((*player),owner);
|
||||
if(prisoner)
|
||||
{
|
||||
((npc_unworthy_initiateAI*)(prisoner->AI()))->EventStart((Creature*)prison_anchor,player);
|
||||
((npc_unworthy_initiateAI*)(prisoner->AI()))->EventStart(CAST_CRE(prison_anchor),player);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -422,7 +422,7 @@ struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI
|
||||
{
|
||||
if(!me->HasAura(7267)) // beg aura has faded
|
||||
{
|
||||
((Player*)me->getVictim())->KilledMonster(29025,m_creature->GetGUID());
|
||||
CAST_PLR(me->getVictim())->KilledMonster(29025,m_creature->GetGUID());
|
||||
EnterEvadeMode();
|
||||
}
|
||||
return;
|
||||
@@ -498,20 +498,20 @@ struct TRINITY_DLL_DECL npc_salanar_the_horsemanAI : public ScriptedAI
|
||||
{
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
|
||||
if(who->GetTypeId() == TYPEID_UNIT && ((Creature*)who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f))
|
||||
if(who->GetTypeId() == TYPEID_UNIT && CAST_CRE(who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f))
|
||||
{
|
||||
if( Unit *charmer = who->GetCharmer() )
|
||||
{
|
||||
if( charmer->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( ((Player*)charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)charmer)->KilledMonster(28767, me->GetGUID());
|
||||
else if( ((Player*)charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)charmer)->GroupEventHappens(12687, me);
|
||||
((Player*)charmer)->ExitVehicle();
|
||||
if( CAST_PLR(charmer)->GetQuestStatus(12680) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(charmer)->KilledMonster(28767, me->GetGUID());
|
||||
else if( CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(charmer)->GroupEventHappens(12687, me);
|
||||
CAST_PLR(charmer)->ExitVehicle();
|
||||
//without this we can see npc kill the horse
|
||||
who->setDeathState(DEAD);
|
||||
((Creature*)who)->Respawn();
|
||||
CAST_CRE(who)->Respawn();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,7 +537,7 @@ struct TRINITY_DLL_DECL npc_ros_dark_riderAI : public ScriptedAI
|
||||
return;
|
||||
|
||||
// this should be before next one otherwise he may enter vehicle again
|
||||
if(!me->m_Vehicle && who->GetEntry() == 28782 && ((Creature*)who)->isVehicle() && !who->GetCharmerGUID())
|
||||
if(!me->m_Vehicle && who->GetEntry() == 28782 && CAST_CRE(who)->isVehicle() && !who->GetCharmerGUID())
|
||||
me->EnterVehicle((Vehicle*)who);
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
|
||||
@@ -449,7 +449,7 @@ void npc_secondTrialAI::JustDied(Unit* Killer) {
|
||||
// last kill quest complete for group
|
||||
if ( m_creature->GetEntry() == CHAMPION_SUNSTRIKER ) {
|
||||
|
||||
if( Group *pGroup = ((Player*)Killer)->GetGroup() )
|
||||
if( Group *pGroup = CAST_PLR(Killer)->GetGroup() )
|
||||
{
|
||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
@@ -461,8 +461,8 @@ void npc_secondTrialAI::JustDied(Unit* Killer) {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( ((Player*)Killer)->GetQuestStatus( QUEST_SECOND_TRIAL ) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)Killer)->CompleteQuest( QUEST_SECOND_TRIAL );
|
||||
if ( CAST_PLR(Killer)->GetQuestStatus( QUEST_SECOND_TRIAL ) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(Killer)->CompleteQuest( QUEST_SECOND_TRIAL );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -472,8 +472,8 @@ void npc_secondTrialAI::KilledUnit(Unit* Killed) {
|
||||
|
||||
if ( Killed->GetTypeId() == TYPEID_PLAYER ) {
|
||||
|
||||
if ( ((Player*)Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)Killed)->FailQuest(QUEST_SECOND_TRIAL);
|
||||
if ( CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -564,7 +564,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_UNEXPECTED_RESULT);
|
||||
CAST_PLR(player)->FailQuest(QUEST_UNEXPECTED_RESULT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ struct TRINITY_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player)
|
||||
((Player*)player)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
|
||||
CAST_PLR(player)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER && !m_creature->canStartAttack(who) && !Progress)
|
||||
{
|
||||
if( ((Player*)who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
float Radius = 10.0;
|
||||
if( m_creature->IsWithinDistInMap(who, Radius) )
|
||||
@@ -680,7 +680,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_POWERING_OUR_DEFENSES);
|
||||
CAST_PLR(player)->FailQuest(QUEST_POWERING_OUR_DEFENSES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ struct TRINITY_DLL_DECL npc_infused_crystalAI : public Scripted_NoMovementAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player)
|
||||
((Player*)player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
|
||||
CAST_PLR(player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
|
||||
}
|
||||
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
m_creature->RemoveCorpse();
|
||||
|
||||
@@ -198,7 +198,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
|
||||
case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
|
||||
case 30:
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
|
||||
break;
|
||||
case 32:
|
||||
m_creature->SetOrientation(2.978281);
|
||||
@@ -232,7 +232,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS);
|
||||
CAST_PLR(player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI
|
||||
|
||||
DoScriptText(YELL_DIE_L, Left);
|
||||
|
||||
((mob_omrogg_headsAI*)((Creature*)Right)->AI())->DoDeathYell();
|
||||
((mob_omrogg_headsAI*)CAST_CRE(Right)->AI())->DoDeathYell();
|
||||
}
|
||||
|
||||
if (pInstance)
|
||||
|
||||
+2
-2
@@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
|
||||
{
|
||||
(*temp).GetMotionMaster()->Clear(true);
|
||||
m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
((Creature*)temp)->RemoveCorpse();
|
||||
CAST_CRE(temp)->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
adds.clear();
|
||||
@@ -177,7 +177,7 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI
|
||||
{
|
||||
(*temp).GetMotionMaster()->Clear(true);
|
||||
m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
((Creature*)temp)->RemoveCorpse();
|
||||
CAST_CRE(temp)->RemoveCorpse();
|
||||
}
|
||||
}
|
||||
assassins.clear();
|
||||
|
||||
@@ -111,8 +111,8 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
|
||||
if(PlayerGUID)
|
||||
{
|
||||
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
if(plr && ((Player*)plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
|
||||
((Player*)plr)->KilledMonster(25086, m_creature->GetGUID());
|
||||
if(plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
|
||||
CAST_PLR(plr)->KilledMonster(25086, m_creature->GetGUID());
|
||||
}
|
||||
DoCast(m_creature, ENRAGE);
|
||||
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
|
||||
|
||||
@@ -130,7 +130,7 @@ struct TRINITY_DLL_DECL netherspite_infernalAI : public ScriptedAI
|
||||
{
|
||||
Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
|
||||
if(pMalchezaar)
|
||||
((Creature*)pMalchezaar)->AI()->KilledUnit(who);
|
||||
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
|
||||
}
|
||||
|
||||
void SpellHit(Unit *who, const SpellEntry *spell)
|
||||
@@ -621,7 +621,7 @@ void netherspite_infernalAI::Cleanup()
|
||||
Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
|
||||
|
||||
if(pMalchezaar && pMalchezaar->isAlive())
|
||||
((boss_malchezaarAI*)((Creature*)pMalchezaar)->AI())->Cleanup(m_creature, point);
|
||||
((boss_malchezaarAI*)CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, point);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_netherspite_infernal(Creature *_Creature)
|
||||
|
||||
@@ -557,21 +557,21 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
|
||||
return 10000;
|
||||
case 2:
|
||||
if(arca)
|
||||
((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
|
||||
return 20000;
|
||||
case 3:
|
||||
m_creature->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
|
||||
return 10000;
|
||||
case 4:
|
||||
if(arca)
|
||||
((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
|
||||
return 20000;
|
||||
case 5:
|
||||
m_creature->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
|
||||
return 20000;
|
||||
case 6:
|
||||
if(arca)
|
||||
((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_6, LANG_UNIVERSAL, NULL);
|
||||
return 10000;
|
||||
case 7:
|
||||
FireArcanagosTimer = 500;
|
||||
@@ -589,7 +589,7 @@ struct TRINITY_DLL_DECL npc_image_of_medivhAI : public ScriptedAI
|
||||
return 1000;
|
||||
case 11:
|
||||
if(arca)
|
||||
((Creature*)arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
|
||||
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL);
|
||||
return 5000;
|
||||
case 12:
|
||||
arca->GetMotionMaster()->MovePoint(0, -11010.82,-1761.18, 156.47);
|
||||
|
||||
@@ -98,7 +98,7 @@ struct TRINITY_DLL_DECL boss_selin_fireheartAI : public ScriptedAI
|
||||
if (pUnit)
|
||||
{
|
||||
if(!pUnit->isAlive())
|
||||
((Creature*)pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc.
|
||||
CAST_CRE(pUnit)->Respawn(); // Let MaNGOS handle setting death state, etc.
|
||||
|
||||
// Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here.
|
||||
pUnit->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
@@ -79,7 +79,7 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI
|
||||
|
||||
void SpellHit(Unit *caster, const SpellEntry* spell)
|
||||
{ // we can feed him without any quest
|
||||
if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && ((Player*)caster)->GetTeam() == HORDE)
|
||||
if(spell->Id == 42222 && caster->GetTypeId() == TYPEID_PLAYER && CAST_PLR(caster)->GetTeam() == HORDE)
|
||||
{
|
||||
STATE = 1;
|
||||
player = caster->GetGUID();
|
||||
@@ -139,8 +139,8 @@ struct TRINITY_DLL_DECL npc_kyle_frenziedAI : public ScriptedAI
|
||||
case 3:
|
||||
STATE = 4; //go home
|
||||
Unit *plr = Unit::GetUnit((*m_creature),player);
|
||||
if(plr && ((Player*)plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE)
|
||||
((Player*)plr)->CompleteQuest(11129);
|
||||
if(plr && CAST_PLR(plr)->GetQuestStatus(11129) == QUEST_STATUS_INCOMPLETE)
|
||||
CAST_PLR(plr)->CompleteQuest(11129);
|
||||
float x, y, z, z2, angle;
|
||||
angle = m_creature->GetAngle(-2146, -430);
|
||||
m_creature->GetPosition(x,y,z);
|
||||
|
||||
@@ -113,12 +113,12 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
|
||||
{
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30)
|
||||
{
|
||||
if (!bReset && ((Player*)done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
|
||||
if (!bReset && CAST_PLR(done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
//Take 0 damage
|
||||
damage = 0;
|
||||
|
||||
((Player*)done_by)->AttackStop();
|
||||
CAST_PLR(done_by)->AttackStop();
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->DeleteThreatList();
|
||||
@@ -529,14 +529,14 @@ struct TRINITY_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public Scripte
|
||||
|
||||
if(who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if(((Player*)who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
|
||||
if(CAST_PLR(who)->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
uint32 creditMarkerId = m_creature->GetEntry();
|
||||
if((creditMarkerId >= 18840) && (creditMarkerId <= 18843))
|
||||
{
|
||||
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
|
||||
if(!((Player*)who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
|
||||
((Player*)who)->KilledMonster(creditMarkerId, m_creature->GetGUID());
|
||||
if(!CAST_PLR(who)->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
|
||||
CAST_PLR(who)->KilledMonster(creditMarkerId, m_creature->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -634,7 +634,7 @@ struct TRINITY_DLL_DECL mob_sparrowhawkAI : public ScriptedAI
|
||||
{
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if(spell->Id == SPELL_SPARROWHAWK_NET && ((Player*)caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
|
||||
if(spell->Id == SPELL_SPARROWHAWK_NET && CAST_PLR(caster)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
m_creature->CastSpell(caster, SPELL_ITEM_CAPTIVE_SPARROWHAWK, true);
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
|
||||
@@ -103,20 +103,20 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
|
||||
switch( m_creature->GetEntry() )
|
||||
{
|
||||
case ENTRY_BNAAR_C_CONSOLE:
|
||||
((Player*)p)->FailQuest(10299);
|
||||
((Player*)p)->FailQuest(10329);
|
||||
CAST_PLR(p)->FailQuest(10299);
|
||||
CAST_PLR(p)->FailQuest(10329);
|
||||
break;
|
||||
case ENTRY_CORUU_C_CONSOLE:
|
||||
((Player*)p)->FailQuest(10321);
|
||||
((Player*)p)->FailQuest(10330);
|
||||
CAST_PLR(p)->FailQuest(10321);
|
||||
CAST_PLR(p)->FailQuest(10330);
|
||||
break;
|
||||
case ENTRY_DURO_C_CONSOLE:
|
||||
((Player*)p)->FailQuest(10322);
|
||||
((Player*)p)->FailQuest(10338);
|
||||
CAST_PLR(p)->FailQuest(10322);
|
||||
CAST_PLR(p)->FailQuest(10338);
|
||||
break;
|
||||
case ENTRY_ARA_C_CONSOLE:
|
||||
((Player*)p)->FailQuest(10323);
|
||||
((Player*)p)->FailQuest(10365);
|
||||
CAST_PLR(p)->FailQuest(10323);
|
||||
CAST_PLR(p)->FailQuest(10365);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ struct TRINITY_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
|
||||
{
|
||||
Unit* u = Unit::GetUnit((*m_creature),someplayer);
|
||||
if( u && u->GetTypeId() == TYPEID_PLAYER )
|
||||
((Player*)u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID());
|
||||
CAST_PLR(u)->KilledMonster(m_creature->GetEntry(),m_creature->GetGUID());
|
||||
DoCast(m_creature,SPELL_DISABLE_VISUAL);
|
||||
}
|
||||
if( goConsole )
|
||||
@@ -788,7 +788,7 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI
|
||||
Unit* target = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
|
||||
if(target && !Weak && m_creature->GetHealth() < (m_creature->GetMaxHealth() / 100 * WeakPercent)
|
||||
&& ((Player*)target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE)
|
||||
&& CAST_PLR(target)->GetQuestStatus(10190) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
DoScriptText(EMOTE_WEAK, m_creature);
|
||||
Weak = true;
|
||||
@@ -851,7 +851,7 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(Q_ALMABTRIEB);
|
||||
CAST_PLR(player)->FailQuest(Q_ALMABTRIEB);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,7 +878,7 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI
|
||||
case 12:
|
||||
if (player)
|
||||
{
|
||||
((Player*)player)->GroupEventHappens(Q_ALMABTRIEB, m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(Q_ALMABTRIEB, m_creature);
|
||||
Completed = true;
|
||||
}
|
||||
{Unit* Thadell = me->FindNearestCreature(N_THADELL, 30);
|
||||
|
||||
@@ -99,7 +99,7 @@ struct TRINITY_DLL_DECL npc_shenthulAI : public ScriptedAI
|
||||
{
|
||||
if( Unit* temp = Unit::GetUnit((*m_creature),playerGUID) )
|
||||
if( temp->GetTypeId() == TYPEID_PLAYER )
|
||||
((Player*)temp)->FailQuest(QUEST_2460);
|
||||
CAST_PLR(temp)->FailQuest(QUEST_2460);
|
||||
Reset();
|
||||
} else Reset_Timer -= diff;
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {}
|
||||
case 45:
|
||||
DoScriptText(SAY_WIN, m_creature, player);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
|
||||
break;
|
||||
case 46:
|
||||
DoScriptText(SAY_END, m_creature, player);
|
||||
@@ -115,7 +115,7 @@ npc_willixAI(Creature *c) : npc_escortAI(c) {}
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
|
||||
CAST_PLR(player)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -750,7 +750,7 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI
|
||||
plr->RemoveAurasDueToSpell(SPELL_FOUR);
|
||||
return 5000;
|
||||
}else{
|
||||
((Player*)plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100;
|
||||
CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100;
|
||||
}break;
|
||||
case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break;
|
||||
case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break;
|
||||
@@ -769,7 +769,7 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI
|
||||
case 25: DoScriptText(OVERLORD_SAY_6, m_creature); return 2000; break;
|
||||
case 26:
|
||||
if(plr)
|
||||
((Player*)plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature);
|
||||
CAST_PLR(plr)->GroupEventHappens(QUEST_LORD_ILLIDAN_STORMRAGE, m_creature);
|
||||
return 6000; break;
|
||||
case 27:
|
||||
{
|
||||
@@ -943,7 +943,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
case 44: SummonAssassin(); break;
|
||||
case 50:
|
||||
DoScriptText(SAY_END, m_creature, player);
|
||||
((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_COILSKAR_CISTERN, m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_COILSKAR_CISTERN, m_creature);
|
||||
Completed = true;
|
||||
break;
|
||||
}
|
||||
@@ -961,7 +961,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
case 0: DoScriptText(ASSASSIN_SAY_AGGRO1, CoilskarAssassin, player); break;
|
||||
case 1: DoScriptText(ASSASSIN_SAY_AGGRO2, CoilskarAssassin, player); break;
|
||||
}
|
||||
((Creature*)CoilskarAssassin)->AI()->AttackStart(m_creature);
|
||||
CAST_CRE(CoilskarAssassin)->AI()->AttackStart(m_creature);
|
||||
}
|
||||
else error_log("TSCR ERROR: Coilskar Assassin couldn't be summmoned");
|
||||
}
|
||||
@@ -972,7 +972,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN);
|
||||
CAST_PLR(player)->FailQuest(QUEST_ESCAPE_FROM_COILSKAR_CISTERN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1381,12 +1381,12 @@ struct TRINITY_DLL_DECL mob_torloth_the_magnificentAI : public ScriptedAI
|
||||
switch(slayer->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
if(((Creature*)slayer)->isPet() && ((Pet*)slayer)->GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)((Pet*)slayer->GetOwner()))->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature);
|
||||
if(CAST_CRE(slayer)->isPet() && ((Pet*)slayer)->GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
CAST_PLR(((Pet*)slayer->GetOwner()))->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature);
|
||||
break;
|
||||
|
||||
case TYPEID_PLAYER:
|
||||
((Player*)slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature);
|
||||
CAST_PLR(slayer)->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1618,11 +1618,11 @@ bool GOQuestAccept_GO_crystal_prison(Player* plr, GameObject* go, Quest const* q
|
||||
{
|
||||
Unit* Illidan = plr->FindNearestCreature(22083, 50);
|
||||
|
||||
if(Illidan && !(((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->EventStarted))
|
||||
if(Illidan && !(((npc_lord_illidan_stormrageAI*)CAST_CRE(Illidan)->AI())->EventStarted))
|
||||
{
|
||||
((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->PlayerGUID = plr->GetGUID();
|
||||
((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->LiveCount = 0;
|
||||
((npc_lord_illidan_stormrageAI*)((Creature*)Illidan)->AI())->EventStarted=true;
|
||||
((npc_lord_illidan_stormrageAI*)CAST_CRE(Illidan)->AI())->PlayerGUID = plr->GetGUID();
|
||||
((npc_lord_illidan_stormrageAI*)CAST_CRE(Illidan)->AI())->LiveCount = 0;
|
||||
((npc_lord_illidan_stormrageAI*)CAST_CRE(Illidan)->AI())->EventStarted=true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI
|
||||
if( done_by->GetTypeId() == TYPEID_PLAYER )
|
||||
if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20 )
|
||||
{
|
||||
((Player*)done_by)->GroupEventHappens(QUEST_10004,m_creature);
|
||||
CAST_PLR(done_by)->GroupEventHappens(QUEST_10004,m_creature);
|
||||
damage = 0;
|
||||
EnterEvadeMode();
|
||||
}
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( ((Player*)who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
float Radius = 10.0;
|
||||
if( m_creature->IsWithinDistInMap(who, Radius) )
|
||||
@@ -400,14 +400,14 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
|
||||
if(Creepjack)
|
||||
{
|
||||
((Creature*)Creepjack)->AI()->EnterEvadeMode();
|
||||
CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
|
||||
Creepjack->setFaction(1194);
|
||||
Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
|
||||
if(Malone)
|
||||
{
|
||||
((Creature*)Malone)->AI()->EnterEvadeMode();
|
||||
CAST_CRE(Malone)->AI()->EnterEvadeMode();
|
||||
Malone->setFaction(1194);
|
||||
Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
@@ -481,7 +481,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
|
||||
if(Creepjack)
|
||||
{
|
||||
((Creature*)Creepjack)->AI()->EnterEvadeMode();
|
||||
CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
|
||||
Creepjack->setFaction(1194);
|
||||
Creepjack->GetMotionMaster()->MoveTargetedHome();
|
||||
Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -489,7 +489,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
|
||||
if(Malone)
|
||||
{
|
||||
((Creature*)Malone)->AI()->EnterEvadeMode();
|
||||
CAST_CRE(Malone)->AI()->EnterEvadeMode();
|
||||
Malone->setFaction(1194);
|
||||
Malone->GetMotionMaster()->MoveTargetedHome();
|
||||
Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -503,7 +503,7 @@ struct TRINITY_DLL_DECL npc_dirty_larryAI : public ScriptedAI
|
||||
m_creature->GetMotionMaster()->MoveTargetedHome();
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if(player)
|
||||
((Player*)player)->GroupEventHappens(QUEST_WBI, m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_WBI, m_creature);
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -75,9 +75,9 @@ struct TRINITY_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI
|
||||
void SpellHit(Unit *Hitter, const SpellEntry *Spellkind)
|
||||
{
|
||||
if((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit &&
|
||||
(Hitter->GetTypeId() == TYPEID_PLAYER) && (((Player*)Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)))
|
||||
(Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD)))
|
||||
{
|
||||
((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
|
||||
CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD);
|
||||
DoCast(m_creature,SPELL_REVIVE_SELF);
|
||||
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
|
||||
|
||||
@@ -111,7 +111,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI
|
||||
case 23: m_creature->SetInFront(player);
|
||||
DoScriptText(SAY_END, m_creature, player);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_PK, m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_PK, m_creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI
|
||||
{
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_PK);
|
||||
CAST_PLR(player)->FailQuest(QUEST_PK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,8 +93,8 @@ struct TRINITY_DLL_DECL npc_bartlebyAI : public ScriptedAI
|
||||
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER && done_by->GetGUID() == PlayerGUID)
|
||||
{
|
||||
((Player*)done_by)->AttackStop();
|
||||
((Player*)done_by)->AreaExploredOrEventHappens(1640);
|
||||
CAST_PLR(done_by)->AttackStop();
|
||||
CAST_PLR(done_by)->AreaExploredOrEventHappens(1640);
|
||||
}
|
||||
m_creature->CombatStop();
|
||||
EnterEvadeMode();
|
||||
@@ -143,8 +143,8 @@ struct TRINITY_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI
|
||||
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
((Player*)done_by)->AttackStop();
|
||||
((Player*)done_by)->AreaExploredOrEventHappens(1447);
|
||||
CAST_PLR(done_by)->AttackStop();
|
||||
CAST_PLR(done_by)->AreaExploredOrEventHappens(1447);
|
||||
}
|
||||
//m_creature->CombatStop();
|
||||
EnterEvadeMode();
|
||||
|
||||
@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
//Yenniku's Release
|
||||
if(!bReset && ((Player*)caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
|
||||
if(!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
|
||||
{
|
||||
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
|
||||
m_creature->CombatStop(); //stop combat
|
||||
@@ -86,7 +86,7 @@ struct TRINITY_DLL_DECL mob_yennikuAI : public ScriptedAI
|
||||
if(m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Unit *victim = m_creature->getVictim();
|
||||
if(((Player*)victim)->GetTeam() == HORDE)
|
||||
if(CAST_PLR(victim)->GetTeam() == HORDE)
|
||||
{
|
||||
m_creature->CombatStop();
|
||||
m_creature->DeleteThreatList();
|
||||
|
||||
@@ -108,7 +108,7 @@ struct TRINITY_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI
|
||||
break;
|
||||
}
|
||||
if(pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID());
|
||||
CAST_PLR(Killer)->KilledMonster(SH_QUEST_CREDIT,m_creature->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL mob_restless_soulAI : public ScriptedAI
|
||||
{
|
||||
if (caster->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && ((Player*)caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE)
|
||||
if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && CAST_PLR(caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
Tagged = true;
|
||||
Tagger = caster->GetGUID();
|
||||
|
||||
@@ -121,7 +121,7 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
|
||||
if (Temp)
|
||||
if (Temp->isDead())
|
||||
{
|
||||
((Creature*)Temp)->Respawn();
|
||||
CAST_CRE(Temp)->Respawn();
|
||||
}else
|
||||
{
|
||||
if(Temp->getVictim())
|
||||
@@ -156,7 +156,7 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS));
|
||||
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
|
||||
((Creature*)Temp)->AI()->AttackStart(who);
|
||||
CAST_CRE(Temp)->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
if(pInstance)
|
||||
@@ -385,7 +385,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
if (Temp)
|
||||
if (Temp->isDead())
|
||||
{
|
||||
((Creature*)Temp)->Respawn();
|
||||
CAST_CRE(Temp)->Respawn();
|
||||
}else
|
||||
{
|
||||
if(Temp->getVictim())
|
||||
@@ -421,7 +421,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH));
|
||||
if (Temp && Temp->isAlive() && !(Temp->getVictim()))
|
||||
((Creature*)Temp)->AI()->AttackStart(who);
|
||||
CAST_CRE(Temp)->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
if(pInstance)
|
||||
|
||||
@@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI
|
||||
}
|
||||
|
||||
Unit *Sath = Unit::GetUnit(*m_creature,SathGUID);
|
||||
if(Sath) ((Creature*)Sath)->AI()->EnterEvadeMode();
|
||||
if(Sath) CAST_CRE(Sath)->AI()->EnterEvadeMode();
|
||||
|
||||
GameObject *Door = GameObject::GetGameObject(*m_creature, DoorGUID);
|
||||
if(Door) Door->SetLootState(GO_JUST_DEACTIVATED);
|
||||
@@ -318,8 +318,8 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
||||
TeleportAllPlayersBack();
|
||||
if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID))
|
||||
{
|
||||
((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->TalkTimer = 1;
|
||||
((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isFriendly = false;
|
||||
((boss_kalecgosAI*)CAST_CRE(Kalecgos)->AI())->TalkTimer = 1;
|
||||
((boss_kalecgosAI*)CAST_CRE(Kalecgos)->AI())->isFriendly = false;
|
||||
}
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
@@ -338,8 +338,8 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
||||
TeleportAllPlayersBack();
|
||||
if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID))
|
||||
{
|
||||
((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->TalkTimer = 1;
|
||||
((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isFriendly = true;
|
||||
((boss_kalecgosAI*)CAST_CRE(Kalecgos)->AI())->TalkTimer = 1;
|
||||
((boss_kalecgosAI*)CAST_CRE(Kalecgos)->AI())->isFriendly = true;
|
||||
}
|
||||
|
||||
if(pInstance)
|
||||
@@ -371,7 +371,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
||||
if(Kalecgos)
|
||||
{
|
||||
Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true);
|
||||
((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isEnraged = true;
|
||||
((boss_kalecgosAI*)CAST_CRE(Kalecgos)->AI())->isEnraged = true;
|
||||
}
|
||||
DoCast(m_creature, SPELL_ENRAGE, true);
|
||||
isEnraged = true;
|
||||
@@ -381,7 +381,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
|
||||
{
|
||||
if(Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID))
|
||||
{
|
||||
if(((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isBanished)
|
||||
if(((boss_kalecgosAI*)CAST_CRE(Kalecgos)->AI())->isBanished)
|
||||
{
|
||||
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return;
|
||||
@@ -570,7 +570,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
|
||||
if(Sath)
|
||||
{
|
||||
Sath->CastSpell(Sath, SPELL_ENRAGE, true);
|
||||
((boss_sathrovarrAI*)((Creature*)Sath)->AI())->isEnraged = true;
|
||||
((boss_sathrovarrAI*)CAST_CRE(Sath)->AI())->isEnraged = true;
|
||||
}
|
||||
DoCast(m_creature, SPELL_ENRAGE, true);
|
||||
isEnraged = true;
|
||||
@@ -580,7 +580,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(Unit *Sath = Unit::GetUnit(*m_creature, SathGUID))
|
||||
{
|
||||
if(((boss_sathrovarrAI*)((Creature*)Sath)->AI())->isBanished)
|
||||
if(((boss_sathrovarrAI*)CAST_CRE(Sath)->AI())->isBanished)
|
||||
{
|
||||
Sath->DealDamage(Sath, Sath->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
return;
|
||||
|
||||
@@ -274,7 +274,7 @@ bool GOHello_go_orb_of_the_blue_flight(Player *plr, GameObject* go)
|
||||
go->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
|
||||
plr->CastSpell(plr, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
|
||||
go->SetUInt32Value(GAMEOBJECT_FACTION, 0);
|
||||
Unit* Kalec = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_KJ)));
|
||||
Unit* Kalec = CAST_CRE(Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_KJ)));
|
||||
//Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
|
||||
go->GetPosition(x,y,z);
|
||||
for(uint8 i = 0; i < 4; ++i){
|
||||
@@ -460,7 +460,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI
|
||||
IsWaiting = false;
|
||||
OrbActivated = false;
|
||||
|
||||
Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ)));
|
||||
Kalec = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ)));
|
||||
ChangeTimers(false, 0);
|
||||
}
|
||||
|
||||
@@ -516,7 +516,7 @@ struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI
|
||||
|
||||
// Reset the controller
|
||||
if(pInstance){
|
||||
Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
|
||||
Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
|
||||
if(Control)
|
||||
((Scripted_NoMovementAI*)Control->AI())->Reset();
|
||||
}
|
||||
@@ -835,7 +835,7 @@ struct TRINITY_DLL_DECL mob_hand_of_the_deceiverAI : public ScriptedAI
|
||||
void EnterCombat(Unit* who){
|
||||
if(pInstance){
|
||||
pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS);
|
||||
Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
|
||||
Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
|
||||
if(Control)
|
||||
Control->AddThreat(who, 1.0f);
|
||||
}
|
||||
@@ -846,7 +846,7 @@ struct TRINITY_DLL_DECL mob_hand_of_the_deceiverAI : public ScriptedAI
|
||||
if(!pInstance)
|
||||
return;
|
||||
|
||||
Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
|
||||
Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
|
||||
if(Control)
|
||||
((mob_kiljaeden_controllerAI*)Control->AI())->DeceiverDeathCount++;
|
||||
}
|
||||
|
||||
@@ -66,15 +66,15 @@ struct TRINITY_DLL_DECL mob_aquementasAI : public ScriptedAI
|
||||
|
||||
void SendItem(Unit* receiver)
|
||||
{
|
||||
if (((Player*)receiver)->HasItemCount(11169,1,false) &&
|
||||
((Player*)receiver)->HasItemCount(11172,11,false) &&
|
||||
((Player*)receiver)->HasItemCount(11173,1,false) &&
|
||||
!((Player*)receiver)->HasItemCount(11522,1,true))
|
||||
if (CAST_PLR(receiver)->HasItemCount(11169,1,false) &&
|
||||
CAST_PLR(receiver)->HasItemCount(11172,11,false) &&
|
||||
CAST_PLR(receiver)->HasItemCount(11173,1,false) &&
|
||||
!CAST_PLR(receiver)->HasItemCount(11522,1,true))
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = ((Player*)receiver)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 11522, 1, false);
|
||||
uint8 msg = CAST_PLR(receiver)->CanStoreNewItem( NULL_BAG, NULL_SLOT, dest, 11522, 1, false);
|
||||
if( msg == EQUIP_ERR_OK )
|
||||
((Player*)receiver)->StoreNewItem( dest, 11522, 1, true);
|
||||
CAST_PLR(receiver)->StoreNewItem( dest, 11522, 1, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
|
||||
DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pTemp);
|
||||
DoCast(pTemp,34883);
|
||||
//below here is temporary workaround, to be removed when spell works properly
|
||||
((Player*)pTemp)->AreaExploredOrEventHappens(10277);
|
||||
CAST_PLR(pTemp)->AreaExploredOrEventHappens(10277);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -191,7 +191,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
|
||||
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( ((Player*)who)->HasAura(34877) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
float Radius = 10.0;
|
||||
if( m_creature->IsWithinDistInMap(who, Radius) )
|
||||
@@ -413,7 +413,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(Q_OOX17);
|
||||
CAST_PLR(player)->FailQuest(Q_OOX17);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
|
||||
if( done_by->GetTypeId() == TYPEID_PLAYER )
|
||||
if( (m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30 )
|
||||
{
|
||||
if( Group* pGroup = ((Player*)done_by)->GetGroup() )
|
||||
if( Group* pGroup = CAST_PLR(done_by)->GetGroup() )
|
||||
{
|
||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
@@ -96,10 +96,10 @@ struct TRINITY_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
} else
|
||||
if( ((Player*)done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
|
||||
((Player*)done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 )
|
||||
if( CAST_PLR(done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
|
||||
CAST_PLR(done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10 )
|
||||
{
|
||||
((Player*)done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
|
||||
CAST_PLR(done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
|
||||
CanDoQuest = true;
|
||||
}
|
||||
}
|
||||
@@ -215,12 +215,12 @@ struct TRINITY_DLL_DECL mob_netherweb_victimAI : public ScriptedAI
|
||||
{
|
||||
if( Killer->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( ((Player*)Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(Killer)->GetQuestStatus(10873) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
if( rand()%100 < 25 )
|
||||
{
|
||||
DoSpawnCreature(QUEST_TARGET,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
|
||||
((Player*)Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID());
|
||||
CAST_PLR(Killer)->KilledMonster(QUEST_TARGET, m_creature->GetGUID());
|
||||
}else
|
||||
DoSpawnCreature(netherwebVictims[rand()%6],0,0,0,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,60000);
|
||||
|
||||
@@ -368,10 +368,10 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI
|
||||
case 29:DoScriptText(SAY_PROGRESS_4, m_creature, player);
|
||||
if (player)
|
||||
{
|
||||
if(((Player*)player)->GetTeam() == ALLIANCE)
|
||||
((Player*)player)->GroupEventHappens(QUEST_EFTW_A, m_creature);
|
||||
else if(((Player*)player)->GetTeam() == HORDE)
|
||||
((Player*)player)->GroupEventHappens(QUEST_EFTW_H, m_creature);
|
||||
if(CAST_PLR(player)->GetTeam() == ALLIANCE)
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_EFTW_A, m_creature);
|
||||
else if(CAST_PLR(player)->GetTeam() == HORDE)
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_EFTW_H, m_creature);
|
||||
} Completed = true;
|
||||
m_creature->SetInFront(player); break;
|
||||
case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
|
||||
@@ -395,10 +395,10 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI
|
||||
Player* player = Unit::GetPlayer(PlayerGUID);
|
||||
if (player && !Completed)
|
||||
{
|
||||
if(((Player*)player)->GetTeam() == ALLIANCE)
|
||||
((Player*)player)->FailQuest(QUEST_EFTW_A);
|
||||
else if(((Player*)player)->GetTeam() == HORDE)
|
||||
((Player*)player)->FailQuest(QUEST_EFTW_H);
|
||||
if(CAST_PLR(player)->GetTeam() == ALLIANCE)
|
||||
CAST_PLR(player)->FailQuest(QUEST_EFTW_A);
|
||||
else if(CAST_PLR(player)->GetTeam() == HORDE)
|
||||
CAST_PLR(player)->FailQuest(QUEST_EFTW_H);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {}
|
||||
case 70:
|
||||
DoScriptText(SAY_FINISH, m_creature, player);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_HOMEWARD_BOUND,m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_HOMEWARD_BOUND,m_creature);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -87,7 +87,7 @@ npc_swiftmountainAI(Creature *c) : npc_escortAI(c) {}
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_HOMEWARD_BOUND);
|
||||
CAST_PLR(player)->FailQuest(QUEST_HOMEWARD_BOUND);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ struct TRINITY_DLL_DECL npc_calvin_montagueAI : public ScriptedAI
|
||||
void JustDied(Unit* Killer)
|
||||
{
|
||||
if( Killer->GetTypeId() == TYPEID_PLAYER )
|
||||
if( ((Player*)Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE )
|
||||
((Player*)Killer)->AreaExploredOrEventHappens(QUEST_590);
|
||||
if( CAST_PLR(Killer)->GetQuestStatus(QUEST_590) == QUEST_STATUS_INCOMPLETE )
|
||||
CAST_PLR(Killer)->AreaExploredOrEventHappens(QUEST_590);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
|
||||
@@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI
|
||||
case 55:
|
||||
DoScriptText(SAY_FINISH, m_creature, player);
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_CHASING_AME,m_creature);
|
||||
CAST_PLR(player)->GroupEventHappens(QUEST_CHASING_AME,m_creature);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI
|
||||
if (PlayerGUID)
|
||||
{
|
||||
if (Player* player = Unit::GetPlayer(PlayerGUID))
|
||||
((Player*)player)->FailQuest(QUEST_CHASING_AME);
|
||||
CAST_PLR(player)->FailQuest(QUEST_CHASING_AME);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -85,7 +85,7 @@ struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI
|
||||
{
|
||||
Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN));
|
||||
if(dalronn && dalronn->isDead())
|
||||
((Creature*)dalronn)->Respawn();
|
||||
CAST_CRE(dalronn)->Respawn();
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED);
|
||||
@@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI
|
||||
{
|
||||
Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD));
|
||||
if(skarvald && skarvald->isDead())
|
||||
((Creature*)skarvald)->Respawn();
|
||||
CAST_CRE(skarvald)->Respawn();
|
||||
|
||||
if(pInstance)
|
||||
pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED);
|
||||
|
||||
@@ -122,32 +122,32 @@ struct TRINITY_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI
|
||||
switch(m_creature->GetAreaId())
|
||||
{
|
||||
case 199: //felstone
|
||||
if( ((Player*)who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
|
||||
((Player*)who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE ||
|
||||
CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
DoSpawnCreature(11075,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||
DoDie();
|
||||
}
|
||||
break;
|
||||
case 200: //dalson
|
||||
if( ((Player*)who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
|
||||
((Player*)who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE ||
|
||||
CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
DoSpawnCreature(11077,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||
DoDie();
|
||||
}
|
||||
break;
|
||||
case 201: //gahrron
|
||||
if( ((Player*)who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
|
||||
((Player*)who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE ||
|
||||
CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
DoSpawnCreature(11078,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||
DoDie();
|
||||
}
|
||||
break;
|
||||
case 202: //writhing
|
||||
if( ((Player*)who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
|
||||
((Player*)who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE )
|
||||
if( CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE ||
|
||||
CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE )
|
||||
{
|
||||
DoSpawnCreature(11076,0,0,0,m_creature->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000);
|
||||
DoDie();
|
||||
|
||||
@@ -257,7 +257,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
|
||||
if(Temp && Temp->isAlive())
|
||||
((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
|
||||
CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim());
|
||||
else
|
||||
{
|
||||
EnterEvadeMode();
|
||||
@@ -353,7 +353,7 @@ struct TRINITY_DLL_DECL boss_hex_lord_malacrassAI : public ScriptedAI
|
||||
{
|
||||
Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]);
|
||||
if(Temp && Temp->isAlive() && !Temp->getVictim())
|
||||
((Creature*)Temp)->AI()->AttackStart(m_creature->getVictim());
|
||||
CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim());
|
||||
}
|
||||
CheckAddState_Timer = 5000;
|
||||
}else CheckAddState_Timer -= diff;
|
||||
|
||||
Reference in New Issue
Block a user