aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/PetHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Handlers/PetHandler.cpp')
-rw-r--r--src/server/game/Handlers/PetHandler.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index c26c0ce7c01..ae18eece9a9 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -51,7 +51,7 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData)
if (_player->GetCritterGUID() == pet->GetGUID())
{
- if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->isSummon())
+ if (pet->GetTypeId() == TYPEID_UNIT && pet->ToCreature()->IsSummon())
pet->ToTempSummon()->UnSummon();
}
}
@@ -89,7 +89,7 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
return;
}
- if (!pet->isAlive())
+ if (!pet->IsAlive())
{
SpellInfo const* spell = (flag == ACT_ENABLED || flag == ACT_PASSIVE) ? sSpellMgr->GetSpellInfo(spellid) : NULL;
if (!spell)
@@ -109,7 +109,7 @@ void WorldSession::HandlePetAction(WorldPacket& recvData)
//If a pet is dismissed, m_Controlled will change
std::vector<Unit*> controlled;
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
- if ((*itr)->GetEntry() == pet->GetEntry() && (*itr)->isAlive())
+ if ((*itr)->GetEntry() == pet->GetEntry() && (*itr)->IsAlive())
controlled.push_back(*itr);
for (std::vector<Unit*>::iterator itr = controlled.begin(); itr != controlled.end(); ++itr)
HandlePetActionHelper(*itr, guid1, spellid, flag, guid2, x, y, z);
@@ -138,7 +138,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData)
return;
}
- if (!pet->isAlive())
+ if (!pet->IsAlive())
return;
pet->AttackStop();
@@ -205,9 +205,9 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
pet->ClearUnitState(UNIT_STATE_FOLLOW);
// This is true if pet has no target or has target but targets differs.
- if (pet->getVictim() != TargetUnit || (pet->getVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack()))
+ if (pet->GetVictim() != TargetUnit || (pet->GetVictim() == TargetUnit && !pet->GetCharmInfo()->IsCommandAttack()))
{
- if (pet->getVictim())
+ if (pet->GetVictim())
pet->AttackStop();
if (pet->GetTypeId() != TYPEID_PLAYER && pet->ToCreature()->IsAIEnabled)
@@ -221,7 +221,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
{
@@ -231,7 +231,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
}
else // charmed player
{
- if (pet->getVictim() && pet->getVictim() != TargetUnit)
+ if (pet->GetVictim() && pet->GetVictim() != TargetUnit)
pet->AttackStop();
charmInfo->SetIsCommandAttack(true);
@@ -252,7 +252,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);
@@ -371,7 +371,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
{
@@ -381,9 +381,9 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint32 spellid
if (unit_target && !GetPlayer()->IsFriendlyTo(unit_target) && !pet->isPossessed() && !pet->IsVehicle())
{
// This is true if pet has no target or has target but targets differs.
- if (pet->getVictim() != unit_target)
+ if (pet->GetVictim() != unit_target)
{
- if (pet->getVictim())
+ if (pet->GetVictim())
pet->AttackStop();
pet->GetMotionMaster()->Clear();
if (pet->ToCreature()->IsAIEnabled)
@@ -449,7 +449,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)
@@ -466,7 +466,7 @@ bool WorldSession::CheckStableMaster(uint64 guid)
// spell case or GM
if (guid == GetPlayer()->GetGUID())
{
- if (!GetPlayer()->isGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
+ if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
{
TC_LOG_DEBUG(LOG_FILTER_NETWORKIO, "Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid));
return false;
@@ -577,7 +577,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)
@@ -587,7 +587,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)
@@ -617,7 +617,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;
@@ -699,7 +699,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
if (pet)
{
- if (pet->isPet())
+ if (pet->IsPet())
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
else if (pet->GetGUID() == _player->GetCharmGUID())
_player->StopCastingCharm();
@@ -740,7 +740,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket)
return;
}
- if (pet->isPet())
+ if (pet->IsPet())
((Pet*)pet)->ToggleAutocast(spellInfo, state);
else
pet->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, state);
@@ -813,7 +813,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