mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
refactor(Core/Object): adds consistency in the use of type object check (#19671)
This commit is contained in:
@@ -673,7 +673,7 @@ struct boss_nefarian : public BossAI
|
||||
{
|
||||
for (auto& ref : me->GetThreatMgr().GetThreatList())
|
||||
{
|
||||
if (ref->getTarget() && ref->getTarget()->GetTypeId() == TYPEID_PLAYER)
|
||||
if (ref->getTarget() && ref->getTarget()->IsPlayer())
|
||||
{
|
||||
classesPresent.insert(ref->getTarget()->getClass());
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ struct boss_curator : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ struct boss_maiden_of_virtue : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ struct boss_attumen : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ struct boss_moroes : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (!_recentlySpoken && victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!_recentlySpoken && victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
_recentlySpoken = true;
|
||||
|
||||
@@ -149,7 +149,7 @@ struct boss_netherspite : public BossAI
|
||||
}
|
||||
}
|
||||
// buff the target
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->IsPlayer())
|
||||
{
|
||||
target->AddAura(PlayerBuff[j], target);
|
||||
}
|
||||
@@ -177,7 +177,7 @@ struct boss_netherspite : public BossAI
|
||||
}
|
||||
}
|
||||
// aggro target if Red Beam
|
||||
if (j == RED_PORTAL && me->GetVictim() != target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (j == RED_PORTAL && me->GetVictim() != target && target->IsPlayer())
|
||||
{
|
||||
me->GetThreatMgr().AddThreat(target, 100000.0f + DoGetThreat(me->GetVictim()));
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ struct boss_terestian_illhoof : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ struct boss_felblood_kaelthas : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!introSpeak && me->IsWithinDistInMap(who, 40.0f) && who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!introSpeak && me->IsWithinDistInMap(who, 40.0f) && who->IsPlayer())
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
introSpeak = true;
|
||||
|
||||
@@ -292,7 +292,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tList.begin(); itr != tList.end(); ++itr)
|
||||
{
|
||||
Unit* pUnit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER && me->GetThreatMgr().GetThreat(pUnit))
|
||||
if (pUnit && pUnit->IsPlayer() && me->GetThreatMgr().GetThreat(pUnit))
|
||||
{
|
||||
float threatMod = GetThreatMod(me->GetDistance2d(pUnit), (float)pUnit->GetArmor(), pUnit->GetHealth(), pUnit->GetMaxHealth(), pUnit);
|
||||
me->GetThreatMgr().ModifyThreatByPercent(pUnit, -100);
|
||||
|
||||
@@ -116,7 +116,7 @@ struct boss_selin_fireheart : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ struct boss_vexallus : public BossAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->IsAlive() && !speechCounter)
|
||||
if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->IsPlayer() && me->IsAlive() && !speechCounter)
|
||||
{
|
||||
if (Player* player = caster->ToPlayer())
|
||||
{
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && roll_chance_i(50))
|
||||
if (victim->IsPlayer() && roll_chance_i(50))
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0, 1))
|
||||
if (victim->IsPlayer() && urand(0, 1))
|
||||
Talk(YELL_SAC_KILL);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0, 1))
|
||||
if (victim->IsPlayer() && urand(0, 1))
|
||||
Talk(YELL_SAC_KILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && roll_chance_i(50))
|
||||
if (victim->IsPlayer() && roll_chance_i(50))
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && roll_chance_i(50))
|
||||
if (victim->IsPlayer() && roll_chance_i(50))
|
||||
Talk(SAY_EVIL_SLAY);
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* target) override
|
||||
{
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (target->IsPlayer())
|
||||
Talk(SAY_SATH_SLAY);
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && events.GetNextEventTime(EVENT_NO_KILL_TALK) == 0)
|
||||
if (victim->IsPlayer() && events.GetNextEventTime(EVENT_NO_KILL_TALK) == 0)
|
||||
Talk(SAY_KJ_SLAY);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (who->IsPlayer())
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ public:
|
||||
|
||||
void SpellHit(Unit* caster, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == NPC_FOREST_FROG)
|
||||
if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->IsPlayer() && me->GetEntry() == NPC_FOREST_FROG)
|
||||
{
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->SetFacingToObject(caster);
|
||||
|
||||
@@ -299,7 +299,7 @@ class spell_enveloping_webs : public SpellScript
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* hitUnit = GetHitUnit();
|
||||
if (caster && hitUnit && hitUnit->GetTypeId() == TYPEID_PLAYER)
|
||||
if (caster && hitUnit && hitUnit->IsPlayer())
|
||||
{
|
||||
caster->GetThreatMgr().ModifyThreatByPercent(hitUnit, -100);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ struct boss_twilight_corrupter : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!_introSpoken && who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!_introSpoken && who->IsPlayer())
|
||||
{
|
||||
_introSpoken = true;
|
||||
Talk(SAY_RESPAWN, who);
|
||||
@@ -102,7 +102,7 @@ struct boss_twilight_corrupter : public ScriptedAI
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_KILL, victim);
|
||||
DoCastSelf(SPELL_SWELL_OF_SOULS);
|
||||
|
||||
@@ -499,7 +499,7 @@ public:
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (!announced && who->GetTypeId() == TYPEID_PLAYER && who->GetPositionZ() < 30.0f)
|
||||
if (!announced && who->IsPlayer() && who->GetPositionZ() < 30.0f)
|
||||
{
|
||||
announced = true;
|
||||
playerGUID = who->GetGUID();
|
||||
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
|
||||
m_uiPhase = 1;
|
||||
|
||||
if (pDoneBy->GetTypeId() == TYPEID_PLAYER)
|
||||
if (pDoneBy->IsPlayer())
|
||||
{
|
||||
m_uiPlayerGUID = pDoneBy->GetGUID();
|
||||
}
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
if (Unit* owner = pDoneBy->GetOwner())
|
||||
{
|
||||
// not sure if this is needed.
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
if (owner->IsPlayer())
|
||||
{
|
||||
m_uiPlayerGUID = owner->GetGUID();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user