Core/SAI: Add check so npc will not send text to pet. Also updated isPet() to IsPet().
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
|
||||
int PetAI::Permissible(const Creature* creature)
|
||||
{
|
||||
if (creature->isPet())
|
||||
if (creature->IsPet())
|
||||
return PERMIT_BASE_SPECIAL;
|
||||
|
||||
return PERMIT_BASE_NO;
|
||||
@@ -580,19 +580,19 @@ void PetAI::ReceiveEmote(Player* player, uint32 emote)
|
||||
switch (emote)
|
||||
{
|
||||
case TEXT_EMOTE_COWER:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(/*EMOTE_ONESHOT_ROAR*/EMOTE_ONESHOT_OMNICAST_GHOUL);
|
||||
break;
|
||||
case TEXT_EMOTE_ANGRY:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(/*EMOTE_ONESHOT_COWER*/EMOTE_STATE_STUN);
|
||||
break;
|
||||
case TEXT_EMOTE_GLARE:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(EMOTE_STATE_STUN);
|
||||
break;
|
||||
case TEXT_EMOTE_SOOTHE:
|
||||
if (me->isPet() && me->ToPet()->IsPetGhoul())
|
||||
if (me->IsPet() && me->ToPet()->IsPetGhoul())
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_OMNICAST_GHOUL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace FactorySelector
|
||||
const CreatureAICreator* ai_factory = NULL;
|
||||
CreatureAIRegistry& ai_registry(*CreatureAIRepository::instance());
|
||||
|
||||
if (creature->isPet())
|
||||
if (creature->IsPet())
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
|
||||
//scriptname in db
|
||||
|
||||
@@ -166,7 +166,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
{
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if (IsCreature((*itr)))
|
||||
if (IsCreature((*itr)) && !(*itr)->ToCreature()->IsPet()) // Prevented sending text to pets.
|
||||
{
|
||||
talker = (*itr)->ToCreature();
|
||||
break;
|
||||
|
||||
@@ -309,7 +309,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags
|
||||
if (unit)
|
||||
{
|
||||
if ((spellFlags & SPELL_DISABLE_PLAYER && unit->GetTypeId() == TYPEID_PLAYER) ||
|
||||
(unit->GetTypeId() == TYPEID_UNIT && ((unit->ToCreature()->isPet() && spellFlags & SPELL_DISABLE_PET) || spellFlags & SPELL_DISABLE_CREATURE)))
|
||||
(unit->GetTypeId() == TYPEID_UNIT && ((unit->ToCreature()->IsPet() && spellFlags & SPELL_DISABLE_PET) || spellFlags & SPELL_DISABLE_CREATURE)))
|
||||
{
|
||||
if (spellFlags & SPELL_DISABLE_MAP)
|
||||
{
|
||||
|
||||
@@ -1022,7 +1022,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
|
||||
void Creature::SelectLevel(const CreatureTemplate* cinfo)
|
||||
{
|
||||
uint32 rank = isPet()? 0 : cinfo->rank;
|
||||
uint32 rank = IsPet()? 0 : cinfo->rank;
|
||||
|
||||
// level
|
||||
uint8 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel);
|
||||
@@ -1427,7 +1427,7 @@ void Creature::setDeathState(DeathState s)
|
||||
|
||||
setActive(false);
|
||||
|
||||
if (!isPet() && GetCreatureTemplate()->SkinLootId)
|
||||
if (!IsPet() && GetCreatureTemplate()->SkinLootId)
|
||||
if (LootTemplates_Skinning.HaveLootFor(GetCreatureTemplate()->SkinLootId))
|
||||
if (hasLootRecipient())
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
@@ -1449,7 +1449,7 @@ void Creature::setDeathState(DeathState s)
|
||||
}
|
||||
else if (s == JUST_RESPAWNED)
|
||||
{
|
||||
//if (isPet())
|
||||
//if (IsPet())
|
||||
// setActive(true);
|
||||
SetFullHealth();
|
||||
SetLootRecipient(NULL);
|
||||
@@ -1593,7 +1593,7 @@ bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index)
|
||||
|
||||
bool Creature::isElite() const
|
||||
{
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
return false;
|
||||
|
||||
uint32 rank = GetCreatureTemplate()->rank;
|
||||
@@ -1602,7 +1602,7 @@ bool Creature::isElite() const
|
||||
|
||||
bool Creature::isWorldBoss() const
|
||||
{
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
return false;
|
||||
|
||||
return GetCreatureTemplate()->type_flags & CREATURE_TYPEFLAGS_BOSS;
|
||||
@@ -1783,7 +1783,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
|
||||
|
||||
void Creature::CallAssistance()
|
||||
{
|
||||
if (!m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed())
|
||||
if (!m_AlreadyCallAssistance && getVictim() && !IsPet() && !isCharmed())
|
||||
{
|
||||
SetNoCallAssistance(true);
|
||||
|
||||
@@ -1823,7 +1823,7 @@ void Creature::CallAssistance()
|
||||
|
||||
void Creature::CallForHelp(float radius)
|
||||
{
|
||||
if (radius <= 0.0f || !getVictim() || isPet() || isCharmed())
|
||||
if (radius <= 0.0f || !getVictim() || IsPet() || isCharmed())
|
||||
return;
|
||||
|
||||
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
|
||||
@@ -2467,7 +2467,7 @@ float Creature::GetAggroRange(Unit const* target) const
|
||||
// Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection.
|
||||
// Based on data from wowwiki due to lack of 3.3.5a data
|
||||
|
||||
if (target && this->isPet())
|
||||
if (target && this->IsPet())
|
||||
{
|
||||
uint32 targetLevel = 0;
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ void TempSummon::Update(uint32 diff)
|
||||
|
||||
void TempSummon::InitStats(uint32 duration)
|
||||
{
|
||||
ASSERT(!isPet());
|
||||
ASSERT(!IsPet());
|
||||
|
||||
m_timer = duration;
|
||||
m_lifetime = duration;
|
||||
@@ -241,8 +241,8 @@ void TempSummon::UnSummon(uint32 msTime)
|
||||
return;
|
||||
}
|
||||
|
||||
//ASSERT(!isPet());
|
||||
if (isPet())
|
||||
//ASSERT(!IsPet());
|
||||
if (IsPet())
|
||||
{
|
||||
((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
|
||||
ASSERT(!IsInWorld());
|
||||
@@ -310,7 +310,7 @@ void Minion::RemoveFromWorld()
|
||||
|
||||
bool Minion::IsGuardianPet() const
|
||||
{
|
||||
return isPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
|
||||
return IsPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
|
||||
}
|
||||
|
||||
Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) : Minion(properties, owner, isWorldObject)
|
||||
|
||||
@@ -832,7 +832,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
|
||||
//Determine pet type
|
||||
PetType petType = MAX_PET_TYPE;
|
||||
if (isPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
if (IsPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (GetOwner()->getClass() == CLASS_WARLOCK
|
||||
|| GetOwner()->getClass() == CLASS_SHAMAN // Fire Elemental
|
||||
|
||||
@@ -22168,7 +22168,7 @@ inline void BeforeVisibilityDestroy(T* /*t*/, Player* /*p*/)
|
||||
template<>
|
||||
inline void BeforeVisibilityDestroy<Creature>(Creature* t, Player* p)
|
||||
{
|
||||
if (p->GetPetGUID() == t->GetGUID() && t->ToCreature()->isPet())
|
||||
if (p->GetPetGUID() == t->GetGUID() && t->ToCreature()->IsPet())
|
||||
((Pet*)t)->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
}
|
||||
|
||||
@@ -23477,7 +23477,7 @@ bool Player::isHonorOrXPTarget(Unit* victim)
|
||||
if (victim->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (victim->ToCreature()->isTotem() ||
|
||||
victim->ToCreature()->isPet() ||
|
||||
victim->ToCreature()->IsPet() ||
|
||||
victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL)
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ bool Guardian::UpdateStats(Stats stat)
|
||||
}
|
||||
else if (stat == STAT_STAMINA)
|
||||
{
|
||||
if (owner->getClass() == CLASS_WARLOCK && isPet())
|
||||
if (owner->getClass() == CLASS_WARLOCK && IsPet())
|
||||
{
|
||||
ownersBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 75);
|
||||
value += ownersBonus;
|
||||
@@ -1134,7 +1134,7 @@ bool Guardian::UpdateStats(Stats stat)
|
||||
else
|
||||
{
|
||||
mod = 0.45f;
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
{
|
||||
PetSpellMap::const_iterator itr = (ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
|
||||
if (itr == ToPet()->m_spells.end())
|
||||
@@ -1206,7 +1206,7 @@ void Guardian::UpdateResistances(uint32 school)
|
||||
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
|
||||
|
||||
// hunter and warlock pets gain 40% of owner's resistance
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
value += float(CalculatePct(m_owner->GetResistance(SpellSchools(school)), 40));
|
||||
|
||||
SetResistance(SpellSchools(school), int32(value));
|
||||
@@ -1222,7 +1222,7 @@ void Guardian::UpdateArmor()
|
||||
UnitMods unitMod = UNIT_MOD_ARMOR;
|
||||
|
||||
// hunter and warlock pets gain 35% of owner's armor value
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
bonus_armor = float(CalculatePct(m_owner->GetArmor(), 35));
|
||||
|
||||
value = GetModifierValue(unitMod, BASE_VALUE);
|
||||
@@ -1304,7 +1304,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
if (isHunterPet()) //hunter pets benefit from owner's attack power
|
||||
{
|
||||
float mod = 1.0f; //Hunter contribution modifier
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
{
|
||||
PetSpellMap::const_iterator itr = ToPet()->m_spells.find(62758); //Wild Hunt rank 1
|
||||
if (itr == ToPet()->m_spells.end())
|
||||
@@ -1334,7 +1334,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged)
|
||||
SetBonusDamage(int32(owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier));
|
||||
}
|
||||
//demons benefit from warlocks shadow or fire damage
|
||||
else if (isPet())
|
||||
else if (IsPet())
|
||||
{
|
||||
int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
|
||||
int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
|
||||
|
||||
@@ -333,7 +333,7 @@ void Unit::Update(uint32 p_time)
|
||||
SendThreatListUpdate();
|
||||
|
||||
// update combat timer only for players and pets (only pets with PetAI)
|
||||
if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->isPet() && IsControlledByPlayer())))
|
||||
if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || (ToCreature()->IsPet() && IsControlledByPlayer())))
|
||||
{
|
||||
// Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
|
||||
// targets without stopping half way there and running off.
|
||||
@@ -583,7 +583,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
}
|
||||
|
||||
// Signal the pet it was attacked so the AI can respond if needed
|
||||
if (victim->GetTypeId() == TYPEID_UNIT && this != victim && victim->isPet() && victim->isAlive())
|
||||
if (victim->GetTypeId() == TYPEID_UNIT && this != victim && victim->IsPet() && victim->isAlive())
|
||||
victim->ToPet()->AI()->AttackedBy(this);
|
||||
|
||||
if (damagetype != NODAMAGE)
|
||||
@@ -2085,8 +2085,8 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackT
|
||||
|
||||
// Max 40% chance to score a glancing blow against mobs that are higher level (can do only players and pets and not with ranged weapon)
|
||||
if (attType != RANGED_ATTACK &&
|
||||
(GetTypeId() == TYPEID_PLAYER || ToCreature()->isPet()) &&
|
||||
victim->GetTypeId() != TYPEID_PLAYER && !victim->ToCreature()->isPet() &&
|
||||
(GetTypeId() == TYPEID_PLAYER || ToCreature()->IsPet()) &&
|
||||
victim->GetTypeId() != TYPEID_PLAYER && !victim->ToCreature()->IsPet() &&
|
||||
getLevel() < victim->getLevelForTarget(this))
|
||||
{
|
||||
// cap possible value (with bonuses > max skill)
|
||||
@@ -3148,7 +3148,7 @@ bool Unit::IsUnderWater() const
|
||||
|
||||
void Unit::UpdateUnderwaterState(Map* m, float x, float y, float z)
|
||||
{
|
||||
if (!isPet() && !IsVehicle())
|
||||
if (!IsPet() && !IsVehicle())
|
||||
return;
|
||||
|
||||
LiquidData liquid_status;
|
||||
@@ -8442,7 +8442,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
case 48090:
|
||||
{
|
||||
// Get talent aura from owner
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
if (Unit* owner = GetOwner())
|
||||
{
|
||||
if (AuraEffect* aurEff = owner->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 3220, 0))
|
||||
@@ -8999,7 +8999,7 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
//if (GetTypeId() == TYPEID_UNIT)
|
||||
// ToCreature()->SetCombatStartPosition(GetPositionX(), GetPositionY(), GetPositionZ());
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet())
|
||||
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
|
||||
{
|
||||
// should not let player enter combat by right clicking target - doesn't helps
|
||||
SetInCombatWith(victim);
|
||||
@@ -9355,10 +9355,10 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
{
|
||||
if (Guardian* oldPet = GetGuardianPet())
|
||||
{
|
||||
if (oldPet != minion && (oldPet->isPet() || minion->isPet() || oldPet->GetEntry() != minion->GetEntry()))
|
||||
if (oldPet != minion && (oldPet->IsPet() || minion->IsPet() || oldPet->GetEntry() != minion->GetEntry()))
|
||||
{
|
||||
// remove existing minion pet
|
||||
if (oldPet->isPet())
|
||||
if (oldPet->IsPet())
|
||||
((Pet*)oldPet)->Remove(PET_SAVE_AS_CURRENT);
|
||||
else
|
||||
oldPet->UnSummon();
|
||||
@@ -9389,7 +9389,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
minion->SetByteValue(UNIT_FIELD_BYTES_2, 1, GetByteValue(UNIT_FIELD_BYTES_2, 1));
|
||||
|
||||
// FIXME: hack, speed must be set only at follow
|
||||
if (GetTypeId() == TYPEID_PLAYER && minion->isPet())
|
||||
if (GetTypeId() == TYPEID_PLAYER && minion->IsPet())
|
||||
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
|
||||
minion->SetSpeed(UnitMoveType(i), m_speed_rate[i], true);
|
||||
|
||||
@@ -9477,7 +9477,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
// show another pet bar if there is no charm bar
|
||||
if (GetTypeId() == TYPEID_PLAYER && !GetCharmGUID())
|
||||
{
|
||||
if ((*itr)->isPet())
|
||||
if ((*itr)->IsPet())
|
||||
ToPlayer()->PetSpellInitialize();
|
||||
else
|
||||
ToPlayer()->CharmSpellInitialize();
|
||||
@@ -9730,7 +9730,7 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
player = ToPlayer();
|
||||
// Should we enable this also for charmed units?
|
||||
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->isPet())
|
||||
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsPet())
|
||||
player = GetOwner()->ToPlayer();
|
||||
|
||||
if (!player)
|
||||
@@ -9895,7 +9895,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
|
||||
int32 DoneTotal = 0;
|
||||
|
||||
// Pet damage?
|
||||
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet())
|
||||
if (GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
|
||||
DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank);
|
||||
|
||||
// Some spells don't benefit from pct done mods
|
||||
@@ -10174,7 +10174,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
|
||||
if (HasAura(100001))
|
||||
DoneTotalMod *= 4;
|
||||
// Shadow Bite (15% increase from each dot)
|
||||
if (spellProto->SpellFamilyFlags[1] & 0x00400000 && isPet())
|
||||
if (spellProto->SpellFamilyFlags[1] & 0x00400000 && IsPet())
|
||||
if (uint8 count = victim->GetDoTsByCaster(GetOwnerGUID()))
|
||||
AddPct(DoneTotalMod, 15 * count);
|
||||
break;
|
||||
@@ -11670,7 +11670,7 @@ void Unit::CombatStart(Unit* target, bool initialAggro)
|
||||
if (!target->isInCombat() && target->GetTypeId() != TYPEID_PLAYER
|
||||
&& !target->ToCreature()->HasReactState(REACT_PASSIVE) && target->ToCreature()->IsAIEnabled)
|
||||
{
|
||||
if (target->isPet())
|
||||
if (target->IsPet())
|
||||
target->ToCreature()->AI()->AttackedBy(this); // PetAI has special handler before AttackStart()
|
||||
else
|
||||
target->ToCreature()->AI()->AttackStart(this);
|
||||
@@ -11726,7 +11726,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
|
||||
creature->GetFormation()->MemberAttackStart(creature, enemy);
|
||||
}
|
||||
|
||||
if (isPet())
|
||||
if (IsPet())
|
||||
{
|
||||
UpdateSpeed(MOVE_RUN, true);
|
||||
UpdateSpeed(MOVE_SWIM, true);
|
||||
@@ -11759,7 +11759,7 @@ void Unit::ClearInCombat()
|
||||
if (HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TAPPED))
|
||||
SetUInt32Value(UNIT_DYNAMIC_FLAGS, creature->GetCreatureTemplate()->dynamicflags);
|
||||
|
||||
if (creature->isPet())
|
||||
if (creature->IsPet())
|
||||
{
|
||||
if (Unit* owner = GetOwner())
|
||||
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
|
||||
@@ -12008,7 +12008,7 @@ int32 Unit::ModifyHealth(int32 dVal)
|
||||
return 0;
|
||||
|
||||
// Part of Evade mechanics. Only track health lost, not gained.
|
||||
if (dVal < 0 && GetTypeId() != TYPEID_PLAYER && !isPet())
|
||||
if (dVal < 0 && GetTypeId() != TYPEID_PLAYER && !IsPet())
|
||||
SetLastDamagedTime(time(NULL));
|
||||
|
||||
int32 curHealth = (int32)GetHealth();
|
||||
@@ -12240,7 +12240,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Unit* pOwner = GetCharmerOrOwner();
|
||||
if ((isPet() || isGuardian()) && !isInCombat() && pOwner) // Must check for owner or crash on "Tame Beast"
|
||||
if ((IsPet() || isGuardian()) && !isInCombat() && pOwner) // Must check for owner or crash on "Tame Beast"
|
||||
{
|
||||
// For every yard over 5, increase speed by 0.01
|
||||
// to help prevent pet from lagging behind and despawning
|
||||
@@ -13428,9 +13428,9 @@ uint32 Unit::GetCreatePowers(Powers power) const
|
||||
{
|
||||
case POWER_MANA: return GetCreateMana();
|
||||
case POWER_RAGE: return 1000;
|
||||
case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100);
|
||||
case POWER_FOCUS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 100);
|
||||
case POWER_ENERGY: return 100;
|
||||
case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->isPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 1050000);
|
||||
case POWER_HAPPINESS: return (GetTypeId() == TYPEID_PLAYER || !((Creature const*)this)->IsPet() || ((Pet const*)this)->getPetType() != HUNTER_PET ? 0 : 1050000);
|
||||
case POWER_RUNIC_POWER: return 1000;
|
||||
case POWER_RUNE: return 0;
|
||||
case POWER_HEALTH: return 0;
|
||||
@@ -14382,7 +14382,7 @@ Player* Unit::GetSpellModOwner() const
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
return (Player*)this;
|
||||
if (ToCreature()->isPet() || ToCreature()->isTotem())
|
||||
if (ToCreature()->IsPet() || ToCreature()->isTotem())
|
||||
{
|
||||
Unit* owner = GetOwner();
|
||||
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -14671,7 +14671,7 @@ void Unit::ApplyCastTimePercentMod(float val, bool apply)
|
||||
uint32 Unit::GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime) const
|
||||
{
|
||||
// Not apply this to creature casted spells with casttime == 0
|
||||
if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->isPet())
|
||||
if (CastingTime == 0 && GetTypeId() == TYPEID_UNIT && !ToCreature()->IsPet())
|
||||
return 3500;
|
||||
|
||||
if (CastingTime > 7000) CastingTime = 7000;
|
||||
@@ -14771,7 +14771,7 @@ void Unit::UpdateAuraForGroup(uint8 slot)
|
||||
player->SetAuraUpdateMaskForRaid(slot);
|
||||
}
|
||||
}
|
||||
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->isPet())
|
||||
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->IsPet())
|
||||
{
|
||||
Pet* pet = ((Pet*)this);
|
||||
if (pet->isControlled())
|
||||
@@ -15240,7 +15240,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
}
|
||||
|
||||
// Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (and its owner - for pets and totems) regardless of who tapped the victim
|
||||
if (isPet() || isTotem())
|
||||
if (IsPet() || isTotem())
|
||||
if (Unit* owner = GetOwner())
|
||||
owner->ProcDamageAndSpell(victim, PROC_FLAG_KILL, PROC_FLAG_NONE, PROC_EX_NONE, 0);
|
||||
|
||||
@@ -15331,7 +15331,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_UNITS, "DealDamageNotPlayer");
|
||||
|
||||
if (!creature->isPet())
|
||||
if (!creature->IsPet())
|
||||
{
|
||||
creature->DeleteThreatList();
|
||||
CreatureTemplate const* cInfo = creature->GetCreatureTemplate();
|
||||
@@ -16398,7 +16398,7 @@ float Unit::GetCombatRatingReduction(CombatRating cr) const
|
||||
if (Player const* player = ToPlayer())
|
||||
return player->GetRatingBonusValue(cr);
|
||||
// Player's pet get resilience from owner
|
||||
else if (isPet() && GetOwner())
|
||||
else if (IsPet() && GetOwner())
|
||||
if (Player* owner = GetOwner()->ToPlayer())
|
||||
return owner->GetRatingBonusValue(cr);
|
||||
|
||||
|
||||
@@ -1327,7 +1327,7 @@ class Unit : public WorldObject
|
||||
void AddUnitTypeMask(uint32 mask) { m_unitTypeMask |= mask; }
|
||||
bool isSummon() const { return m_unitTypeMask & UNIT_MASK_SUMMON; }
|
||||
bool isGuardian() const { return m_unitTypeMask & UNIT_MASK_GUARDIAN; }
|
||||
bool isPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
||||
bool IsPet() const { return m_unitTypeMask & UNIT_MASK_PET; }
|
||||
bool isHunterPet() const{ return m_unitTypeMask & UNIT_MASK_HUNTER_PET; }
|
||||
bool isTotem() const { return m_unitTypeMask & UNIT_MASK_TOTEM; }
|
||||
bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
|
||||
@@ -2124,8 +2124,8 @@ class Unit : public WorldObject
|
||||
virtual bool isBeingLoaded() const { return false;}
|
||||
bool IsDuringRemoveFromWorld() const {return m_duringRemoveFromWorld;}
|
||||
|
||||
Pet* ToPet() { if (isPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
|
||||
Pet const* ToPet() const { if (isPet()) return reinterpret_cast<Pet const*>(this); else return NULL; }
|
||||
Pet* ToPet() { if (IsPet()) return reinterpret_cast<Pet*>(this); else return NULL; }
|
||||
Pet const* ToPet() const { if (IsPet()) return reinterpret_cast<Pet const*>(this); else return NULL; }
|
||||
|
||||
Totem* ToTotem() { if (isTotem()) return reinterpret_cast<Totem*>(this); else return NULL; }
|
||||
Totem const* ToTotem() const { if (isTotem()) return reinterpret_cast<Totem const*>(this); else return NULL; }
|
||||
|
||||
@@ -38,7 +38,7 @@ void ObjectGridEvacuator::Visit(CreatureMapType &m)
|
||||
Creature* c = iter->getSource();
|
||||
++iter;
|
||||
|
||||
ASSERT(!c->isPet() && "ObjectGridRespawnMover must not be called for pets");
|
||||
ASSERT(!c->IsPet() && "ObjectGridRespawnMover must not be called for pets");
|
||||
c->GetMap()->CreatureRespawnRelocation(c, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
pet->ToCreature()->AI()->AttackStart(TargetUnit);
|
||||
|
||||
//10% chance to play special pet attack talk, else growl
|
||||
if (pet->ToCreature()->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
|
||||
if (pet->ToCreature()->IsPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && urand(0, 100) < 10)
|
||||
pet->SendPetTalk((uint32)PET_TALK_ATTACK);
|
||||
else
|
||||
{
|
||||
@@ -247,7 +247,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
else if (pet->GetOwnerGUID() == GetPlayer()->GetGUID())
|
||||
{
|
||||
ASSERT(pet->GetTypeId() == TYPEID_UNIT);
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
if (((Pet*)pet)->getPetType() == HUNTER_PET)
|
||||
GetPlayer()->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
|
||||
@@ -354,7 +354,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
|
||||
|
||||
//10% chance to play special pet attack talk, else growl
|
||||
//actually this only seems to happen on special spells, fire shield for imp, torment for voidwalker, but it's stupid to check every spell
|
||||
if (pet->ToCreature()->isPet() && (((Pet*)pet)->getPetType() == SUMMON_PET) && (pet != unit_target) && (urand(0, 100) < 10))
|
||||
if (pet->ToCreature()->IsPet() && (((Pet*)pet)->getPetType() == SUMMON_PET) && (pet != unit_target) && (urand(0, 100) < 10))
|
||||
pet->SendPetTalk((uint32)PET_TALK_SPECIAL_SPELL);
|
||||
else
|
||||
{
|
||||
@@ -432,7 +432,7 @@ void WorldSession::SendPetNameQuery(uint64 petguid, uint32 petnumber)
|
||||
data << pet->GetName();
|
||||
data << uint32(pet->GetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP));
|
||||
|
||||
if (pet->isPet() && ((Pet*)pet)->GetDeclinedNames())
|
||||
if (pet->IsPet() && ((Pet*)pet)->GetDeclinedNames())
|
||||
{
|
||||
data << uint8(1);
|
||||
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
@@ -560,7 +560,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
|
||||
//sign for autocast
|
||||
if (act_state == ACT_ENABLED)
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isPet())
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->IsPet())
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, true);
|
||||
else
|
||||
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
@@ -570,7 +570,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData)
|
||||
//sign for no/turn off autocast
|
||||
else if (act_state == ACT_DISABLED)
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isPet())
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->IsPet())
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, false);
|
||||
else
|
||||
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
|
||||
@@ -600,7 +600,7 @@ void WorldSession::HandlePetRename(WorldPacket& recvData)
|
||||
|
||||
Pet* pet = ObjectAccessor::FindPet(petguid);
|
||||
// check it!
|
||||
if (!pet || !pet->isPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET ||
|
||||
if (!pet || !pet->IsPet() || ((Pet*)pet)->getPetType()!= HUNTER_PET ||
|
||||
!pet->HasByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED) ||
|
||||
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo())
|
||||
return;
|
||||
@@ -682,7 +682,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
||||
if (pet)
|
||||
{
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
if (pet->GetGUID() == _player->GetPetGUID())
|
||||
{
|
||||
@@ -731,7 +731,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
((Pet*)pet)->ToggleAutocast(spellInfo, state);
|
||||
else
|
||||
pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state);
|
||||
@@ -804,7 +804,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket)
|
||||
{
|
||||
Creature* pet = caster->ToCreature();
|
||||
pet->AddCreatureSpellCooldown(spellId);
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
Pet* p = (Pet*)pet;
|
||||
// 10% chance to play special pet attack talk, else growl
|
||||
|
||||
@@ -839,7 +839,7 @@ void Map::MoveAllCreaturesInMoveList()
|
||||
//But this check is always needed to ensure safety
|
||||
/// @todo pets will disappear if this is outside CreatureRespawnRelocation
|
||||
//need to check why pet is frequently relocated to an unloaded cell
|
||||
if (c->isPet())
|
||||
if (c->IsPet())
|
||||
((Pet*)c)->Remove(PET_SAVE_NOT_IN_SLOT, true);
|
||||
else
|
||||
AddObjectToRemoveList(c);
|
||||
@@ -2232,7 +2232,7 @@ void Map::AddToActive(Creature* c)
|
||||
AddToActiveHelper(c);
|
||||
|
||||
// also not allow unloading spawn grid to prevent creating creature clone at load
|
||||
if (!c->isPet() && c->GetDBTableGUIDLow())
|
||||
if (!c->IsPet() && c->GetDBTableGUIDLow())
|
||||
{
|
||||
float x, y, z;
|
||||
c->GetRespawnPosition(x, y, z);
|
||||
@@ -2253,7 +2253,7 @@ void Map::RemoveFromActive(Creature* c)
|
||||
RemoveFromActiveHelper(c);
|
||||
|
||||
// also allow unloading spawn grid
|
||||
if (!c->isPet() && c->GetDBTableGUIDLow())
|
||||
if (!c->IsPet() && c->GetDBTableGUIDLow())
|
||||
{
|
||||
float x, y, z;
|
||||
c->GetRespawnPosition(x, y, z);
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Trinity
|
||||
uint32 gain;
|
||||
|
||||
if (u->GetTypeId() == TYPEID_UNIT &&
|
||||
(((Creature*)u)->isTotem() || ((Creature*)u)->isPet() ||
|
||||
(((Creature*)u)->isTotem() || ((Creature*)u)->IsPet() ||
|
||||
(((Creature*)u)->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ||
|
||||
((Creature*)u)->GetCreatureTemplate()->type == CREATURE_TYPE_CRITTER))
|
||||
gain = 0;
|
||||
|
||||
@@ -58,7 +58,7 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
|
||||
// be (GetCombatReach() + i_offset) away.
|
||||
// Only applies when i_target is pet's owner otherwise pets and mobs end up
|
||||
// doing a "dance" while fighting
|
||||
if (owner->isPet() && i_target->GetTypeId() == TYPEID_PLAYER)
|
||||
if (owner->IsPet() && i_target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
dist = i_target->GetCombatReach();
|
||||
size = i_target->GetCombatReach() - i_target->GetObjectSize();
|
||||
@@ -89,7 +89,7 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T* owner, bool up
|
||||
i_path = new PathGenerator(owner);
|
||||
|
||||
// allow pets to use shortcut if no path found when following their master
|
||||
bool forceDest = (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->isPet()
|
||||
bool forceDest = (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsPet()
|
||||
&& owner->HasUnitState(UNIT_STATE_FOLLOW));
|
||||
|
||||
bool result = i_path->CalculatePath(x, y, z, forceDest);
|
||||
@@ -252,7 +252,7 @@ void FollowMovementGenerator<Creature>::_updateSpeed(Creature* owner)
|
||||
{
|
||||
// pet only sync speed with owner
|
||||
/// Make sure we are not in the process of a map change (IsInWorld)
|
||||
if (!owner->isPet() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
|
||||
if (!owner->IsPet() || !owner->IsInWorld() || !i_target.isValid() || i_target->GetGUID() != owner->GetOwnerGUID())
|
||||
return;
|
||||
|
||||
owner->UpdateSpeed(MOVE_RUN, true);
|
||||
|
||||
@@ -2824,7 +2824,7 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode,
|
||||
// return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
if (target->GetTypeId() != TYPEID_UNIT || !target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() != TYPEID_UNIT || !target->ToCreature()->IsPet())
|
||||
return;
|
||||
|
||||
Pet* pet = target->ToPet();
|
||||
@@ -3498,7 +3498,7 @@ void AuraEffect::HandleAuraModResistance(AuraApplication const* aurApp, uint8 mo
|
||||
if (GetMiscValue() & int32(1<<x))
|
||||
{
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply);
|
||||
}
|
||||
}
|
||||
@@ -3515,7 +3515,7 @@ void AuraEffect::HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, u
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
//pets only have base armor
|
||||
if (target->ToCreature()->isPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
if (target->ToCreature()->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(GetAmount()), apply);
|
||||
}
|
||||
else
|
||||
@@ -3540,7 +3540,7 @@ void AuraEffect::HandleModResistancePercent(AuraApplication const* aurApp, uint8
|
||||
if (GetMiscValue() & int32(1<<i))
|
||||
{
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
{
|
||||
target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, (float)GetAmount(), apply);
|
||||
target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, (float)GetAmount(), apply);
|
||||
@@ -3560,7 +3560,7 @@ void AuraEffect::HandleModBaseResistance(AuraApplication const* aurApp, uint8 mo
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
//only pets have base stats
|
||||
if (target->ToCreature()->isPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
if (target->ToCreature()->IsPet() && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL))
|
||||
target->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
}
|
||||
else
|
||||
@@ -3613,7 +3613,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bo
|
||||
{
|
||||
//target->ApplyStatMod(Stats(i), m_amount, apply);
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply);
|
||||
}
|
||||
}
|
||||
@@ -3739,7 +3739,7 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
|
||||
if (GetMiscValue() == i || GetMiscValue() == -1)
|
||||
{
|
||||
target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(GetAmount()), apply);
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
|
||||
target->ApplyStatPercentBuffMod(Stats(i), float(GetAmount()), apply);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2565,7 +2565,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
|
||||
// cast at creature (or GO) quest objectives update at successful cast finished (+channel finished)
|
||||
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm...)
|
||||
if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
|
||||
if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->IsPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
|
||||
if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id);
|
||||
}
|
||||
@@ -3893,7 +3893,7 @@ void Spell::SendSpellStart()
|
||||
if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO)
|
||||
castFlags |= CAST_FLAG_AMMO;
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsPet()))
|
||||
&& m_spellInfo->PowerType != POWER_HEALTH)
|
||||
castFlags |= CAST_FLAG_POWER_LEFT_SELF;
|
||||
|
||||
@@ -3947,7 +3947,7 @@ void Spell::SendSpellGo()
|
||||
castFlags |= CAST_FLAG_AMMO; // arrows/bullets visual
|
||||
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet()))
|
||||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsPet()))
|
||||
&& m_spellInfo->PowerType != POWER_HEALTH)
|
||||
castFlags |= CAST_FLAG_POWER_LEFT_SELF; // should only be sent to self, but the current messaging doesn't make that possible
|
||||
|
||||
|
||||
@@ -452,7 +452,7 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
|
||||
// Shadow Bite
|
||||
else if (m_spellInfo->SpellFamilyFlags[1] & 0x400000)
|
||||
{
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->isPet())
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsPet())
|
||||
{
|
||||
if (Player* owner = m_caster->GetOwner()->ToPlayer())
|
||||
{
|
||||
@@ -2992,7 +2992,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/)
|
||||
|
||||
Creature* creatureTarget = unitTarget->ToCreature();
|
||||
|
||||
if (creatureTarget->isPet())
|
||||
if (creatureTarget->IsPet())
|
||||
return;
|
||||
|
||||
if (m_caster->getClass() != CLASS_HUNTER)
|
||||
@@ -4635,7 +4635,7 @@ void Spell::EffectDismissPet(SpellEffIndex effIndex)
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
|
||||
if (!unitTarget || !unitTarget->isPet())
|
||||
if (!unitTarget || !unitTarget->IsPet())
|
||||
return;
|
||||
|
||||
Pet* pet = unitTarget->ToPet();
|
||||
@@ -5878,7 +5878,7 @@ void Spell::EffectRenamePet(SpellEffIndex /*effIndex*/)
|
||||
return;
|
||||
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT ||
|
||||
!unitTarget->ToCreature()->isPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET)
|
||||
!unitTarget->ToCreature()->IsPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET)
|
||||
return;
|
||||
|
||||
unitTarget->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED);
|
||||
|
||||
@@ -796,7 +796,7 @@ public:
|
||||
static bool HandleDebugThreatListCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
if (!target || target->isTotem() || target->isPet())
|
||||
if (!target || target->isTotem() || target->IsPet())
|
||||
return false;
|
||||
|
||||
ThreatContainer::StorageType const &threatList = target->getThreatManager().getThreatList();
|
||||
|
||||
@@ -1877,7 +1877,7 @@ public:
|
||||
Unit* target = handler->getSelectedUnit();
|
||||
if (player->GetSelection() && target)
|
||||
{
|
||||
if (target->GetTypeId() != TYPEID_UNIT || target->isPet())
|
||||
if (target->GetTypeId() != TYPEID_UNIT || target->IsPet())
|
||||
{
|
||||
handler->SendSysMessage(LANG_SELECT_CREATURE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -2594,7 +2594,7 @@ public:
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
Creature* creatureTarget = handler->getSelectedCreature();
|
||||
|
||||
if (!creatureTarget || creatureTarget->isPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
if (!creatureTarget || creatureTarget->IsPet() || creatureTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_SELECT_CREATURE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
|
||||
@@ -442,7 +442,7 @@ public:
|
||||
target->ToPlayer()->SendTalentsInfoData(false);
|
||||
return true;
|
||||
}
|
||||
else if (target->ToCreature()->isPet())
|
||||
else if (target->ToCreature()->IsPet())
|
||||
{
|
||||
Unit* owner = target->GetOwner();
|
||||
if (owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet*)target)->IsPermanentPetFor(owner->ToPlayer()))
|
||||
|
||||
@@ -394,7 +394,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (creature->isPet())
|
||||
if (creature->IsPet())
|
||||
{
|
||||
if (((Pet*)creature)->getPetType() == HUNTER_PET)
|
||||
{
|
||||
@@ -435,7 +435,7 @@ public:
|
||||
else
|
||||
unit = handler->getSelectedCreature();
|
||||
|
||||
if (!unit || unit->isPet() || unit->isTotem())
|
||||
if (!unit || unit->IsPet() || unit->isTotem())
|
||||
{
|
||||
handler->SendSysMessage(LANG_SELECT_CREATURE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -836,7 +836,7 @@ public:
|
||||
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
|
||||
if (!creature || creature->isPet())
|
||||
if (!creature || creature->IsPet())
|
||||
{
|
||||
handler->SendSysMessage(LANG_SELECT_CREATURE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
@@ -920,7 +920,7 @@ public:
|
||||
{
|
||||
type_str = guid_str;
|
||||
creature = handler->getSelectedCreature();
|
||||
if (!creature || creature->isPet())
|
||||
if (!creature || creature->IsPet())
|
||||
return false;
|
||||
lowguid = creature->GetDBTableGUIDLow();
|
||||
}
|
||||
@@ -1022,7 +1022,7 @@ public:
|
||||
|
||||
creature->SetPhaseMask(phasemask, true);
|
||||
|
||||
if (!creature->isPet())
|
||||
if (!creature->IsPet())
|
||||
creature->SaveToDB();
|
||||
|
||||
return true;
|
||||
@@ -1272,7 +1272,7 @@ public:
|
||||
static bool HandleNpcTameCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Creature* creatureTarget = handler->getSelectedCreature();
|
||||
if (!creatureTarget || creatureTarget->isPet())
|
||||
if (!creatureTarget || creatureTarget->IsPet())
|
||||
{
|
||||
handler->PSendSysMessage (LANG_SELECT_CREATURE);
|
||||
handler->SetSentErrorMessage (true);
|
||||
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
{
|
||||
// Try reset talents as Hunter Pet
|
||||
Creature* creature = handler->getSelectedCreature();
|
||||
if (!*args && creature && creature->isPet())
|
||||
if (!*args && creature && creature->IsPet())
|
||||
{
|
||||
Unit* owner = creature->GetOwner();
|
||||
if (owner && owner->GetTypeId() == TYPEID_PLAYER && creature->ToPet()->IsPermanentPetFor(owner->ToPlayer()))
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
Talk(SAY_CONVERTED);
|
||||
|
||||
DoCast(me, SPELL_CONVERT_CREDIT);
|
||||
if (me->isPet())
|
||||
if (me->IsPet())
|
||||
me->ToPet()->SetDuration(7500);
|
||||
Credit = true;
|
||||
} else Timer -= diff;
|
||||
|
||||
@@ -191,7 +191,7 @@ hyjal_trashAI::hyjal_trashAI(Creature* creature) : npc_escortAI(creature)
|
||||
|
||||
void hyjal_trashAI::DamageTaken(Unit* done_by, uint32 &damage)
|
||||
{
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER || done_by->isPet())
|
||||
if (done_by->GetTypeId() == TYPEID_PLAYER || done_by->IsPet())
|
||||
{
|
||||
damageTaken += damage;
|
||||
if (instance)
|
||||
|
||||
@@ -201,7 +201,7 @@ class PlayerOrPetCheck
|
||||
bool operator()(WorldObject* object) const
|
||||
{
|
||||
if (object->GetTypeId() != TYPEID_PLAYER)
|
||||
if (!object->ToCreature()->isPet())
|
||||
if (!object->ToCreature()->IsPet())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -355,7 +355,7 @@ class PlayerOrPetCheck
|
||||
bool operator()(WorldObject* object) const
|
||||
{
|
||||
if (object->GetTypeId() != TYPEID_PLAYER)
|
||||
if (!object->ToCreature()->isPet())
|
||||
if (!object->ToCreature()->IsPet())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -482,7 +482,7 @@ class spell_hun_pet_carrion_feeder : public SpellScriptLoader
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (!GetCaster()->isPet())
|
||||
if (!GetCaster()->IsPet())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -539,7 +539,7 @@ class spell_hun_pet_heart_of_the_phoenix : public SpellScriptLoader
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (!GetCaster()->isPet())
|
||||
if (!GetCaster()->IsPet())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1640,7 +1640,7 @@ class spell_item_crystal_prison_dummy_dnd : public SpellScriptLoader
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (Creature* target = GetHitCreature())
|
||||
if (target->isDead() && !target->isPet())
|
||||
if (target->isDead() && !target->IsPet())
|
||||
{
|
||||
GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 0, 0, 0, 0, uint32(target->GetRespawnTime()-time(NULL)));
|
||||
target->DespawnOrUnsummon();
|
||||
|
||||
@@ -240,7 +240,7 @@ public:
|
||||
void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = CalculatePct(owner->GetStat(STAT_STAMINA), 75);
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
|
||||
pet->ToPet()->SetCreateHealth(pInfo->health);
|
||||
@@ -294,7 +294,7 @@ public:
|
||||
void CalculateAttackPowerAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
@@ -322,7 +322,7 @@ public:
|
||||
void CalculateDamageDoneAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
//the damage bonus used for pets is either fire or shadow damage, whatever is higher
|
||||
@@ -377,7 +377,7 @@ public:
|
||||
void CalculateIntellectAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -420,7 +420,7 @@ public:
|
||||
void RemoveEffect(AuraEffect const* /* aurEff */, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
|
||||
pet->ToPet()->SetCreateMana(pInfo->mana);
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
void CalculateArmorAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -442,7 +442,7 @@ public:
|
||||
void CalculateFireResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
void CalculateFrostResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -501,7 +501,7 @@ public:
|
||||
void CalculateArcaneResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -513,7 +513,7 @@ public:
|
||||
void CalculateNatureResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -556,7 +556,7 @@ public:
|
||||
void CalculateShadowResistanceAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float ownerBonus = 0.0f;
|
||||
@@ -795,7 +795,7 @@ public:
|
||||
void CalculateAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
if (AuraEffect* /* aurEff */ect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0))
|
||||
amount += /* aurEff */ect->GetAmount();
|
||||
@@ -885,7 +885,7 @@ public:
|
||||
void CalculateStaminaAmount(AuraEffect const* /* aurEff */, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->isPet())
|
||||
if (pet->IsPet())
|
||||
if (Unit* owner = pet->ToPet()->GetOwner())
|
||||
{
|
||||
float mod = 0.45f;
|
||||
@@ -924,7 +924,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -954,7 +954,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1019,7 +1019,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1038,7 +1038,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1057,7 +1057,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1106,7 +1106,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1125,7 +1125,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1144,7 +1144,7 @@ public:
|
||||
{
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
{
|
||||
if (!pet->isPet())
|
||||
if (!pet->IsPet())
|
||||
return;
|
||||
|
||||
Unit* owner = pet->ToPet()->GetOwner();
|
||||
@@ -1348,7 +1348,7 @@ public:
|
||||
if (GetCaster()->GetOwner()->ToPlayer())
|
||||
{
|
||||
// Pet's base damage changes depending on happiness
|
||||
if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet())
|
||||
if (GetCaster()->IsPet() && GetCaster()->ToPet()->isHunterPet())
|
||||
{
|
||||
switch (GetCaster()->ToPet()->GetHappinessState())
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ class spell_generic_quest_update_entry_SpellScript : public SpellScript
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Creature* creatureTarget = GetHitCreature())
|
||||
if (!creatureTarget->isPet() && creatureTarget->GetEntry() == _originalEntry)
|
||||
if (!creatureTarget->IsPet() && creatureTarget->GetEntry() == _originalEntry)
|
||||
{
|
||||
creatureTarget->UpdateEntry(_newEntry);
|
||||
if (_shouldAttack && creatureTarget->IsAIEnabled)
|
||||
|
||||
@@ -349,7 +349,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader
|
||||
{
|
||||
if (Creature* targetCreature = GetHitCreature())
|
||||
{
|
||||
if (targetCreature->isPet())
|
||||
if (targetCreature->IsPet())
|
||||
{
|
||||
CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry());
|
||||
switch (ci->family)
|
||||
|
||||
Reference in New Issue
Block a user