mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 17:13:47 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -233,7 +233,7 @@ enum AuraType
|
||||
SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT = 182,
|
||||
SPELL_AURA_MOD_CRITICAL_THREAT = 183,
|
||||
SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE = 184,
|
||||
SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE= 185,
|
||||
SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE = 185,
|
||||
SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE = 186,
|
||||
SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE = 187,
|
||||
SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE = 188,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,305 +19,305 @@ typedef void(AuraEffect::*pAuraEffectHandler)(AuraApplication const* aurApp, uin
|
||||
|
||||
class AuraEffect
|
||||
{
|
||||
friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
|
||||
friend void Aura::_InitEffects(uint8 effMask, Unit* caster, int32* baseAmount);
|
||||
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID, bool noPeriodicReset);
|
||||
friend Aura::~Aura();
|
||||
private:
|
||||
~AuraEffect();
|
||||
explicit AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster);
|
||||
public:
|
||||
Unit* GetCaster() const { return GetBase()->GetCaster(); }
|
||||
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
|
||||
Aura* GetBase() const { return m_base; }
|
||||
void GetTargetList(std::list<Unit*> & targetList) const;
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
SpellModifier* GetSpellModifier() const { return m_spellmod; }
|
||||
private:
|
||||
~AuraEffect();
|
||||
explicit AuraEffect(Aura* base, uint8 effIndex, int32* baseAmount, Unit* caster);
|
||||
public:
|
||||
Unit* GetCaster() const { return GetBase()->GetCaster(); }
|
||||
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
|
||||
Aura* GetBase() const { return m_base; }
|
||||
void GetTargetList(std::list<Unit*>& targetList) const;
|
||||
void GetApplicationList(std::list<AuraApplication*>& applicationList) const;
|
||||
SpellModifier* GetSpellModifier() const { return m_spellmod; }
|
||||
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const;
|
||||
uint32 GetEffIndex() const { return m_effIndex; }
|
||||
int32 GetBaseAmount() const { return m_baseAmount; }
|
||||
int32 GetAmplitude() const { return m_amplitude; }
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const;
|
||||
uint32 GetEffIndex() const { return m_effIndex; }
|
||||
int32 GetBaseAmount() const { return m_baseAmount; }
|
||||
int32 GetAmplitude() const { return m_amplitude; }
|
||||
|
||||
int32 GetMiscValueB() const;
|
||||
int32 GetMiscValue() const;
|
||||
AuraType GetAuraType() const;
|
||||
int32 GetAmount() const { return m_isAuraEnabled ? m_amount : 0; }
|
||||
int32 GetForcedAmount() const { return m_amount; }
|
||||
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
||||
int32 GetMiscValueB() const;
|
||||
int32 GetMiscValue() const;
|
||||
AuraType GetAuraType() const;
|
||||
int32 GetAmount() const { return m_isAuraEnabled ? m_amount : 0; }
|
||||
int32 GetForcedAmount() const { return m_amount; }
|
||||
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
||||
|
||||
int32 GetPeriodicTimer() const { return m_periodicTimer; }
|
||||
void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; }
|
||||
int32 GetPeriodicTimer() const { return m_periodicTimer; }
|
||||
void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; }
|
||||
|
||||
int32 CalculateAmount(Unit* caster);
|
||||
void CalculatePeriodic(Unit* caster, bool create = false, bool load = false);
|
||||
void CalculatePeriodicData();
|
||||
void CalculateSpellMod();
|
||||
void ChangeAmount(int32 newAmount, bool mark = true, bool onStackOrReapply = false);
|
||||
void RecalculateAmount() { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(GetCaster()), false); }
|
||||
void RecalculateAmount(Unit* caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
|
||||
bool CanBeRecalculated() const { return m_canBeRecalculated; }
|
||||
void SetCanBeRecalculated(bool val) { m_canBeRecalculated = val; }
|
||||
void HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||
void HandleEffect(Unit* target, uint8 mode, bool apply);
|
||||
void ApplySpellMod(Unit* target, bool apply);
|
||||
int32 CalculateAmount(Unit* caster);
|
||||
void CalculatePeriodic(Unit* caster, bool create = false, bool load = false);
|
||||
void CalculatePeriodicData();
|
||||
void CalculateSpellMod();
|
||||
void ChangeAmount(int32 newAmount, bool mark = true, bool onStackOrReapply = false);
|
||||
void RecalculateAmount() { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(GetCaster()), false); }
|
||||
void RecalculateAmount(Unit* caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
|
||||
bool CanBeRecalculated() const { return m_canBeRecalculated; }
|
||||
void SetCanBeRecalculated(bool val) { m_canBeRecalculated = val; }
|
||||
void HandleEffect(AuraApplication* aurApp, uint8 mode, bool apply);
|
||||
void HandleEffect(Unit* target, uint8 mode, bool apply);
|
||||
void ApplySpellMod(Unit* target, bool apply);
|
||||
|
||||
void Update(uint32 diff, Unit* caster);
|
||||
void UpdatePeriodic(Unit* caster);
|
||||
void Update(uint32 diff, Unit* caster);
|
||||
void UpdatePeriodic(Unit* caster);
|
||||
|
||||
uint32 GetTickNumber() const { return m_tickNumber; }
|
||||
int32 GetTotalTicks() const { return m_amplitude ? (GetBase()->GetMaxDuration() / m_amplitude) : 1;}
|
||||
void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;}
|
||||
uint32 GetTickNumber() const { return m_tickNumber; }
|
||||
int32 GetTotalTicks() const { return m_amplitude ? (GetBase()->GetMaxDuration() / m_amplitude) : 1;}
|
||||
void ResetPeriodic(bool resetPeriodicTimer = false) { if (resetPeriodicTimer) m_periodicTimer = m_amplitude; m_tickNumber = 0;}
|
||||
|
||||
bool IsPeriodic() const { return m_isPeriodic; }
|
||||
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
|
||||
bool IsAffectedOnSpell(SpellInfo const* spell) const;
|
||||
bool HasSpellClassMask() const;
|
||||
bool IsPeriodic() const { return m_isPeriodic; }
|
||||
void SetPeriodic(bool isPeriodic) { m_isPeriodic = isPeriodic; }
|
||||
bool IsAffectedOnSpell(SpellInfo const* spell) const;
|
||||
bool HasSpellClassMask() const;
|
||||
|
||||
void SendTickImmune(Unit* target, Unit* caster) const;
|
||||
void PeriodicTick(AuraApplication * aurApp, Unit* caster) const;
|
||||
void SendTickImmune(Unit* target, Unit* caster) const;
|
||||
void PeriodicTick(AuraApplication* aurApp, Unit* caster) const;
|
||||
|
||||
void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
void CleanupTriggeredSpells(Unit* target);
|
||||
void CleanupTriggeredSpells(Unit* target);
|
||||
|
||||
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
|
||||
void HandleShapeshiftBoosts(Unit* target, bool apply) const;
|
||||
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
|
||||
void HandleShapeshiftBoosts(Unit* target, bool apply) const;
|
||||
|
||||
// xinef: storing initial crit chance
|
||||
float GetCritChance() const { return m_critChance; }
|
||||
void SetCritChance(float crit) { m_critChance = crit; }
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
bool CanApplyResilience() const { return m_applyResilience; }
|
||||
float GetPctMods() const { return m_pctMods; }
|
||||
// xinef: storing initial crit chance
|
||||
float GetCritChance() const { return m_critChance; }
|
||||
void SetCritChance(float crit) { m_critChance = crit; }
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
bool CanApplyResilience() const { return m_applyResilience; }
|
||||
float GetPctMods() const { return m_pctMods; }
|
||||
|
||||
// xinef: stacking
|
||||
uint32 GetAuraGroup() const { return m_auraGroup; }
|
||||
int32 GetOldAmount() const { return m_oldAmount; }
|
||||
void SetOldAmount(int32 amount) { m_oldAmount = amount; }
|
||||
void SetEnabled(bool enabled) { m_isAuraEnabled = enabled; }
|
||||
// xinef: stacking
|
||||
uint32 GetAuraGroup() const { return m_auraGroup; }
|
||||
int32 GetOldAmount() const { return m_oldAmount; }
|
||||
void SetOldAmount(int32 amount) { m_oldAmount = amount; }
|
||||
void SetEnabled(bool enabled) { m_isAuraEnabled = enabled; }
|
||||
|
||||
private:
|
||||
Aura* const m_base;
|
||||
private:
|
||||
Aura* const m_base;
|
||||
|
||||
SpellInfo const* const m_spellInfo;
|
||||
int32 const m_baseAmount;
|
||||
SpellInfo const* const m_spellInfo;
|
||||
int32 const m_baseAmount;
|
||||
|
||||
bool m_applyResilience;
|
||||
uint8 m_casterLevel;
|
||||
int32 m_amount;
|
||||
float m_critChance;
|
||||
float m_pctMods;
|
||||
bool m_applyResilience;
|
||||
uint8 m_casterLevel;
|
||||
int32 m_amount;
|
||||
float m_critChance;
|
||||
float m_pctMods;
|
||||
|
||||
// xinef: stacking
|
||||
uint32 m_auraGroup;
|
||||
int32 m_oldAmount;
|
||||
bool m_isAuraEnabled;
|
||||
// xinef: channel information for channel triggering
|
||||
ChannelTargetData* m_channelData;
|
||||
// xinef: stacking
|
||||
uint32 m_auraGroup;
|
||||
int32 m_oldAmount;
|
||||
bool m_isAuraEnabled;
|
||||
// xinef: channel information for channel triggering
|
||||
ChannelTargetData* m_channelData;
|
||||
|
||||
|
||||
SpellModifier* m_spellmod;
|
||||
SpellModifier* m_spellmod;
|
||||
|
||||
int32 m_periodicTimer;
|
||||
int32 m_amplitude;
|
||||
uint32 m_tickNumber;
|
||||
int32 m_periodicTimer;
|
||||
int32 m_amplitude;
|
||||
uint32 m_tickNumber;
|
||||
|
||||
uint8 const m_effIndex;
|
||||
bool m_canBeRecalculated;
|
||||
bool m_isPeriodic;
|
||||
private:
|
||||
float CalcPeriodicCritChance(Unit const* caster, Unit const* target) const;
|
||||
uint8 const m_effIndex;
|
||||
bool m_canBeRecalculated;
|
||||
bool m_isPeriodic;
|
||||
private:
|
||||
float CalcPeriodicCritChance(Unit const* caster, Unit const* target) const;
|
||||
|
||||
public:
|
||||
// aura effect apply/remove handlers
|
||||
void HandleNULL(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// not implemented
|
||||
}
|
||||
void HandleUnused(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// useless
|
||||
}
|
||||
void HandleNoImmediateEffect(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// aura type not have immediate effect at add/remove and handled by ID in other code place
|
||||
}
|
||||
// visibility & phases
|
||||
void HandleModInvisibilityDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModInvisibility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// unit model
|
||||
void HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// fight
|
||||
void HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModUnattackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// tracking
|
||||
void HandleAuraTrackResources(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraUntrackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// skills & talents
|
||||
void HandleAuraModPetTalentsPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// movement
|
||||
void HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// threat
|
||||
void HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// control
|
||||
void HandleModConfuse(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// charm
|
||||
void HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModCharm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleCharmConvert(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// modify speed
|
||||
void HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// immunity
|
||||
void HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// modify stats
|
||||
// resistance
|
||||
void HandleAuraModResistanceExclusive(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModResistancePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModBaseResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// stat
|
||||
void HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellDamagePercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHealingPercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellDamagePercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHealingPercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHealingDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModResistenceOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModExpertise(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// heal and energize
|
||||
void HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModManaRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseMaxHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraIncreaseBaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// fight
|
||||
void HandleAuraModParryPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDodgePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModBlockPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChanceShool(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// attack speed
|
||||
void HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModCombatSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleRangedAmmoHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// combat rating
|
||||
void HandleModRating(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModRatingFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// attack power
|
||||
void HandleAuraModAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// damage bonus
|
||||
void HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleShieldBlockValue(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// power cost
|
||||
void HandleModPowerCostPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerCost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleArenaPreparation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// others
|
||||
void HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
public:
|
||||
// aura effect apply/remove handlers
|
||||
void HandleNULL(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// not implemented
|
||||
}
|
||||
void HandleUnused(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// useless
|
||||
}
|
||||
void HandleNoImmediateEffect(AuraApplication const* /*aurApp*/, uint8 /*mode*/, bool /*apply*/) const
|
||||
{
|
||||
// aura type not have immediate effect at add/remove and handled by ID in other code place
|
||||
}
|
||||
// visibility & phases
|
||||
void HandleModInvisibilityDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModInvisibility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealthLevel(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModStealthDetect(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraGhost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePhase(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// unit model
|
||||
void HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTransform(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModScale(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraCloneCaster(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// fight
|
||||
void HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModUnattackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraAllowOnlyAbility(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// tracking
|
||||
void HandleAuraTrackResources(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraTrackStealthed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStalked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraUntrackable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// skills & talents
|
||||
void HandleAuraModPetTalentsPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSkill(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// movement
|
||||
void HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraAllowFlight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraWaterWalk(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraFeatherFall(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraHover(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleWaterBreathing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceMoveForward(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// threat
|
||||
void HandleModThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModTotalThreat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTaunt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// control
|
||||
void HandleModConfuse(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModFear(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStun(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRoot(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventFleeing(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// charm
|
||||
void HandleModPossess(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPossessPet(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModCharm(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleCharmConvert(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// modify speed
|
||||
void HandleAuraModIncreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseMountedSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseFlightSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseSwimSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// immunity
|
||||
void HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// modify stats
|
||||
// resistance
|
||||
void HandleAuraModResistanceExclusive(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModBaseResistancePCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModResistancePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModBaseResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTargetResistance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// stat
|
||||
void HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellDamagePercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHealingPercentFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellDamagePercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHealingPercentFromAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHealingDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModTotalPercentStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModResistenceOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModExpertise(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// heal and energize
|
||||
void HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModManaRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseMaxHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModIncreaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraIncreaseBaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// fight
|
||||
void HandleAuraModParryPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModDodgePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModBlockPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChanceShool(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModCritPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// attack speed
|
||||
void HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMeleeRangedSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModCombatSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModAttackSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleRangedAmmoHaste(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// combat rating
|
||||
void HandleModRating(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModRatingFromStat(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// attack power
|
||||
void HandleAuraModAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPowerPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRangedAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerOfStatPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// damage bonus
|
||||
void HandleModDamageDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModDamagePercentDone(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleShieldBlockValue(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// power cost
|
||||
void HandleModPowerCostPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerCost(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleArenaPreparation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleNoReagentUseAura(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraRetainComboPoints(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// others
|
||||
void HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleChannelDeathItem(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleBindSight(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleForceReaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraEmpathy(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModFaction(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleComprehendLanguage(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraConvertRune(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraLinked(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraOpenStable(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModFakeInebriation(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraOverrideSpells(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraSetVehicle(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandlePreventResurrection(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
// aura effect periodic tick handlers
|
||||
void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandleObsModPowerAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const;
|
||||
// aura effect periodic tick handlers
|
||||
void HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandleObsModPowerAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const;
|
||||
void HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const;
|
||||
|
||||
// aura effect proc handlers
|
||||
void HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
// aura effect proc handlers
|
||||
void HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
void HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
};
|
||||
|
||||
namespace acore
|
||||
@@ -325,57 +325,57 @@ namespace acore
|
||||
// Binary predicate for sorting the priority of absorption aura effects
|
||||
class AbsorbAuraOrderPred
|
||||
{
|
||||
public:
|
||||
AbsorbAuraOrderPred() { }
|
||||
bool operator() (AuraEffect* aurEffA, AuraEffect* aurEffB) const
|
||||
{
|
||||
SpellInfo const* spellProtoA = aurEffA->GetSpellInfo();
|
||||
SpellInfo const* spellProtoB = aurEffB->GetSpellInfo();
|
||||
public:
|
||||
AbsorbAuraOrderPred() { }
|
||||
bool operator() (AuraEffect* aurEffA, AuraEffect* aurEffB) const
|
||||
{
|
||||
SpellInfo const* spellProtoA = aurEffA->GetSpellInfo();
|
||||
SpellInfo const* spellProtoB = aurEffB->GetSpellInfo();
|
||||
|
||||
// Wards
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
// Wards
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
(spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK))
|
||||
if (spellProtoA->GetCategory() == 56)
|
||||
return true;
|
||||
if ((spellProtoB->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
if (spellProtoA->GetCategory() == 56)
|
||||
return true;
|
||||
if ((spellProtoB->SpellFamilyName == SPELLFAMILY_MAGE) ||
|
||||
(spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK))
|
||||
if (spellProtoB->GetCategory() == 56)
|
||||
return false;
|
||||
|
||||
// Sacred Shield
|
||||
if (spellProtoA->Id == 58597)
|
||||
return true;
|
||||
if (spellProtoB->Id == 58597)
|
||||
return false;
|
||||
|
||||
// Fel Blossom
|
||||
if (spellProtoA->Id == 28527)
|
||||
return true;
|
||||
if (spellProtoB->Id == 28527)
|
||||
return false;
|
||||
|
||||
// Divine Aegis
|
||||
if (spellProtoA->Id == 47753)
|
||||
return true;
|
||||
if (spellProtoB->Id == 47753)
|
||||
return false;
|
||||
|
||||
// Ice Barrier
|
||||
if (spellProtoA->GetCategory() == 471)
|
||||
return true;
|
||||
if (spellProtoB->GetCategory() == 471)
|
||||
return false;
|
||||
|
||||
// Sacrifice
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
|
||||
(spellProtoA->SpellIconID == 693))
|
||||
return true;
|
||||
if ((spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
|
||||
(spellProtoB->SpellIconID == 693))
|
||||
if (spellProtoB->GetCategory() == 56)
|
||||
return false;
|
||||
|
||||
// Sacred Shield
|
||||
if (spellProtoA->Id == 58597)
|
||||
return true;
|
||||
if (spellProtoB->Id == 58597)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Fel Blossom
|
||||
if (spellProtoA->Id == 28527)
|
||||
return true;
|
||||
if (spellProtoB->Id == 28527)
|
||||
return false;
|
||||
|
||||
// Divine Aegis
|
||||
if (spellProtoA->Id == 47753)
|
||||
return true;
|
||||
if (spellProtoB->Id == 47753)
|
||||
return false;
|
||||
|
||||
// Ice Barrier
|
||||
if (spellProtoA->GetCategory() == 471)
|
||||
return true;
|
||||
if (spellProtoB->GetCategory() == 471)
|
||||
return false;
|
||||
|
||||
// Sacrifice
|
||||
if ((spellProtoA->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
|
||||
(spellProtoA->SpellIconID == 693))
|
||||
return true;
|
||||
if ((spellProtoB->SpellFamilyName == SPELLFAMILY_WARLOCK) &&
|
||||
(spellProtoB->SpellIconID == 693))
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
static constexpr int32 UPDATE_TARGET_MAP_INTERVAL = 500;
|
||||
|
||||
AuraApplication::AuraApplication(Unit* target, Unit* caster, Aura* aura, uint8 effMask):
|
||||
_target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS),
|
||||
_flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disableMask(0)
|
||||
_target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS),
|
||||
_flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disableMask(0)
|
||||
{
|
||||
ASSERT(GetTarget() && GetBase());
|
||||
|
||||
@@ -39,7 +39,7 @@ _flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disable
|
||||
// Try find slot for aura
|
||||
uint8 slot = MAX_AURAS;
|
||||
// Lookup for auras already applied from spell
|
||||
if (AuraApplication * foundAura = GetTarget()->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
|
||||
if (AuraApplication* foundAura = GetTarget()->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
|
||||
{
|
||||
// allow use single slot only by auras from same caster
|
||||
slot = foundAura->GetSlot();
|
||||
@@ -69,7 +69,8 @@ _flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disable
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outError(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask());
|
||||
#endif
|
||||
@@ -85,7 +86,7 @@ void AuraApplication::_Remove()
|
||||
if (slot >= MAX_AURAS)
|
||||
return;
|
||||
|
||||
if (AuraApplication * foundAura = _target->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
|
||||
if (AuraApplication* foundAura = _target->GetAuraApplication(GetBase()->GetId(), GetBase()->GetCasterGUID(), GetBase()->GetCastItemGUID()))
|
||||
{
|
||||
// Reuse visible aura slot by aura which is still applied - prevent storing dead pointers
|
||||
if (slot == foundAura->GetSlot())
|
||||
@@ -120,7 +121,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
|
||||
bool negativeFound = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (((1<<i) & effMask) && !GetBase()->GetSpellInfo()->IsPositiveEffect(i))
|
||||
if (((1 << i) & effMask) && !GetBase()->GetSpellInfo()->IsPositiveEffect(i))
|
||||
{
|
||||
negativeFound = true;
|
||||
break;
|
||||
@@ -135,7 +136,7 @@ void AuraApplication::_InitFlags(Unit* caster, uint8 effMask)
|
||||
bool positiveFound = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (((1<<i) & effMask) && GetBase()->GetSpellInfo()->IsPositiveEffect(i))
|
||||
if (((1 << i) & effMask) && GetBase()->GetSpellInfo()->IsPositiveEffect(i))
|
||||
{
|
||||
positiveFound = true;
|
||||
break;
|
||||
@@ -150,21 +151,21 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
|
||||
AuraEffect* aurEff = GetBase()->GetEffect(effIndex);
|
||||
ASSERT(aurEff);
|
||||
ASSERT(HasEffect(effIndex) == (!apply));
|
||||
ASSERT((1<<effIndex) & _effectsToApply);
|
||||
ASSERT((1 << effIndex) & _effectsToApply);
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount());
|
||||
#endif
|
||||
|
||||
if (apply)
|
||||
{
|
||||
ASSERT(!(_flags & (1<<effIndex)));
|
||||
_flags |= 1<<effIndex;
|
||||
ASSERT(!(_flags & (1 << effIndex)));
|
||||
_flags |= 1 << effIndex;
|
||||
aurEff->HandleEffect(this, AURA_EFFECT_HANDLE_REAL, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(_flags & (1<<effIndex));
|
||||
_flags &= ~(1<<effIndex);
|
||||
ASSERT(_flags & (1 << effIndex));
|
||||
_flags &= ~(1 << effIndex);
|
||||
aurEff->HandleEffect(this, AURA_EFFECT_HANDLE_REAL, false);
|
||||
|
||||
// Remove all triggered by aura spells vs unlimited duration
|
||||
@@ -189,7 +190,7 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply)
|
||||
|
||||
// xinef: skip different misc values
|
||||
if (aurEff->GetAuraType() != SPELL_AURA_230 /*SPELL_AURA_MOD_INCREASE_HEALTH_2*/ && aurEff->GetAuraType() != SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK &&
|
||||
aurEff->GetMiscValue() != (*iter)->GetMiscValue())
|
||||
aurEff->GetMiscValue() != (*iter)->GetMiscValue())
|
||||
continue;
|
||||
|
||||
// xinef: should not happen
|
||||
@@ -279,7 +280,7 @@ void AuraApplication::ClientUpdate(bool remove)
|
||||
if (const Player* plr = GetTarget()->ToPlayer())
|
||||
if (Aura* aura = GetBase())
|
||||
if (plr->NeedSendSpectatorData() && ArenaSpectator::ShouldSendAura(aura, GetEffectMask(), GetTarget()->GetGUID(), remove))
|
||||
ArenaSpectator::SendCommand_Aura(plr->FindMap(), plr->GetGUID(), "AUR", aura->GetCasterGUID(), aura->GetSpellInfo()->Id, aura->GetSpellInfo()->IsPositive(), aura->GetSpellInfo()->Dispel, aura->GetDuration(), aura->GetMaxDuration(), (aura->GetCharges() > 1 ? aura->GetCharges() : aura->GetStackAmount()), remove);
|
||||
ArenaSpectator::SendCommand_Aura(plr->FindMap(), plr->GetGUID(), "AUR", aura->GetCasterGUID(), aura->GetSpellInfo()->Id, aura->GetSpellInfo()->IsPositive(), aura->GetSpellInfo()->Dispel, aura->GetDuration(), aura->GetMaxDuration(), (aura->GetCharges() > 1 ? aura->GetCharges() : aura->GetStackAmount()), remove);
|
||||
|
||||
_target->SendMessageToSet(&data, true);
|
||||
}
|
||||
@@ -293,14 +294,14 @@ uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleE
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
case TYPEID_PLAYER:
|
||||
for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellProto->Effects[i].IsUnitOwnedAuraEffect())
|
||||
effMask |= 1 << i;
|
||||
}
|
||||
break;
|
||||
case TYPEID_DYNAMICOBJECT:
|
||||
for (uint8 i = 0; i< MAX_SPELL_EFFECTS; ++i)
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellProto->Effects[i].Effect == SPELL_EFFECT_PERSISTENT_AREA_AURA)
|
||||
effMask |= 1 << i;
|
||||
@@ -396,11 +397,11 @@ Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
}
|
||||
|
||||
Aura::Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, uint64 casterGUID) :
|
||||
m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0),m_castItemEntry(castItem ? castItem->GetEntry() : 0), m_applyTime(time(nullptr)),
|
||||
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
|
||||
m_spellInfo(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()),
|
||||
m_castItemGuid(castItem ? castItem->GetGUID() : 0), m_castItemEntry(castItem ? castItem->GetEntry() : 0), m_applyTime(time(nullptr)),
|
||||
m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(caster ? caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
|
||||
{
|
||||
if ((m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel) && !m_spellInfo->HasAttribute(SPELL_ATTR2_HEALTH_FUNNEL))
|
||||
m_timeCla = 1 * IN_MILLISECONDS;
|
||||
@@ -421,7 +422,7 @@ AuraScript* Aura::GetScriptByName(std::string const& scriptName) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount)
|
||||
void Aura::_InitEffects(uint8 effMask, Unit* caster, int32* baseAmount)
|
||||
{
|
||||
// shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -446,7 +447,7 @@ Aura::~Aura()
|
||||
|
||||
// free effects memory
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
delete m_effects[i];
|
||||
delete m_effects[i];
|
||||
|
||||
ASSERT(m_applications.empty());
|
||||
_DeleteRemovedApplications();
|
||||
@@ -472,7 +473,7 @@ AuraObjectType Aura::GetType() const
|
||||
return (m_owner->GetTypeId() == TYPEID_DYNAMICOBJECT) ? DYNOBJ_AURA_TYPE : UNIT_AURA_TYPE;
|
||||
}
|
||||
|
||||
void Aura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp)
|
||||
void Aura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication* auraApp)
|
||||
{
|
||||
ASSERT(target);
|
||||
ASSERT(auraApp);
|
||||
@@ -492,7 +493,7 @@ void Aura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp)
|
||||
void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication* auraApp)
|
||||
{
|
||||
ASSERT(target);
|
||||
ASSERT(auraApp->GetRemoveMode());
|
||||
@@ -504,7 +505,7 @@ void Aura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraA
|
||||
if (itr == m_applications.end())
|
||||
{
|
||||
sLog->outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!",
|
||||
target->GetGUIDLow(), caster ? caster->GetGUIDLow() : 0, auraApp->GetBase()->GetSpellInfo()->Id);
|
||||
target->GetGUIDLow(), caster ? caster->GetGUIDLow() : 0, auraApp->GetBase()->GetSpellInfo()->Id);
|
||||
ABORT();
|
||||
}
|
||||
|
||||
@@ -532,7 +533,7 @@ void Aura::_Remove(AuraRemoveMode removeMode)
|
||||
ApplicationMap::iterator appItr = m_applications.begin();
|
||||
for (appItr = m_applications.begin(); appItr != m_applications.end();)
|
||||
{
|
||||
AuraApplication * aurApp = appItr->second;
|
||||
AuraApplication* aurApp = appItr->second;
|
||||
Unit* target = aurApp->GetTarget();
|
||||
target->_UnapplyAura(aurApp, removeMode);
|
||||
appItr = m_applications.begin();
|
||||
@@ -555,7 +556,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
UnitList targetsToRemove;
|
||||
|
||||
// mark all auras as ready to remove
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();++appIter)
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
|
||||
{
|
||||
std::map<Unit*, uint8>::iterator existing = targets.find(appIter->second->GetTarget());
|
||||
// not found in current area - remove the aura
|
||||
@@ -582,10 +583,10 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
}
|
||||
|
||||
// register auras for units
|
||||
for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr!= targets.end();)
|
||||
for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr != targets.end();)
|
||||
{
|
||||
// aura mustn't be already applied on target
|
||||
if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
|
||||
if (AuraApplication* aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
|
||||
{
|
||||
// the core created 2 different units with same guid
|
||||
// this is a major failue, which i can't fix right now
|
||||
@@ -613,8 +614,8 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
itr->second &= ~(1 << effIndex);
|
||||
}
|
||||
if (!itr->second
|
||||
|| itr->first->IsImmunedToSpell(GetSpellInfo())
|
||||
|| !CanBeAppliedOn(itr->first))
|
||||
|| itr->first->IsImmunedToSpell(GetSpellInfo())
|
||||
|| !CanBeAppliedOn(itr->first))
|
||||
addUnit = false;
|
||||
|
||||
if (addUnit)
|
||||
@@ -630,7 +631,10 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
case 62821: // Ulduar, Hodir, Toasty Fire
|
||||
case 62807: // Ulduar, Hodir, Starlight
|
||||
case 51103: // Oculus, Mage-Lord Urom, Frostbomb
|
||||
case 69146: case 70823: case 70824: case 70825: // Icecrown Citadel, Lord Marrowgar, Coldflame
|
||||
case 69146:
|
||||
case 70823:
|
||||
case 70824:
|
||||
case 70825: // Icecrown Citadel, Lord Marrowgar, Coldflame
|
||||
{
|
||||
if( itr->first->HasAura(GetId()) )
|
||||
addUnit = false;
|
||||
@@ -667,8 +671,8 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
{
|
||||
//TODO: There is a crash caused by shadowfiend load addon
|
||||
sLog->outCrash("Aura %u: Owner %s (map %u) is not in the same map as target %s (map %u).", GetSpellInfo()->Id,
|
||||
GetOwner()->GetName().c_str(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1),
|
||||
itr->first->GetName().c_str(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1));
|
||||
GetOwner()->GetName().c_str(), GetOwner()->IsInWorld() ? GetOwner()->GetMap()->GetId() : uint32(-1),
|
||||
itr->first->GetName().c_str(), itr->first->IsInWorld() ? itr->first->GetMap()->GetId() : uint32(-1));
|
||||
ABORT();
|
||||
}
|
||||
itr->first->_CreateAuraApplication(this, itr->second);
|
||||
@@ -677,17 +681,17 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply)
|
||||
}
|
||||
|
||||
// remove auras from units no longer needing them
|
||||
for (UnitList::iterator itr = targetsToRemove.begin(); itr != targetsToRemove.end();++itr)
|
||||
if (AuraApplication * aurApp = GetApplicationOfTarget((*itr)->GetGUID()))
|
||||
for (UnitList::iterator itr = targetsToRemove.begin(); itr != targetsToRemove.end(); ++itr)
|
||||
if (AuraApplication* aurApp = GetApplicationOfTarget((*itr)->GetGUID()))
|
||||
(*itr)->_UnapplyAura(aurApp, AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
if (!apply)
|
||||
return;
|
||||
|
||||
// apply aura effects for units
|
||||
for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr!= targets.end();++itr)
|
||||
for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
{
|
||||
if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
|
||||
if (AuraApplication* aurApp = GetApplicationOfTarget(itr->first->GetGUID()))
|
||||
{
|
||||
// owner has to be in world, or effect has to be applied to self
|
||||
ASSERT((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first));
|
||||
@@ -703,7 +707,7 @@ void Aura::_ApplyEffectForTargets(uint8 effIndex)
|
||||
UnitList targetList;
|
||||
for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
|
||||
{
|
||||
if ((appIter->second->GetEffectsToApply() & (1<<effIndex)) && !appIter->second->HasEffect(effIndex))
|
||||
if ((appIter->second->GetEffectsToApply() & (1 << effIndex)) && !appIter->second->HasEffect(effIndex))
|
||||
targetList.push_back(appIter->second->GetTarget());
|
||||
}
|
||||
|
||||
@@ -870,7 +874,7 @@ void Aura::RefreshTimersWithMods()
|
||||
m_maxDuration = CalcMaxDuration();
|
||||
if ((caster && caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo)) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
|
||||
m_maxDuration = int32(m_maxDuration * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
|
||||
|
||||
|
||||
// xinef: we should take ModSpellDuration into account, but none of the spells using this function is affected by contents of ModSpellDuration
|
||||
RefreshDuration();
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -1015,7 +1019,7 @@ bool Aura::IsDeathPersistent() const
|
||||
return GetSpellInfo()->IsDeathPersistent();
|
||||
}
|
||||
|
||||
bool Aura::IsRemovedOnShapeLost(Unit *target) const
|
||||
bool Aura::IsRemovedOnShapeLost(Unit* target) const
|
||||
{
|
||||
return (GetCasterGUID() == target->GetGUID() && m_spellInfo->Stances && !m_spellInfo->HasAttribute(SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && !m_spellInfo->HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT));
|
||||
}
|
||||
@@ -1138,7 +1142,7 @@ int32 Aura::CalcDispelChance(Unit* auraTarget, bool offensive) const
|
||||
return 100 - resistChance;
|
||||
}
|
||||
|
||||
void Aura::SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount)
|
||||
void Aura::SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32* amount)
|
||||
{
|
||||
m_maxDuration = maxduration;
|
||||
m_duration = duration;
|
||||
@@ -1150,7 +1154,7 @@ void Aura::SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint
|
||||
if (m_effects[i])
|
||||
{
|
||||
m_effects[i]->SetAmount(amount[i]);
|
||||
m_effects[i]->SetCanBeRecalculated(recalculateMask & (1<<i));
|
||||
m_effects[i]->SetCanBeRecalculated(recalculateMask & (1 << i));
|
||||
m_effects[i]->CalculatePeriodic(caster, false, true);
|
||||
m_effects[i]->CalculateSpellMod();
|
||||
m_effects[i]->RecalculateAmount(caster);
|
||||
@@ -1176,7 +1180,7 @@ void Aura::RecalculateAmountOfEffects()
|
||||
m_effects[i]->RecalculateAmount(caster);
|
||||
}
|
||||
|
||||
void Aura::HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply)
|
||||
void Aura::HandleAllEffects(AuraApplication* aurApp, uint8 mode, bool apply)
|
||||
{
|
||||
ASSERT (!IsRemoved());
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
@@ -1184,7 +1188,7 @@ void Aura::HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply)
|
||||
m_effects[i]->HandleEffect(aurApp, mode, apply);
|
||||
}
|
||||
|
||||
void Aura::GetApplicationList(std::list<AuraApplication*> & applicationList) const
|
||||
void Aura::GetApplicationList(std::list<AuraApplication*>& applicationList) const
|
||||
{
|
||||
for (Aura::ApplicationMap::const_iterator appIter = m_applications.begin(); appIter != m_applications.end(); ++appIter)
|
||||
{
|
||||
@@ -1344,8 +1348,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
|
||||
switch (aurEff->GetId())
|
||||
{
|
||||
case 31571: spellId = 57529; break;
|
||||
case 31572: spellId = 57531; break;
|
||||
case 31571:
|
||||
spellId = 57529;
|
||||
break;
|
||||
case 31572:
|
||||
spellId = 57531;
|
||||
break;
|
||||
default:
|
||||
sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId());
|
||||
}
|
||||
@@ -1354,17 +1362,17 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
}
|
||||
break;
|
||||
case 44544: // Fingers of Frost
|
||||
{
|
||||
// See if we already have the indicator aura. If not, create one.
|
||||
if (Aura* aur = target->GetAura(74396))
|
||||
{
|
||||
// Aura already there. Refresh duration and set original charges
|
||||
aur->SetCharges(2);
|
||||
aur->RefreshDuration();
|
||||
// See if we already have the indicator aura. If not, create one.
|
||||
if (Aura* aur = target->GetAura(74396))
|
||||
{
|
||||
// Aura already there. Refresh duration and set original charges
|
||||
aur->SetCharges(2);
|
||||
aur->RefreshDuration();
|
||||
}
|
||||
else
|
||||
target->AddAura(74396, target);
|
||||
}
|
||||
else
|
||||
target->AddAura(74396, target);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1411,7 +1419,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (AuraEffect* glyph = caster->GetAuraEffect(55672, 0))
|
||||
{
|
||||
// instantly heal m_amount% of the absorb-value
|
||||
int32 heal = glyph->GetAmount() * GetEffect(0)->GetAmount()/100;
|
||||
int32 heal = glyph->GetAmount() * GetEffect(0)->GetAmount() / 100;
|
||||
caster->CastCustomSpell(GetUnitOwner(), 56160, &heal, nullptr, nullptr, true, 0, GetEffect(0));
|
||||
}
|
||||
}
|
||||
@@ -1452,13 +1460,25 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
switch (aurEff->GetId())
|
||||
{
|
||||
// Ebon Plague
|
||||
case 51161: spellId = 51735; break;
|
||||
case 51160: spellId = 51734; break;
|
||||
case 51099: spellId = 51726; break;
|
||||
case 51161:
|
||||
spellId = 51735;
|
||||
break;
|
||||
case 51160:
|
||||
spellId = 51734;
|
||||
break;
|
||||
case 51099:
|
||||
spellId = 51726;
|
||||
break;
|
||||
// Crypt Fever
|
||||
case 49632: spellId = 50510; break;
|
||||
case 49631: spellId = 50509; break;
|
||||
case 49032: spellId = 50508; break;
|
||||
case 49632:
|
||||
spellId = 50510;
|
||||
break;
|
||||
case 49631:
|
||||
spellId = 50509;
|
||||
break;
|
||||
case 49032:
|
||||
spellId = 50508;
|
||||
break;
|
||||
default:
|
||||
sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Crypt Fever/Ebon Plague (%d) found", aurEff->GetId());
|
||||
}
|
||||
@@ -1482,9 +1502,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
{
|
||||
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (GetEffect(i))
|
||||
GetEffect(i)->SetAmount(CalculatePct(GetEffect(i)->GetAmount(), 100+sSpellMgr->GetSpellMixologyBonus(GetId())));
|
||||
GetEffect(i)->SetAmount(CalculatePct(GetEffect(i)->GetAmount(), 100 + sSpellMgr->GetSpellMixologyBonus(GetId())));
|
||||
|
||||
SetMaxDuration(caster->CalcSpellDuration(GetSpellInfo())*2);
|
||||
SetMaxDuration(caster->CalcSpellDuration(GetSpellInfo()) * 2);
|
||||
SetDuration(GetMaxDuration());
|
||||
}
|
||||
}
|
||||
@@ -1570,8 +1590,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
uint32 spellId = 0;
|
||||
switch (aurEff->GetId())
|
||||
{
|
||||
case 53759: spellId = 60947; break;
|
||||
case 53754: spellId = 60946; break;
|
||||
case 53759:
|
||||
spellId = 60947;
|
||||
break;
|
||||
case 53754:
|
||||
spellId = 60946;
|
||||
break;
|
||||
default:
|
||||
sLog->outError("Aura::HandleAuraSpecificMods: Unknown rank of Improved Fear (%d) found", aurEff->GetId());
|
||||
}
|
||||
@@ -1610,7 +1634,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
break;
|
||||
}
|
||||
else // and add if needed
|
||||
caster->ToPlayer()->AddSpellCooldown(aura->GetId(), 0, 12*IN_MILLISECONDS);
|
||||
caster->ToPlayer()->AddSpellCooldown(aura->GetId(), 0, 12 * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
// effect on caster
|
||||
@@ -1635,14 +1659,20 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
switch (target->getPowerType())
|
||||
{
|
||||
case POWER_MANA:
|
||||
{
|
||||
int32 basepoints0 = int32(CalculatePct(target->GetMaxPower(POWER_MANA), 2));
|
||||
caster->CastCustomSpell(target, 63654, &basepoints0, nullptr, nullptr, true);
|
||||
{
|
||||
int32 basepoints0 = int32(CalculatePct(target->GetMaxPower(POWER_MANA), 2));
|
||||
caster->CastCustomSpell(target, 63654, &basepoints0, nullptr, nullptr, true);
|
||||
break;
|
||||
}
|
||||
case POWER_RAGE:
|
||||
triggeredSpellId = 63653;
|
||||
break;
|
||||
case POWER_ENERGY:
|
||||
triggeredSpellId = (!target->HasAura(70405) ? 63655 : 0);
|
||||
break;
|
||||
case POWER_RUNIC_POWER:
|
||||
triggeredSpellId = 63652;
|
||||
break;
|
||||
}
|
||||
case POWER_RAGE: triggeredSpellId = 63653; break;
|
||||
case POWER_ENERGY: triggeredSpellId = (!target->HasAura(70405) ? 63655 : 0); break;
|
||||
case POWER_RUNIC_POWER: triggeredSpellId = 63652; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1668,7 +1698,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
|
||||
player->AddSpellCooldown(GetSpellInfo()->Id, 0, aurEff->GetAmount()*IN_MILLISECONDS);
|
||||
|
||||
WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4);
|
||||
WorldPacket data(SMSG_MODIFY_COOLDOWN, 4 + 8 + 4);
|
||||
data << uint32(GetId()); // Spell ID
|
||||
data << uint64(player->GetGUID()); // Player GUID
|
||||
data << int32(-110000); // Cooldown mod in milliseconds
|
||||
@@ -1707,7 +1737,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (target->ToPlayer()->getClass() != CLASS_DEATH_KNIGHT)
|
||||
break;
|
||||
|
||||
// aura removed - remove death runes
|
||||
// aura removed - remove death runes
|
||||
target->ToPlayer()->RemoveRunesByAuraEffect(GetEffect(0));
|
||||
}
|
||||
break;
|
||||
@@ -1801,7 +1831,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
|
||||
if (apply)
|
||||
target->CastSpell(target, 70725, true);
|
||||
}
|
||||
else if (AuraEffect *aurEff = caster->GetAuraEffect(SPELL_AURA_MOD_BASE_RESISTANCE_PCT, SPELLFAMILY_DRUID, 107, 0))
|
||||
else if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_MOD_BASE_RESISTANCE_PCT, SPELLFAMILY_DRUID, 107, 0))
|
||||
aurEff->RecalculateAmount();
|
||||
}
|
||||
break;
|
||||
@@ -1886,14 +1916,14 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
{
|
||||
// prevent remove triggering aura by triggered aura
|
||||
if (existingSpellInfo->Effects[i].TriggerSpell == GetId()
|
||||
// prevent remove triggered aura by triggering aura refresh
|
||||
|| m_spellInfo->Effects[i].TriggerSpell == existingAura->GetId())
|
||||
// prevent remove triggered aura by triggering aura refresh
|
||||
|| m_spellInfo->Effects[i].TriggerSpell == existingAura->GetId())
|
||||
return true;
|
||||
}
|
||||
|
||||
// check spell specific stack rules
|
||||
if (m_spellInfo->IsAuraExclusiveBySpecificWith(existingSpellInfo)
|
||||
|| (sameCaster && m_spellInfo->IsAuraExclusiveBySpecificPerCasterWith(existingSpellInfo)))
|
||||
|| (sameCaster && m_spellInfo->IsAuraExclusiveBySpecificPerCasterWith(existingSpellInfo)))
|
||||
return false;
|
||||
|
||||
// check spell group stack rules
|
||||
@@ -1902,8 +1932,8 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
if (stackFlags)
|
||||
{
|
||||
// xinef: same caster rule is bounded by spellfamily
|
||||
if (sameCaster && m_spellInfo->SpellFamilyName == existingSpellInfo->SpellFamilyName &&
|
||||
(stackFlags & SPELL_GROUP_STACK_FLAG_NOT_SAME_CASTER))
|
||||
if (sameCaster && m_spellInfo->SpellFamilyName == existingSpellInfo->SpellFamilyName &&
|
||||
(stackFlags & SPELL_GROUP_STACK_FLAG_NOT_SAME_CASTER))
|
||||
return false;
|
||||
|
||||
// xinef: normal exclusive stacking, remove if auras are equal by effects
|
||||
@@ -1980,9 +2010,9 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
while (i < MAX_SPELL_EFFECTS && !(VehicleAura1 && VehicleAura2))
|
||||
{
|
||||
if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE)
|
||||
VehicleAura1 = i+1;
|
||||
VehicleAura1 = i + 1;
|
||||
if (existingSpellInfo->Effects[i].ApplyAuraName == SPELL_AURA_CONTROL_VEHICLE)
|
||||
VehicleAura2 = i+1;
|
||||
VehicleAura2 = i + 1;
|
||||
|
||||
++i;
|
||||
}
|
||||
@@ -1997,9 +2027,9 @@ bool Aura::CanStackWith(Aura const* existingAura, bool remove) const
|
||||
return true;
|
||||
|
||||
// xinef: allow direct auras to stack if there is no passenger in this slot
|
||||
if (AuraEffect* aurEff = GetEffect(VehicleAura1-1))
|
||||
if (AuraEffect* aurEff = GetEffect(VehicleAura1 - 1))
|
||||
if (aurEff->GetAmount() > 0)
|
||||
if (!veh->GetPassenger(aurEff->GetAmount()-1))
|
||||
if (!veh->GetPassenger(aurEff->GetAmount() - 1))
|
||||
return true;
|
||||
|
||||
if (!veh->GetAvailableSeatCount())
|
||||
@@ -2120,7 +2150,7 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
|
||||
else
|
||||
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_RANGED);
|
||||
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1<<item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask))
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_WEAPON || !((1 << item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2128,7 +2158,7 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
|
||||
{
|
||||
// Check if player is wearing shield
|
||||
Item* item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1<<item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask))
|
||||
if (!item || item->IsBroken() || item->GetTemplate()->Class != ITEM_CLASS_ARMOR || !((1 << item->GetTemplate()->SubClass) & GetSpellInfo()->EquippedItemSubClassMask))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -2344,7 +2374,7 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff)
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated)
|
||||
void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2358,7 +2388,7 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 &
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude)
|
||||
void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2372,7 +2402,7 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool &
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod)
|
||||
void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier*& spellMod)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2386,7 +2416,7 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool& defaultPrevented)
|
||||
void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount, bool& defaultPrevented)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2404,7 +2434,7 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2418,7 +2448,7 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplicati
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/)
|
||||
void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount, bool& /*defaultPrevented*/)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2432,7 +2462,7 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplicatio
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2446,7 +2476,7 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraAppli
|
||||
}
|
||||
}
|
||||
|
||||
void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount)
|
||||
void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& splitAmount)
|
||||
{
|
||||
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
|
||||
{
|
||||
@@ -2558,7 +2588,7 @@ void Aura::CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraAppli
|
||||
}
|
||||
}
|
||||
|
||||
UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
|
||||
UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID)
|
||||
: Aura(spellproto, owner, caster, castItem, casterGUID)
|
||||
{
|
||||
m_AuraDRGroup = DIMINISHING_NONE;
|
||||
@@ -2567,7 +2597,7 @@ UnitAura::UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owne
|
||||
GetUnitOwner()->_AddAura(this, caster);
|
||||
};
|
||||
|
||||
void UnitAura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp)
|
||||
void UnitAura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication* aurApp)
|
||||
{
|
||||
Aura::_ApplyForTarget(target, caster, aurApp);
|
||||
|
||||
@@ -2576,7 +2606,7 @@ void UnitAura::_ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aur
|
||||
target->ApplyDiminishingAura(group, true);
|
||||
}
|
||||
|
||||
void UnitAura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp)
|
||||
void UnitAura::_UnapplyForTarget(Unit* target, Unit* caster, AuraApplication* aurApp)
|
||||
{
|
||||
Aura::_UnapplyForTarget(target, caster, aurApp);
|
||||
|
||||
@@ -2592,7 +2622,7 @@ void UnitAura::Remove(AuraRemoveMode removeMode)
|
||||
GetUnitOwner()->RemoveOwnedAura(this, removeMode);
|
||||
}
|
||||
|
||||
void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
|
||||
void UnitAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster)
|
||||
{
|
||||
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
|
||||
{
|
||||
@@ -2614,54 +2644,54 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
|
||||
{
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PARTY:
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_RAID:
|
||||
{
|
||||
targetList.push_back(GetUnitOwner());
|
||||
acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID);
|
||||
acore::UnitListSearcher<acore::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
{
|
||||
targetList.push_back(GetUnitOwner());
|
||||
acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID);
|
||||
acore::UnitListSearcher<acore::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
|
||||
{
|
||||
targetList.push_back(GetUnitOwner());
|
||||
acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius);
|
||||
acore::UnitListSearcher<acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
{
|
||||
targetList.push_back(GetUnitOwner());
|
||||
acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius);
|
||||
acore::UnitListSearcher<acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
||||
{
|
||||
acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
|
||||
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
{
|
||||
acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
|
||||
acore::UnitListSearcher<acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
GetUnitOwner()->VisitNearbyObject(radius, searcher);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
|
||||
targetList.push_back(GetUnitOwner());
|
||||
[[fallthrough]]; // TODO: Not sure whether the fallthrough was a mistake (forgetting a break) or intended. This should be double-checked.
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
|
||||
{
|
||||
if (Unit* owner = GetUnitOwner()->GetCharmerOrOwner())
|
||||
if (GetUnitOwner()->IsWithinDistInMap(owner, radius))
|
||||
targetList.push_back(owner);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Unit* owner = GetUnitOwner()->GetCharmerOrOwner())
|
||||
if (GetUnitOwner()->IsWithinDistInMap(owner, radius))
|
||||
targetList.push_back(owner);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr)
|
||||
for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
|
||||
{
|
||||
std::map<Unit*, uint8>::iterator existing = targets.find(*itr);
|
||||
if (existing != targets.end())
|
||||
existing->second |= 1<<effIndex;
|
||||
existing->second |= 1 << effIndex;
|
||||
else
|
||||
targets[*itr] = 1<<effIndex;
|
||||
targets[*itr] = 1 << effIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DynObjAura::DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID)
|
||||
DynObjAura::DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID)
|
||||
: Aura(spellproto, owner, caster, castItem, casterGUID)
|
||||
{
|
||||
LoadScripts();
|
||||
@@ -2679,7 +2709,7 @@ void DynObjAura::Remove(AuraRemoveMode removeMode)
|
||||
_Remove(removeMode);
|
||||
}
|
||||
|
||||
void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*/)
|
||||
void DynObjAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* /*caster*/)
|
||||
{
|
||||
Unit* dynObjOwnerCaster = GetDynobjOwner()->GetCaster();
|
||||
float radius = GetDynobjOwner()->GetRadius();
|
||||
@@ -2690,7 +2720,7 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*
|
||||
continue;
|
||||
UnitList targetList;
|
||||
if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY
|
||||
|| GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY)
|
||||
|| GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY)
|
||||
{
|
||||
acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
acore::UnitListSearcher<acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
@@ -2711,20 +2741,20 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*
|
||||
GetDynobjOwner()->VisitNearbyObject(radius, searcher);
|
||||
}
|
||||
|
||||
for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr)
|
||||
for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
|
||||
{
|
||||
// xinef: check z level and los dependence
|
||||
Unit* target = *itr;
|
||||
float zLevel = GetDynobjOwner()->GetPositionZ();
|
||||
if (target->GetPositionZ()+3.0f < zLevel || target->GetPositionZ()-5.0f > zLevel)
|
||||
if (target->GetPositionZ() + 3.0f < zLevel || target->GetPositionZ() - 5.0f > zLevel)
|
||||
if (!target->IsWithinLOSInMap(GetDynobjOwner()))
|
||||
continue;
|
||||
|
||||
std::map<Unit*, uint8>::iterator existing = targets.find(*itr);
|
||||
if (existing != targets.end())
|
||||
existing->second |= 1<<effIndex;
|
||||
existing->second |= 1 << effIndex;
|
||||
else
|
||||
targets[*itr] = 1<<effIndex;
|
||||
targets[*itr] = 1 << effIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,266 +25,266 @@ class ProcInfo;
|
||||
|
||||
class AuraApplication
|
||||
{
|
||||
friend void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask);
|
||||
friend void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
|
||||
friend void Unit::_ApplyAura(AuraApplication* aurApp, uint8 effMask);
|
||||
friend void Unit::_UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMode);
|
||||
friend void Unit::_ApplyAuraEffect(Aura* aura, uint8 effIndex);
|
||||
friend void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode);
|
||||
friend AuraApplication * Unit::_CreateAuraApplication(Aura* aura, uint8 effMask);
|
||||
private:
|
||||
Unit* const _target;
|
||||
Aura* const _base;
|
||||
AuraRemoveMode _removeMode:8; // Store info for know remove aura reason
|
||||
uint8 _slot; // Aura slot on unit
|
||||
uint8 _flags; // Aura info flag
|
||||
uint8 _effectsToApply; // Used only at spell hit to determine which effect should be applied
|
||||
bool _needClientUpdate:1;
|
||||
friend void Unit::RemoveAura(AuraApplication* aurApp, AuraRemoveMode mode);
|
||||
friend AuraApplication* Unit::_CreateAuraApplication(Aura* aura, uint8 effMask);
|
||||
private:
|
||||
Unit* const _target;
|
||||
Aura* const _base;
|
||||
AuraRemoveMode _removeMode: 8; // Store info for know remove aura reason
|
||||
uint8 _slot; // Aura slot on unit
|
||||
uint8 _flags; // Aura info flag
|
||||
uint8 _effectsToApply; // Used only at spell hit to determine which effect should be applied
|
||||
bool _needClientUpdate: 1;
|
||||
|
||||
// xinef: stacking
|
||||
uint8 _disableMask;
|
||||
// xinef: stacking
|
||||
uint8 _disableMask;
|
||||
|
||||
explicit AuraApplication(Unit* target, Unit* caster, Aura* base, uint8 effMask);
|
||||
void _Remove();
|
||||
private:
|
||||
void _InitFlags(Unit* caster, uint8 effMask);
|
||||
void _HandleEffect(uint8 effIndex, bool apply);
|
||||
public:
|
||||
explicit AuraApplication(Unit* target, Unit* caster, Aura* base, uint8 effMask);
|
||||
void _Remove();
|
||||
private:
|
||||
void _InitFlags(Unit* caster, uint8 effMask);
|
||||
void _HandleEffect(uint8 effIndex, bool apply);
|
||||
public:
|
||||
|
||||
Unit* GetTarget() const { return _target; }
|
||||
Aura* GetBase() const { return _base; }
|
||||
Unit* GetTarget() const { return _target; }
|
||||
Aura* GetBase() const { return _base; }
|
||||
|
||||
uint8 GetSlot() const { return _slot; }
|
||||
uint8 GetFlags() const { return _flags; }
|
||||
uint8 GetEffectMask() const { return _flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
|
||||
bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return _flags & (1<<effect); }
|
||||
bool IsPositive() const { return _flags & AFLAG_POSITIVE; }
|
||||
bool IsSelfcasted() const { return _flags & AFLAG_CASTER; }
|
||||
uint8 GetEffectsToApply() const { return _effectsToApply; }
|
||||
uint8 GetSlot() const { return _slot; }
|
||||
uint8 GetFlags() const { return _flags; }
|
||||
uint8 GetEffectMask() const { return _flags & (AFLAG_EFF_INDEX_0 | AFLAG_EFF_INDEX_1 | AFLAG_EFF_INDEX_2); }
|
||||
bool HasEffect(uint8 effect) const { ASSERT(effect < MAX_SPELL_EFFECTS); return _flags & (1 << effect); }
|
||||
bool IsPositive() const { return _flags & AFLAG_POSITIVE; }
|
||||
bool IsSelfcasted() const { return _flags & AFLAG_CASTER; }
|
||||
uint8 GetEffectsToApply() const { return _effectsToApply; }
|
||||
|
||||
void SetRemoveMode(AuraRemoveMode mode) { _removeMode = mode; }
|
||||
AuraRemoveMode GetRemoveMode() const {return _removeMode;}
|
||||
void SetRemoveMode(AuraRemoveMode mode) { _removeMode = mode; }
|
||||
AuraRemoveMode GetRemoveMode() const {return _removeMode;}
|
||||
|
||||
void SetNeedClientUpdate() { _needClientUpdate = true;}
|
||||
bool IsNeedClientUpdate() const { return _needClientUpdate;}
|
||||
void BuildUpdatePacket(ByteBuffer& data, bool remove) const;
|
||||
void ClientUpdate(bool remove = false);
|
||||
void SetNeedClientUpdate() { _needClientUpdate = true;}
|
||||
bool IsNeedClientUpdate() const { return _needClientUpdate;}
|
||||
void BuildUpdatePacket(ByteBuffer& data, bool remove) const;
|
||||
void ClientUpdate(bool remove = false);
|
||||
|
||||
// xinef: stacking
|
||||
bool IsActive(uint8 effIdx) { return ((1 << effIdx) & _disableMask) == 0; }
|
||||
void SetDisableMask(uint8 effIdx) { _disableMask |= 1 << effIdx; }
|
||||
void RemoveDisableMask(uint8 effIdx) { _disableMask &= ~(1 << effIdx); }
|
||||
// xinef: stacking
|
||||
bool IsActive(uint8 effIdx) { return ((1 << effIdx) & _disableMask) == 0; }
|
||||
void SetDisableMask(uint8 effIdx) { _disableMask |= 1 << effIdx; }
|
||||
void RemoveDisableMask(uint8 effIdx) { _disableMask &= ~(1 << effIdx); }
|
||||
};
|
||||
|
||||
class Aura
|
||||
{
|
||||
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID, bool noPeriodicReset);
|
||||
public:
|
||||
typedef std::map<uint64, AuraApplication *> ApplicationMap;
|
||||
friend Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID, bool noPeriodicReset);
|
||||
public:
|
||||
typedef std::map<uint64, AuraApplication*> ApplicationMap;
|
||||
|
||||
static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner);
|
||||
static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0, bool* refresh = NULL, bool periodicReset = false);
|
||||
static Aura* TryCreate(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
|
||||
static Aura* Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, uint64 casterGUID);
|
||||
void _InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount);
|
||||
virtual ~Aura();
|
||||
static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 avalibleEffectMask, WorldObject* owner);
|
||||
static Aura* TryRefreshStackOrCreate(SpellInfo const* spellproto, uint8 tryEffMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0, bool* refresh = NULL, bool periodicReset = false);
|
||||
static Aura* TryCreate(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
|
||||
static Aura* Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
explicit Aura(SpellInfo const* spellproto, WorldObject* owner, Unit* caster, Item* castItem, uint64 casterGUID);
|
||||
void _InitEffects(uint8 effMask, Unit* caster, int32* baseAmount);
|
||||
virtual ~Aura();
|
||||
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const;
|
||||
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
|
||||
uint32 GetId() const;
|
||||
|
||||
uint64 GetCastItemGUID() const { return m_castItemGuid; }
|
||||
uint32 GetCastItemEntry() const { return m_castItemEntry; }
|
||||
uint64 GetCasterGUID() const { return m_casterGuid; }
|
||||
Unit* GetCaster() const;
|
||||
WorldObject* GetOwner() const { return m_owner; }
|
||||
Unit* GetUnitOwner() const { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; }
|
||||
DynamicObject* GetDynobjOwner() const { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; }
|
||||
uint64 GetCastItemGUID() const { return m_castItemGuid; }
|
||||
uint32 GetCastItemEntry() const { return m_castItemEntry; }
|
||||
uint64 GetCasterGUID() const { return m_casterGuid; }
|
||||
Unit* GetCaster() const;
|
||||
WorldObject* GetOwner() const { return m_owner; }
|
||||
Unit* GetUnitOwner() const { ASSERT(GetType() == UNIT_AURA_TYPE); return (Unit*)m_owner; }
|
||||
DynamicObject* GetDynobjOwner() const { ASSERT(GetType() == DYNOBJ_AURA_TYPE); return (DynamicObject*)m_owner; }
|
||||
|
||||
AuraObjectType GetType() const;
|
||||
AuraObjectType GetType() const;
|
||||
|
||||
virtual void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp);
|
||||
virtual void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * auraApp);
|
||||
void _Remove(AuraRemoveMode removeMode);
|
||||
virtual void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) = 0;
|
||||
virtual void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication* auraApp);
|
||||
virtual void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication* auraApp);
|
||||
void _Remove(AuraRemoveMode removeMode);
|
||||
virtual void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) = 0;
|
||||
|
||||
virtual void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) = 0;
|
||||
void UpdateTargetMap(Unit* caster, bool apply = true);
|
||||
virtual void FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster) = 0;
|
||||
void UpdateTargetMap(Unit* caster, bool apply = true);
|
||||
|
||||
void _RegisterForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);}
|
||||
void ApplyForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, true);}
|
||||
void _ApplyEffectForTargets(uint8 effIndex);
|
||||
void _RegisterForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);}
|
||||
void ApplyForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, true);}
|
||||
void _ApplyEffectForTargets(uint8 effIndex);
|
||||
|
||||
void UpdateOwner(uint32 diff, WorldObject* owner);
|
||||
void Update(uint32 diff, Unit* caster);
|
||||
void UpdateOwner(uint32 diff, WorldObject* owner);
|
||||
void Update(uint32 diff, Unit* caster);
|
||||
|
||||
time_t GetApplyTime() const { return m_applyTime; }
|
||||
int32 GetMaxDuration() const { return m_maxDuration; }
|
||||
void SetMaxDuration(int32 duration) { m_maxDuration = duration; }
|
||||
int32 CalcMaxDuration() const { return CalcMaxDuration(GetCaster()); }
|
||||
int32 CalcMaxDuration(Unit* caster) const;
|
||||
int32 GetDuration() const { return m_duration; }
|
||||
void SetDuration(int32 duration, bool withMods = false);
|
||||
void RefreshDuration();
|
||||
void RefreshTimers(bool periodicReset = false);
|
||||
void RefreshTimersWithMods();
|
||||
bool IsExpired() const { return !GetDuration();}
|
||||
bool IsPermanent() const { return GetMaxDuration() == -1; }
|
||||
time_t GetApplyTime() const { return m_applyTime; }
|
||||
int32 GetMaxDuration() const { return m_maxDuration; }
|
||||
void SetMaxDuration(int32 duration) { m_maxDuration = duration; }
|
||||
int32 CalcMaxDuration() const { return CalcMaxDuration(GetCaster()); }
|
||||
int32 CalcMaxDuration(Unit* caster) const;
|
||||
int32 GetDuration() const { return m_duration; }
|
||||
void SetDuration(int32 duration, bool withMods = false);
|
||||
void RefreshDuration();
|
||||
void RefreshTimers(bool periodicReset = false);
|
||||
void RefreshTimersWithMods();
|
||||
bool IsExpired() const { return !GetDuration();}
|
||||
bool IsPermanent() const { return GetMaxDuration() == -1; }
|
||||
|
||||
uint8 GetCharges() const { return m_procCharges; }
|
||||
void SetCharges(uint8 charges);
|
||||
uint8 CalcMaxCharges(Unit* caster) const;
|
||||
uint8 CalcMaxCharges() const { return CalcMaxCharges(GetCaster()); }
|
||||
bool ModCharges(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
bool DropCharge(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) { return ModCharges(-1, removeMode); }
|
||||
uint8 GetCharges() const { return m_procCharges; }
|
||||
void SetCharges(uint8 charges);
|
||||
uint8 CalcMaxCharges(Unit* caster) const;
|
||||
uint8 CalcMaxCharges() const { return CalcMaxCharges(GetCaster()); }
|
||||
bool ModCharges(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
bool DropCharge(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) { return ModCharges(-1, removeMode); }
|
||||
|
||||
uint8 GetStackAmount() const { return m_stackAmount; }
|
||||
void SetStackAmount(uint8 num);
|
||||
bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, bool periodicReset = false);
|
||||
uint8 GetStackAmount() const { return m_stackAmount; }
|
||||
void SetStackAmount(uint8 num);
|
||||
bool ModStackAmount(int32 num, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, bool periodicReset = false);
|
||||
|
||||
void RefreshSpellMods();
|
||||
void RefreshSpellMods();
|
||||
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
uint8 GetCasterLevel() const { return m_casterLevel; }
|
||||
|
||||
bool IsArea() const;
|
||||
bool IsPassive() const;
|
||||
bool IsDeathPersistent() const;
|
||||
bool IsRemovedOnShapeLost(Unit* target) const;
|
||||
bool CanBeSaved() const;
|
||||
bool IsRemoved() const { return m_isRemoved; }
|
||||
bool CanBeSentToClient() const;
|
||||
// Single cast aura helpers
|
||||
bool IsSingleTarget() const {return m_isSingleTarget; }
|
||||
bool IsSingleTargetWith(Aura const* aura) const;
|
||||
void SetIsSingleTarget(bool val) { m_isSingleTarget = val; }
|
||||
void UnregisterSingleTarget();
|
||||
int32 CalcDispelChance(Unit* auraTarget, bool offensive) const;
|
||||
bool IsArea() const;
|
||||
bool IsPassive() const;
|
||||
bool IsDeathPersistent() const;
|
||||
bool IsRemovedOnShapeLost(Unit* target) const;
|
||||
bool CanBeSaved() const;
|
||||
bool IsRemoved() const { return m_isRemoved; }
|
||||
bool CanBeSentToClient() const;
|
||||
// Single cast aura helpers
|
||||
bool IsSingleTarget() const {return m_isSingleTarget; }
|
||||
bool IsSingleTargetWith(Aura const* aura) const;
|
||||
void SetIsSingleTarget(bool val) { m_isSingleTarget = val; }
|
||||
void UnregisterSingleTarget();
|
||||
int32 CalcDispelChance(Unit* auraTarget, bool offensive) const;
|
||||
|
||||
void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount);
|
||||
void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32* amount);
|
||||
|
||||
// helpers for aura effects
|
||||
bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); }
|
||||
bool HasEffectType(AuraType type) const;
|
||||
AuraEffect* GetEffect(uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; }
|
||||
uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1<<i; return effMask; }
|
||||
void RecalculateAmountOfEffects();
|
||||
void HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||
// helpers for aura effects
|
||||
bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); }
|
||||
bool HasEffectType(AuraType type) const;
|
||||
AuraEffect* GetEffect(uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; }
|
||||
uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1 << i; return effMask; }
|
||||
void RecalculateAmountOfEffects();
|
||||
void HandleAllEffects(AuraApplication* aurApp, uint8 mode, bool apply);
|
||||
|
||||
// Helpers for targets
|
||||
ApplicationMap const & GetApplicationMap() {return m_applications;}
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
const AuraApplication * GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
|
||||
AuraApplication * GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
|
||||
bool IsAppliedOnTarget(uint64 guid) const { return m_applications.find(guid) != m_applications.end(); }
|
||||
// Helpers for targets
|
||||
ApplicationMap const& GetApplicationMap() {return m_applications;}
|
||||
void GetApplicationList(std::list<AuraApplication*>& applicationList) const;
|
||||
const AuraApplication* GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
|
||||
AuraApplication* GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return nullptr; }
|
||||
bool IsAppliedOnTarget(uint64 guid) const { return m_applications.find(guid) != m_applications.end(); }
|
||||
|
||||
void SetNeedClientUpdateForTargets() const;
|
||||
void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply);
|
||||
bool CanBeAppliedOn(Unit* target);
|
||||
bool CheckAreaTarget(Unit* target);
|
||||
bool CanStackWith(Aura const* checkAura, bool remove) const;
|
||||
bool IsAuraStronger(Aura const* newAura) const;
|
||||
void SetNeedClientUpdateForTargets() const;
|
||||
void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply);
|
||||
bool CanBeAppliedOn(Unit* target);
|
||||
bool CheckAreaTarget(Unit* target);
|
||||
bool CanStackWith(Aura const* checkAura, bool remove) const;
|
||||
bool IsAuraStronger(Aura const* newAura) const;
|
||||
|
||||
// Proc system
|
||||
// this subsystem is not yet in use - the core of it is functional, but still some research has to be done
|
||||
// and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
|
||||
// currently proc system functionality is implemented in Unit::ProcDamageAndSpell
|
||||
bool IsProcOnCooldown() const;
|
||||
void AddProcCooldown(uint32 msec);
|
||||
bool IsUsingCharges() const { return m_isUsingCharges; }
|
||||
void SetUsingCharges(bool val) { m_isUsingCharges = val; }
|
||||
void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const;
|
||||
float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
|
||||
void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
// Proc system
|
||||
// this subsystem is not yet in use - the core of it is functional, but still some research has to be done
|
||||
// and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
|
||||
// currently proc system functionality is implemented in Unit::ProcDamageAndSpell
|
||||
bool IsProcOnCooldown() const;
|
||||
void AddProcCooldown(uint32 msec);
|
||||
bool IsUsingCharges() const { return m_isUsingCharges; }
|
||||
void SetUsingCharges(bool val) { m_isUsingCharges = val; }
|
||||
void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
bool IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) const;
|
||||
float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
|
||||
void TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
// AuraScript
|
||||
void LoadScripts();
|
||||
bool CallScriptCheckAreaTargetHandlers(Unit* target);
|
||||
void CallScriptDispel(DispelInfo* dispelInfo);
|
||||
void CallScriptAfterDispel(DispelInfo* dispelInfo);
|
||||
bool CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp);
|
||||
void CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff);
|
||||
void CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated);
|
||||
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude);
|
||||
void CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod);
|
||||
void CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
|
||||
void CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
|
||||
void CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented);
|
||||
void CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount);
|
||||
void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount);
|
||||
// AuraScript
|
||||
void LoadScripts();
|
||||
bool CallScriptCheckAreaTargetHandlers(Unit* target);
|
||||
void CallScriptDispel(DispelInfo* dispelInfo);
|
||||
void CallScriptAfterDispel(DispelInfo* dispelInfo);
|
||||
bool CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
void CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode);
|
||||
bool CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp);
|
||||
void CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff);
|
||||
void CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated);
|
||||
void CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool& isPeriodic, int32& amplitude);
|
||||
void CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier*& spellMod);
|
||||
void CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount, bool& defaultPrevented);
|
||||
void CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount);
|
||||
void CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount, bool& defaultPrevented);
|
||||
void CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& absorbAmount);
|
||||
void CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo& dmgInfo, uint32& splitAmount);
|
||||
|
||||
// Spell Proc Hooks
|
||||
bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
// Spell Proc Hooks
|
||||
bool CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
void CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
bool CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
void CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo);
|
||||
|
||||
AuraScript* GetScriptByName(std::string const& scriptName) const;
|
||||
AuraScript* GetScriptByName(std::string const& scriptName) const;
|
||||
|
||||
std::list<AuraScript*> m_loadedScripts;
|
||||
private:
|
||||
void _DeleteRemovedApplications();
|
||||
protected:
|
||||
SpellInfo const* const m_spellInfo;
|
||||
uint64 const m_casterGuid;
|
||||
uint64 const m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
|
||||
uint32 const m_castItemEntry; // when deleted, we could retrieve some information from template instead
|
||||
time_t const m_applyTime;
|
||||
WorldObject* const m_owner; //
|
||||
std::list<AuraScript*> m_loadedScripts;
|
||||
private:
|
||||
void _DeleteRemovedApplications();
|
||||
protected:
|
||||
SpellInfo const* const m_spellInfo;
|
||||
uint64 const m_casterGuid;
|
||||
uint64 const m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
|
||||
uint32 const m_castItemEntry; // when deleted, we could retrieve some information from template instead
|
||||
time_t const m_applyTime;
|
||||
WorldObject* const m_owner; //
|
||||
|
||||
int32 m_maxDuration; // Max aura duration
|
||||
int32 m_duration; // Current time
|
||||
int32 m_timeCla; // Timer for power per sec calcultion
|
||||
int32 m_updateTargetMapInterval; // Timer for UpdateTargetMapOfEffect
|
||||
int32 m_maxDuration; // Max aura duration
|
||||
int32 m_duration; // Current time
|
||||
int32 m_timeCla; // Timer for power per sec calcultion
|
||||
int32 m_updateTargetMapInterval; // Timer for UpdateTargetMapOfEffect
|
||||
|
||||
uint8 const m_casterLevel; // Aura level (store caster level for correct show level dep amount)
|
||||
uint8 m_procCharges; // Aura charges (0 for infinite)
|
||||
uint8 m_stackAmount; // Aura stack amount
|
||||
uint8 const m_casterLevel; // Aura level (store caster level for correct show level dep amount)
|
||||
uint8 m_procCharges; // Aura charges (0 for infinite)
|
||||
uint8 m_stackAmount; // Aura stack amount
|
||||
|
||||
AuraEffect* m_effects[3];
|
||||
ApplicationMap m_applications;
|
||||
AuraEffect* m_effects[3];
|
||||
ApplicationMap m_applications;
|
||||
|
||||
bool m_isRemoved:1;
|
||||
bool m_isSingleTarget:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
|
||||
bool m_isUsingCharges:1;
|
||||
bool m_isRemoved: 1;
|
||||
bool m_isSingleTarget: 1; // true if it's a single target spell and registered at caster - can change at spell steal for example
|
||||
bool m_isUsingCharges: 1;
|
||||
|
||||
private:
|
||||
Unit::AuraApplicationList m_removedApplications;
|
||||
private:
|
||||
Unit::AuraApplicationList m_removedApplications;
|
||||
};
|
||||
|
||||
class UnitAura : public Aura
|
||||
{
|
||||
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp);
|
||||
void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication * aurApp);
|
||||
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit UnitAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void _ApplyForTarget(Unit* target, Unit* caster, AuraApplication* aurApp);
|
||||
void _UnapplyForTarget(Unit* target, Unit* caster, AuraApplication* aurApp);
|
||||
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster);
|
||||
void FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster);
|
||||
|
||||
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
|
||||
void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
|
||||
DiminishingGroup GetDiminishGroup() const { return m_AuraDRGroup; }
|
||||
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
|
||||
void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
|
||||
DiminishingGroup GetDiminishGroup() const { return m_AuraDRGroup; }
|
||||
|
||||
private:
|
||||
DiminishingGroup m_AuraDRGroup:8; // Diminishing
|
||||
private:
|
||||
DiminishingGroup m_AuraDRGroup: 8; // Diminishing
|
||||
};
|
||||
|
||||
class DynObjAura : public Aura
|
||||
{
|
||||
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32 *baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
friend Aura* Aura::Create(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
protected:
|
||||
explicit DynObjAura(SpellInfo const* spellproto, uint8 effMask, WorldObject* owner, Unit* caster, int32* baseAmount, Item* castItem, uint64 casterGUID);
|
||||
public:
|
||||
void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
|
||||
|
||||
void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster);
|
||||
void FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster);
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user