diff --git a/src/game/AggressorAI.cpp b/src/game/AggressorAI.cpp index a5fed3ebffb..615fd3fa2f2 100644 --- a/src/game/AggressorAI.cpp +++ b/src/game/AggressorAI.cpp @@ -30,7 +30,7 @@ int AggressorAI::Permissible(const Creature *creature) { // have some hostile factions, it will be selected by IsHostileTo check at MoveInLineOfSight - if( !creature->isCivilian() && !creature->IsNeutralToAll() ) + if( !creature->IsCivilian() && !creature->IsNeutralToAll() ) return PERMIT_BASE_PROACTIVE; return PERMIT_BASE_NO; @@ -44,7 +44,7 @@ void AggressorAI::MoveInLineOfSight(Unit *u) { // Ignore Z for flying creatures - if( !m_creature->canFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE ) + if( !m_creature->CanFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE ) return; if (m_creature->CanInitiateAttack() && u->isTargetableForAttack() && diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 720d0f76872..5c59aa9b39c 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -1587,7 +1587,7 @@ void BattleGround::SpawnBGCreature(uint64 const& guid, uint32 respawntime) else { map->Add(obj); - obj->setDeathState(JUST_DIED); + obj->SetDeathState(JUST_DIED); obj->SetRespawnDelay(respawntime); obj->RemoveCorpse(); } diff --git a/src/game/ConfusedMovementGenerator.cpp b/src/game/ConfusedMovementGenerator.cpp index e1048a4305b..d9718a842fd 100644 --- a/src/game/ConfusedMovementGenerator.cpp +++ b/src/game/ConfusedMovementGenerator.cpp @@ -73,8 +73,8 @@ ConfusedMovementGenerator::_InitSpecific(Creature &creature, bool &is_ { creature.RemoveSplineFlag(SPLINEFLAG_WALKMODE); - is_water_ok = creature.canSwim(); - is_land_ok = creature.canWalk(); + is_water_ok = creature.CanSwim(); + is_land_ok = creature.CanWalk(); } template<> diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 183b7655ee4..ac1cb9af1c3 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -172,7 +172,7 @@ void Creature::RemoveCorpse() return; m_corpseDecayTimer = 0; - setDeathState(DEAD); + SetDeathState(DEAD); UpdateObjectVisibility(); // stop loot rolling before loot clear and for close client dialogs @@ -418,11 +418,11 @@ void Creature::Update(uint32 diff) switch( m_deathState ) { case JUST_ALIVED: - // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. + // Don't must be called, see Creature::SetDeathState JUST_ALIVED -> ALIVE promoting. sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry()); break; case JUST_DIED: - // Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. + // Don't must be called, see Creature::SetDeathState JUST_DIED -> CORPSE promoting. sLog.outError("Creature (GUIDLow: %u Entry: %u ) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry()); break; case DEAD: @@ -444,14 +444,14 @@ void Creature::Update(uint32 diff) SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); if (m_isDeadByDefault) { - setDeathState(JUST_DIED); + SetDeathState(JUST_DIED); SetHealth(0); i_motionMaster.Clear(); clearUnitState(UNIT_STAT_ALL_STATE); - LoadCreaturesAddon(true); + LoadCreatureAddon(true); } else - setDeathState( JUST_ALIVED ); + SetDeathState( JUST_ALIVED ); //Call AI respawn virtual function i_AI->JustRespawned(); @@ -557,7 +557,7 @@ void Creature::Update(uint32 diff) } case DEAD_FALLING: { - setDeathState(CORPSE); + SetDeathState(CORPSE); } default: break; @@ -611,7 +611,7 @@ void Creature::RegenerateMana() void Creature::RegenerateHealth() { - if (!isRegeneratingHealth()) + if (!IsRegeneratingHealth()) return; uint32 curValue = GetHealth(); @@ -715,13 +715,13 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, m_corpseDelay = sWorld.getConfig(CONFIG_UINT32_CORPSE_DECAY_NORMAL); break; } - LoadCreaturesAddon(); + LoadCreatureAddon(); } return bResult; } -bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const +bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const { if(!isTrainer()) return false; @@ -807,7 +807,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const return true; } -bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const +bool Creature::CanInteractWithBattleMaster(Player* pPlayer, bool msg) const { if(!isBattleMaster()) return false; @@ -842,7 +842,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const return true; } -bool Creature::isCanTrainingAndResetTalentsOf(Player* pPlayer) const +bool Creature::CanTrainAndResetTalentsOf(Player* pPlayer) const { return pPlayer->getLevel() >= 10 && GetCreatureInfo()->trainer_type == TRAINER_TYPE_CLASS @@ -1062,7 +1062,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) void Creature::SelectLevel(const CreatureInfo *cinfo, float percentHealth, float percentMana) { - uint32 rank = isPet()? 0 : cinfo->rank; + uint32 rank = IsPet()? 0 : cinfo->rank; // level uint32 minlevel = std::min(cinfo->maxlevel, cinfo->minlevel); @@ -1233,7 +1233,7 @@ bool Creature::LoadFromDB(uint32 guidlow, Map *map) if(m_respawnTime > time(NULL)) // not ready to respawn { m_deathState = DEAD; - if(canFly()) + if(CanFly()) { float tz = GetMap()->GetHeight(data->posX, data->posY, data->posZ, false); if(data->posZ - tz > 0.1) @@ -1288,7 +1288,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force) SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, einfo->equipentry[i]); } -bool Creature::hasQuest(uint32 quest_id) const +bool Creature::HasQuest(uint32 quest_id) const { QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestRelationsMapBounds(GetEntry()); for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr) @@ -1299,7 +1299,7 @@ bool Creature::hasQuest(uint32 quest_id) const return false; } -bool Creature::hasInvolvedQuest(uint32 quest_id) const +bool Creature::HasInvolvedQuest(uint32 quest_id) const { QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestInvolvedRelationsMapBounds(GetEntry()); for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr) @@ -1337,8 +1337,8 @@ float Creature::GetAttackDistance(Unit const* pl) const if(aggroRate == 0) return 0.0f; - uint32 playerlevel = pl->getLevelForTarget(this); - uint32 creaturelevel = getLevelForTarget(pl); + uint32 playerlevel = pl->GetLevelForTarget(this); + uint32 creaturelevel = GetLevelForTarget(pl); int32 leveldif = int32(playerlevel) - int32(creaturelevel); @@ -1369,7 +1369,7 @@ float Creature::GetAttackDistance(Unit const* pl) const return (RetDistance*aggroRate); } -void Creature::setDeathState(DeathState s) +void Creature::SetDeathState(DeathState s) { if ((s == JUST_DIED && !m_isDeadByDefault) || (s == JUST_ALIVED && m_isDeadByDefault)) { @@ -1377,15 +1377,15 @@ void Creature::setDeathState(DeathState s) m_respawnTime = time(NULL) + m_respawnDelay; // respawn delay (spawntimesecs) // always save boss respawn time at death to prevent crash cheating - if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY) || isWorldBoss()) + if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY) || IsWorldBoss()) SaveRespawnTime(); } - Unit::setDeathState(s); + Unit::SetDeathState(s); if (s == JUST_DIED) { - SetTargetGUID(0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState) + SetTargetGUID(0); // remove target selection in any cases (can be set at aura remove in Unit::SetDeathState) SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); if (HasSearchedAssistance()) @@ -1395,10 +1395,10 @@ void Creature::setDeathState(DeathState s) } // return, since we promote to DEAD_FALLING. DEAD_FALLING is promoted to CORPSE at next update. - if (canFly() && FallGround()) + if (CanFly() && FallGround()) return; - Unit::setDeathState(CORPSE); + Unit::SetDeathState(CORPSE); } if (s == JUST_ALIVED) @@ -1410,11 +1410,11 @@ void Creature::setDeathState(DeathState s) RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); AddSplineFlag(SPLINEFLAG_WALKMODE); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); - Unit::setDeathState(ALIVE); + Unit::SetDeathState(ALIVE); clearUnitState(UNIT_STAT_ALL_STATE); i_motionMaster.Clear(); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); - LoadCreaturesAddon(true); + LoadCreatureAddon(true); } } @@ -1437,7 +1437,7 @@ bool Creature::FallGround() if (fabs(GetPositionZ() - tz) < 0.1f) return false; - Unit::setDeathState(DEAD_FALLING); + Unit::SetDeathState(DEAD_FALLING); float dz = tz - GetPositionZ(); float distance = sqrt(dz*dz); @@ -1491,13 +1491,13 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn) } if (isAlive()) - setDeathState(JUST_DIED); + SetDeathState(JUST_DIED); RemoveCorpse(); SetHealth(0); // just for nice GM-mode view } -bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo) +bool Creature::IsImmuneToSpell(SpellEntry const* spellInfo) { if (!spellInfo) return false; @@ -1505,10 +1505,10 @@ bool Creature::IsImmunedToSpell(SpellEntry const* spellInfo) if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->Mechanic - 1))) return true; - return Unit::IsImmunedToSpell(spellInfo); + return Unit::IsImmuneToSpell(spellInfo); } -bool Creature::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const +bool Creature::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const { if (GetCreatureInfo()->MechanicImmuneMask & (1 << (spellInfo->EffectMechanic[index] - 1))) return true; @@ -1527,10 +1527,10 @@ bool Creature::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIn return true; } - return Unit::IsImmunedToSpellEffect(spellInfo, index); + return Unit::IsImmuneToSpellEffect(spellInfo, index); } -SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim) +SpellEntry const *Creature::ReachWithSpellAttack(Unit *pVictim) { if(!pVictim) return NULL; @@ -1582,7 +1582,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim) return NULL; } -SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim) +SpellEntry const *Creature::ReachWithSpellCure(Unit *pVictim) { if(!pVictim) return NULL; @@ -1680,7 +1680,7 @@ void Creature::SendAIReaction(AiReaction reactionType) void Creature::CallAssistance() { - if( !m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed()) + if( !m_AlreadyCallAssistance && getVictim() && !IsPet() && !isCharmed()) { SetNoCallAssistance(true); @@ -1706,7 +1706,7 @@ void Creature::CallAssistance() void Creature::CallForHelp(float fRadius) { - if (fRadius <= 0.0f || !getVictim() || isPet() || isCharmed()) + if (fRadius <= 0.0f || !getVictim() || IsPet() || isCharmed()) return; MaNGOS::CallOfHelpCreatureInRangeDo u_do(this, getVictim(), fRadius); @@ -1721,7 +1721,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / return false; // we don't need help from non-combatant ;) - if (isCivilian()) + if (IsCivilian()) return false; if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE)) @@ -1770,7 +1770,7 @@ bool Creature::CanInitiateAttack() void Creature::SaveRespawnTime() { - if(isPet() || !m_DBTableGuid) + if(IsPet() || !m_DBTableGuid) return; if(m_respawnTime > time(NULL)) // dead (no corpse) @@ -1820,7 +1820,7 @@ CreatureDataAddon const* Creature::GetCreatureAddon() const } //creature_addon table -bool Creature::LoadCreaturesAddon(bool reload) +bool Creature::LoadCreatureAddon(bool reload) { CreatureDataAddon const *cainfo = GetCreatureAddon(); if(!cainfo) @@ -2139,10 +2139,10 @@ void Creature::AllLootRemovedFromCorpse() } } -uint32 Creature::getLevelForTarget( Unit const* target ) const +uint32 Creature::GetLevelForTarget( Unit const* target ) const { - if(!isWorldBoss()) - return Unit::getLevelForTarget(target); + if(!IsWorldBoss()) + return Unit::GetLevelForTarget(target); uint32 level = target->getLevel()+sWorld.getConfig(CONFIG_UINT32_WORLD_BOSS_LEVEL_DIFF); if(level < 1) diff --git a/src/game/Creature.h b/src/game/Creature.h index 07ae1555142..abef83cc32a 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -394,56 +394,56 @@ class MANGOS_DLL_SPEC Creature : public Unit void RemoveFromWorld(); bool Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, const CreatureData *data = NULL); - bool LoadCreaturesAddon(bool reload = false); + bool LoadCreatureAddon(bool reload = false); void SelectLevel(const CreatureInfo *cinfo, float percentHealth = 100.0f, float percentMana = 100.0f); void LoadEquipment(uint32 equip_entry, bool force=false); uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } char const* GetSubName() const { return GetCreatureInfo()->SubName; } - void Update( uint32 time ); // overwrited Unit::Update + void Update(uint32 time); // overwrite Unit::Update void GetRespawnCoord(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const; uint32 GetEquipmentId() const { return m_equipmentId; } CreatureSubtype GetSubtype() const { return m_subtype; } - bool isPet() const { return m_subtype == CREATURE_SUBTYPE_PET; } - bool isVehicle() const { return m_subtype == CREATURE_SUBTYPE_VEHICLE; } - bool isTotem() const { return m_subtype == CREATURE_SUBTYPE_TOTEM; } - bool isTemporarySummon() const { return m_subtype == CREATURE_SUBTYPE_TEMPORARY_SUMMON; } + bool IsPet() const { return m_subtype == CREATURE_SUBTYPE_PET; } + bool IsVehicle() const { return m_subtype == CREATURE_SUBTYPE_VEHICLE; } + bool IsTotem() const { return m_subtype == CREATURE_SUBTYPE_TOTEM; } + bool IsTemporarySummon() const { return m_subtype == CREATURE_SUBTYPE_TEMPORARY_SUMMON; } void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; } - bool isRacialLeader() const { return GetCreatureInfo()->RacialLeader; } - bool isCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } - bool canWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } - bool canSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } - bool canFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } - ///// TODO RENAME THIS!!!!! - bool isCanTrainingOf(Player* player, bool msg) const; - bool isCanInteractWithBattleMaster(Player* player, bool msg) const; - bool isCanTrainingAndResetTalentsOf(Player* pPlayer) const; + bool IsRacialLeader() const { return GetCreatureInfo()->RacialLeader; } + bool IsCivilian() const { return GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN; } + bool CanWalk() const { return GetCreatureInfo()->InhabitType & INHABIT_GROUND; } + bool CanSwim() const { return GetCreatureInfo()->InhabitType & INHABIT_WATER; } + bool CanFly() const { return GetCreatureInfo()->InhabitType & INHABIT_AIR; } + + bool IsTrainerOf(Player* player, bool msg) const; + bool CanInteractWithBattleMaster(Player* player, bool msg) const; + bool CanTrainAndResetTalentsOf(Player* pPlayer) const; bool IsOutOfThreatArea(Unit* pVictim) const; - bool IsImmunedToSpell(SpellEntry const* spellInfo); - // redefine Unit::IsImmunedToSpell - bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; - // redefine Unit::IsImmunedToSpellEffect - bool isElite() const + bool IsImmuneToSpell(SpellEntry const* spellInfo); + // redefine Unit::IsImmuneToSpell + bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; + // redefine Unit::IsImmuneToSpellEffect + bool IsElite() const { - if(isPet()) + if(IsPet()) return false; uint32 rank = GetCreatureInfo()->rank; return rank != CREATURE_ELITE_NORMAL && rank != CREATURE_ELITE_RARE; } - bool isWorldBoss() const + bool IsWorldBoss() const { - if(isPet()) + if(IsPet()) return false; return GetCreatureInfo()->rank == CREATURE_ELITE_WORLDBOSS; } - uint32 getLevelForTarget(Unit const* target) const; // overwrite Unit::getLevelForTarget for boss level support + uint32 GetLevelForTarget(Unit const* target) const; // overwrite Unit::GetLevelForTarget for boss level support bool IsInEvadeMode() const; @@ -477,7 +477,7 @@ class MANGOS_DLL_SPEC Creature : public Unit void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL); - uint32 GetShieldBlockValue() const //dunno mob block value + uint32 GetShieldBlockValue() const // dunno mob block value { return (getLevel() / 2 + uint32(GetStat(STAT_STRENGTH) / 20)); } @@ -529,7 +529,7 @@ class MANGOS_DLL_SPEC Creature : public Unit // overwrite WorldObject function for proper name localization const char* GetNameForLocaleIdx(int32 locale_idx) const; - void setDeathState(DeathState s); // overwrite virtual Unit::setDeathState + void SetDeathState(DeathState s); // overwrite virtual Unit::SetDeathState bool FallGround(); bool LoadFromDB(uint32 guid, Map *map); @@ -554,8 +554,8 @@ class MANGOS_DLL_SPEC Creature : public Unit void AllLootRemovedFromCorpse(); Player* GetOriginalLootRecipient() const; // ignore group changes/etc, not for looting - SpellEntry const *reachWithSpellAttack(Unit *pVictim); - SpellEntry const *reachWithSpellCure(Unit *pVictim); + SpellEntry const *ReachWithSpellAttack(Unit *pVictim); + SpellEntry const *ReachWithSpellCure(Unit *pVictim); uint32 m_spells[CREATURE_MAX_SPELLS]; CreatureSpellCooldowns m_CreatureSpellCooldowns; @@ -584,7 +584,7 @@ class MANGOS_DLL_SPEC Creature : public Unit bool IsVisibleInGridForPlayer(Player* pl) const; void RemoveCorpse(); - bool isDeadByDefault() const { return m_isDeadByDefault; }; + bool IsDeadByDefault() const { return m_isDeadByDefault; }; void ForcedDespawn(uint32 timeMSToDespawn = 0); @@ -608,11 +608,11 @@ class MANGOS_DLL_SPEC Creature : public Unit Unit* SelectAttackingTarget(AttackingTarget target, uint32 position) const; - bool hasQuest(uint32 quest_id) const; - bool hasInvolvedQuest(uint32 quest_id) const; + bool HasQuest(uint32 quest_id) const; + bool HasInvolvedQuest(uint32 quest_id) const; GridReference &GetGridRef() { return m_gridRef; } - bool isRegeneratingHealth() { return m_regenHealth; } + bool IsRegeneratingHealth() { return m_regenHealth; } virtual uint8 GetPetAutoSpellSize() const { return CREATURE_MAX_SPELLS; } virtual uint32 GetPetAutoSpellOnPos(uint8 pos) const { diff --git a/src/game/CreatureAISelector.cpp b/src/game/CreatureAISelector.cpp index 2b374223c3f..47e5201849d 100644 --- a/src/game/CreatureAISelector.cpp +++ b/src/game/CreatureAISelector.cpp @@ -33,7 +33,7 @@ namespace FactorySelector CreatureAI* selectAI(Creature *creature) { // Allow scripting AI for normal creatures and not controlled pets (guardians and mini-pets) - if ((!creature->isPet() || !((Pet*)creature)->isControlled()) && !creature->isCharmed()) + if ((!creature->IsPet() || !((Pet*)creature)->isControlled()) && !creature->isCharmed()) if(CreatureAI* scriptedAI = Script->GetAI(creature)) return scriptedAI; @@ -46,10 +46,10 @@ namespace FactorySelector // select by NPC flags _first_ - otherwise EventAI might be choosen for pets/totems // excplicit check for isControlled() and owner type to allow guardian, mini-pets and pets controlled by NPCs to be scripted by EventAI Unit *owner=NULL; - if ((creature->isPet() && ((Pet*)creature)->isControlled() && + if ((creature->IsPet() && ((Pet*)creature)->isControlled() && ((owner=creature->GetOwner()) && owner->GetTypeId()==TYPEID_PLAYER)) || creature->isCharmed()) ai_factory = ai_registry.GetRegistryItem("PetAI"); - else if (creature->isTotem()) + else if (creature->IsTotem()) ai_factory = ai_registry.GetRegistryItem("TotemAI"); // select by script name diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index fc4d7d72a35..21c8f68f789 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -1084,13 +1084,13 @@ void CreatureEventAI::MoveInLineOfSight(Unit *who) } } - if (m_creature->isCivilian() || m_creature->IsNeutralToAll()) + if (m_creature->IsCivilian() || m_creature->IsNeutralToAll()) return; if (m_creature->CanInitiateAttack() && who->isTargetableForAttack() && m_creature->IsHostileTo(who) && who->isInAccessablePlaceFor(m_creature)) { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) return; float attackRadius = m_creature->GetAttackDistance(who); diff --git a/src/game/FleeingMovementGenerator.cpp b/src/game/FleeingMovementGenerator.cpp index a686659cd77..7670f29c6d8 100644 --- a/src/game/FleeingMovementGenerator.cpp +++ b/src/game/FleeingMovementGenerator.cpp @@ -312,8 +312,8 @@ FleeingMovementGenerator::_Init(Creature &owner) { owner.RemoveSplineFlag(SPLINEFLAG_WALKMODE); owner.SetTargetGUID(0); - is_water_ok = owner.canSwim(); - is_land_ok = owner.canWalk(); + is_water_ok = owner.CanSwim(); + is_land_ok = owner.CanWalk(); } template<> diff --git a/src/game/Formulas.h b/src/game/Formulas.h index f96154e14e2..46c58007e03 100644 --- a/src/game/Formulas.h +++ b/src/game/Formulas.h @@ -111,7 +111,7 @@ namespace MaNGOS inline uint32 Gain(Player *pl, Unit *u) { if(u->GetTypeId()==TYPEID_UNIT && ( - ((Creature*)u)->isTotem() || ((Creature*)u)->isPet() || + ((Creature*)u)->IsTotem() || ((Creature*)u)->IsPet() || (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) )) return 0; @@ -119,7 +119,7 @@ namespace MaNGOS if( xp_gain == 0 ) return 0; - if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isElite()) + if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->IsElite()) xp_gain *= 2; return (uint32)(xp_gain*sWorld.getConfig(CONFIG_FLOAT_RATE_XP_KILL)); diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 2469294d024..29bf7726097 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -635,7 +635,7 @@ GameObjectInfo const *GameObject::GetGOInfo() const /*********************************************************/ /*** QUEST SYSTEM ***/ /*********************************************************/ -bool GameObject::hasQuest(uint32 quest_id) const +bool GameObject::HasQuest(uint32 quest_id) const { QuestRelationsMapBounds bounds = sObjectMgr.GetGOQuestRelationsMapBounds(GetEntry()); for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr) @@ -646,7 +646,7 @@ bool GameObject::hasQuest(uint32 quest_id) const return false; } -bool GameObject::hasInvolvedQuest(uint32 quest_id) const +bool GameObject::HasInvolvedQuest(uint32 quest_id) const { QuestRelationsMapBounds bounds = sObjectMgr.GetGOQuestInvolvedRelationsMapBounds(GetEntry()); for(QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr) diff --git a/src/game/GameObject.h b/src/game/GameObject.h index 1f405f8ce22..f09e74958dc 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -690,8 +690,8 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject Loot loot; - bool hasQuest(uint32 quest_id) const; - bool hasInvolvedQuest(uint32 quest_id) const; + bool HasQuest(uint32 quest_id) const; + bool HasInvolvedQuest(uint32 quest_id) const; bool ActivateToQuest(Player *pTarget) const; void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false); // 0 = use `gameobject`.`spawntimesecs` diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index 01fd2d6016b..acce56b9527 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -554,7 +554,7 @@ namespace MaNGOS bool operator()(Creature* u) { if (i_fobj->isHonorOrXPTarget(u) || - u->getDeathState() != CORPSE || u->isDeadByDefault() || u->IsTaxiFlying() || + u->getDeathState() != CORPSE || u->IsDeadByDefault() || u->IsTaxiFlying() || ( u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1)) )==0 || (u->GetDisplayId() != u->GetNativeDisplayId())) return false; @@ -582,7 +582,7 @@ namespace MaNGOS } bool operator()(Creature* u) { - if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() || u->isDeadByDefault() || + if (u->getDeathState()!=CORPSE || u->IsTaxiFlying() || u->IsDeadByDefault() || (u->GetDisplayId() != u->GetNativeDisplayId()) || (u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL)!=0) return false; @@ -896,7 +896,7 @@ namespace MaNGOS return false; // ignore totems as AoE targets - if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isTotem()) + if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->IsTotem()) return false; // check visibility only for unit-like original casters @@ -931,7 +931,7 @@ namespace MaNGOS if (!u->isTargetableForAttack()) return false; - if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isTotem()) + if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->IsTotem()) return false; if(( i_targetForPlayer ? !i_obj->IsFriendlyTo(u) : i_obj->IsHostileTo(u) )&& i_obj->IsWithinDistInMap(u, i_range)) diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index ed1f7415865..8b50bf2284b 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -132,7 +132,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) if (!target->isAlive() || target->IsTaxiFlying() ) return; - if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem()) + if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsTotem()) return; if (!i_dynobject.IsWithinDistInMap(target, i_dynobject.GetRadius())) @@ -168,7 +168,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) SpellEffectIndex eff_index = i_dynobject.GetEffIndex(); // Check target immune to spell or aura - if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index)) + if (target->IsImmuneToSpell(spellInfo) || target->IsImmuneToSpellEffect(spellInfo, eff_index)) return; // Apply PersistentAreaAura on target diff --git a/src/game/GuardAI.cpp b/src/game/GuardAI.cpp index 5818bed9c77..877e7d4ba12 100644 --- a/src/game/GuardAI.cpp +++ b/src/game/GuardAI.cpp @@ -38,7 +38,7 @@ GuardAI::GuardAI(Creature *c) : CreatureAI(c), i_victimGuid(0), i_state(STATE_NO void GuardAI::MoveInLineOfSight(Unit *u) { // Ignore Z for flying creatures - if (!m_creature->canFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE) + if (!m_creature->CanFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE) return; if (!m_creature->getVictim() && u->isTargetableForAttack() && diff --git a/src/game/HomeMovementGenerator.cpp b/src/game/HomeMovementGenerator.cpp index 13274bd18be..0406fbdc4e3 100644 --- a/src/game/HomeMovementGenerator.cpp +++ b/src/game/HomeMovementGenerator.cpp @@ -81,7 +81,7 @@ HomeMovementGenerator::Update(Creature &owner, const uint32& time_diff } } - owner.LoadCreaturesAddon(true); + owner.LoadCreatureAddon(true); owner.AI()->JustReachedHome(); return false; } diff --git a/src/game/Item.h b/src/game/Item.h index b5e47ec5690..33ac5417189 100644 --- a/src/game/Item.h +++ b/src/game/Item.h @@ -320,8 +320,8 @@ class MANGOS_DLL_SPEC Item : public Object uState = state; } - bool hasQuest(uint32 quest_id) const { return GetProto()->StartQuest == quest_id; } - bool hasInvolvedQuest(uint32 /*quest_id*/) const { return false; } + bool HasQuest(uint32 quest_id) const { return GetProto()->StartQuest == quest_id; } + bool HasInvolvedQuest(uint32 /*quest_id*/) const { return false; } bool IsPotion() const { return GetProto()->IsPotion(); } bool IsConjuredConsumable() const { return GetProto()->IsConjuredConsumable(); } diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 208021a5351..11957054fde 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -907,7 +907,7 @@ bool ChatHandler::HandleModifyTalentCommand (char* args) ((Player*)target)->SendTalentsInfoData(false); return true; } - else if(((Creature*)target)->isPet()) + else if(((Creature*)target)->IsPet()) { Unit *owner = target->GetOwner(); if(owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet *)target)->IsPermanentPetFor((Player*)owner)) diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 59daa980f02..e6790611e3f 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1706,7 +1706,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(char* args) pCreature->GetMotionMaster()->Initialize(); if (pCreature->isAlive()) // dead creature will reset movement generator at respawn { - pCreature->setDeathState(JUST_DIED); + pCreature->SetDeathState(JUST_DIED); pCreature->Respawn(); } pCreature->SaveToDB(); @@ -1739,7 +1739,7 @@ bool ChatHandler::HandleNpcChangeLevelCommand(char* args) return false; } - if (pCreature->isPet()) + if (pCreature->IsPet()) { if (((Pet*)pCreature)->getPetType()==HUNTER_PET) { @@ -1805,7 +1805,7 @@ bool ChatHandler::HandleNpcDeleteCommand(char* args) else unit = getSelectedCreature(); - if (!unit || unit->isPet() || unit->isTotem() || unit->isVehicle()) + if (!unit || unit->IsPet() || unit->IsTotem() || unit->IsVehicle()) { SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); @@ -1875,7 +1875,7 @@ bool ChatHandler::HandleNpcMoveCommand(char* args) pCreature->GetMotionMaster()->Initialize(); if (pCreature->isAlive()) // dead creature will reset movement generator at respawn { - pCreature->setDeathState(JUST_DIED); + pCreature->SetDeathState(JUST_DIED); pCreature->Respawn(); } } @@ -1912,7 +1912,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(char* args) if (!ExtractUInt32(&args, lowguid)) // case .setmovetype $move_type (with selected creature) { pCreature = getSelectedCreature(); - if (!pCreature || pCreature->isPet()) + if (!pCreature || pCreature->IsPet()) return false; lowguid = pCreature->GetDBTableGUIDLow(); } @@ -1966,7 +1966,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(char* args) pCreature->GetMotionMaster()->Initialize(); if (pCreature->isAlive()) // dead creature will reset movement generator at respawn { - pCreature->setDeathState(JUST_DIED); + pCreature->SetDeathState(JUST_DIED); pCreature->Respawn(); } pCreature->SaveToDB(); @@ -1990,7 +1990,7 @@ bool ChatHandler::HandleNpcSetModelCommand(char* args) Creature *pCreature = getSelectedCreature(); - if (!pCreature || pCreature->isPet()) + if (!pCreature || pCreature->IsPet()) { SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); @@ -2074,7 +2074,7 @@ bool ChatHandler::HandleNpcSpawnDistCommand(char* args) pCreature->GetMotionMaster()->Initialize(); if (pCreature->isAlive()) // dead creature will reset movement generator at respawn { - pCreature->setDeathState(JUST_DIED); + pCreature->SetDeathState(JUST_DIED); pCreature->Respawn(); } @@ -2165,7 +2165,7 @@ bool ChatHandler::HandleNpcUnFollowCommand(char* /*args*/) bool ChatHandler::HandleNpcTameCommand(char* /*args*/) { Creature *creatureTarget = getSelectedCreature (); - if (!creatureTarget || creatureTarget->isPet ()) + if (!creatureTarget || creatureTarget->IsPet ()) { PSendSysMessage (LANG_SELECT_CREATURE); SetSentErrorMessage (true); @@ -2252,7 +2252,7 @@ bool ChatHandler::HandleNpcSetPhaseCommand(char* args) pCreature->SetPhaseMask(phasemask,true); - if (!pCreature->isPet()) + if (!pCreature->IsPet()) pCreature->SaveToDB(); return true; @@ -2269,7 +2269,7 @@ bool ChatHandler::HandleNpcSetDeathStateCommand(char* args) } Creature* pCreature = getSelectedCreature(); - if (!pCreature || pCreature->isPet()) + if (!pCreature || pCreature->IsPet()) { SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); @@ -2861,7 +2861,7 @@ bool ChatHandler::HandleWpAddCommand(char* args) // No GUID provided // -> Player must have selected a creature - if (!target || target->isPet()) + if (!target || target->IsPet()) { SendSysMessage(LANG_SELECT_CREATURE); SetSentErrorMessage(true); @@ -2945,7 +2945,7 @@ bool ChatHandler::HandleWpAddCommand(char* args) } target = m_session->GetPlayer()->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, data->id, lowguid)); - if (!target || target->isPet()) + if (!target || target->IsPet()) { PSendSysMessage(LANG_WAYPOINT_CREATNOTFOUND, lowguid); SetSentErrorMessage(true); @@ -2968,7 +2968,7 @@ bool ChatHandler::HandleWpAddCommand(char* args) target->GetMotionMaster()->Initialize(); if (target->isAlive()) // dead creature will reset movement generator at respawn { - target->setDeathState(JUST_DIED); + target->SetDeathState(JUST_DIED); target->Respawn(); } target->SaveToDB(); @@ -3184,7 +3184,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args) npcCreature->GetMotionMaster()->Initialize(); if (npcCreature->isAlive()) // dead creature will reset movement generator at respawn { - npcCreature->setDeathState(JUST_DIED); + npcCreature->SetDeathState(JUST_DIED); npcCreature->Respawn(); } } @@ -3272,7 +3272,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args) npcCreature->GetMotionMaster()->Initialize(); if (npcCreature->isAlive()) // dead creature will reset movement generator at respawn { - npcCreature->setDeathState(JUST_DIED); + npcCreature->SetDeathState(JUST_DIED); npcCreature->Respawn(); } npcCreature->SaveToDB(); @@ -3342,7 +3342,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args) npcCreature->GetMotionMaster()->Initialize(); if (npcCreature->isAlive()) // dead creature will reset movement generator at respawn { - npcCreature->setDeathState(JUST_DIED); + npcCreature->SetDeathState(JUST_DIED); npcCreature->Respawn(); } } @@ -3376,7 +3376,7 @@ bool ChatHandler::HandleWpModifyCommand(char* args) npcCreature->GetMotionMaster()->Initialize(); if (npcCreature->isAlive()) // dead creature will reset movement generator at respawn { - npcCreature->setDeathState(JUST_DIED); + npcCreature->SetDeathState(JUST_DIED); npcCreature->Respawn(); } } diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 6b4298bfa9d..27d32394f7f 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4849,7 +4849,7 @@ bool ChatHandler::HandleResetTalentsCommand(char* args) { // Try reset talents as Hunter Pet Creature* creature = getSelectedCreature(); - if (!*args && creature && creature->isPet()) + if (!*args && creature && creature->IsPet()) { Unit *owner = creature->GetOwner(); if(owner && owner->GetTypeId() == TYPEID_PLAYER && ((Pet *)creature)->IsPermanentPetFor((Player*)owner)) diff --git a/src/game/Map.cpp b/src/game/Map.cpp index d934afeb1cc..3a4c4401eeb 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -186,7 +186,7 @@ template<> void Map::AddToGrid(Creature* obj, NGridType *grid, Cell const& cell) { // add to world object registry in grid - if(obj->isPet() || obj->isVehicle()) + if(obj->IsPet() || obj->IsVehicle()) { (*grid)(cell.CellX(), cell.CellY()).AddWorldObject(obj); obj->SetCurrentCell(cell); @@ -230,7 +230,7 @@ template<> void Map::RemoveFromGrid(Creature* obj, NGridType *grid, Cell const& cell) { // remove from world object registry in grid - if(obj->isPet() || obj->isVehicle()) + if(obj->IsPet() || obj->IsVehicle()) { (*grid)(cell.CellX(), cell.CellY()).RemoveWorldObject(obj); } @@ -1595,7 +1595,7 @@ void Map::AddToActive( WorldObject* obj ) { Creature* c= (Creature*)obj; - if (!c->isPet() && c->GetDBTableGUIDLow()) + if (!c->IsPet() && c->GetDBTableGUIDLow()) { float x,y,z; c->GetRespawnCoord(x,y,z); @@ -1630,7 +1630,7 @@ void Map::RemoveFromActive( WorldObject* obj ) { Creature* c= (Creature*)obj; - if(!c->isPet() && c->GetDBTableGUIDLow()) + if(!c->IsPet() && c->GetDBTableGUIDLow()) { float x,y,z; c->GetRespawnCoord(x,y,z); diff --git a/src/game/NPCHandler.cpp b/src/game/NPCHandler.cpp index 4c0dfeb9e7f..e583172f3e2 100644 --- a/src/game/NPCHandler.cpp +++ b/src/game/NPCHandler.cpp @@ -130,7 +130,7 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle ) GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); // trainer list loaded at check; - if(!unit->isCanTrainingOf(_player,true)) + if(!unit->IsTrainerOf(_player,true)) return; CreatureInfo const *ci = unit->GetCreatureInfo(); @@ -214,7 +214,7 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data ) if(GetPlayer()->hasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); - if(!unit->isCanTrainingOf(_player,true)) + if(!unit->IsTrainerOf(_player,true)) return; // check present spell in trainer spell list diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 4b66c095d42..60c52acf5f8 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -249,7 +249,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const uint16 moveFlags2 = (isType(TYPEMASK_UNIT) ? ((Unit*)this)->m_movementInfo.GetMovementFlags2() : MOVEFLAG2_NONE); if(GetTypeId() == TYPEID_UNIT) - if(((Creature*)this)->isVehicle()) + if(((Creature*)this)->IsVehicle()) moveFlags2 |= MOVEFLAG2_ALLOW_PITCHING; // always allow pitch *data << uint16(updateFlags); // update flags @@ -269,7 +269,7 @@ void Object::BuildMovementUpdate(ByteBuffer * data, uint16 updateFlags) const /*if (((Creature*)unit)->hasUnitState(UNIT_STAT_MOVING)) unit->m_movementInfo.SetMovementFlags(MOVEFLAG_FORWARD);*/ - if (((Creature*)unit)->canFly()) + if (((Creature*)unit)->CanFly()) { // (ok) most seem to have this unit->m_movementInfo.AddMovementFlag(MOVEFLAG_LEVITATING); @@ -606,7 +606,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask * if (appendValue & UNIT_NPC_FLAG_TRAINER) { - if (!((Creature*)this)->isCanTrainingOf(target, false)) + if (!((Creature*)this)->IsTrainerOf(target, false)) appendValue &= ~(UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS | UNIT_NPC_FLAG_TRAINER_PROFESSION); } @@ -1488,11 +1488,11 @@ void WorldObject::UpdateAllowedPositionZ(float x, float y, float &z) const { // non fly unit don't must be in air // non swim unit must be at ground (mostly speedup, because it don't must be in water and water level check less fast - if (!((Creature const*)this)->canFly()) + if (!((Creature const*)this)->CanFly()) { - bool canSwim = ((Creature const*)this)->canSwim(); + bool CanSwim = ((Creature const*)this)->CanSwim(); float ground_z = z; - float max_z = canSwim + float max_z = CanSwim ? GetBaseMap()->GetWaterOrGroundLevel(x, y, z, &ground_z, !((Unit const*)this)->HasAuraType(SPELL_AURA_WATER_WALK)) : ((ground_z = GetBaseMap()->GetHeight(x, y, z, true))); if (max_z > INVALID_HEIGHT) diff --git a/src/game/Object.h b/src/game/Object.h index 58bee490d92..9da8b345ff3 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -289,8 +289,8 @@ class MANGOS_DLL_SPEC Object void InitValues() { _InitValues(); } - virtual bool hasQuest(uint32 /* quest_id */) const { return false; } - virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; } + virtual bool HasQuest(uint32 /* quest_id */) const { return false; } + virtual bool HasInvolvedQuest(uint32 /* quest_id */) const { return false; } protected: Object ( ); diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index 9fa5a0bf9a6..d0405903877 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -57,7 +57,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m) Creature * c = iter->getSource(); - MANGOS_ASSERT((!c->isPet() || !c->isVehicle()) && "ObjectGridRespawnMover don't must be called for pets"); + MANGOS_ASSERT((!c->IsPet() || !c->IsVehicle()) && "ObjectGridRespawnMover don't must be called for pets"); Cell const& cur_cell = c->GetCurrentCell(); diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index ab9c911c00c..400270b9874 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -452,9 +452,9 @@ void Pet::DeleteFromDB(uint32 guidlow) CharacterDatabase.PExecute("DELETE FROM pet_spell_cooldown WHERE guid = '%u'", guidlow); } -void Pet::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState +void Pet::SetDeathState(DeathState s) // overwrite virtual Creature::SetDeathState and Unit::SetDeathState { - Creature::setDeathState(s); + Creature::SetDeathState(s); if(getDeathState()==CORPSE) { //remove summoned pet (no corpse) diff --git a/src/game/Pet.h b/src/game/Pet.h index 15ee86a65d4..15d3a6e8dd3 100644 --- a/src/game/Pet.h +++ b/src/game/Pet.h @@ -156,7 +156,7 @@ class Pet : public Creature void Remove(PetSaveMode mode, bool returnreagent = false); static void DeleteFromDB(uint32 guidlow); - void setDeathState(DeathState s); // overwrite virtual Creature::setDeathState and Unit::setDeathState + void SetDeathState(DeathState s); // overwrite virtual Creature::SetDeathState and Unit::SetDeathState void Update(uint32 diff); // overwrite virtual Creature::Update and Unit::Update uint8 GetPetAutoSpellSize() const { return m_autospells.size(); } diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 45db4d35451..4cdd42dcf66 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -30,7 +30,7 @@ int PetAI::Permissible(const Creature *creature) { - if( creature->isPet()) + if( creature->IsPet()) return PERMIT_BASE_SPECIAL; return PERMIT_BASE_NO; @@ -47,7 +47,7 @@ void PetAI::MoveInLineOfSight(Unit *u) if (m_creature->getVictim()) return; - if (m_creature->isPet() && ((Pet*)m_creature)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS) + if (m_creature->IsPet() && ((Pet*)m_creature)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS) return; if (!m_creature->GetCharmInfo() || !m_creature->GetCharmInfo()->HasReactState(REACT_AGGRESSIVE)) @@ -70,7 +70,7 @@ void PetAI::MoveInLineOfSight(Unit *u) void PetAI::AttackStart(Unit *u) { - if(!u || (m_creature->isPet() && ((Pet*)m_creature)->getPetType() == MINI_PET)) + if(!u || (m_creature->IsPet() && ((Pet*)m_creature)->getPetType() == MINI_PET)) return; if(m_creature->Attack(u,true)) @@ -144,7 +144,7 @@ void PetAI::UpdateAI(const uint32 diff) else m_updateAlliesTimer -= diff; - if (inCombat && (!m_creature->getVictim() || m_creature->isPet() && ((Pet*)m_creature)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS)) + if (inCombat && (!m_creature->getVictim() || m_creature->IsPet() && ((Pet*)m_creature)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS)) _stopAttack(); // i_pet.getVictim() can't be used for check in case stop fighting, i_pet.getVictim() clear at Unit death etc. diff --git a/src/game/PetHandler.cpp b/src/game/PetHandler.cpp index 6b1c8e601ee..61c6be4c831 100644 --- a/src/game/PetHandler.cpp +++ b/src/game/PetHandler.cpp @@ -66,7 +66,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) if (!(flag == ACT_COMMAND && spellid == COMMAND_ATTACK)) return; } - else if (((Creature*)pet)->isPet()) + else if (((Creature*)pet)->IsPet()) { // pet can have action bar disabled if(((Pet*)pet)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS) @@ -128,7 +128,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) ((Creature*)pet)->AI()->AttackStart(TargetUnit); // 10% chance to play special pet attack talk, else growl - if(((Creature*)pet)->isPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && roll_chance_i(10)) + if(((Creature*)pet)->IsPet() && ((Pet*)pet)->getPetType() == SUMMON_PET && pet != TargetUnit && roll_chance_i(10)) pet->SendPetTalk((uint32)PET_TALK_ATTACK); else { @@ -140,14 +140,14 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) break; } case COMMAND_ABANDON: // abandon (hunter pet) or dismiss (summoned pet) - if(((Creature*)pet)->isPet()) + if(((Creature*)pet)->IsPet()) { Pet* p = (Pet*)pet; if(p->getPetType() == HUNTER_PET) _player->RemovePet(p,PET_SAVE_AS_DELETED); else //dismissing a summoned pet is like killing them (this prevents returning a soulshard...) - p->setDeathState(CORPSE); + p->SetDeathState(CORPSE); } else // charmed _player->Uncharm(); @@ -230,7 +230,7 @@ void WorldSession::HandlePetAction( WorldPacket & recv_data ) //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(((Creature*)pet)->isPet() && (((Pet*)pet)->getPetType() == SUMMON_PET) && (pet != unit_target) && (urand(0, 100) < 10)) + if(((Creature*)pet)->IsPet() && (((Pet*)pet)->getPetType() == SUMMON_PET) && (pet != unit_target) && (urand(0, 100) < 10)) pet->SendPetTalk((uint32)PET_TALK_SPECIAL_SPELL); else { @@ -324,7 +324,7 @@ void WorldSession::SendPetNameQuery( uint64 petguid, uint32 petnumber) data << name.c_str(); 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(int i = 0; i < MAX_DECLINED_NAME_CASES; ++i) @@ -354,7 +354,7 @@ void WorldSession::HandlePetSetAction( WorldPacket & recv_data ) } // pet can have action bar disabled - if(pet->isPet() && ((Pet*)pet)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS) + if(pet->IsPet() && ((Pet*)pet)->GetModeFlags() & PET_MODE_DISABLE_ACTIONS) return; CharmInfo *charmInfo = pet->GetCharmInfo(); @@ -535,7 +535,7 @@ void WorldSession::HandlePetAbandon( WorldPacket & recv_data ) // pet/charmed if (Creature* pet = _player->GetMap()->GetAnyTypeCreature(guid)) { - if(pet->isPet()) + if(pet->IsPet()) { if(pet->GetGUID() == _player->GetPetGUID()) { @@ -671,7 +671,7 @@ void WorldSession::HandlePetCastSpellOpcode( WorldPacket& recvPacket ) if (result == SPELL_CAST_OK) { pet->AddCreatureSpellCooldown(spellid); - if (pet->isPet()) + if (pet->IsPet()) { //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 diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 279cc8f1810..4fa2ced372f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -1474,7 +1474,7 @@ void Player::Update( uint32 p_time ) TeleportTo(m_teleport_dest, m_teleport_options); } -void Player::setDeathState(DeathState s) +void Player::SetDeathState(DeathState s) { uint32 ressSpellId = 0; @@ -1484,7 +1484,7 @@ void Player::setDeathState(DeathState s) { // drunken state is cleared on death SetDrunkValue(0); - // lost combo points at any target (targeted combo points clear in Unit::setDeathState) + // lost combo points at any target (targeted combo points clear in Unit::SetDeathState) ClearComboPoints(); clearResurrectRequestData(); @@ -1492,13 +1492,13 @@ void Player::setDeathState(DeathState s) // remove form before other mods to prevent incorrect stats calculation RemoveAurasDueToSpell(m_ShapeShiftFormSpellId); - //FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) + //FIXME: is pet dismissed at dying or releasing spirit? if second, add SetDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD) RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); // remove uncontrolled pets RemoveMiniPet(); - // save value before aura remove in Unit::setDeathState + // save value before aura remove in Unit::SetDeathState ressSpellId = GetUInt32Value(PLAYER_SELF_RES_SPELL); // passive spell @@ -1513,7 +1513,7 @@ void Player::setDeathState(DeathState s) mapInstance->OnPlayerDeath(this); } - Unit::setDeathState(s); + Unit::SetDeathState(s); // restore resurrection spell id for player after aura remove if(s == JUST_DIED && cur && ressSpellId) @@ -4475,7 +4475,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) RemoveAurasDueToSpell(20584); // speed bonuses RemoveAurasDueToSpell(8326); // SPELL_AURA_GHOST - setDeathState(ALIVE); + SetDeathState(ALIVE); SetMovement(MOVE_LAND_WALK); SetMovement(MOVE_UNROOT); @@ -4538,7 +4538,7 @@ void Player::KillPlayer() StopMirrorTimers(); //disable timers(bars) - setDeathState(CORPSE); + SetDeathState(CORPSE); //SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_IN_PVP ); SetFlag(UNIT_DYNAMIC_FLAGS, 0x00); @@ -5570,7 +5570,7 @@ void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool de { uint32 plevel = getLevel(); // if defense than pVictim == attacker uint32 greylevel = MaNGOS::XP::GetGrayLevel(plevel); - uint32 moblevel = pVictim->getLevelForTarget(this); + uint32 moblevel = pVictim->GetLevelForTarget(this); if(moblevel < greylevel) return; @@ -6531,7 +6531,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor) { Creature *cVictim = (Creature *)uVictim; - if (!cVictim->isRacialLeader()) + if (!cVictim->IsRacialLeader()) return false; honor = 100; // ??? need more info @@ -12756,11 +12756,11 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) break; } case GOSSIP_OPTION_TRAINER: - if (!pCreature->isCanTrainingOf(this, false)) + if (!pCreature->IsTrainerOf(this, false)) hasMenuItem = false; break; case GOSSIP_OPTION_UNLEARNTALENTS: - if (!pCreature->isCanTrainingAndResetTalentsOf(this)) + if (!pCreature->CanTrainAndResetTalentsOf(this)) hasMenuItem = false; break; case GOSSIP_OPTION_UNLEARNPETSKILLS: @@ -12772,7 +12772,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) return; break; case GOSSIP_OPTION_BATTLEFIELD: - if (!pCreature->isCanInteractWithBattleMaster(this, false)) + if (!pCreature->CanInteractWithBattleMaster(this, false)) hasMenuItem = false; break; case GOSSIP_OPTION_STABLEPET: @@ -12851,13 +12851,13 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId) if (pCreature->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_TRAINER)) { // output error message if need - pCreature->isCanTrainingOf(this, true); + pCreature->IsTrainerOf(this, true); } if (pCreature->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_BATTLEMASTER)) { // output error message if need - pCreature->isCanInteractWithBattleMaster(this, true); + pCreature->CanInteractWithBattleMaster(this, true); } }*/ } @@ -19320,7 +19320,7 @@ inline void BeforeVisibilityDestroy(T* /*t*/, Player* /*p*/) template<> inline void BeforeVisibilityDestroy(Creature* t, Player* p) { - if (p->GetPetGUID()==t->GetGUID() && ((Creature*)t)->isPet()) + if (p->GetPetGUID()==t->GetGUID() && ((Creature*)t)->IsPet()) ((Pet*)t)->Remove(PET_SAVE_NOT_IN_SLOT, true); } @@ -20305,8 +20305,8 @@ bool Player::isHonorOrXPTarget(Unit* pVictim) const if(pVictim->GetTypeId() == TYPEID_UNIT) { - if (((Creature*)pVictim)->isTotem() || - ((Creature*)pVictim)->isPet() || + if (((Creature*)pVictim)->IsTotem() || + ((Creature*)pVictim)->IsPet() || ((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) return false; } @@ -22205,7 +22205,7 @@ void Player::SendDuelCountdown(uint32 counter) GetSession()->SendPacket(&data); } -bool Player::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const +bool Player::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const { switch(spellInfo->Effect[index]) { @@ -22221,7 +22221,7 @@ bool Player::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectInde default: break; } - return Unit::IsImmunedToSpellEffect(spellInfo, index); + return Unit::IsImmuneToSpellEffect(spellInfo, index); } void Player::SetHomebindToLocation(WorldLocation const& loc, uint32 area_id) diff --git a/src/game/Player.h b/src/game/Player.h index 4a9240e51f5..2915d5b23d0 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1199,7 +1199,7 @@ class MANGOS_DLL_SPEC Player : public Unit void ResetTimeSync(); void SendTimeSync(); - void setDeathState(DeathState s); // overwrite Unit::setDeathState + void SetDeathState(DeathState s); // overwrite Unit::SetDeathState float GetRestBonus() const { return m_rest_bonus; } void SetRestBonus(float rest_bonus_new); @@ -1642,7 +1642,7 @@ class MANGOS_DLL_SPEC Player : public Unit TrainerSpellState GetTrainerSpellState(TrainerSpell const* trainer_spell) const; bool IsSpellFitByClassAndRace( uint32 spell_id ) const; bool IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const; - bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; + bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask); void SendInitialSpells(); diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp index b8dcb429855..bc48ffe8f1d 100644 --- a/src/game/PointMovementGenerator.cpp +++ b/src/game/PointMovementGenerator.cpp @@ -36,7 +36,7 @@ void PointMovementGenerator::Initialize(T &unit) Traveller traveller(unit); i_destinationHolder.SetDestination(traveller, i_x, i_y, i_z); - if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->canFly()) + if (unit.GetTypeId() == TYPEID_UNIT && ((Creature*)&unit)->CanFly()) ((Creature&)unit).AddSplineFlag(SPLINEFLAG_UNKNOWN7); } @@ -103,7 +103,7 @@ void PointMovementGenerator::MovementInform(Creature &unit) if (unit.AI()) unit.AI()->MovementInform(POINT_MOTION_TYPE, id); - if (unit.isTemporarySummon()) + if (unit.IsTemporarySummon()) { TemporarySummon* pSummon = (TemporarySummon*)(&unit); if (pSummon->GetSummonerGuid().IsCreature()) diff --git a/src/game/PoolManager.cpp b/src/game/PoolManager.cpp index 3ff2ca8a009..b3df9e2c655 100644 --- a/src/game/PoolManager.cpp +++ b/src/game/PoolManager.cpp @@ -385,7 +385,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj, bool instantly) if(!instantly) { pCreature->SetRespawnTime( pCreature->GetRespawnDelay() ); - if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY) || pCreature->isWorldBoss()) + if (sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATLY) || pCreature->IsWorldBoss()) pCreature->SaveRespawnTime(); } map->Add(pCreature); diff --git a/src/game/QuestHandler.cpp b/src/game/QuestHandler.cpp index 0d6f386e797..d8bc812bbc4 100644 --- a/src/game/QuestHandler.cpp +++ b/src/game/QuestHandler.cpp @@ -128,7 +128,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data ) // no or incorrect quest giver if(!pObject - || (pObject->GetTypeId()!=TYPEID_PLAYER && !pObject->hasQuest(quest)) + || (pObject->GetTypeId()!=TYPEID_PLAYER && !pObject->HasQuest(quest)) || (pObject->GetTypeId()==TYPEID_PLAYER && !((Player*)pObject)->CanShareQuest(quest)) ) { @@ -243,7 +243,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode( WorldPacket & recv_data ) // Verify that the guid is valid and is a questgiver or involved in the requested quest Object* pObject = _player->GetObjectByTypeMask(guid, TYPEMASK_CREATURE_GAMEOBJECT_OR_ITEM); - if(!pObject||!pObject->hasQuest(quest) && !pObject->hasInvolvedQuest(quest)) + if(!pObject||!pObject->HasQuest(quest) && !pObject->HasInvolvedQuest(quest)) { _player->PlayerTalkClass->CloseGossip(); return; @@ -290,7 +290,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data ) if(!pObject) return; - if(!pObject->hasInvolvedQuest(quest)) + if(!pObject->HasInvolvedQuest(quest)) return; Quest const *pQuest = sObjectMgr.GetQuestTemplate(quest); @@ -337,7 +337,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode( WorldPacket & recv_data DEBUG_LOG( "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest ); Object* pObject = _player->GetObjectByTypeMask(guid, TYPEMASK_CREATURE_OR_GAMEOBJECT); - if(!pObject||!pObject->hasInvolvedQuest(quest)) + if(!pObject||!pObject->HasInvolvedQuest(quest)) return; if ( _player->CanCompleteQuest( quest ) ) diff --git a/src/game/RandomMovementGenerator.cpp b/src/game/RandomMovementGenerator.cpp index be68677cdd9..892aeb17a79 100644 --- a/src/game/RandomMovementGenerator.cpp +++ b/src/game/RandomMovementGenerator.cpp @@ -35,9 +35,9 @@ RandomMovementGenerator::_setRandomLocation(Creature &creature) Map const* map = creature.GetBaseMap(); // For 2D/3D system selection - //bool is_land_ok = creature.canWalk(); // not used? - //bool is_water_ok = creature.canSwim(); // not used? - bool is_air_ok = creature.canFly(); + //bool is_land_ok = creature.CanWalk(); // not used? + //bool is_water_ok = creature.CanSwim(); // not used? + bool is_air_ok = creature.CanFly(); const float angle = rand_norm_f() * (M_PI_F*2.0f); const float range = rand_norm_f() * wander_distance; @@ -116,7 +116,7 @@ void RandomMovementGenerator::Initialize(Creature &creature) if (!creature.isAlive()) return; - if (creature.canFly()) + if (creature.CanFly()) creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7); else creature.AddSplineFlag(SPLINEFLAG_WALKMODE); @@ -155,7 +155,7 @@ bool RandomMovementGenerator::Update(Creature &creature, const uint32 i_nextMoveTime.Update(diff); - if (i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.canFly()) + if (i_destinationHolder.HasArrived() && !creature.IsStopped() && !creature.CanFly()) creature.clearUnitState(UNIT_STAT_ROAMING_MOVE); if (!i_destinationHolder.HasArrived() && creature.IsStopped()) @@ -170,14 +170,14 @@ bool RandomMovementGenerator::Update(Creature &creature, const uint32 if (i_nextMoveTime.Passed()) { - if (creature.canFly()) + if (creature.CanFly()) creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7); else creature.AddSplineFlag(SPLINEFLAG_WALKMODE); _setRandomLocation(creature); } - else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f)) + else if (creature.IsPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f)) { creature.AddSplineFlag(SPLINEFLAG_WALKMODE); _setRandomLocation(creature); diff --git a/src/game/ReactorAI.cpp b/src/game/ReactorAI.cpp index 25c5cd425ad..5eae25ac341 100644 --- a/src/game/ReactorAI.cpp +++ b/src/game/ReactorAI.cpp @@ -28,7 +28,7 @@ int ReactorAI::Permissible(const Creature *creature) { - if( creature->isCivilian() || creature->IsNeutralToAll() ) + if( creature->IsCivilian() || creature->IsNeutralToAll() ) return PERMIT_BASE_REACTIVE; return PERMIT_BASE_NO; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 828172941b4..5139c9844d1 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -797,7 +797,7 @@ void Spell::AddUnitTarget(Unit* pVictim, SpellEffectIndex effIndex) return; // Check for effect immune skip if immuned - bool immuned = pVictim->IsImmunedToSpellEffect(m_spellInfo, effIndex); + bool immuned = pVictim->IsImmuneToSpellEffect(m_spellInfo, effIndex); ObjectGuid targetGUID = pVictim->GetObjectGuid(); @@ -1106,7 +1106,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 (real_caster && !((Creature*)unit)->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive()) + if (real_caster && !((Creature*)unit)->IsPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive()) if (Player* p = real_caster->GetCharmerOrOwnerPlayerOrPlayerItself()) p->RewardPlayerAndGroupAtCast(unit, m_spellInfo->Id); @@ -1129,7 +1129,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) // Recheck immune (only for delayed spells) if (m_spellInfo->speed && ( unit->IsImmunedToDamage(GetSpellSchoolMask(m_spellInfo)) || - unit->IsImmunedToSpell(m_spellInfo))) + unit->IsImmuneToSpell(m_spellInfo))) { if (realCaster) realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_IMMUNE); @@ -1915,7 +1915,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& break; case TARGET_NONCOMBAT_PET: if(Unit* target = m_targets.getUnitTarget()) - if( target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isPet() && ((Pet*)target)->getPetType() == MINI_PET) + if( target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsPet() && ((Pet*)target)->getPetType() == MINI_PET) targetUnitMap.push_back(target); break; case TARGET_CASTER_COORDINATES: @@ -2011,7 +2011,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& } else if (m_caster->GetTypeId() == TYPEID_PLAYER) { - if( targetOwner == m_caster && target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isPet()) + if( targetOwner == m_caster && target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsPet()) { targetUnitMap.push_back(target); break; @@ -2025,7 +2025,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& if(targetOwner) { if( targetOwner->GetTypeId() == TYPEID_PLAYER && - target->GetTypeId() == TYPEID_UNIT && (((Creature*)target)->isPet()) && + target->GetTypeId() == TYPEID_UNIT && (((Creature*)target)->IsPet()) && target->GetOwnerGUID() == targetOwner->GetGUID() && pGroup->IsMember(((Player*)targetOwner)->GetObjectGuid())) { @@ -2125,7 +2125,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& { if( target->GetTypeId() != TYPEID_PLAYER) { - if(((Creature*)target)->isPet()) + if(((Creature*)target)->IsPet()) { Unit *targetOwner = target->GetOwner(); if(targetOwner->GetTypeId() == TYPEID_PLAYER) @@ -4497,7 +4497,7 @@ SpellCastResult Spell::CheckCast(bool strict) } if(IsPositiveSpell(m_spellInfo->Id)) - if(target->IsImmunedToSpell(m_spellInfo)) + if(target->IsImmuneToSpell(m_spellInfo)) return SPELL_FAILED_TARGET_AURASTATE; //Must be behind the target. @@ -4833,7 +4833,7 @@ SpellCastResult Spell::CheckCast(bool strict) Creature* target = (Creature*)m_targets.getUnitTarget(); - if(target->isPet() || target->isCharmed()) + if(target->IsPet() || target->isCharmed()) { plrCaster->SendPetTameFailure(PETTAME_CREATUREALREADYOWNED); return SPELL_FAILED_DONT_REPORT; @@ -5331,7 +5331,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) if(m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo)) return SPELL_FAILED_AFFECTING_COMBAT; - if(m_caster->GetTypeId()==TYPEID_UNIT && (((Creature*)m_caster)->isPet() || m_caster->isCharmed())) + if(m_caster->GetTypeId()==TYPEID_UNIT && (((Creature*)m_caster)->IsPet() || m_caster->isCharmed())) { //dead owner (pets still alive when owners ressed?) if(m_caster->GetCharmerOrOwner() && !m_caster->GetCharmerOrOwner()->isAlive()) diff --git a/src/game/Spell.h b/src/game/Spell.h index 3e19f31cc35..b0a97a19726 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -732,7 +732,7 @@ namespace MaNGOS break; case SPELL_TARGETS_AOE_DAMAGE: { - if(itr->getSource()->GetTypeId()==TYPEID_UNIT && ((Creature*)itr->getSource())->isTotem()) + if(itr->getSource()->GetTypeId()==TYPEID_UNIT && ((Creature*)itr->getSource())->IsTotem()) continue; if (i_playerControled) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 050fcfb87ea..c62fea91947 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -197,7 +197,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleAuraSafeFall, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes &Aura::HandleAuraModPetTalentsPoints, //145 SPELL_AURA_MOD_PET_TALENT_POINTS &Aura::HandleNoImmediateEffect, //146 SPELL_AURA_ALLOW_TAME_PET_TYPE implemented in Player::CanTameExoticPets - &Aura::HandleModMechanicImmunityMask, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK implemented in Unit::IsImmunedToSpell and Unit::IsImmunedToSpellEffect (check part) + &Aura::HandleModMechanicImmunityMask, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK implemented in Unit::IsImmuneToSpell and Unit::IsImmuneToSpellEffect (check part) &Aura::HandleAuraRetainComboPoints, //148 SPELL_AURA_RETAIN_COMBO_POINTS &Aura::HandleNoImmediateEffect, //149 SPELL_AURA_REDUCE_PUSHBACK implemented in Spell::Delayed and Spell::DelayedChannel &Aura::HandleShieldBlockValue, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT @@ -317,7 +317,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleUnused, //264 unused (3.0.8a-3.2.2a) &Aura::HandleUnused, //265 unused (3.0.8a-3.2.2a) &Aura::HandleUnused, //266 unused (3.0.8a-3.2.2a) - &Aura::HandleNoImmediateEffect, //267 SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL implemented in Unit::IsImmunedToSpellEffect + &Aura::HandleNoImmediateEffect, //267 SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL implemented in Unit::IsImmuneToSpellEffect &Aura::HandleAuraModAttackPowerOfStatPercent, //268 SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT &Aura::HandleNoImmediateEffect, //269 SPELL_AURA_MOD_IGNORE_DAMAGE_REDUCTION_SCHOOL implemented in Unit::CalcNotIgnoreDamageRedunction &Aura::HandleUnused, //270 SPELL_AURA_MOD_IGNORE_TARGET_RESIST (unused in 3.2.2a) @@ -473,12 +473,12 @@ Unit *caster, Item* castItem) : Aura(spellproto, eff, currentBasePoints, holder, { case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: m_areaAuraType = AREA_AURA_PARTY; - if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem()) + if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsTotem()) m_modifier.m_auraname = SPELL_AURA_NONE; break; case SPELL_EFFECT_APPLY_AREA_AURA_RAID: m_areaAuraType = AREA_AURA_RAID; - if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->isTotem()) + if (target->GetTypeId() == TYPEID_UNIT && ((Creature*)target)->IsTotem()) m_modifier.m_auraname = SPELL_AURA_NONE; // Light's Beacon not applied to caster itself (TODO: more generic check for another simialr spell if any?) else if (target == caster_ptr && spellproto->Id == 53651) @@ -3519,7 +3519,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real) return; Unit* target = GetTarget(); - if (target->GetTypeId() != TYPEID_UNIT || !((Creature*)target)->isPet()) + if (target->GetTypeId() != TYPEID_UNIT || !((Creature*)target)->IsPet()) return; Pet* pet = (Pet*)target; @@ -3665,7 +3665,7 @@ void Aura::HandleModCharm(bool apply, bool Real) CreatureInfo const *cinfo = ((Creature*)target)->GetCreatureInfo(); // restore faction - if(((Creature*)target)->isPet()) + if(((Creature*)target)->IsPet()) { if(Unit* owner = target->GetOwner()) target->setFaction(owner->getFaction()); @@ -4442,7 +4442,7 @@ void Aura::HandleModMechanicImmunityMask(bool apply, bool /*Real*/) if(apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY) GetTarget()->RemoveAurasAtMechanicImmunity(mechanic,GetId()); - // check implemented in Unit::IsImmunedToSpell and Unit::IsImmunedToSpellEffect + // check implemented in Unit::IsImmuneToSpell and Unit::IsImmuneToSpellEffect } //this method is called whenever we add / remove aura which gives m_target some imunity to some spell effect @@ -4992,7 +4992,7 @@ void Aura::HandleAuraModResistance(bool apply, bool /*Real*/) if(m_modifier.m_miscvalue & int32(1<HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_modifier.m_amount), apply); - if(GetTarget()->GetTypeId() == TYPEID_PLAYER || ((Creature*)GetTarget())->isPet()) + if(GetTarget()->GetTypeId() == TYPEID_PLAYER || ((Creature*)GetTarget())->IsPet()) GetTarget()->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply); } } @@ -5004,7 +5004,7 @@ void Aura::HandleAuraModBaseResistancePCT(bool apply, bool /*Real*/) if(GetTarget()->GetTypeId() != TYPEID_PLAYER) { //pets only have base armor - if(((Creature*)GetTarget())->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) + if(((Creature*)GetTarget())->IsPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) GetTarget()->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_modifier.m_amount), apply); } else @@ -5026,7 +5026,7 @@ void Aura::HandleModResistancePercent(bool apply, bool /*Real*/) if(m_modifier.m_miscvalue & int32(1<HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply); - if(target->GetTypeId() == TYPEID_PLAYER || ((Creature*)target)->isPet()) + if(target->GetTypeId() == TYPEID_PLAYER || ((Creature*)target)->IsPet()) { target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, float(m_modifier.m_amount), apply); target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, float(m_modifier.m_amount), apply); @@ -5041,7 +5041,7 @@ void Aura::HandleModBaseResistance(bool apply, bool /*Real*/) if(GetTarget()->GetTypeId() != TYPEID_PLAYER) { //only pets have base stats - if(((Creature*)GetTarget())->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) + if(((Creature*)GetTarget())->IsPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) GetTarget()->HandleStatModifier(UNIT_MOD_ARMOR, TOTAL_VALUE, float(m_modifier.m_amount), apply); } else @@ -5071,7 +5071,7 @@ void Aura::HandleAuraModStat(bool apply, bool /*Real*/) { //m_target->ApplyStatMod(Stats(i), m_modifier.m_amount,apply); GetTarget()->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(m_modifier.m_amount), apply); - if(GetTarget()->GetTypeId() == TYPEID_PLAYER || ((Creature*)GetTarget())->isPet()) + if(GetTarget()->GetTypeId() == TYPEID_PLAYER || ((Creature*)GetTarget())->IsPet()) GetTarget()->ApplyStatBuffMod(Stats(i), float(m_modifier.m_amount), apply); } } @@ -5173,7 +5173,7 @@ void Aura::HandleModTotalPercentStat(bool apply, bool /*Real*/) if(m_modifier.m_miscvalue == i || m_modifier.m_miscvalue == -1) { target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(m_modifier.m_amount), apply); - if(target->GetTypeId() == TYPEID_PLAYER || ((Creature*)target)->isPet()) + if(target->GetTypeId() == TYPEID_PLAYER || ((Creature*)target)->IsPet()) target->ApplyStatPercentBuffMod(Stats(i), float(m_modifier.m_amount), apply ); } } @@ -7562,7 +7562,7 @@ void Aura::HandleAuraControlVehicle(bool apply, bool Real) return; Unit* target = GetTarget(); - if (target->GetTypeId() != TYPEID_UNIT || !((Creature*)target)->isVehicle()) + if (target->GetTypeId() != TYPEID_UNIT || !((Creature*)target)->IsVehicle()) return; Vehicle* vehicle = (Vehicle*)target; @@ -7969,7 +7969,7 @@ void SpellAuraHolder::_RemoveSpellAuraHolder() //passive auras do not get put in slots - said who? ;) // Note: but totem can be not accessible for aura target in time remove (to far for find in grid) - //if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem())) + //if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->IsTotem())) // return; uint8 slot = GetAuraSlot(); @@ -8207,7 +8207,7 @@ bool SpellAuraHolder::IsWeaponBuffCoexistableWith(SpellAuraHolder* ref) bool SpellAuraHolder::IsNeedVisibleSlot(Unit const* caster) const { - bool totemAura = caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem(); + bool totemAura = caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->IsTotem(); if (m_spellProto->procFlags) return true; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index ead31476515..f0ce84be0c1 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -826,7 +826,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) return; - ((Creature*)unitTarget)->setDeathState(JUST_ALIVED); + ((Creature*)unitTarget)->SetDeathState(JUST_ALIVED); return; } case 10254: // Stone Dwarf Awaken Visual @@ -938,11 +938,11 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) } case 23019: // Crystal Prison Dummy DND { - if (!unitTarget || !unitTarget->isAlive() || unitTarget->GetTypeId() != TYPEID_UNIT || ((Creature*)unitTarget)->isPet()) + if (!unitTarget || !unitTarget->isAlive() || unitTarget->GetTypeId() != TYPEID_UNIT || ((Creature*)unitTarget)->IsPet()) return; Creature* creatureTarget = (Creature*)unitTarget; - if (creatureTarget->isPet()) + if (creatureTarget->IsPet()) return; GameObject* pGameObj = new GameObject; @@ -1390,7 +1390,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) return; unitTarget->CastSpell(m_caster, 43160, true); - unitTarget->setDeathState(JUST_DIED); + unitTarget->SetDeathState(JUST_DIED); unitTarget->SetHealth(0); return; } @@ -1496,7 +1496,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) unitTarget->CastSpell(unitTarget, 51278, true); unitTarget->CastSpell(m_caster, 51279, true); - unitTarget->setDeathState(JUST_DIED); + unitTarget->SetDeathState(JUST_DIED); return; } case 51330: // Shoot RJR @@ -4978,7 +4978,7 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx) uint32 faction = m_caster->getFaction(); if(m_caster->GetTypeId() == TYPEID_UNIT) { - if ( ((Creature*)m_caster)->isTotem() ) + if ( ((Creature*)m_caster)->IsTotem() ) NewSummon->GetCharmInfo()->SetReactState(REACT_AGGRESSIVE); else NewSummon->GetCharmInfo()->SetReactState(REACT_DEFENSIVE); @@ -5749,7 +5749,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) if (const SpellEntry *pSpell = sSpellStore.LookupEntry(m_spellInfo->CalculateSimpleValue(eff_idx))) { // if we used item at least once... - if (pTarget->isTemporarySummon() && pTarget->GetEntry() == pSpell->EffectMiscValue[eff_idx]) + if (pTarget->IsTemporarySummon() && pTarget->GetEntry() == pSpell->EffectMiscValue[eff_idx]) { TemporarySummon* pSummon = (TemporarySummon*)pTarget; @@ -5797,7 +5797,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) if (!pQuestCow) return; - if (!((Creature*)m_caster)->isTemporarySummon()) + if (!((Creature*)m_caster)->IsTemporarySummon()) return; if (const SpellEntry *pSpell = sSpellStore.LookupEntry(m_spellInfo->CalculateSimpleValue(eff_idx))) @@ -6017,7 +6017,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) if (m_caster->GetTypeId() != TYPEID_UNIT) return; - if (((Creature*)m_caster)->isTemporarySummon()) + if (((Creature*)m_caster)->IsTemporarySummon()) { TemporarySummon* pSummon = (TemporarySummon*)m_caster; @@ -7332,7 +7332,7 @@ void Spell::EffectSkinning(SpellEffectIndex /*eff_idx*/) int32 skillValue = ((Player*)m_caster)->GetPureSkillValue(skill); // Double chances for elites - ((Player*)m_caster)->UpdateGatherSkill(skill, skillValue, reqValue, creature->isElite() ? 2 : 1 ); + ((Player*)m_caster)->UpdateGatherSkill(skill, skillValue, reqValue, creature->IsElite() ? 2 : 1 ); } void Spell::EffectCharge(SpellEffectIndex /*eff_idx*/) @@ -7531,7 +7531,7 @@ void Spell::EffectSummonDeadPet(SpellEffectIndex /*eff_idx*/) return; pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); - pet->setDeathState( ALIVE ); + pet->SetDeathState( ALIVE ); pet->clearUnitState(UNIT_STAT_ALL_STATE); pet->SetHealth( uint32(pet->GetMaxHealth()*(float(damage)/100))); @@ -7965,7 +7965,7 @@ void Spell::EffectTitanGrip(SpellEffectIndex eff_idx) void Spell::EffectRenamePet(SpellEffectIndex /*eff_idx*/) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || - !((Creature*)unitTarget)->isPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET) + !((Creature*)unitTarget)->IsPet() || ((Pet*)unitTarget)->getPetType() != HUNTER_PET) return; unitTarget->RemoveByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_RENAMED); diff --git a/src/game/TargetedMovementGenerator.cpp b/src/game/TargetedMovementGenerator.cpp index adfe0909c5b..df529395bd9 100644 --- a/src/game/TargetedMovementGenerator.cpp +++ b/src/game/TargetedMovementGenerator.cpp @@ -79,7 +79,7 @@ void TargetedMovementGeneratorMedium::_setTargetLocation(T &owner) i_destinationHolder.SetDestination(traveller, x, y, z); D::_addUnitStateMove(owner); - if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) + if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->CanFly()) ((Creature&)owner).AddSplineFlag(SPLINEFLAG_UNKNOWN7); } @@ -146,7 +146,7 @@ bool TargetedMovementGeneratorMedium::Update(T &owner, const uint32 & time_ if (owner.IsStopped() && !i_destinationHolder.HasArrived()) { D::_addUnitStateMove(owner); - if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->canFly()) + if (owner.GetTypeId() == TYPEID_UNIT && ((Creature*)&owner)->CanFly()) ((Creature&)owner).AddSplineFlag(SPLINEFLAG_UNKNOWN7); i_destinationHolder.StartTravel(traveller); @@ -210,7 +210,7 @@ void ChaseMovementGenerator::Initialize(Creature &owner) owner.addUnitState(UNIT_STAT_CHASE|UNIT_STAT_CHASE_MOVE); owner.RemoveSplineFlag(SPLINEFLAG_WALKMODE); - if (((Creature*)&owner)->canFly()) + if (((Creature*)&owner)->CanFly()) owner.AddSplineFlag(SPLINEFLAG_UNKNOWN7); _setTargetLocation(owner); @@ -238,7 +238,7 @@ void ChaseMovementGenerator::Reset(T &owner) template<> void FollowMovementGenerator::_updateWalkMode(Creature &u) { - if (i_target.isValid() && u.isPet()) + if (i_target.isValid() && u.IsPet()) u.UpdateWalkMode(i_target.getTarget()); } @@ -257,7 +257,7 @@ template<> void FollowMovementGenerator::_updateSpeed(Creature &u) { // pet only sync speed with owner - if (!((Creature&)u).isPet() || !i_target.isValid() || i_target->GetGUID() != u.GetOwnerGUID()) + if (!((Creature&)u).IsPet() || !i_target.isValid() || i_target->GetGUID() != u.GetOwnerGUID()) return; u.UpdateSpeed(MOVE_RUN,true); @@ -281,7 +281,7 @@ void FollowMovementGenerator::Initialize(Creature &owner) _updateWalkMode(owner); _updateSpeed(owner); - if (((Creature*)&owner)->canFly()) + if (((Creature*)&owner)->CanFly()) owner.AddSplineFlag(SPLINEFLAG_UNKNOWN7); _setTargetLocation(owner); diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index c67edeb24d8..87cb0d56c87 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -139,7 +139,7 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto) m_type = TOTEM_STATUE; //Jewelery statue } -bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const +bool Totem::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const { // TODO: possibly all negative auras immune? switch(spellInfo->Effect[index]) @@ -160,5 +160,5 @@ bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex default: break; } - return Creature::IsImmunedToSpellEffect(spellInfo, index); + return Creature::IsImmuneToSpellEffect(spellInfo, index); } diff --git a/src/game/Totem.h b/src/game/Totem.h index d5dcd23c076..57c1686c661 100644 --- a/src/game/Totem.h +++ b/src/game/Totem.h @@ -53,7 +53,7 @@ class Totem : public Creature void UpdateAttackPowerAndDamage(bool /*ranged*/ ) {} void UpdateDamagePhysical(WeaponAttackType /*attType*/) {} - bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; + bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; protected: TotemType m_type; diff --git a/src/game/TotemAI.cpp b/src/game/TotemAI.cpp index 391798cf69e..684223df439 100644 --- a/src/game/TotemAI.cpp +++ b/src/game/TotemAI.cpp @@ -30,7 +30,7 @@ int TotemAI::Permissible(const Creature *creature) { - if( creature->isTotem() ) + if( creature->IsTotem() ) return PERMIT_BASE_PROACTIVE; return PERMIT_BASE_NO; diff --git a/src/game/Traveller.h b/src/game/Traveller.h index d55628276fa..aab6f58351d 100644 --- a/src/game/Traveller.h +++ b/src/game/Traveller.h @@ -93,7 +93,7 @@ inline float Traveller::GetMoveDestinationTo(float x, float y, float z float dx = x - GetPositionX(); float dy = y - GetPositionY(); - if (i_traveller.canFly()) + if (i_traveller.CanFly()) { float dz = z - GetPositionZ(); return sqrt((dx*dx) + (dy*dy) + (dz*dz)); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index dab2fcbf91c..bd2b77bccaa 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -323,7 +323,7 @@ void Unit::Update( uint32 p_time ) getThreatManager().UpdateForClient(p_time); // update combat timer only for players and pets - if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->isPet() || ((Creature*)this)->isCharmed())) + if (isInCombat() && (GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->IsPet() || ((Creature*)this)->isCharmed())) { // Check UNIT_STAT_MELEE_ATTACKING or UNIT_STAT_CHASE (without UNIT_STAT_FOLLOW in this case) so pets can reach far away // targets without stopping half way there and running off. @@ -581,7 +581,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa ((Creature*)pVictim)->SetLootRecipient(this); - pVictim->setDeathState(JUST_DIED); + pVictim->SetDeathState(JUST_DIED); pVictim->SetHealth(0); // allow loot only if has loot_id in creature_template @@ -680,7 +680,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (pVictim->GetTypeId() == TYPEID_PLAYER) ((Player*)pVictim)->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED, damage); - if (pVictim->GetTypeId() == TYPEID_UNIT && !((Creature*)pVictim)->isPet() && !((Creature*)pVictim)->HasLootRecipient()) + if (pVictim->GetTypeId() == TYPEID_UNIT && !((Creature*)pVictim)->IsPet() && !((Creature*)pVictim)->HasLootRecipient()) ((Creature*)pVictim)->SetLootRecipient(this); if (health <= damage) @@ -768,7 +768,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (!spiritOfRedemtionTalentReady) { DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE,"SET JUST_DIED"); - pVictim->setDeathState(JUST_DIED); + pVictim->SetDeathState(JUST_DIED); } DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE,"DealDamageHealth1"); @@ -829,7 +829,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE,"DealDamageNotPlayer"); Creature *cVictim = (Creature*)pVictim; - if(!cVictim->isPet()) + if(!cVictim->IsPet()) { cVictim->DeleteThreatList(); // only lootable if it has loot or can drop gold @@ -842,7 +842,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa if (cVictim->AI()) cVictim->AI()->JustDied(this); - if (cVictim->isTemporarySummon()) + if (cVictim->IsTemporarySummon()) { TemporarySummon* pSummon = (TemporarySummon*)cVictim; if (pSummon->GetSummonerGuid().IsCreature()) @@ -2682,9 +2682,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // 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 || ((Creature*)this)->isPet()) && - pVictim->GetTypeId() != TYPEID_PLAYER && !((Creature*)pVictim)->isPet() && - getLevel() < pVictim->getLevelForTarget(this) ) + (GetTypeId() == TYPEID_PLAYER || ((Creature*)this)->IsPet()) && + pVictim->GetTypeId() != TYPEID_PLAYER && !((Creature*)pVictim)->IsPet() && + getLevel() < pVictim->GetLevelForTarget(this) ) { // cap possible value (with bonuses > max skill) int32 skill = attackerWeaponSkill; @@ -2701,9 +2701,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack } // mobs can score crushing blows if they're 4 or more levels above victim - if (getLevelForTarget(pVictim) >= pVictim->getLevelForTarget(this) + 4 && + if (GetLevelForTarget(pVictim) >= pVictim->GetLevelForTarget(this) + 4 && // can be from by creature (if can) or from controlled player that considered as creature - (GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->isPet() && + (GetTypeId()!=TYPEID_PLAYER && !((Creature*)this)->IsPet() && !(((Creature*)this)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRUSH) || GetTypeId()==TYPEID_PLAYER && GetCharmerOrOwnerGUID())) { @@ -3028,7 +3028,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) SpellSchoolMask schoolMask = GetSpellSchoolMask(spell); // PvP - PvE spell misschances per leveldif > 2 int32 lchance = pVictim->GetTypeId() == TYPEID_PLAYER ? 7 : 11; - int32 leveldif = int32(pVictim->getLevelForTarget(this)) - int32(getLevelForTarget(pVictim)); + int32 leveldif = int32(pVictim->GetLevelForTarget(this)) - int32(GetLevelForTarget(pVictim)); // Base hit chance from attacker and victim levels int32 modHitChance; @@ -3114,7 +3114,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool return SPELL_MISS_EVADE; // Check for immune - if (pVictim->IsImmunedToSpell(spell)) + if (pVictim->IsImmuneToSpell(spell)) return SPELL_MISS_IMMUNE; // All positive spells can`t miss @@ -3244,7 +3244,7 @@ float Unit::GetUnitDodgeChance() const return GetFloatValue(PLAYER_DODGE_PERCENTAGE); else { - if(((Creature const*)this)->isTotem()) + if(((Creature const*)this)->IsTotem()) return 0.0f; else { @@ -3306,7 +3306,7 @@ float Unit::GetUnitBlockChance() const } else { - if(((Creature const*)this)->isTotem()) + if(((Creature const*)this)->IsTotem()) return 0.0f; else { @@ -3718,9 +3718,9 @@ void Unit::SetFacingToObject(WorldObject* pObject) bool Unit::isInAccessablePlaceFor(Creature const* c) const { if(IsInWater()) - return c->canSwim(); + return c->CanSwim(); else - return c->canWalk() || c->canFly(); + return c->CanWalk() || c->CanFly(); } bool Unit::IsInWater() const @@ -4671,7 +4671,7 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode) Totem* statue = NULL; Unit* caster = holder->GetCaster(); if(IsChanneledSpell(AurSpellInfo) && caster) - if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE) + if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->IsTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE) statue = ((Totem*)caster); if (m_spellAuraHoldersUpdateIterator != m_spellAuraHolders.end() && m_spellAuraHoldersUpdateIterator->second == holder) @@ -5255,7 +5255,7 @@ void Unit::setPowerType(Powers new_powertype) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POWER_TYPE); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -5939,7 +5939,7 @@ Totem* Unit::GetTotem(TotemSlot slot ) const return NULL; Creature *totem = GetMap()->GetCreature(m_TotemSlot[slot]); - return totem && totem->isTotem() ? (Totem*)totem : NULL; + return totem && totem->IsTotem() ? (Totem*)totem : NULL; } bool Unit::IsAllTotemSlotsUsed() const @@ -5982,7 +5982,7 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro Unit* unit = this; - if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) + if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->IsTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) unit = GetOwner(); if (unit->GetTypeId()==TYPEID_PLAYER) @@ -6076,7 +6076,7 @@ int32 Unit::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int3 float coeff; // Not apply this to creature casted spells - if (GetTypeId()==TYPEID_UNIT && !((Creature*)this)->isPet()) + if (GetTypeId()==TYPEID_UNIT && !((Creature*)this)->IsPet()) coeff = 1.0f; // Check for table values else if (SpellBonusEntry const* bonus = sSpellMgr.GetSpellBonusData(spellProto->Id)) @@ -6130,7 +6130,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u return pdamage; // For totems get damage bonus from owner (statue isn't totem in fact) - if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) + if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->IsTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) { if(Unit* owner = GetOwner()) return owner->SpellDamageBonusDone(pVictim, spellProto, pdamage, damagetype); @@ -6140,7 +6140,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u int32 DoneTotal = 0; // Creature damage - if( GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet() ) + if( GetTypeId() == TYPEID_UNIT && !((Creature*)this)->IsPet() ) DoneTotalMod *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->rank); AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); @@ -6415,7 +6415,7 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u // Pets just add their bonus damage to their spell damage // note that their spell damage is just gain of their own auras - if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) + if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()) DoneAdvertisedBenefit += ((Pet*)this)->GetBonusDamage(); // apply ap bonus and benefit affected by spell power implicit coeffs and spell level penalties @@ -6475,7 +6475,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit *pCaster, SpellEntry const *spellProto, if(IsAreaOfEffectSpell(spellProto)) { TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, schoolMask); - if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) + if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()) TakenTotalMod *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE, schoolMask); } @@ -6784,7 +6784,7 @@ uint32 Unit::SpellCriticalHealingBonus(SpellEntry const *spellProto, uint32 dama uint32 Unit::SpellHealingBonusDone(Unit *pVictim, SpellEntry const *spellProto, int32 healamount, DamageEffectType damagetype, uint32 stack) { // For totems get healing bonus from owner (statue isn't totem in fact) - if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) + if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->IsTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) if(Unit* owner = GetOwner()) return owner->SpellHealingBonusDone(pVictim, spellProto, healamount, damagetype, stack); @@ -7001,7 +7001,7 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask) return false; } -bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) +bool Unit::IsImmuneToSpell(SpellEntry const* spellInfo) { if (!spellInfo) return false; @@ -7040,7 +7040,7 @@ bool Unit::IsImmunedToSpell(SpellEntry const* spellInfo) return false; } -bool Unit::IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const +bool Unit::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const { //If m_immuneToEffect type contain this effect type, IMMUNE effect. uint32 effect = spellInfo->Effect[index]; @@ -7139,7 +7139,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType } // Pets just add their bonus damage to their melee damage - if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) + if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()) DoneFlat += ((Pet*)this)->GetBonusDamage(); } @@ -7399,7 +7399,7 @@ uint32 Unit::MeleeDamageBonusTaken(Unit *pCaster, uint32 pdamage,WeaponAttackTyp if(spellProto && IsAreaOfEffectSpell(spellProto)) { TakenPercent *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, schoolMask); - if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) + if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()) TakenPercent *= GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_PET_AOE_DAMAGE_AVOIDANCE, schoolMask); } @@ -7600,7 +7600,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - if (isCharmed() || (GetTypeId()!=TYPEID_PLAYER && ((Creature*)this)->isPet())) + if (isCharmed() || (GetTypeId()!=TYPEID_PLAYER && ((Creature*)this)->IsPet())) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT); // interrupt all delayed non-combat casts @@ -7627,7 +7627,7 @@ void Unit::ClearInCombat() m_CombatTimer = 0; RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - if(isCharmed() || (GetTypeId()!=TYPEID_PLAYER && ((Creature*)this)->isPet())) + if(isCharmed() || (GetTypeId()!=TYPEID_PLAYER && ((Creature*)this)->IsPet())) RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PET_IN_COMBAT); // Player's state will be cleared in Player::UpdateContestedPvP @@ -7939,7 +7939,7 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo //Visible distance is modified by //-Level Diff (every level diff = 1.0f in visible distance) - visibleDistance += int32(u->getLevelForTarget(this)) - int32(getLevelForTarget(u)); + visibleDistance += int32(u->GetLevelForTarget(this)) - int32(GetLevelForTarget(u)); //This allows to check talent tree and will add addition stealth dependent on used points) int32 stealthMod = GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH_LEVEL); @@ -8061,12 +8061,12 @@ void Unit::UpdateWalkMode(Unit* source, bool self) if (on) { - if (((Creature*)this)->isPet() && hasUnitState(UNIT_STAT_FOLLOW)) + if (((Creature*)this)->IsPet() && hasUnitState(UNIT_STAT_FOLLOW)) ((Creature*)this)->AddSplineFlag(SPLINEFLAG_WALKMODE); } else { - if (((Creature*)this)->isPet()) + if (((Creature*)this)->IsPet()) ((Creature*)this)->RemoveSplineFlag(SPLINEFLAG_WALKMODE); } } @@ -8082,7 +8082,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced, float ratio) case MOVE_RUN: case MOVE_WALK: case MOVE_SWIM: - if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet() && hasUnitState(UNIT_STAT_FOLLOW)) + if (GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet() && hasUnitState(UNIT_STAT_FOLLOW)) { if(Unit* owner = GetOwner()) { @@ -8332,7 +8332,7 @@ void Unit::SetHover(bool on) RemoveAurasDueToSpell(11010); } -void Unit::setDeathState(DeathState s) +void Unit::SetDeathState(DeathState s) { if (s != ALIVE && s!= JUST_ALIVED) { @@ -8401,15 +8401,15 @@ bool Unit::CanHaveThreatList() const Creature const* creature = ((Creature const*)this); // totems can not have threat list - if (creature->isTotem()) + if (creature->IsTotem()) return false; // vehicles can not have threat list - if (creature->isVehicle()) + if (creature->IsVehicle()) return false; // pets can not have a threat list, unless they are controlled by a creature - if (creature->isPet() && IS_PLAYER_GUID(((Pet const*)creature)->GetOwnerGUID())) + if (creature->IsPet() && IS_PLAYER_GUID(((Pet const*)creature)->GetOwnerGUID())) return false; // charmed units can not have a threat list if charmed by player @@ -9076,7 +9076,7 @@ void Unit::SetHealth(uint32 val) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_CUR_HP); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -9099,7 +9099,7 @@ void Unit::SetMaxHealth(uint32 val) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_MAX_HP); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -9143,7 +9143,7 @@ void Unit::SetPower(Powers power, uint32 val) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_CUR_POWER); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -9172,7 +9172,7 @@ void Unit::SetMaxPower(Powers power, uint32 val) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_MAX_POWER); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -9197,7 +9197,7 @@ void Unit::ApplyPowerMod(Powers power, uint32 val, bool apply) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_CUR_POWER); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -9219,7 +9219,7 @@ void Unit::ApplyMaxPowerMod(Powers power, uint32 val, bool apply) if(((Player*)this)->GetGroup()) ((Player*)this)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_MAX_POWER); } - else if(((Creature*)this)->isPet()) + else if(((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -9248,9 +9248,9 @@ uint32 Unit::GetCreatePowers( Powers power ) const case POWER_HEALTH: return 0; 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; } @@ -9744,7 +9744,7 @@ Player* Unit::GetSpellModOwner() { if(GetTypeId()==TYPEID_PLAYER) return (Player*)this; - if(((Creature*)this)->isPet() || ((Creature*)this)->isTotem()) + if(((Creature*)this)->IsPet() || ((Creature*)this)->IsTotem()) { Unit* owner = GetOwner(); if(owner && owner->GetTypeId()==TYPEID_PLAYER) @@ -10002,7 +10002,7 @@ void Unit::SetDisplayId(uint32 modelId) UpdateModelData(); - if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) + if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(!pet->isControlled()) @@ -10212,7 +10212,7 @@ void Unit::UpdateAuraForGroup(uint8 slot) player->SetAuraUpdateMask(slot); } } - else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) + else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->IsPet()) { Pet *pet = ((Pet*)this); if(pet->isControlled()) @@ -10537,7 +10537,7 @@ float Unit::GetCombatRatingReduction(CombatRating cr) const { if (GetTypeId() == TYPEID_PLAYER) return ((Player const*)this)->GetRatingBonusValue(cr); - else if (((Creature const*)this)->isPet()) + else if (((Creature const*)this)->IsPet()) { // Player's pet get 100% resilience from owner if (Unit* owner = GetOwner()) diff --git a/src/game/Unit.h b/src/game/Unit.h index 25cca3788be..def113fbeb0 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1217,7 +1217,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject } uint32 getLevel() const { return GetUInt32Value(UNIT_FIELD_LEVEL); } - virtual uint32 getLevelForTarget(Unit const* /*target*/) const { return getLevel(); } + virtual uint32 GetLevelForTarget(Unit const* /*target*/) const { return getLevel(); } void SetLevel(uint32 lvl); uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, 0); } uint32 getRaceMask() const { return 1 << (getRace()-1); } @@ -1298,7 +1298,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void Mount(uint32 mount, uint32 spellId = 0); void Unmount(); - uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } + uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? GetLevelForTarget(target) : getLevel()) * 5; } void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb); uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss); int32 DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellProto, bool critical = false, uint32 absorb = 0); @@ -1345,7 +1345,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVictim) const; virtual uint32 GetShieldBlockValue() const =0; - uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; } + uint32 GetUnitMeleeSkill(Unit const* target = NULL) const { return (target ? GetLevelForTarget(target) : getLevel()) * 5; } uint32 GetDefenseSkillValue(Unit const* target = NULL) const; uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const; float GetWeaponProcChance() const; @@ -1471,7 +1471,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject bool isAlive() const { return (m_deathState == ALIVE); }; bool isDead() const { return ( m_deathState == DEAD || m_deathState == CORPSE ); }; DeathState getDeathState() { return m_deathState; }; - virtual void setDeathState(DeathState s); // overwritten in Creature/Player/Pet + virtual void SetDeathState(DeathState s); // overwritten in Creature/Player/Pet uint64 GetOwnerGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMONEDBY); } void SetOwnerGUID(uint64 owner) { SetUInt64Value(UNIT_FIELD_SUMMONEDBY, owner); } @@ -1843,10 +1843,10 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply); void ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType type, bool apply); - virtual bool IsImmunedToSpell(SpellEntry const* spellInfo); + virtual bool IsImmuneToSpell(SpellEntry const* spellInfo); // redefined in Creature bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask); - virtual bool IsImmunedToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; + virtual bool IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectIndex index) const; // redefined in Creature uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage); diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index b92e5428b2c..21db9ab8b29 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -51,9 +51,9 @@ void Vehicle::RemoveFromWorld() Unit::RemoveFromWorld(); } -void Vehicle::setDeathState(DeathState s) // overwrite virtual Creature::setDeathState and Unit::setDeathState +void Vehicle::SetDeathState(DeathState s) // overwrite virtual Creature::SetDeathState and Unit::SetDeathState { - Creature::setDeathState(s); + Creature::SetDeathState(s); } void Vehicle::Update(uint32 diff) diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h index 5bf14ac15f3..c191c094ff0 100644 --- a/src/game/Vehicle.h +++ b/src/game/Vehicle.h @@ -35,7 +35,7 @@ class Vehicle : public Creature bool Create (uint32 guidlow, Map *map, uint32 Entry, uint32 vehicleId, uint32 team); - void setDeathState(DeathState s); // overwrite virtual Creature::setDeathState and Unit::setDeathState + void SetDeathState(DeathState s); // overwrite virtual Creature::SetDeathState and Unit::SetDeathState void Update(uint32 diff); // overwrite virtual Creature::Update and Unit::Update uint32 GetVehicleId() { return m_vehicleId; } diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 6a9aa0597fa..ba55359cea2 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -78,7 +78,7 @@ void WaypointMovementGenerator::LoadPath(Creature &creature) // We have to set the destination here (for the first point), right after Initialize. Without, we may not have valid xyz for GetResetPosition CreatureTraveller traveller(creature); - if (creature.canFly()) + if (creature.CanFly()) creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7); const WaypointNode &node = i_path->at(i_currentNode); @@ -155,7 +155,7 @@ bool WaypointMovementGenerator::Update(Creature &creature, const uint3 creature.addUnitState(UNIT_STAT_ROAMING_MOVE); - if (creature.canFly()) + if (creature.CanFly()) creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7); // Now we re-set destination to same node and start travel @@ -253,7 +253,7 @@ bool WaypointMovementGenerator::Update(Creature &creature, const uint3 { creature.addUnitState(UNIT_STAT_ROAMING_MOVE); - if (creature.canFly()) + if (creature.CanFly()) creature.AddSplineFlag(SPLINEFLAG_UNKNOWN7); if (WaypointBehavior *behavior = i_path->at(i_currentNode).behavior) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6d9e86caff9..5ba78b79d8f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10609" + #define REVISION_NR "10610" #endif // __REVISION_NR_H__