mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
@@ -87,7 +87,7 @@ struct SpellDestination
|
||||
void RelocateOffset(Position const& offset);
|
||||
|
||||
WorldLocation _position;
|
||||
uint64 _transportGUID;
|
||||
ObjectGuid _transportGUID;
|
||||
Position _transportOffset;
|
||||
};
|
||||
|
||||
@@ -105,23 +105,23 @@ public:
|
||||
|
||||
void SetTargetFlag(SpellCastTargetFlags flag) { m_targetMask |= flag; }
|
||||
|
||||
uint64 GetUnitTargetGUID() const;
|
||||
ObjectGuid GetUnitTargetGUID() const;
|
||||
Unit* GetUnitTarget() const;
|
||||
void SetUnitTarget(Unit* target);
|
||||
|
||||
uint64 GetGOTargetGUID() const;
|
||||
ObjectGuid GetGOTargetGUID() const;
|
||||
GameObject* GetGOTarget() const;
|
||||
void SetGOTarget(GameObject* target);
|
||||
|
||||
uint64 GetCorpseTargetGUID() const;
|
||||
ObjectGuid GetCorpseTargetGUID() const;
|
||||
Corpse* GetCorpseTarget() const;
|
||||
void SetCorpseTarget(Corpse* target);
|
||||
|
||||
WorldObject* GetObjectTarget() const;
|
||||
uint64 GetObjectTargetGUID() const;
|
||||
ObjectGuid GetObjectTargetGUID() const;
|
||||
void RemoveObjectTarget();
|
||||
|
||||
uint64 GetItemTargetGUID() const { return m_itemTargetGUID; }
|
||||
ObjectGuid GetItemTargetGUID() const { return m_itemTargetGUID; }
|
||||
Item* GetItemTarget() const { return m_itemTarget; }
|
||||
uint32 GetItemTargetEntry() const { return m_itemTargetEntry; }
|
||||
void SetItemTarget(Item* item);
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
void OutDebug() const;
|
||||
|
||||
// Xinef: Channel data
|
||||
void SetObjectTargetChannel(uint64 targetGUID);
|
||||
void SetObjectTargetChannel(ObjectGuid targetGUID);
|
||||
void SetDstChannel(SpellDestination const& spellDest);
|
||||
WorldObject* GetObjectTargetChannel(Unit* caster) const;
|
||||
bool HasDstChannel() const;
|
||||
@@ -178,8 +178,8 @@ private:
|
||||
Item* m_itemTarget;
|
||||
|
||||
// object GUID/etc, can be used always
|
||||
uint64 m_objectTargetGUID;
|
||||
uint64 m_itemTargetGUID;
|
||||
ObjectGuid m_objectTargetGUID;
|
||||
ObjectGuid m_itemTargetGUID;
|
||||
uint32 m_itemTargetEntry;
|
||||
|
||||
SpellDestination m_src;
|
||||
@@ -190,7 +190,7 @@ private:
|
||||
|
||||
// Xinef: Save channel data
|
||||
SpellDestination m_dstChannel;
|
||||
uint64 m_objectTargetGUIDChannel;
|
||||
ObjectGuid m_objectTargetGUIDChannel;
|
||||
};
|
||||
|
||||
struct SpellValue
|
||||
@@ -224,20 +224,20 @@ enum SpellEffectHandleMode
|
||||
// Xinef: special structure containing data for channel target spells
|
||||
struct ChannelTargetData
|
||||
{
|
||||
ChannelTargetData(uint64 cguid, const SpellDestination* dst) : channelGUID(cguid)
|
||||
ChannelTargetData(ObjectGuid cguid, const SpellDestination* dst) : channelGUID(cguid)
|
||||
{
|
||||
if (dst)
|
||||
spellDst = *dst;
|
||||
}
|
||||
|
||||
uint64 channelGUID;
|
||||
ObjectGuid channelGUID;
|
||||
SpellDestination spellDst;
|
||||
};
|
||||
|
||||
// Targets store structures and data
|
||||
struct TargetInfo
|
||||
{
|
||||
uint64 targetGUID;
|
||||
ObjectGuid targetGUID;
|
||||
uint64 timeDelay;
|
||||
SpellMissInfo missCondition:8;
|
||||
SpellMissInfo reflectResult:8;
|
||||
@@ -256,7 +256,7 @@ class Spell
|
||||
friend void Unit::SetCurrentCastedSpell(Spell* pSpell);
|
||||
friend class SpellScript;
|
||||
public:
|
||||
Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, uint64 originalCasterGUID = 0, bool skipCheck = false);
|
||||
Spell(Unit* caster, SpellInfo const* info, TriggerCastFlags triggerFlags, ObjectGuid originalCasterGUID = ObjectGuid::Empty, bool skipCheck = false);
|
||||
~Spell();
|
||||
|
||||
void EffectNULL(SpellEffIndex effIndex);
|
||||
@@ -490,7 +490,7 @@ public:
|
||||
|
||||
SpellInfo const* m_spellInfo;
|
||||
Item* m_CastItem;
|
||||
uint64 m_castItemGUID;
|
||||
ObjectGuid m_castItemGUID;
|
||||
uint8 m_cast_count;
|
||||
uint32 m_glyphIndex;
|
||||
uint32 m_preCastSpell;
|
||||
@@ -544,13 +544,13 @@ protected:
|
||||
void TriggerGlobalCooldown();
|
||||
void CancelGlobalCooldown();
|
||||
|
||||
void SendLoot(uint64 guid, LootType loottype);
|
||||
void SendLoot(ObjectGuid guid, LootType loottype);
|
||||
|
||||
Unit* const m_caster;
|
||||
|
||||
SpellValue* const m_spellValue;
|
||||
|
||||
uint64 m_originalCasterGUID; // real source of cast (aura caster/etc), used for spell targets selection
|
||||
ObjectGuid m_originalCasterGUID; // real source of cast (aura caster/etc), used for spell targets selection
|
||||
// e.g. damage around area spell trigered by victim aura and damage enemies of aura caster
|
||||
Unit* m_originalCaster; // cached pointer for m_originalCaster, updated at Spell::UpdatePointers()
|
||||
|
||||
@@ -629,7 +629,7 @@ protected:
|
||||
|
||||
struct GOTargetInfo
|
||||
{
|
||||
uint64 targetGUID;
|
||||
ObjectGuid targetGUID;
|
||||
uint64 timeDelay;
|
||||
uint8 effectMask: 8;
|
||||
bool processed: 1;
|
||||
@@ -801,12 +801,12 @@ protected:
|
||||
class ReflectEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
ReflectEvent(uint64 casterGUID, uint64 targetGUID, const SpellInfo* spellInfo) : _casterGUID(casterGUID), _targetGUID(targetGUID), _spellInfo(spellInfo) { }
|
||||
ReflectEvent(Unit* caster, ObjectGuid targetGUID, const SpellInfo* spellInfo) : _caster(caster), _targetGUID(targetGUID), _spellInfo(spellInfo) { }
|
||||
bool Execute(uint64 e_time, uint32 p_time) override;
|
||||
|
||||
protected:
|
||||
uint64 _casterGUID;
|
||||
uint64 _targetGUID;
|
||||
Unit* _caster;
|
||||
ObjectGuid _targetGUID;
|
||||
const SpellInfo* _spellInfo;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user