mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 01:37:04 +00:00
Eliminated tabs!
Eliminated tabs!
This commit is contained in:
parent
0f19fec851
commit
942dd64a53
27 changed files with 247 additions and 247 deletions
|
|
@ -110,7 +110,7 @@ void AggressorAI::EnterEvadeMode()
|
|||
// i_tracker.Reset(TIME_INTERVAL_LOOK);
|
||||
}
|
||||
|
||||
if (!m_creature->IsCharmed())
|
||||
if (!m_creature->IsCharmed())
|
||||
{
|
||||
m_creature->RemoveAllAurasOnEvade();
|
||||
|
||||
|
|
|
|||
|
|
@ -901,7 +901,7 @@ bool Creature::IsTrainerOf(Player* pPlayer, bool msg) const
|
|||
|
||||
bool Creature::CanInteractWithBattleMaster(Player* pPlayer, bool msg) const
|
||||
{
|
||||
if (!IsBattleMaster())
|
||||
if (!IsBattleMaster())
|
||||
return false;
|
||||
|
||||
BattleGroundTypeId bgTypeId = sBattleGroundMgr.GetBattleMasterBG(GetEntry());
|
||||
|
|
@ -1637,14 +1637,14 @@ bool Creature::IsImmuneToSpellEffect(SpellEntry const* spellInfo, SpellEffectInd
|
|||
// return true if this creature is tapped by the player or by a member of his group.
|
||||
bool Creature::IsTappedBy(Player const* player) const
|
||||
{
|
||||
if (player == GetOriginalLootRecipient())
|
||||
return true;
|
||||
if (player == GetOriginalLootRecipient())
|
||||
return true;
|
||||
|
||||
Group const* playerGroup = player->GetGroup();
|
||||
if (!playerGroup || playerGroup != GetGroupLootRecipient()) // if we dont have a group we arent the recipient
|
||||
return false; // if creature doesnt have group bound it means it was solo killed by someone else
|
||||
Group const* playerGroup = player->GetGroup();
|
||||
if (!playerGroup || playerGroup != GetGroupLootRecipient()) // if we dont have a group we arent the recipient
|
||||
return false; // if creature doesnt have group bound it means it was solo killed by someone else
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim)
|
||||
|
|
@ -1803,7 +1803,7 @@ void Creature::SendAIReaction(AiReaction reactionType)
|
|||
void Creature::CallAssistance()
|
||||
{
|
||||
// FIXME: should player pets call for assistance?
|
||||
if (!m_AlreadyCallAssistance && getVictim() && !IsCharmed())
|
||||
if (!m_AlreadyCallAssistance && getVictim() && !IsCharmed())
|
||||
{
|
||||
SetNoCallAssistance(true);
|
||||
AI()->SendAIEventAround(AI_EVENT_CALL_ASSISTANCE, getVictim(), sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_ASSISTANCE_DELAY), sWorld.getConfig(CONFIG_FLOAT_CREATURE_FAMILY_ASSISTANCE_RADIUS));
|
||||
|
|
@ -1812,7 +1812,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);
|
||||
|
|
@ -2180,9 +2180,9 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const
|
|||
|
||||
uint32 Creature::GetCreatureSpellCooldownDelay(uint32 spellId) const
|
||||
{
|
||||
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spellId);
|
||||
time_t t = time(NULL);
|
||||
return uint32(itr != m_CreatureSpellCooldowns.end() && itr->second > t ? itr->second - t : 0);
|
||||
CreatureSpellCooldowns::const_iterator itr = m_CreatureSpellCooldowns.find(spellId);
|
||||
time_t t = time(NULL);
|
||||
return uint32(itr != m_CreatureSpellCooldowns.end() && itr->second > t ? itr->second - t : 0);
|
||||
}
|
||||
|
||||
bool Creature::HasSpellCooldown(uint32 spell_id) const
|
||||
|
|
@ -2446,7 +2446,7 @@ void Creature::ClearTemporaryFaction()
|
|||
// No restore if creature is charmed/possessed.
|
||||
// For later we may consider extend to restore to charmer faction where charmer is creature.
|
||||
// This can also be done by update any pet/charmed of creature at any faction change to charmer.
|
||||
if (IsCharmed())
|
||||
if (IsCharmed())
|
||||
return;
|
||||
|
||||
// Reset to original faction
|
||||
|
|
|
|||
|
|
@ -39,7 +39,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 = sScriptMgr.GetCreatureAI(creature))
|
||||
return scriptedAI;
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ namespace FactorySelector
|
|||
// 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() &&
|
||||
((owner = creature->GetOwner()) && owner->GetTypeId() == TYPEID_PLAYER)) || creature->IsCharmed())
|
||||
((owner = creature->GetOwner()) && owner->GetTypeId() == TYPEID_PLAYER)) || creature->IsCharmed())
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if (creature->IsTotem())
|
||||
ai_factory = ai_registry.GetRegistryItem("TotemAI");
|
||||
|
|
|
|||
|
|
@ -708,8 +708,8 @@ class GameObject : public WorldObject
|
|||
(m_respawnTime > 0 && !m_spawnedByDefault) ||
|
||||
(m_respawnTime == 0 && m_spawnedByDefault);
|
||||
}
|
||||
bool isSpawnedByDefault() const { return m_spawnedByDefault; }
|
||||
void SetSpawnedByDefault(bool b) { m_spawnedByDefault = b; }
|
||||
bool isSpawnedByDefault() const { return m_spawnedByDefault; }
|
||||
void SetSpawnedByDefault(bool b) { m_spawnedByDefault = b; }
|
||||
uint32 GetRespawnDelay() const { return m_respawnDelayTime; }
|
||||
void Refresh();
|
||||
void Delete();
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ bool Guild::AddMember(ObjectGuid plGuid, uint32 plRank)
|
|||
pl->SetInGuild(m_Id);
|
||||
pl->SetGuildLevel(GetLevel());
|
||||
pl->SetRank(newmember.RankId);
|
||||
pl->SetGuildIdInvited(0);
|
||||
pl->SetGuildIdInvited(0);
|
||||
}
|
||||
|
||||
UpdateAccountsNumber();
|
||||
|
|
@ -569,13 +569,13 @@ bool Guild::DelMember(ObjectGuid guid, bool isDisbanding)
|
|||
|
||||
bool Guild::ChangeMemberRank(ObjectGuid guid, uint8 newRank)
|
||||
{
|
||||
if (newRank <= GetLowestRank()) // Validate rank (allow only existing ranks)
|
||||
if (MemberSlot* member = GetMemberSlot(guid))
|
||||
{
|
||||
member->ChangeRank(newRank);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (newRank <= GetLowestRank()) // Validate rank (allow only existing ranks)
|
||||
if (MemberSlot* member = GetMemberSlot(guid))
|
||||
{
|
||||
member->ChangeRank(newRank);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Guild::BroadcastToGuild(WorldSession* session, const std::string& msg, uint32 language)
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ class Guild
|
|||
void SetLeader(ObjectGuid guid);
|
||||
bool AddMember(ObjectGuid plGuid, uint32 plRank);
|
||||
bool DelMember(ObjectGuid guid, bool isDisbanding = false);
|
||||
bool ChangeMemberRank(ObjectGuid guid, uint8 newRank);
|
||||
bool ChangeMemberRank(ObjectGuid guid, uint8 newRank);
|
||||
// lowest rank is the count of ranks - 1 (the highest rank_id in table)
|
||||
uint32 GetLowestRank() const { return m_Ranks.size() - 1; }
|
||||
|
||||
|
|
|
|||
|
|
@ -411,9 +411,9 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
|
|||
|
||||
bool Item::IsNotEmptyBag() const
|
||||
{
|
||||
if (Bag const* bag = ToBag())
|
||||
return !bag->IsEmpty();
|
||||
return false;
|
||||
if (Bag const* bag = ToBag())
|
||||
return !bag->IsEmpty();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Item::UpdateDuration(Player* owner, uint32 diff)
|
||||
|
|
|
|||
|
|
@ -308,15 +308,15 @@ class Item : public Object
|
|||
virtual bool LoadFromDB(uint32 guidLow, Field* fields, ObjectGuid ownerGuid = ObjectGuid());
|
||||
virtual void DeleteFromDB();
|
||||
void DeleteFromInventoryDB();
|
||||
void LoadLootFromDB(Field* fields);
|
||||
void LoadLootFromDB(Field* fields);
|
||||
|
||||
Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return NULL; }
|
||||
const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return NULL; }
|
||||
Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return NULL; }
|
||||
const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return NULL; }
|
||||
|
||||
bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_UNLOCKED); }
|
||||
bool IsBag() const { return GetProto()->InventoryType == INVTYPE_BAG; }
|
||||
bool IsCurrencyToken() const { return GetProto()->IsCurrencyToken(); }
|
||||
bool IsNotEmptyBag() const;
|
||||
bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_UNLOCKED); }
|
||||
bool IsBag() const { return GetProto()->InventoryType == INVTYPE_BAG; }
|
||||
bool IsCurrencyToken() const { return GetProto()->IsCurrencyToken(); }
|
||||
bool IsNotEmptyBag() const;
|
||||
bool IsBroken() const { return GetUInt32Value(ITEM_FIELD_MAXDURABILITY) > 0 && GetUInt32Value(ITEM_FIELD_DURABILITY) == 0; }
|
||||
bool CanBeTraded(bool mail = false) const;
|
||||
void SetInTrade(bool b = true) { mb_in_trade = b; }
|
||||
|
|
|
|||
|
|
@ -652,9 +652,9 @@ struct ItemPrototype
|
|||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool IsCurrencyToken() const { return BagFamily & BAG_FAMILY_CURRENCY_TOKENS; }
|
||||
bool IsCurrencyToken() const { return BagFamily & BAG_FAMILY_CURRENCY_TOKENS; }
|
||||
|
||||
uint32 GetMaxStackSize() const { return Stackable > 0 ? uint32(Stackable) : uint32(0x7FFFFFFF - 1); }
|
||||
float getDPS() const;
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ bool PetAI::IsVisible(Unit* pl) const
|
|||
bool PetAI::_needToStop() const
|
||||
{
|
||||
// This is needed for charmed creatures, as once their target was reset other effects can trigger threat
|
||||
if (m_creature->IsCharmed() && m_creature->getVictim() == m_creature->GetCharmer())
|
||||
if (m_creature->IsCharmed() && m_creature->getVictim() == m_creature->GetCharmer())
|
||||
return true;
|
||||
|
||||
return !m_creature->getVictim()->IsTargetableForAttack();
|
||||
|
|
|
|||
|
|
@ -6757,7 +6757,7 @@ time_t Player::GetTalentResetTime() const
|
|||
return m_resetTalentsTime;
|
||||
}
|
||||
|
||||
uint32 Player::GetTalentResetCost() const
|
||||
uint32 Player::GetTalentResetCost() const
|
||||
{
|
||||
return resetTalentsCost(); // this function added in dev21 - remove this comment if this line works
|
||||
}
|
||||
|
|
@ -21749,7 +21749,7 @@ void Player::SendCorpseReclaimDelay(bool load)
|
|||
GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
uint32 Player::GetNextResetTalentsCost() const
|
||||
uint32 Player::GetNextResetTalentsCost() const
|
||||
{
|
||||
// The first time reset costs 1 gold
|
||||
if (GetTalentResetCost() < 1 * GOLD)
|
||||
|
|
|
|||
|
|
@ -1065,17 +1065,17 @@ class Player : public Unit
|
|||
|
||||
static bool BuildEnumData(QueryResult* result, ByteBuffer* data, ByteBuffer* buffer);
|
||||
|
||||
void SetInWater(bool apply);
|
||||
void SetInWater(bool apply);
|
||||
|
||||
bool IsInWater() const override
|
||||
{
|
||||
return m_isInWater;
|
||||
}
|
||||
bool IsUnderWater() const override;
|
||||
bool IsFalling()
|
||||
{
|
||||
return GetPositionZ() < m_lastFallZ;
|
||||
}
|
||||
bool IsInWater() const override
|
||||
{
|
||||
return m_isInWater;
|
||||
}
|
||||
bool IsUnderWater() const override;
|
||||
bool IsFalling()
|
||||
{
|
||||
return GetPositionZ() < m_lastFallZ;
|
||||
}
|
||||
|
||||
void SendInitialPacketsBeforeAddToMap();
|
||||
void SendInitialPacketsAfterAddToMap();
|
||||
|
|
@ -1109,7 +1109,7 @@ class Player : public Unit
|
|||
void SetGameMaster(bool on);
|
||||
bool isGMChat() const { return GetSession()->GetSecurity() >= SEC_MODERATOR && (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT); }
|
||||
void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
|
||||
bool IsTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; }
|
||||
bool IsTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; }
|
||||
void SetTaxiCheater(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; }
|
||||
bool isGMVisible() const { return !(m_ExtraFlags & PLAYER_EXTRA_GM_INVISIBLE); }
|
||||
void SetGMVisible(bool on);
|
||||
|
|
@ -1756,15 +1756,15 @@ class Player : public Unit
|
|||
void SetInGuild(uint32 GuildId);
|
||||
void SetGuildLevel(uint32 level) { SetUInt32Value(PLAYER_GUILDLEVEL, level); }
|
||||
void SetRank(uint32 rankId){ SetUInt32Value(PLAYER_GUILDRANK, rankId); }
|
||||
// void SetGuildInvited(uint32 GuildId, ObjectGuid inviter = ObjectGuid()) { m_GuildIdInvited = GuildId; m_GuildInviterGuid = inviter; } .. PRE Dev21 version (DELETE IT?)
|
||||
void SetGuildIdInvited(uint32 GuildId)
|
||||
{
|
||||
m_GuildIdInvited = GuildId;
|
||||
}
|
||||
// void SetGuildInvited(uint32 GuildId, ObjectGuid inviter = ObjectGuid()) { m_GuildIdInvited = GuildId; m_GuildInviterGuid = inviter; } .. PRE Dev21 version (DELETE IT?)
|
||||
void SetGuildIdInvited(uint32 GuildId)
|
||||
{
|
||||
m_GuildIdInvited = GuildId;
|
||||
}
|
||||
uint32 GetGuildId() const { return GetGuildGuid().GetCounter(); }
|
||||
ObjectGuid GetGuildGuid() const { return GetGuidValue(OBJECT_FIELD_DATA); }
|
||||
std::string GetGuildName() const;
|
||||
uint32 GetTalentResetCost() const;
|
||||
uint32 GetTalentResetCost() const;
|
||||
time_t GetTalentResetTime() const;
|
||||
static uint32 GetGuildIdFromDB(ObjectGuid guid);
|
||||
static ObjectGuid GetGuildGuidFromDB(ObjectGuid guid);
|
||||
|
|
@ -2349,7 +2349,7 @@ class Player : public Unit
|
|||
void SetGroupUpdateFlag(uint32 flag) { m_groupUpdateMask |= flag; }
|
||||
const uint64& GetAuraUpdateMask() const { return m_auraUpdateMask; }
|
||||
void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
|
||||
uint32 GetNextResetTalentsCost() const;
|
||||
uint32 GetNextResetTalentsCost() const;
|
||||
Player* GetNextRandomRaidMember(float radius);
|
||||
PartyResult CanUninviteFromGroup() const;
|
||||
// BattleGround Group System
|
||||
|
|
|
|||
|
|
@ -5704,17 +5704,17 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
|
|||
|
||||
void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
|
||||
{
|
||||
CalcDamageInfo dmgInfo;
|
||||
dmgInfo.HitInfo = HitInfo;
|
||||
dmgInfo.attacker = this;
|
||||
dmgInfo.target = target;
|
||||
dmgInfo.damage = Damage - AbsorbDamage - Resist - BlockedAmount;
|
||||
dmgInfo.damageSchoolMask = damageSchoolMask;
|
||||
dmgInfo.absorb = AbsorbDamage;
|
||||
dmgInfo.resist = Resist;
|
||||
dmgInfo.TargetState = TargetState;
|
||||
dmgInfo.blocked_amount = BlockedAmount;
|
||||
SendAttackStateUpdate(&dmgInfo);
|
||||
CalcDamageInfo dmgInfo;
|
||||
dmgInfo.HitInfo = HitInfo;
|
||||
dmgInfo.attacker = this;
|
||||
dmgInfo.target = target;
|
||||
dmgInfo.damage = Damage - AbsorbDamage - Resist - BlockedAmount;
|
||||
dmgInfo.damageSchoolMask = damageSchoolMask;
|
||||
dmgInfo.absorb = AbsorbDamage;
|
||||
dmgInfo.resist = Resist;
|
||||
dmgInfo.TargetState = TargetState;
|
||||
dmgInfo.blocked_amount = BlockedAmount;
|
||||
SendAttackStateUpdate(&dmgInfo);
|
||||
}
|
||||
|
||||
void Unit::SetPowerType(Powers new_powertype)
|
||||
|
|
@ -8330,7 +8330,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
|
||||
|
|
@ -8373,7 +8373,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
|
||||
|
|
@ -9800,7 +9800,7 @@ bool Unit::isInvisibleForAlive() const
|
|||
if (m_AuraFlags & UNIT_AURAFLAG_ALIVE_INVISIBLE)
|
||||
return true;
|
||||
// TODO: maybe spiritservices also have just an aura
|
||||
return IsSpiritService();
|
||||
return IsSpiritService();
|
||||
}
|
||||
|
||||
uint32 Unit::GetCreatureType() const
|
||||
|
|
|
|||
|
|
@ -1684,8 +1684,8 @@ class Unit : public WorldObject
|
|||
|
||||
bool IsFullHealth() const { return GetHealth() == GetMaxHealth(); }
|
||||
|
||||
bool HealthBelowPct(int32 pct) const { return GetHealth() < CountPctFromMaxHealth(pct); }
|
||||
bool HealthAbovePct(int32 pct) const { return GetHealth() > CountPctFromMaxHealth(pct); }
|
||||
bool HealthBelowPct(int32 pct) const { return GetHealth() < CountPctFromMaxHealth(pct); }
|
||||
bool HealthAbovePct(int32 pct) const { return GetHealth() > CountPctFromMaxHealth(pct); }
|
||||
|
||||
/**
|
||||
* Gets the percent of the health. The formula: (GetHealth() * 100) / GetMaxHealth()
|
||||
|
|
@ -1693,9 +1693,9 @@ class Unit : public WorldObject
|
|||
* \see GetHealth
|
||||
* \see GetMaxHealth
|
||||
*/
|
||||
float GetHealthPercent() const { return (GetHealth() * 100.0f) / GetMaxHealth(); }
|
||||
uint32 CountPctFromMaxHealth(int32 pct) const { return (GetMaxHealth() * static_cast<float>(pct) / 100.0f); }
|
||||
uint32 CountPctFromCurHealth(int32 pct) const { return (GetHealth() * static_cast<float>(pct) / 100.0f); }
|
||||
float GetHealthPercent() const { return (GetHealth() * 100.0f) / GetMaxHealth(); }
|
||||
uint32 CountPctFromMaxHealth(int32 pct) const { return (GetMaxHealth() * static_cast<float>(pct) / 100.0f); }
|
||||
uint32 CountPctFromCurHealth(int32 pct) const { return (GetHealth() * static_cast<float>(pct) / 100.0f); }
|
||||
/**
|
||||
* Sets the health to the given value, it cant be higher than Unit::GetMaxHealth though
|
||||
* @param val the value to set the health to
|
||||
|
|
@ -2164,18 +2164,18 @@ class Unit : public WorldObject
|
|||
bool IsVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); }
|
||||
bool IsTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); }
|
||||
bool IsQuestGiver() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); }
|
||||
bool IsGossip() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
|
||||
bool IsTaxi() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER); }
|
||||
bool IsGuildMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER); }
|
||||
bool IsBattleMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER); }
|
||||
bool IsBanker() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); }
|
||||
bool IsInnkeeper() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER); }
|
||||
bool IsSpiritHealer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER); }
|
||||
bool IsSpiritGuide() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
bool IsTabardDesigner()const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER); }
|
||||
bool IsGossip() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); }
|
||||
bool IsTaxi() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_FLIGHTMASTER); }
|
||||
bool IsGuildMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_PETITIONER); }
|
||||
bool IsBattleMaster() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BATTLEMASTER); }
|
||||
bool IsBanker() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); }
|
||||
bool IsInnkeeper() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_INNKEEPER); }
|
||||
bool IsSpiritHealer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER); }
|
||||
bool IsSpiritGuide() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
bool IsTabardDesigner()const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TABARDDESIGNER); }
|
||||
bool isAuctioner() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_AUCTIONEER); }
|
||||
bool IsArmorer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR); }
|
||||
bool IsServiceProvider() const
|
||||
bool IsArmorer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_REPAIR); }
|
||||
bool IsServiceProvider() const
|
||||
{
|
||||
return HasFlag(UNIT_NPC_FLAGS,
|
||||
UNIT_NPC_FLAG_VENDOR | UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_FLIGHTMASTER |
|
||||
|
|
@ -2183,7 +2183,7 @@ class Unit : public WorldObject
|
|||
UNIT_NPC_FLAG_INNKEEPER | UNIT_NPC_FLAG_SPIRITHEALER |
|
||||
UNIT_NPC_FLAG_SPIRITGUIDE | UNIT_NPC_FLAG_TABARDDESIGNER | UNIT_NPC_FLAG_AUCTIONEER);
|
||||
}
|
||||
bool IsSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
bool IsSpiritService() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPIRITHEALER | UNIT_NPC_FLAG_SPIRITGUIDE); }
|
||||
|
||||
bool IsTaxiFlying() const { return hasUnitState(UNIT_STAT_TAXI_FLIGHT); }
|
||||
|
||||
|
|
@ -2422,8 +2422,8 @@ class Unit : public WorldObject
|
|||
* \todo What's the swingtype for?
|
||||
*/
|
||||
void SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
|
||||
void SendAttackStateUpdate(uint32 HitInfo, Unit* target, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
|
||||
/**
|
||||
void SendAttackStateUpdate(uint32 HitInfo, Unit* target, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
|
||||
/**
|
||||
* Used to send a update to the combat log for all \ref Player/\ref Unit s in the vicinity.
|
||||
* @param log Info about who/what did damage to who and how etc, data needed for the packet
|
||||
* \see OpcodesList::SMSG_SPELLNONMELEEDAMAGELOG
|
||||
|
|
@ -2564,32 +2564,32 @@ class Unit : public WorldObject
|
|||
void SendThreatRemove(HostileReference* pHostileReference);
|
||||
void SendThreatUpdate();
|
||||
|
||||
/**
|
||||
* Checks whether or not this \ref Unit is alive by checking the \ref Unit::m_deathState member
|
||||
* for the value \ref DeathState::ALIVE
|
||||
* @return true if this \ref Unit is alive, false otherwise
|
||||
*/
|
||||
/**
|
||||
* Checks whether or not this \ref Unit is alive by checking the \ref Unit::m_deathState member
|
||||
* for the value \ref DeathState::ALIVE
|
||||
* @return true if this \ref Unit is alive, false otherwise
|
||||
*/
|
||||
bool IsAlive() const { return (m_deathState == ALIVE); };
|
||||
bool IsDying() const { return (m_deathState == JUST_DIED); }
|
||||
/**
|
||||
* Checks whether or not this \ref Unit is dead by checking the \ref Unit::m_deathState member
|
||||
* for the value \ref DeathState::DEAD or \ref DeathState::CORPSE
|
||||
* @return true if this \ref Unit is dead or a corpse (also dead), false otherwise
|
||||
*/
|
||||
bool IsDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); };
|
||||
/**
|
||||
* Returns the current \ref DeathState for this \ref Unit.
|
||||
* @return the value of the member \ref Unit::m_deathState
|
||||
*/
|
||||
DeathState getDeathState() const { return m_deathState; };
|
||||
/**
|
||||
* Changes the \ref DeathState for this \ref Unit and making sure that some things that should
|
||||
* happen when that changes happen, ie: you just died, then you're auras should be removed,
|
||||
* any combopoints that you had should be removed etc.
|
||||
*
|
||||
* This is overwritten to do different things in at least \ref Player, \ref Creature, \ref Pet
|
||||
* @param s the new \ref DeathState this \ref Unit should get
|
||||
*/
|
||||
bool IsDying() const { return (m_deathState == JUST_DIED); }
|
||||
/**
|
||||
* Checks whether or not this \ref Unit is dead by checking the \ref Unit::m_deathState member
|
||||
* for the value \ref DeathState::DEAD or \ref DeathState::CORPSE
|
||||
* @return true if this \ref Unit is dead or a corpse (also dead), false otherwise
|
||||
*/
|
||||
bool IsDead() const { return (m_deathState == DEAD || m_deathState == CORPSE); };
|
||||
/**
|
||||
* Returns the current \ref DeathState for this \ref Unit.
|
||||
* @return the value of the member \ref Unit::m_deathState
|
||||
*/
|
||||
DeathState getDeathState() const { return m_deathState; };
|
||||
/**
|
||||
* Changes the \ref DeathState for this \ref Unit and making sure that some things that should
|
||||
* happen when that changes happen, ie: you just died, then you're auras should be removed,
|
||||
* any combopoints that you had should be removed etc.
|
||||
*
|
||||
* This is overwritten to do different things in at least \ref Player, \ref Creature, \ref Pet
|
||||
* @param s the new \ref DeathState this \ref Unit should get
|
||||
*/
|
||||
virtual void SetDeathState(DeathState s); // overwritten in Creature/Player/Pet
|
||||
|
||||
ObjectGuid const& GetOwnerGuid() const { return GetGuidValue(UNIT_FIELD_SUMMONEDBY); }
|
||||
|
|
@ -2737,7 +2737,7 @@ class Unit : public WorldObject
|
|||
* @return true if the \ref Unit has a charmer, false otherwise
|
||||
* \see Unit::GetCharmerGuid
|
||||
*/
|
||||
bool IsCharmed() const { return !GetCharmerGuid().IsEmpty(); }
|
||||
bool IsCharmed() const { return !GetCharmerGuid().IsEmpty(); }
|
||||
|
||||
/**
|
||||
* There's only \ref CharmInfo available if this \ref Unit is in fact charmed by someone
|
||||
|
|
@ -3035,8 +3035,8 @@ class Unit : public WorldObject
|
|||
// delayed+channeled spells are always interrupted
|
||||
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0);
|
||||
|
||||
Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; }
|
||||
Spell* GetCurrentSpell(uint32 spellType) const { return m_currentSpells[spellType]; }
|
||||
Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; }
|
||||
Spell* GetCurrentSpell(uint32 spellType) const { return m_currentSpells[spellType]; }
|
||||
Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
|
||||
|
||||
bool CheckAndIncreaseCastCounter();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue