mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 21:45:12 +00:00
refactor(Core/Spells): QAston proc system (#24233)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: QAston <qaston@gmail.com> Co-authored-by: joschiwald <joschiwald@online.de> Co-authored-by: ariel- <ariel-@users.noreply.github.com> Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Co-authored-by: blinkysc <your-github-email@example.com> Co-authored-by: Tereneckla <Tereneckla@users.noreply.github.com> Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com>
This commit is contained in:
@@ -347,6 +347,7 @@ private:
|
||||
uint32 m_resist;
|
||||
uint32 m_block;
|
||||
uint32 m_cleanDamage;
|
||||
uint32 m_hitMask;
|
||||
|
||||
// amalgamation constructor (used for proc)
|
||||
DamageInfo(DamageInfo const& dmg1, DamageInfo const& dmg2);
|
||||
@@ -355,7 +356,8 @@ public:
|
||||
explicit DamageInfo(Unit* _attacker, Unit* _victim, uint32 _damage, SpellInfo const* _spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType, uint32 cleanDamage = 0);
|
||||
explicit DamageInfo(CalcDamageInfo const& dmgInfo); // amalgamation wrapper
|
||||
DamageInfo(CalcDamageInfo const& dmgInfo, uint8 damageIndex);
|
||||
DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType);
|
||||
DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType, uint32 hitMask);
|
||||
DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEffectType damageType, WeaponAttackType attackType, SpellMissInfo missInfo);
|
||||
|
||||
void ModifyDamage(int32 amount);
|
||||
void AbsorbDamage(uint32 amount);
|
||||
@@ -373,6 +375,8 @@ public:
|
||||
[[nodiscard]] uint32 GetResist() const { return m_resist; };
|
||||
[[nodiscard]] uint32 GetBlock() const { return m_block; };
|
||||
|
||||
[[nodiscard]] uint32 GetHitMask() const;
|
||||
void AddHitMask(uint32 hitMask) { m_hitMask |= hitMask; }
|
||||
[[nodiscard]] uint32 GetUnmitigatedDamage() const;
|
||||
};
|
||||
|
||||
@@ -386,9 +390,10 @@ private:
|
||||
uint32 m_absorb;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
SpellSchoolMask const m_schoolMask;
|
||||
uint32 m_hitMask;
|
||||
public:
|
||||
explicit HealInfo(Unit* _healer, Unit* _target, uint32 _heal, SpellInfo const* _spellInfo, SpellSchoolMask _schoolMask)
|
||||
: m_healer(_healer), m_target(_target), m_heal(_heal), m_spellInfo(_spellInfo), m_schoolMask(_schoolMask)
|
||||
: m_healer(_healer), m_target(_target), m_heal(_heal), m_spellInfo(_spellInfo), m_schoolMask(_schoolMask), m_hitMask(0)
|
||||
{
|
||||
m_absorb = 0;
|
||||
m_effectiveHeal = 0;
|
||||
@@ -421,6 +426,8 @@ public:
|
||||
[[nodiscard]] uint32 GetAbsorb() const { return m_absorb; }
|
||||
[[nodiscard]] SpellInfo const* GetSpellInfo() const { return m_spellInfo; };
|
||||
[[nodiscard]] SpellSchoolMask GetSchoolMask() const { return m_schoolMask; };
|
||||
[[nodiscard]] uint32 GetHitMask() const { return m_hitMask; }
|
||||
void AddHitMask(uint32 hitMask) { m_hitMask |= hitMask; }
|
||||
};
|
||||
|
||||
class ProcEventInfo
|
||||
@@ -451,7 +458,7 @@ public:
|
||||
[[nodiscard]] uint32 GetSpellPhaseMask() const { return _spellPhaseMask; }
|
||||
[[nodiscard]] uint32 GetHitMask() const { return _hitMask; }
|
||||
[[nodiscard]] SpellInfo const* GetSpellInfo() const;
|
||||
[[nodiscard]] SpellSchoolMask GetSchoolMask() const { return SPELL_SCHOOL_MASK_NONE; }
|
||||
[[nodiscard]] SpellSchoolMask GetSchoolMask() const;
|
||||
[[nodiscard]] Spell const* GetProcSpell() const { return _spell; }
|
||||
[[nodiscard]] DamageInfo* GetDamageInfo() const { return _damageInfo; }
|
||||
[[nodiscard]] HealInfo* GetHealInfo() const { return _healInfo; }
|
||||
@@ -486,7 +493,6 @@ struct CalcDamageInfo
|
||||
WeaponAttackType attackType; //
|
||||
uint32 procAttacker;
|
||||
uint32 procVictim;
|
||||
uint32 procEx;
|
||||
uint32 cleanDamage; // Used only for rage calculation
|
||||
MeleeHitOutcome hitOutCome; /// @todo: remove this field (need use TargetState)
|
||||
};
|
||||
@@ -530,7 +536,6 @@ struct SpellPeriodicAuraLogInfo
|
||||
};
|
||||
|
||||
void createProcFlags(SpellInfo const* spellInfo, WeaponAttackType attackType, bool positive, uint32& procAttacker, uint32& procVictim);
|
||||
uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition);
|
||||
|
||||
#define MAX_DECLINED_NAME_CASES 5
|
||||
|
||||
@@ -627,8 +632,6 @@ typedef std::unordered_map<uint32, uint32> PacketCooldowns;
|
||||
#define ATTACK_DISPLAY_DELAY 200
|
||||
#define MAX_PLAYER_STEALTH_DETECT_RANGE 30.0f // max distance for detection targets by player
|
||||
|
||||
struct SpellProcEventEntry; // used only privately
|
||||
|
||||
enum class SpeedOpcodeIndex : uint32
|
||||
{
|
||||
PC,
|
||||
@@ -671,6 +674,7 @@ public:
|
||||
typedef std::vector<AuraEffect*> AuraEffectList;
|
||||
typedef std::list<Aura*> AuraList;
|
||||
typedef std::list<AuraApplication*> AuraApplicationList;
|
||||
typedef std::vector<std::pair<uint8 /*procEffectMask*/, AuraApplication*>> AuraApplicationProcContainer;
|
||||
typedef std::list<DiminishingReturn> Diminishing;
|
||||
typedef GuidUnorderedSet ComboPointHolderSet;
|
||||
|
||||
@@ -1542,14 +1546,14 @@ public:
|
||||
bool CanProc() { return !m_procDeep; }
|
||||
void SetCantProc(bool apply);
|
||||
|
||||
static void ProcDamageAndSpell(Unit* actor, Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpellInfo = nullptr, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/);
|
||||
void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpellInfo, uint32 damage, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/);
|
||||
static void ProcSkillsAndAuras(Unit* actor, Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpellInfo = nullptr, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/);
|
||||
void ProcSkillsAndReactives(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpellInfo, uint32 damage, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/);
|
||||
|
||||
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
|
||||
void GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
|
||||
|
||||
void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo);
|
||||
void TriggerAurasProcOnEvent(std::list<AuraApplication*>* myProcAuras, std::list<AuraApplication*>* targetProcAuras, Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo);
|
||||
void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list<AuraApplication*>& procAuras);
|
||||
void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& procAuras);
|
||||
|
||||
[[nodiscard]] float GetWeaponProcChance() const;
|
||||
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, SpellInfo const* spellProto) const;
|
||||
@@ -2188,11 +2192,7 @@ protected:
|
||||
bool _instantCast;
|
||||
|
||||
private:
|
||||
bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent, ProcEventInfo const& eventInfo);
|
||||
bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, ProcEventInfo const& eventInfo);
|
||||
bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool* handled);
|
||||
bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, uint32 procPhase, ProcEventInfo& eventInfo);
|
||||
bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown);
|
||||
// Legacy proc handlers removed - all procs now use AuraScripts and spell_proc table
|
||||
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
|
||||
bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user