Core/Misc: Remove Unit::Get* wrappers for ObjectAccessor::Get*
This commit is contained in:
1 parent
d36ecbf4a3
commit
1083dbb993
148 files changed
+728
-746
No files matched your search
+2
-2
@@ -292,7 +292,7 @@ public:
|
||||
bHealth = false;
|
||||
bDone = false;
|
||||
|
||||
if (Creature* pMemory = Unit::GetCreature(*me, MemoryGUID))
|
||||
if (Creature* pMemory = ObjectAccessor::GetCreature(*me, MemoryGUID))
|
||||
if (pMemory->IsAlive())
|
||||
pMemory->RemoveFromWorld();
|
||||
}
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
DoCast(me, SPELL_RENEW);
|
||||
break;
|
||||
case 1:
|
||||
if (Creature* pMemory = Unit::GetCreature(*me, MemoryGUID))
|
||||
if (Creature* pMemory = ObjectAccessor::GetCreature(*me, MemoryGUID))
|
||||
if (pMemory->IsAlive())
|
||||
DoCast(pMemory, SPELL_RENEW);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ public:
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
{
|
||||
if (Creature* temp = Unit::GetCreature(*me, *itr))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (temp)
|
||||
temp->DisappearAndDie();
|
||||
}
|
||||
|
||||
+4
-4
@@ -126,9 +126,9 @@ bool GrandChampionsOutVehicle(Creature* me)
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
Creature* pGrandChampion1 = Unit::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_1));
|
||||
Creature* pGrandChampion2 = Unit::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_2));
|
||||
Creature* pGrandChampion3 = Unit::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_3));
|
||||
Creature* pGrandChampion1 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_1));
|
||||
Creature* pGrandChampion2 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_2));
|
||||
Creature* pGrandChampion3 = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_GRAND_CHAMPION_3));
|
||||
|
||||
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
|
||||
{
|
||||
@@ -829,7 +829,7 @@ public:
|
||||
if (bShoot && uiMultiShotTimer <= uiDiff)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
Unit* target = Unit::GetUnit(*me, uiTargetGUID);
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, uiTargetGUID);
|
||||
|
||||
if (target && me->IsInRange(target, 5.0f, 30.0f, false))
|
||||
{
|
||||
|
||||
+5
-5
@@ -161,7 +161,7 @@ public:
|
||||
}
|
||||
|
||||
for (std::list<uint64>::const_iterator itr = TempList.begin(); itr != TempList.end(); ++itr)
|
||||
if (Creature* summon = Unit::GetCreature(*me, *itr))
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
AggroAllPlayers(summon);
|
||||
}else if (uiLesserChampions == 9)
|
||||
StartGrandChampionsAttack();
|
||||
@@ -173,9 +173,9 @@ public:
|
||||
|
||||
void StartGrandChampionsAttack()
|
||||
{
|
||||
Creature* pGrandChampion1 = Unit::GetCreature(*me, uiVehicle1GUID);
|
||||
Creature* pGrandChampion2 = Unit::GetCreature(*me, uiVehicle2GUID);
|
||||
Creature* pGrandChampion3 = Unit::GetCreature(*me, uiVehicle3GUID);
|
||||
Creature* pGrandChampion1 = ObjectAccessor::GetCreature(*me, uiVehicle1GUID);
|
||||
Creature* pGrandChampion2 = ObjectAccessor::GetCreature(*me, uiVehicle2GUID);
|
||||
Creature* pGrandChampion3 = ObjectAccessor::GetCreature(*me, uiVehicle3GUID);
|
||||
|
||||
if (pGrandChampion1 && pGrandChampion2 && pGrandChampion3)
|
||||
{
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
if (!Champion1List.empty())
|
||||
{
|
||||
for (std::list<uint64>::const_iterator itr = Champion1List.begin(); itr != Champion1List.end(); ++itr)
|
||||
if (Creature* summon = Unit::GetCreature(*me, *itr))
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
AggroAllPlayers(summon);
|
||||
NextStep(0, false);
|
||||
}
|
||||
|
||||
+2
-2
@@ -344,7 +344,7 @@ class boss_anubarak_trial : public CreatureScript
|
||||
uint32 at = urand(0, _burrowGUID.size()-1);
|
||||
for (uint32 k = 0; k < at; k++)
|
||||
++i;
|
||||
if (Creature* pBurrow = Unit::GetCreature(*me, *i))
|
||||
if (Creature* pBurrow = ObjectAccessor::GetCreature(*me, *i))
|
||||
pBurrow->CastSpell(pBurrow, 66340, false);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON_SCARAB, 4*IN_MILLISECONDS, 0, PHASE_SUBMERGED);
|
||||
@@ -377,7 +377,7 @@ class boss_anubarak_trial : public CreatureScript
|
||||
uint8 i = startAt;
|
||||
do
|
||||
{
|
||||
if (Unit* pSphere = Unit::GetCreature(*me, _sphereGUID[i]))
|
||||
if (Unit* pSphere = ObjectAccessor::GetCreature(*me, _sphereGUID[i]))
|
||||
{
|
||||
if (!pSphere->HasAura(SPELL_FROST_SPHERE))
|
||||
{
|
||||
|
||||
+9
-9
@@ -479,7 +479,7 @@ class boss_toc_champion_controller : public CreatureScript
|
||||
case 1:
|
||||
for (std::list<uint64>::iterator i = _summons.begin(); i != _summons.end(); ++i)
|
||||
{
|
||||
if (Creature* temp = Unit::GetCreature(*me, *i))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, *i))
|
||||
{
|
||||
temp->SetReactState(REACT_AGGRESSIVE);
|
||||
temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC);
|
||||
@@ -559,7 +559,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
void JustReachedHome() override
|
||||
{
|
||||
if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
if (Creature* pChampionController = ObjectAccessor::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
pChampionController->AI()->SetData(2, FAIL);
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
@@ -577,7 +577,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
std::list<HostileReference*> const& tList = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = tList.begin(); itr != tList.end(); ++itr)
|
||||
{
|
||||
Unit* unit = Unit::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (unit && me->getThreatManager().getThreat(unit))
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -609,7 +609,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (_aiType != AI_PET)
|
||||
if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
if (Creature* pChampionController = ObjectAccessor::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
pChampionController->AI()->SetData(2, DONE);
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
{
|
||||
DoCast(me, SPELL_ANTI_AOE, true);
|
||||
_EnterCombat();
|
||||
if (Creature* pChampionController = Unit::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
if (Creature* pChampionController = ObjectAccessor::GetCreature((*me), instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
pChampionController->AI()->SetData(2, IN_PROGRESS);
|
||||
}
|
||||
|
||||
@@ -634,11 +634,11 @@ struct boss_faction_championsAI : public BossAI
|
||||
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
{
|
||||
if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_VARIAN)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_VARIAN)))
|
||||
temp->AI()->Talk(SAY_KILL_PLAYER);
|
||||
}
|
||||
else
|
||||
if (Creature* temp = Unit::GetCreature(*me, instance->GetData64(NPC_GARROSH)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_GARROSH)))
|
||||
temp->AI()->Talk(SAY_KILL_PLAYER);
|
||||
|
||||
|
||||
@@ -663,7 +663,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
Unit* target;
|
||||
for (iter = tList.begin(); iter!=tList.end(); ++iter)
|
||||
{
|
||||
target = Unit::GetUnit(*me, (*iter)->getUnitGuid());
|
||||
target = ObjectAccessor::GetUnit(*me, (*iter)->getUnitGuid());
|
||||
if (target && target->getPowerType() == POWER_MANA)
|
||||
return target;
|
||||
}
|
||||
@@ -678,7 +678,7 @@ struct boss_faction_championsAI : public BossAI
|
||||
Unit* target;
|
||||
for (iter = tList.begin(); iter != tList.end(); ++iter)
|
||||
{
|
||||
target = Unit::GetUnit(*me, (*iter)->getUnitGuid());
|
||||
target = ObjectAccessor::GetUnit(*me, (*iter)->getUnitGuid());
|
||||
if (target && me->GetDistance2d(target) < distance)
|
||||
++count;
|
||||
}
|
||||
|
||||
+1
-1
@@ -508,7 +508,7 @@ struct boss_jormungarAI : public BossAI
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* otherWorm = Unit::GetCreature(*me, instance->GetData64(OtherWormEntry)))
|
||||
if (Creature* otherWorm = ObjectAccessor::GetCreature(*me, instance->GetData64(OtherWormEntry)))
|
||||
{
|
||||
if (!otherWorm->IsAlive())
|
||||
{
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ struct boss_twin_baseAI : public BossAI
|
||||
// Called when sister pointer needed
|
||||
Creature* GetSister()
|
||||
{
|
||||
return Unit::GetCreature((*me), instance->GetData64(SisterNpcId));
|
||||
return ObjectAccessor::GetCreature((*me), instance->GetData64(SisterNpcId));
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
|
||||
// make sure Anub'arak isnt missing and floor is destroyed after a crash
|
||||
if (GetBossState(BOSS_LICH_KING) == DONE && TrialCounter && GetBossState(BOSS_ANUBARAK) != DONE)
|
||||
{
|
||||
Creature* anubArak = Unit::GetCreature(*player, GetData64(NPC_ANUBARAK));
|
||||
Creature* anubArak = ObjectAccessor::GetCreature(*player, GetData64(NPC_ANUBARAK));
|
||||
if (!anubArak)
|
||||
anubArak = player->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
|
||||
|
||||
|
||||
+14
-14
@@ -173,7 +173,7 @@ class npc_announcer_toc10 : public CreatureScript
|
||||
else if (instance->GetBossState(BOSS_JARAXXUS) != DONE)
|
||||
{
|
||||
// if Jaraxxus is spawned, but the raid wiped
|
||||
if (Creature* jaraxxus = Unit::GetCreature(*player, instance->GetData64(NPC_JARAXXUS)))
|
||||
if (Creature* jaraxxus = ObjectAccessor::GetCreature(*player, instance->GetData64(NPC_JARAXXUS)))
|
||||
{
|
||||
jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS);
|
||||
jaraxxus->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
@@ -207,7 +207,7 @@ class npc_announcer_toc10 : public CreatureScript
|
||||
creature->CastSpell(creature, SPELL_CORPSE_TELEPORT, false);
|
||||
creature->CastSpell(creature, SPELL_DESTROY_FLOOR_KNOCKUP, false);
|
||||
|
||||
Creature* anubArak = Unit::GetCreature(*creature, instance->GetData64(NPC_ANUBARAK));
|
||||
Creature* anubArak = ObjectAccessor::GetCreature(*creature, instance->GetData64(NPC_ANUBARAK));
|
||||
if (!anubArak || !anubArak->IsAlive())
|
||||
anubArak = creature->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
|
||||
|
||||
@@ -330,7 +330,7 @@ class boss_lich_king_toc : public CreatureScript
|
||||
me->CastSpell(me, SPELL_DESTROY_FLOOR_KNOCKUP, false);
|
||||
|
||||
_instance->SetBossState(BOSS_LICH_KING, DONE);
|
||||
Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_ANUBARAK));
|
||||
Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_ANUBARAK));
|
||||
if (!temp || !temp->IsAlive())
|
||||
temp = me->SummonCreature(NPC_ANUBARAK, AnubarakLoc[0].GetPositionX(), AnubarakLoc[0].GetPositionY(), AnubarakLoc[0].GetPositionZ(), 3, TEMPSUMMON_CORPSE_TIMED_DESPAWN, DESPAWN_TIME);
|
||||
|
||||
@@ -377,7 +377,7 @@ class npc_fizzlebang_toc : public CreatureScript
|
||||
{
|
||||
Talk(SAY_STAGE_1_06, killer);
|
||||
_instance->SetData(TYPE_EVENT, 1180);
|
||||
if (Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
{
|
||||
temp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
temp->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -484,23 +484,23 @@ class npc_fizzlebang_toc : public CreatureScript
|
||||
_updateTimer = 5*IN_MILLISECONDS;
|
||||
break;
|
||||
case 1142:
|
||||
if (Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
temp->SetTarget(me->GetGUID());
|
||||
if (Creature* pTrigger = Unit::GetCreature(*me, _triggerGUID))
|
||||
if (Creature* pTrigger = ObjectAccessor::GetCreature(*me, _triggerGUID))
|
||||
pTrigger->DespawnOrUnsummon();
|
||||
if (Creature* pPortal = Unit::GetCreature(*me, _portalGUID))
|
||||
if (Creature* pPortal = ObjectAccessor::GetCreature(*me, _portalGUID))
|
||||
pPortal->DespawnOrUnsummon();
|
||||
_instance->SetData(TYPE_EVENT, 1144);
|
||||
_updateTimer = 10*IN_MILLISECONDS;
|
||||
break;
|
||||
case 1144:
|
||||
if (Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
temp->AI()->Talk(SAY_STAGE_1_05);
|
||||
_instance->SetData(TYPE_EVENT, 1150);
|
||||
_updateTimer = 5*IN_MILLISECONDS;
|
||||
break;
|
||||
case 1150:
|
||||
if (Creature* temp = Unit::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature(*me, _instance->GetData64(NPC_JARAXXUS)))
|
||||
{
|
||||
//1-shot Fizzlebang
|
||||
temp->CastSpell(me, 67888, false);
|
||||
@@ -699,7 +699,7 @@ class npc_tirion_toc : public CreatureScript
|
||||
_instance->SetData(TYPE_EVENT, 3092);
|
||||
break;
|
||||
case 3092:
|
||||
if (Creature* pChampionController = Unit::GetCreature((*me), _instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
if (Creature* pChampionController = ObjectAccessor::GetCreature((*me), _instance->GetData64(NPC_CHAMPIONS_CONTROLLER)))
|
||||
pChampionController->AI()->SetData(1, NOT_STARTED);
|
||||
_instance->SetData(TYPE_EVENT, 3095);
|
||||
break;
|
||||
@@ -735,12 +735,12 @@ class npc_tirion_toc : public CreatureScript
|
||||
break;
|
||||
case 4015:
|
||||
_instance->DoUseDoorOrButton(_instance->GetData64(GO_MAIN_GATE_DOOR));
|
||||
if (Creature* temp = Unit::GetCreature((*me), _instance->GetData64(NPC_LIGHTBANE)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature((*me), _instance->GetData64(NPC_LIGHTBANE)))
|
||||
{
|
||||
temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[8].GetPositionX(), ToCCommonLoc[8].GetPositionY(), ToCCommonLoc[8].GetPositionZ());
|
||||
temp->SetVisible(true);
|
||||
}
|
||||
if (Creature* temp = Unit::GetCreature((*me), _instance->GetData64(NPC_DARKBANE)))
|
||||
if (Creature* temp = ObjectAccessor::GetCreature((*me), _instance->GetData64(NPC_DARKBANE)))
|
||||
{
|
||||
temp->GetMotionMaster()->MovePoint(1, ToCCommonLoc[9].GetPositionX(), ToCCommonLoc[9].GetPositionY(), ToCCommonLoc[9].GetPositionZ());
|
||||
temp->SetVisible(true);
|
||||
@@ -779,7 +779,7 @@ class npc_tirion_toc : public CreatureScript
|
||||
_instance->SetData(TYPE_EVENT, 6005);
|
||||
break;
|
||||
case 6005:
|
||||
if (Creature* tirionFordring = Unit::GetCreature((*me), _instance->GetData64(NPC_TIRION_FORDRING)))
|
||||
if (Creature* tirionFordring = ObjectAccessor::GetCreature((*me), _instance->GetData64(NPC_TIRION_FORDRING)))
|
||||
tirionFordring->AI()->Talk(SAY_STAGE_4_06);
|
||||
_updateTimer = 20*IN_MILLISECONDS;
|
||||
_instance->SetData(TYPE_EVENT, 6010);
|
||||
@@ -787,7 +787,7 @@ class npc_tirion_toc : public CreatureScript
|
||||
case 6010:
|
||||
if (IsHeroic())
|
||||
{
|
||||
if (Creature* tirionFordring = Unit::GetCreature((*me), _instance->GetData64(NPC_TIRION_FORDRING)))
|
||||
if (Creature* tirionFordring = ObjectAccessor::GetCreature((*me), _instance->GetData64(NPC_TIRION_FORDRING)))
|
||||
tirionFordring->AI()->Talk(SAY_STAGE_4_07);
|
||||
_updateTimer = 1*MINUTE*IN_MILLISECONDS;
|
||||
_instance->SetBossState(BOSS_ANUBARAK, SPECIAL);
|
||||
|
||||
Reference in new issue
Block a user