mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1039,13 +1039,13 @@ uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missC
|
||||
struct RedirectThreatInfo
|
||||
{
|
||||
RedirectThreatInfo() { }
|
||||
uint64 _targetGUID{0};
|
||||
ObjectGuid _targetGUID;
|
||||
uint32 _threatPct{0};
|
||||
|
||||
[[nodiscard]] uint64 GetTargetGUID() const { return _targetGUID; }
|
||||
[[nodiscard]] ObjectGuid GetTargetGUID() const { return _targetGUID; }
|
||||
[[nodiscard]] uint32 GetThreatPct() const { return _threatPct; }
|
||||
|
||||
void Set(uint64 guid, uint32 pct)
|
||||
void Set(ObjectGuid guid, uint32 pct)
|
||||
{
|
||||
_targetGUID = guid;
|
||||
_threatPct = pct;
|
||||
@@ -1235,8 +1235,8 @@ public:
|
||||
|
||||
void SetForcedSpell(uint32 id) { _forcedSpellId = id; }
|
||||
int32 GetForcedSpell() { return _forcedSpellId; }
|
||||
void SetForcedTargetGUID(uint64 guid) { _forcedTargetGUID = guid; }
|
||||
uint64 GetForcedTarget() { return _forcedTargetGUID; }
|
||||
void SetForcedTargetGUID(ObjectGuid guid = ObjectGuid::Empty) { _forcedTargetGUID = guid; }
|
||||
ObjectGuid GetForcedTarget() { return _forcedTargetGUID; }
|
||||
|
||||
// Player react states
|
||||
void SetPlayerReactState(ReactStates s) { _oldReactState = s; }
|
||||
@@ -1258,7 +1258,7 @@ private:
|
||||
bool _isFollowing;
|
||||
bool _isReturning;
|
||||
int32 _forcedSpellId;
|
||||
uint64 _forcedTargetGUID;
|
||||
ObjectGuid _forcedTargetGUID;
|
||||
float _stayX;
|
||||
float _stayY;
|
||||
float _stayZ;
|
||||
@@ -1400,7 +1400,7 @@ public:
|
||||
typedef std::list<Aura*> AuraList;
|
||||
typedef std::list<AuraApplication*> AuraApplicationList;
|
||||
typedef std::list<DiminishingReturn> Diminishing;
|
||||
typedef std::unordered_set<uint32> ComboPointHolderSet;
|
||||
typedef GuidUnorderedSet ComboPointHolderSet;
|
||||
|
||||
typedef std::map<uint8, AuraApplication*> VisibleAuraMap;
|
||||
|
||||
@@ -1486,7 +1486,7 @@ public:
|
||||
[[nodiscard]] bool CanFreeMove() const
|
||||
{
|
||||
return !HasUnitState(UNIT_STATE_CONFUSED | UNIT_STATE_FLEEING | UNIT_STATE_IN_FLIGHT |
|
||||
UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) && GetOwnerGUID() == 0;
|
||||
UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) && !GetOwnerGUID();
|
||||
}
|
||||
|
||||
[[nodiscard]] uint32 HasUnitTypeMask(uint32 mask) const { return mask & m_unitTypeMask; }
|
||||
@@ -1774,22 +1774,22 @@ public:
|
||||
void SendEnergizeSpellLog(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype);
|
||||
void EnergizeBySpell(Unit* victim, uint32 SpellID, uint32 Damage, Powers powertype);
|
||||
|
||||
SpellCastResult CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, uint64 originalCaster = 0);
|
||||
SpellCastResult CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
SpellCastResult CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||
Aura* AddAura(uint32 spellId, Unit* target);
|
||||
Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target);
|
||||
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
|
||||
void SendPlaySpellVisual(uint32 id);
|
||||
void SendPlaySpellImpact(uint64 guid, uint32 id);
|
||||
void SendPlaySpellImpact(ObjectGuid guid, uint32 id);
|
||||
void BuildCooldownPacket(WorldPacket& data, uint8 flags, uint32 spellId, uint32 cooldown);
|
||||
void BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns const& cooldowns);
|
||||
|
||||
@@ -1856,30 +1856,31 @@ public:
|
||||
DeathState getDeathState() { return m_deathState; };
|
||||
virtual void setDeathState(DeathState s, bool despawn = false); // overwrited in Creature/Player/Pet
|
||||
|
||||
[[nodiscard]] uint64 GetOwnerGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMONEDBY); }
|
||||
void SetOwnerGUID(uint64 owner);
|
||||
[[nodiscard]] uint64 GetCreatorGUID() const { return GetUInt64Value(UNIT_FIELD_CREATEDBY); }
|
||||
void SetCreatorGUID(uint64 creator) { SetUInt64Value(UNIT_FIELD_CREATEDBY, creator); }
|
||||
[[nodiscard]] uint64 GetMinionGUID() const { return GetUInt64Value(UNIT_FIELD_SUMMON); }
|
||||
void SetMinionGUID(uint64 guid) { SetUInt64Value(UNIT_FIELD_SUMMON, guid); }
|
||||
[[nodiscard]] uint64 GetCharmerGUID() const { return GetUInt64Value(UNIT_FIELD_CHARMEDBY); }
|
||||
void SetCharmerGUID(uint64 owner) { SetUInt64Value(UNIT_FIELD_CHARMEDBY, owner); }
|
||||
[[nodiscard]] uint64 GetCharmGUID() const { return GetUInt64Value(UNIT_FIELD_CHARM); }
|
||||
void SetPetGUID(uint64 guid) { m_SummonSlot[SUMMON_SLOT_PET] = guid; }
|
||||
[[nodiscard]] uint64 GetPetGUID() const { return m_SummonSlot[SUMMON_SLOT_PET]; }
|
||||
void SetCritterGUID(uint64 guid) { SetUInt64Value(UNIT_FIELD_CRITTER, guid); }
|
||||
[[nodiscard]] uint64 GetCritterGUID() const { return GetUInt64Value(UNIT_FIELD_CRITTER); }
|
||||
[[nodiscard]] ObjectGuid GetOwnerGUID() const { return GetGuidValue(UNIT_FIELD_SUMMONEDBY); }
|
||||
void SetOwnerGUID(ObjectGuid owner);
|
||||
[[nodiscard]] ObjectGuid GetCreatorGUID() const { return GetGuidValue(UNIT_FIELD_CREATEDBY); }
|
||||
void SetCreatorGUID(ObjectGuid creator) { SetGuidValue(UNIT_FIELD_CREATEDBY, creator); }
|
||||
[[nodiscard]] ObjectGuid GetMinionGUID() const { return GetGuidValue(UNIT_FIELD_SUMMON); }
|
||||
void SetMinionGUID(ObjectGuid guid) { SetGuidValue(UNIT_FIELD_SUMMON, guid); }
|
||||
[[nodiscard]] ObjectGuid GetCharmerGUID() const { return GetGuidValue(UNIT_FIELD_CHARMEDBY); }
|
||||
void SetCharmerGUID(ObjectGuid owner) { SetGuidValue(UNIT_FIELD_CHARMEDBY, owner); }
|
||||
[[nodiscard]] ObjectGuid GetCharmGUID() const { return GetGuidValue(UNIT_FIELD_CHARM); }
|
||||
void SetPetGUID(ObjectGuid guid) { m_SummonSlot[SUMMON_SLOT_PET] = guid; }
|
||||
[[nodiscard]] ObjectGuid GetPetGUID() const { return m_SummonSlot[SUMMON_SLOT_PET]; }
|
||||
void SetCritterGUID(ObjectGuid guid) { SetGuidValue(UNIT_FIELD_CRITTER, guid); }
|
||||
[[nodiscard]] ObjectGuid GetCritterGUID() const { return GetGuidValue(UNIT_FIELD_CRITTER); }
|
||||
|
||||
[[nodiscard]] bool IsControlledByPlayer() const { return m_ControlledByPlayer; }
|
||||
[[nodiscard]] bool IsCreatedByPlayer() const { return m_CreatedByPlayer; }
|
||||
[[nodiscard]] uint64 GetCharmerOrOwnerGUID() const { return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); }
|
||||
[[nodiscard]] uint64 GetCharmerOrOwnerOrOwnGUID() const
|
||||
[[nodiscard]] ObjectGuid GetCharmerOrOwnerGUID() const { return GetCharmerGUID() ? GetCharmerGUID() : GetOwnerGUID(); }
|
||||
[[nodiscard]] ObjectGuid GetCharmerOrOwnerOrOwnGUID() const
|
||||
{
|
||||
if (uint64 guid = GetCharmerOrOwnerGUID())
|
||||
if (ObjectGuid guid = GetCharmerOrOwnerGUID())
|
||||
return guid;
|
||||
|
||||
return GetGUID();
|
||||
}
|
||||
[[nodiscard]] bool IsCharmedOwnedByPlayerOrPlayer() const { return IS_PLAYER_GUID(GetCharmerOrOwnerOrOwnGUID()); }
|
||||
[[nodiscard]] bool IsCharmedOwnedByPlayerOrPlayer() const { return GetCharmerOrOwnerOrOwnGUID().IsPlayer(); }
|
||||
|
||||
[[nodiscard]] Player* GetSpellModOwner() const;
|
||||
|
||||
@@ -1912,9 +1913,9 @@ public:
|
||||
[[nodiscard]] Unit* GetFirstControlled() const;
|
||||
void RemoveAllControlled();
|
||||
|
||||
[[nodiscard]] bool IsCharmed() const { return GetCharmerGUID() != 0; }
|
||||
[[nodiscard]] bool IsCharmed() const { return GetCharmerGUID(); }
|
||||
[[nodiscard]] bool isPossessed() const { return HasUnitState(UNIT_STATE_POSSESSED); }
|
||||
[[nodiscard]] bool isPossessedByPlayer() const { return HasUnitState(UNIT_STATE_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
|
||||
[[nodiscard]] bool isPossessedByPlayer() const { return HasUnitState(UNIT_STATE_POSSESSED) && GetCharmerGUID().IsPlayer(); }
|
||||
[[nodiscard]] bool isPossessing() const
|
||||
{
|
||||
if (Unit* u = GetCharm())
|
||||
@@ -1942,7 +1943,7 @@ public:
|
||||
bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id);
|
||||
|
||||
// aura apply/remove helpers - you should better not use these
|
||||
Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, uint64 casterGUID = 0, bool periodicReset = false);
|
||||
Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty, bool periodicReset = false);
|
||||
void _AddAura(UnitAura* aura, Unit* caster);
|
||||
AuraApplication* _CreateAuraApplication(Aura* aura, uint8 effMask);
|
||||
void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
|
||||
@@ -1959,17 +1960,17 @@ public:
|
||||
[[nodiscard]] AuraMap const& GetOwnedAuras() const { return m_ownedAuras; }
|
||||
|
||||
void RemoveOwnedAura(AuraMap::iterator& i, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = nullptr) const;
|
||||
Aura* GetOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, Aura* except = nullptr) const;
|
||||
|
||||
// m_appliedAuras container management
|
||||
AuraApplicationMap& GetAppliedAuras() { return m_appliedAuras; }
|
||||
[[nodiscard]] AuraApplicationMap const& GetAppliedAuras() const { return m_appliedAuras; }
|
||||
|
||||
void RemoveAura(AuraApplicationMap::iterator& i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAura(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAura(AuraApplication* aurApp, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAura(Aura* aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
@@ -1981,16 +1982,16 @@ public:
|
||||
void RemoveAppliedAuras(uint32 spellId, std::function<bool(AuraApplication const*)> const& check);
|
||||
void RemoveOwnedAuras(uint32 spellId, std::function<bool(Aura const*)> const& check);
|
||||
|
||||
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAuraFromStack(uint32 spellId, uint64 casterGUID = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
|
||||
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer);
|
||||
void RemoveAurasDueToItemSpell(uint32 spellId, uint64 castItemGuid);
|
||||
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = nullptr, bool negative = true, bool positive = true);
|
||||
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
|
||||
void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, Unit* stealer);
|
||||
void RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid);
|
||||
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID = ObjectGuid::Empty, Aura* except = nullptr, bool negative = true, bool positive = true);
|
||||
void RemoveNotOwnSingleTargetAuras();
|
||||
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
|
||||
void RemoveAurasWithAttribute(uint32 flags);
|
||||
void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID);
|
||||
void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID);
|
||||
void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode = AURA_REMOVE_BY_DEFAULT, uint32 except = 0);
|
||||
void RemoveMovementImpairingAuras(bool withRoot);
|
||||
void RemoveAurasByShapeShift();
|
||||
@@ -2003,7 +2004,7 @@ public:
|
||||
void RemoveAllAurasExceptType(AuraType type);
|
||||
//void RemoveAllAurasExceptType(AuraType type1, AuraType type2); // pussywizard: replaced with RemoveEvadeAuras()
|
||||
void RemoveEvadeAuras();
|
||||
void DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime);
|
||||
void DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime);
|
||||
|
||||
void _RemoveAllAuraStatMods();
|
||||
void _ApplyAllAuraStatMods();
|
||||
@@ -2012,37 +2013,37 @@ public:
|
||||
AuraList& GetSingleCastAuras() { return m_scAuras; }
|
||||
[[nodiscard]] AuraList const& GetSingleCastAuras() const { return m_scAuras; }
|
||||
|
||||
[[nodiscard]] AuraEffect* GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
|
||||
[[nodiscard]] AuraEffect* GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
|
||||
[[nodiscard]] AuraEffect* GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID = ObjectGuid::Empty) const;
|
||||
[[nodiscard]] AuraEffect* GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID = ObjectGuid::Empty) const;
|
||||
[[nodiscard]] AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const; // spell mustn't have familyflags
|
||||
[[nodiscard]] AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID = 0) const;
|
||||
[[nodiscard]] AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID = ObjectGuid::Empty) const;
|
||||
[[nodiscard]] AuraEffect* GetAuraEffectDummy(uint32 spellid) const;
|
||||
[[nodiscard]] inline AuraEffect* GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex);}
|
||||
|
||||
AuraApplication* GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication* except = nullptr) const;
|
||||
[[nodiscard]] Aura* GetAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
AuraApplication* GetAuraApplication(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraApplication* except = nullptr) const;
|
||||
[[nodiscard]] Aura* GetAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0) const;
|
||||
|
||||
AuraApplication* GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication* except = nullptr) const;
|
||||
[[nodiscard]] Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
AuraApplication* GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraApplication* except = nullptr) const;
|
||||
[[nodiscard]] Aura* GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0) const;
|
||||
|
||||
void GetDispellableAuraList(Unit* caster, uint32 dispelMask, DispelChargesList& dispelList);
|
||||
|
||||
[[nodiscard]] bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
|
||||
[[nodiscard]] bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster = ObjectGuid::Empty) const;
|
||||
[[nodiscard]] uint32 GetAuraCount(uint32 spellId) const;
|
||||
[[nodiscard]] bool HasAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
|
||||
[[nodiscard]] bool HasAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0) const;
|
||||
[[nodiscard]] bool HasAuraType(AuraType auraType) const;
|
||||
[[nodiscard]] bool HasAuraTypeWithCaster(AuraType auratype, uint64 caster) const;
|
||||
[[nodiscard]] bool HasAuraTypeWithCaster(AuraType auratype, ObjectGuid caster) const;
|
||||
[[nodiscard]] bool HasAuraTypeWithMiscvalue(AuraType auratype, int32 miscvalue) const;
|
||||
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const* affectedSpell) const;
|
||||
[[nodiscard]] bool HasAuraTypeWithValue(AuraType auratype, int32 value) const;
|
||||
bool HasNegativeAuraWithInterruptFlag(uint32 flag, uint64 guid = 0);
|
||||
bool HasNegativeAuraWithInterruptFlag(uint32 flag, ObjectGuid guid = ObjectGuid::Empty);
|
||||
[[nodiscard]] bool HasVisibleAuraType(AuraType auraType) const;
|
||||
bool HasNegativeAuraWithAttribute(uint32 flag, uint64 guid = 0);
|
||||
bool HasNegativeAuraWithAttribute(uint32 flag, ObjectGuid guid = ObjectGuid::Empty);
|
||||
[[nodiscard]] bool HasAuraWithMechanic(uint32 mechanicMask) const;
|
||||
|
||||
AuraEffect* IsScriptOverriden(SpellInfo const* spell, int32 script) const;
|
||||
uint32 GetDiseasesByCaster(uint64 casterGUID, uint8 mode = 0);
|
||||
[[nodiscard]] uint32 GetDoTsByCaster(uint64 casterGUID) const;
|
||||
uint32 GetDiseasesByCaster(ObjectGuid casterGUID, uint8 mode = 0);
|
||||
[[nodiscard]] uint32 GetDoTsByCaster(ObjectGuid casterGUID) const;
|
||||
|
||||
[[nodiscard]] int32 GetTotalAuraModifierAreaExclusive(AuraType auratype) const;
|
||||
[[nodiscard]] int32 GetTotalAuraModifier(AuraType auratype) const;
|
||||
@@ -2109,8 +2110,8 @@ public:
|
||||
[[nodiscard]] Spell* FindCurrentSpellBySpellId(uint32 spell_id) const;
|
||||
[[nodiscard]] int32 GetCurrentSpellCastTime(uint32 spell_id) const;
|
||||
|
||||
uint64 m_SummonSlot[MAX_SUMMON_SLOT];
|
||||
uint64 m_ObjectSlot[MAX_GAMEOBJECT_SLOT];
|
||||
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT];
|
||||
ObjectGuid m_ObjectSlot[MAX_GAMEOBJECT_SLOT];
|
||||
|
||||
[[nodiscard]] ShapeshiftForm GetShapeshiftForm() const { return ShapeshiftForm(GetByteValue(UNIT_FIELD_BYTES_2, 3)); }
|
||||
void SetShapeshiftForm(ShapeshiftForm form)
|
||||
@@ -2327,14 +2328,14 @@ public:
|
||||
void DisableRotate(bool apply);
|
||||
void DisableSpline();
|
||||
|
||||
void AddComboPointHolder(uint32 lowguid) { m_ComboPointHolders.insert(lowguid); }
|
||||
void RemoveComboPointHolder(uint32 lowguid) { m_ComboPointHolders.erase(lowguid); }
|
||||
void AddComboPointHolder(ObjectGuid lowguid) { m_ComboPointHolders.insert(lowguid); }
|
||||
void RemoveComboPointHolder(ObjectGuid lowguid) { m_ComboPointHolders.erase(lowguid); }
|
||||
void ClearComboPointHolders();
|
||||
|
||||
///----------Pet responses methods-----------------
|
||||
void SendPetActionFeedback (uint8 msg);
|
||||
void SendPetTalk (uint32 pettalk);
|
||||
void SendPetAIReaction(uint64 guid);
|
||||
void SendPetAIReaction(ObjectGuid guid);
|
||||
///----------End of Pet responses methods----------
|
||||
|
||||
void propagateSpeedChange() { GetMotionMaster()->propagateSpeedChange(); }
|
||||
@@ -2372,8 +2373,8 @@ public:
|
||||
uint32 GetModelForTotem(PlayerTotemType totemType);
|
||||
|
||||
// Redirect Threat
|
||||
void SetRedirectThreat(uint64 guid, uint32 pct) { _redirectThreatInfo.Set(guid, pct); }
|
||||
void ResetRedirectThreat() { SetRedirectThreat(0, 0); }
|
||||
void SetRedirectThreat(ObjectGuid guid, uint32 pct) { _redirectThreatInfo.Set(guid, pct); }
|
||||
void ResetRedirectThreat() { SetRedirectThreat(ObjectGuid::Empty, 0); }
|
||||
void ModifyRedirectThreat(int32 amount) { _redirectThreatInfo.ModifyThreatPct(amount); }
|
||||
uint32 GetRedirectThreatPercent() { return _redirectThreatInfo.GetThreatPct(); }
|
||||
[[nodiscard]] Unit* GetRedirectThreatTarget() const;
|
||||
@@ -2386,7 +2387,7 @@ public:
|
||||
bool IsOnVehicle(const Unit* vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); }
|
||||
[[nodiscard]] Unit* GetVehicleBase() const;
|
||||
[[nodiscard]] Creature* GetVehicleCreatureBase() const;
|
||||
[[nodiscard]] uint64 GetTransGUID() const override;
|
||||
[[nodiscard]] ObjectGuid GetTransGUID() const override;
|
||||
/// Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
|
||||
[[nodiscard]] TransportBase* GetDirectTransport() const;
|
||||
|
||||
@@ -2480,8 +2481,8 @@ public:
|
||||
|
||||
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, Unit* caster) const;
|
||||
|
||||
[[nodiscard]] uint64 GetTarget() const { return GetUInt64Value(UNIT_FIELD_TARGET); }
|
||||
virtual void SetTarget(uint64 /*guid*/) = 0;
|
||||
[[nodiscard]] ObjectGuid GetTarget() const { return GetGuidValue(UNIT_FIELD_TARGET); }
|
||||
virtual void SetTarget(ObjectGuid /*guid*/ = ObjectGuid::Empty) = 0;
|
||||
|
||||
void SetInstantCast(bool set) { _instantCast = set; }
|
||||
[[nodiscard]] bool CanInstantCast() const { return _instantCast; }
|
||||
@@ -2524,7 +2525,7 @@ protected:
|
||||
typedef std::list<DynamicObject*> DynObjectList;
|
||||
DynObjectList m_dynObj;
|
||||
|
||||
typedef std::list<uint64> GameObjectList;
|
||||
typedef GuidList GameObjectList;
|
||||
GameObjectList m_gameObj;
|
||||
uint32 m_transform;
|
||||
|
||||
@@ -2560,7 +2561,7 @@ protected:
|
||||
int32 m_regenTimer;
|
||||
|
||||
ThreatManager m_ThreatManager;
|
||||
typedef std::map<uint64, float> CharmThreatMap;
|
||||
typedef std::map<ObjectGuid, float> CharmThreatMap;
|
||||
CharmThreatMap _charmThreatInfo;
|
||||
|
||||
Vehicle* m_vehicle;
|
||||
@@ -2680,23 +2681,23 @@ namespace acore
|
||||
class ConflagrateAuraStateDelayEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
ConflagrateAuraStateDelayEvent(uint64 ownerGUID, uint64 casterGUID) : BasicEvent(), m_owner(ownerGUID), m_caster(casterGUID) { }
|
||||
ConflagrateAuraStateDelayEvent(Unit* owner, ObjectGuid casterGUID) : BasicEvent(), m_owner(owner), m_casterGUID(casterGUID) { }
|
||||
bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
|
||||
private:
|
||||
uint64 m_owner;
|
||||
uint64 m_caster;
|
||||
Unit* m_owner;
|
||||
ObjectGuid m_casterGUID;
|
||||
};
|
||||
|
||||
class RedirectSpellEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
RedirectSpellEvent(Unit& self, uint64 auraOwnerGUID, AuraEffect* auraEffect) : _self(self), _auraOwnerGUID(auraOwnerGUID), _auraEffect(auraEffect) { }
|
||||
RedirectSpellEvent(Unit& self, ObjectGuid auraOwnerGUID, AuraEffect* auraEffect) : _self(self), _auraOwnerGUID(auraOwnerGUID), _auraEffect(auraEffect) { }
|
||||
bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
|
||||
protected:
|
||||
Unit& _self;
|
||||
uint64 _auraOwnerGUID;
|
||||
ObjectGuid _auraOwnerGUID;
|
||||
AuraEffect* _auraEffect;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user