refactor(Core/Game): restyle game lib with astyle (#3466)

This commit is contained in:
Kargatum
2020-10-12 15:08:15 +07:00
committed by GitHub
parent e99b526e17
commit a2b26272d2
338 changed files with 52196 additions and 50944 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
}
}

View File

@@ -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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -88,19 +88,19 @@ float SpellImplicitTargetInfo::CalcDirectionAngle() const
case TARGET_DIR_BACK:
return static_cast<float>(M_PI);
case TARGET_DIR_RIGHT:
return static_cast<float>(-M_PI/2);
return static_cast<float>(-M_PI / 2);
case TARGET_DIR_LEFT:
return static_cast<float>(M_PI/2);
return static_cast<float>(M_PI / 2);
case TARGET_DIR_FRONT_RIGHT:
return static_cast<float>(-M_PI/4);
return static_cast<float>(-M_PI / 4);
case TARGET_DIR_BACK_RIGHT:
return static_cast<float>(-3*M_PI/4);
return static_cast<float>(-3 * M_PI / 4);
case TARGET_DIR_BACK_LEFT:
return static_cast<float>(3*M_PI/4);
return static_cast<float>(3 * M_PI / 4);
case TARGET_DIR_FRONT_LEFT:
return static_cast<float>(M_PI/4);
return static_cast<float>(M_PI / 4);
case TARGET_DIR_RANDOM:
return float(rand_norm())*static_cast<float>(2*M_PI);
return float(rand_norm()) * static_cast<float>(2 * M_PI);
default:
return 0.0f;
}
@@ -258,7 +258,7 @@ SpellImplicitTargetInfo::StaticData SpellImplicitTargetInfo::_data[TOTAL_SPELL_
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_NEARBY, TARGET_CHECK_RAID, TARGET_DIR_NONE}, // 58 TARGET_UNIT_NEARBY_RAID
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ALLY, TARGET_DIR_FRONT}, // 59 TARGET_UNIT_CONE_ALLY
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_CASTER, TARGET_SELECT_CATEGORY_CONE, TARGET_CHECK_ENTRY, TARGET_DIR_FRONT}, // 60 TARGET_UNIT_CONE_ENTRY
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS,TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS
{TARGET_OBJECT_TYPE_UNIT, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_AREA, TARGET_CHECK_RAID_CLASS, TARGET_DIR_NONE}, // 61 TARGET_UNIT_TARGET_AREA_RAID_CLASS
{TARGET_OBJECT_TYPE_NONE, TARGET_REFERENCE_TYPE_NONE, TARGET_SELECT_CATEGORY_NYI, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 62 TARGET_UNK_62
{TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_NONE}, // 63 TARGET_DEST_TARGET_ANY
{TARGET_OBJECT_TYPE_DEST, TARGET_REFERENCE_TYPE_TARGET, TARGET_SELECT_CATEGORY_DEFAULT, TARGET_CHECK_DEFAULT, TARGET_DIR_FRONT}, // 64 TARGET_DEST_TARGET_FRONT
@@ -365,11 +365,11 @@ bool SpellEffectInfo::IsTargetingArea() const
bool SpellEffectInfo::IsAreaAuraEffect() const
{
if (Effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_PET ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_OWNER)
Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_PET ||
Effect == SPELL_EFFECT_APPLY_AREA_AURA_OWNER)
return true;
return false;
}
@@ -377,10 +377,10 @@ bool SpellEffectInfo::IsAreaAuraEffect() const
bool SpellEffectInfo::IsFarUnitTargetEffect() const
{
return (Effect == SPELL_EFFECT_SUMMON_PLAYER)
|| (Effect == SPELL_EFFECT_SUMMON_RAF_FRIEND)
|| (Effect == SPELL_EFFECT_RESURRECT)
|| (Effect == SPELL_EFFECT_RESURRECT_NEW)
/*|| (Effect == SPELL_EFFECT_SKIN_PLAYER_CORPSE) Xinef: This is not Far Unit Target Effect... what a bullshit*/;
|| (Effect == SPELL_EFFECT_SUMMON_RAF_FRIEND)
|| (Effect == SPELL_EFFECT_RESURRECT)
|| (Effect == SPELL_EFFECT_RESURRECT_NEW)
/*|| (Effect == SPELL_EFFECT_SKIN_PLAYER_CORPSE) Xinef: This is not Far Unit Target Effect... what a bullshit*/;
}
bool SpellEffectInfo::IsFarDestTargetEffect() const
@@ -417,13 +417,16 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
// roll in a range <1;EffectDieSides> as of patch 3.3.3
switch (randomPoints)
{
case 0: break;
case 1: basePoints += 1; break; // range 1..1
case 0:
break;
case 1:
basePoints += 1;
break; // range 1..1
default:
// range can have positive (1..rand) and negative (rand..1) values, so order its for irand
int32 randvalue = (randomPoints >= 1)
? irand(1, randomPoints)
: irand(randomPoints, 1);
? irand(1, randomPoints)
: irand(randomPoints, 1);
basePoints += randvalue;
break;
@@ -438,14 +441,14 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
if (caster->m_movedByPlayer)
if (uint8 comboPoints = caster->m_movedByPlayer->ToPlayer()->GetComboPoints())
if (float comboDamage = PointsPerComboPoint)
value += comboDamage* comboPoints;
value += comboDamage * comboPoints;
value = caster->ApplyEffectModifiers(_spellInfo, _effIndex, value);
// amount multiplication based on caster's level
if (!caster->IsControlledByPlayer() &&
_spellInfo->SpellLevel && _spellInfo->SpellLevel != caster->getLevel() &&
!basePointsPerLevel && _spellInfo->HasAttribute(SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION))
_spellInfo->SpellLevel && _spellInfo->SpellLevel != caster->getLevel() &&
!basePointsPerLevel && _spellInfo->HasAttribute(SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION))
{
bool canEffectScale = false;
switch (Effect)
@@ -891,17 +894,17 @@ bool SpellInfo::HasAreaAuraEffect() const
bool SpellInfo::IsExplicitDiscovery() const
{
return ((Effects[0].Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM
|| Effects[0].Effect == SPELL_EFFECT_CREATE_ITEM_2)
&& Effects[1].Effect == SPELL_EFFECT_SCRIPT_EFFECT)
|| Id == 64323;
|| Effects[0].Effect == SPELL_EFFECT_CREATE_ITEM_2)
&& Effects[1].Effect == SPELL_EFFECT_SCRIPT_EFFECT)
|| Id == 64323;
}
bool SpellInfo::IsLootCrafting() const
{
return (Effects[0].Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM ||
// different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item
(Effects[0].Effect == SPELL_EFFECT_CREATE_ITEM_2 &&
((TotemCategory[0] != 0 || (Totem[0] != 0 && SpellIconID == 1)) || Effects[0].ItemType == 0)));
// different random cards from Inscription (121==Virtuoso Inking Set category) r without explicit item
(Effects[0].Effect == SPELL_EFFECT_CREATE_ITEM_2 &&
((TotemCategory[0] != 0 || (Totem[0] != 0 && SpellIconID == 1)) || Effects[0].ItemType == 0)));
}
bool SpellInfo::IsQuestTame() const
@@ -1108,7 +1111,7 @@ bool SpellInfo::ComputeIsStackableWithRanks() const
case SPELLFAMILY_DRUID:
// Druid form Spell
if (Effects[i].Effect == SPELL_EFFECT_APPLY_AURA &&
Effects[i].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT)
Effects[i].ApplyAuraName == SPELL_AURA_MOD_SHAPESHIFT)
return false;
break;
}
@@ -1245,8 +1248,8 @@ bool SpellInfo::IsBreakingStealth() const
bool SpellInfo::IsRangedWeaponSpell() const
{
return (SpellFamilyName == SPELLFAMILY_HUNTER && !(SpellFamilyFlags[1] & 0x10000000)) // for 53352, cannot find better way
|| (EquippedItemSubClassMask & ITEM_SUBCLASS_MASK_WEAPON_RANGED)
|| (Attributes & SPELL_ATTR0_REQ_AMMO); // Xinef: added
|| (EquippedItemSubClassMask & ITEM_SUBCLASS_MASK_WEAPON_RANGED)
|| (Attributes & SPELL_ATTR0_REQ_AMMO); // Xinef: added
}
bool SpellInfo::IsAutoRepeatRangedSpell() const
@@ -1286,8 +1289,8 @@ bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
// these spells (Cyclone for example) can pierce all...
if ((AttributesEx & SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE)
// ...but not these (Divine shield for example) // xinef: banish exception, banish can override banish to cancel itself
&& !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY || (aura->Mechanic == MECHANIC_BANISH && (Mechanic != MECHANIC_BANISH || !(AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED))))))
// ...but not these (Divine shield for example) // xinef: banish exception, banish can override banish to cancel itself
&& !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY || (aura->Mechanic == MECHANIC_BANISH && (Mechanic != MECHANIC_BANISH || !(AttributesEx2 & SPELL_ATTR2_CANT_TARGET_TAPPED))))))
return true;
return false;
@@ -1355,14 +1358,14 @@ bool SpellInfo::IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const
return spellSpec1 == spellSpec2;
case SPELL_SPECIFIC_FOOD:
return spellSpec2 == SPELL_SPECIFIC_FOOD
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
case SPELL_SPECIFIC_DRINK:
return spellSpec2 == SPELL_SPECIFIC_DRINK
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
case SPELL_SPECIFIC_FOOD_AND_DRINK:
return spellSpec2 == SPELL_SPECIFIC_FOOD
|| spellSpec2 == SPELL_SPECIFIC_DRINK
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
|| spellSpec2 == SPELL_SPECIFIC_DRINK
|| spellSpec2 == SPELL_SPECIFIC_FOOD_AND_DRINK;
default:
return false;
}
@@ -1392,7 +1395,7 @@ SpellCastResult SpellInfo::CheckShapeshift(uint32 form) const
// talents that learn spells can have stance requirements that need ignore
// (this requirement only for client-side stance show in talent description)
if (GetTalentSpellCost(Id) > 0 &&
(Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL || Effects[1].Effect == SPELL_EFFECT_LEARN_SPELL || Effects[2].Effect == SPELL_EFFECT_LEARN_SPELL))
(Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL || Effects[1].Effect == SPELL_EFFECT_LEARN_SPELL || Effects[2].Effect == SPELL_EFFECT_LEARN_SPELL))
return SPELL_CAST_OK;
uint32 stanceMask = (form ? 1 << (form - 1) : 0);
@@ -1508,24 +1511,24 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
case 42792: // Recently Dropped Flag
case 43681: // Inactive
case 44535: // Spirit Heal (mana)
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if (!mapEntry)
return SPELL_FAILED_INCORRECT_AREA;
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if (!mapEntry)
return SPELL_FAILED_INCORRECT_AREA;
return zone_id == 4197 || (mapEntry->IsBattleground() && player && player->InBattleground()) ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
}
return zone_id == 4197 || (mapEntry->IsBattleground() && player && player->InBattleground()) ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
}
case 32724: // Gold Team (Alliance)
case 32725: // Green Team (Alliance)
case 35774: // Gold Team (Horde)
case 35775: // Green Team (Horde)
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if (!mapEntry)
return SPELL_FAILED_INCORRECT_AREA;
{
MapEntry const* mapEntry = sMapStore.LookupEntry(map_id);
if (!mapEntry)
return SPELL_FAILED_INCORRECT_AREA;
return mapEntry->IsBattleArena() && player && player->InBattleground() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
}
return mapEntry->IsBattleArena() && player && player->InBattleground() ? SPELL_CAST_OK : SPELL_FAILED_REQUIRES_AREA;
}
}
// aura limitations
@@ -1537,15 +1540,15 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
{
case SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED:
case SPELL_AURA_FLY:
{
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id);
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{
if (skillIter->second->skillId == SKILL_MOUNTS)
if (player && !player->canFlyInZone(map_id, zone_id))
return SPELL_FAILED_INCORRECT_AREA;
SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(Id);
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
{
if (skillIter->second->skillId == SKILL_MOUNTS)
if (player && !player->canFlyInZone(map_id, zone_id))
return SPELL_FAILED_INCORRECT_AREA;
}
}
}
}
}
return SPELL_CAST_OK;
@@ -1633,9 +1636,9 @@ bool SpellInfo::IsStrongerAuraActive(Unit const* caster, Unit const* target) con
basePoints = player->m_spellModTakingSpell->GetSpellValue()->EffectBasePoints[i];
int32 curValue = abs(Effects[i].CalcValue(caster, &basePoints));
int32 auraValue = (sFlag & SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK) ?
abs((*iter)->GetSpellInfo()->Effects[(*iter)->GetEffIndex()].CalcValue((*iter)->GetCaster())) :
abs((*iter)->GetAmount());
int32 auraValue = (sFlag & SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK) ?
abs((*iter)->GetSpellInfo()->Effects[(*iter)->GetEffIndex()].CalcValue((*iter)->GetCaster())) :
abs((*iter)->GetAmount());
// xinef: for same spells, divide amount by stack amount
if (Id == (*iter)->GetId())
@@ -1674,7 +1677,7 @@ bool SpellInfo::IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const
{
if (!otherSpellInfo->Effects[j].IsAura())
continue;
if (Effects[i].ApplyAuraName != otherSpellInfo->Effects[j].ApplyAuraName || Effects[i].MiscValue != otherSpellInfo->Effects[j].MiscValue)
continue;
@@ -1695,9 +1698,9 @@ bool SpellInfo::IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const
++auraCount;
}
return matchCount*2 == auraCount;
return matchCount * 2 == auraCount;
}
bool SpellInfo::ValidateAttribute6SpellDamageMods(const Unit* caster, const AuraEffect* auraEffect, bool isDot) const
{
// Xinef: no attribute
@@ -1709,8 +1712,8 @@ bool SpellInfo::ValidateAttribute6SpellDamageMods(const Unit* caster, const Aura
if (Id == 70890 && auraEffect)
{
const SpellInfo* auraInfo = auraEffect->GetSpellInfo();
return auraInfo->SpellIconID == 3086 ||
(auraInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (auraInfo->SpellFamilyFlags & flag96(8388608, 64, 16) || auraInfo->SpellIconID == 235 || auraInfo->SpellIconID == 154));
return auraInfo->SpellIconID == 3086 ||
(auraInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (auraInfo->SpellFamilyFlags & flag96(8388608, 64, 16) || auraInfo->SpellIconID == 235 || auraInfo->SpellIconID == 154));
}
// Xinef: Necrosis, no profits for done and taken
else if (Id == 51460)
@@ -1759,10 +1762,10 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
if (AttributesCu & SPELL_ATTR0_CU_PICKPOCKET)
{
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_BAD_TARGETS;
else if ((unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
return SPELL_FAILED_TARGET_NO_POCKETS;
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_BAD_TARGETS;
else if ((unitTarget->GetCreatureTypeMask() & CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) == 0)
return SPELL_FAILED_TARGET_NO_POCKETS;
}
// Not allow disarm unarmed player
@@ -1798,14 +1801,14 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
// corpseOwner and unit specific target checks
if (AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS && !unitTarget->ToPlayer())
return SPELL_FAILED_TARGET_NOT_PLAYER;
return SPELL_FAILED_TARGET_NOT_PLAYER;
if (!IsAllowingDeadTarget() && !unitTarget->IsAlive())
return SPELL_FAILED_TARGETS_DEAD;
return SPELL_FAILED_TARGETS_DEAD;
// check this flag only for implicit targets (chain and area), allow to explicitly target units for spells like Shield of Righteousness
if (implicit && AttributesEx6 & SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED && !unitTarget->CanFreeMove())
return SPELL_FAILED_BAD_TARGETS;
return SPELL_FAILED_BAD_TARGETS;
// checked in Unit::IsValidAttack/AssistTarget, shouldn't be checked for ENTRY targets
//if (!(AttributesEx6 & SPELL_ATTR6_CAN_TARGET_UNTARGETABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
@@ -1887,10 +1890,10 @@ SpellCastResult SpellInfo::CheckExplicitTarget(Unit const* caster, WorldObject c
if (caster->_IsValidAttackTarget(unitTarget, this))
return SPELL_CAST_OK;
if (neededTargets & TARGET_FLAG_UNIT_ALLY
|| (neededTargets & TARGET_FLAG_UNIT_PARTY && caster->IsInPartyWith(unitTarget))
|| (neededTargets & TARGET_FLAG_UNIT_RAID && caster->IsInRaidWith(unitTarget)))
if (caster->_IsValidAssistTarget(unitTarget, this))
return SPELL_CAST_OK;
|| (neededTargets & TARGET_FLAG_UNIT_PARTY && caster->IsInPartyWith(unitTarget))
|| (neededTargets & TARGET_FLAG_UNIT_RAID && caster->IsInRaidWith(unitTarget)))
if (caster->_IsValidAssistTarget(unitTarget, this))
return SPELL_CAST_OK;
if (neededTargets & TARGET_FLAG_UNIT_MINIPET)
if (unitTarget->GetGUID() == caster->GetCritterGUID())
return SPELL_CAST_OK;
@@ -1938,9 +1941,9 @@ uint32 SpellInfo::GetEffectMechanicMask(uint8 effIndex) const
{
uint32 mask = 0;
if (Mechanic)
mask |= 1<< Mechanic;
mask |= 1 << Mechanic;
if (Effects[effIndex].IsEffect() && Effects[effIndex].Mechanic)
mask |= 1<< Effects[effIndex].Mechanic;
mask |= 1 << Effects[effIndex].Mechanic;
return mask;
}
@@ -1948,10 +1951,10 @@ uint32 SpellInfo::GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
{
uint32 mask = 0;
if (Mechanic)
mask |= 1<< Mechanic;
mask |= 1 << Mechanic;
for (int i = 0; i < MAX_SPELL_EFFECTS; ++i)
if ((effectMask & (1 << i)) && Effects[i].Mechanic)
mask |= 1<< Effects[i].Mechanic;
mask |= 1 << Effects[i].Mechanic;
return mask;
}
@@ -2004,24 +2007,26 @@ AuraStateType SpellInfo::LoadAuraState() const
// Conflagrate aura state on Immolate and Shadowflame
if (SpellFamilyName == SPELLFAMILY_WARLOCK &&
// Immolate
((SpellFamilyFlags[0] & 4) ||
// Shadowflame
(SpellFamilyFlags[2] & 2)))
// Immolate
((SpellFamilyFlags[0] & 4) ||
// Shadowflame
(SpellFamilyFlags[2] & 2)))
return AURA_STATE_CONFLAGRATE;
// Faerie Fire (druid versions)
if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x400)
return AURA_STATE_FAERIE_FIRE;
// Any Spells that prevent spells can be added here.
uint32 StealthPreventionSpellList[] = { 9991, 35331, 9806, 35325 };
// Goes through each of the spells and identifies them as Stealth Prevention Spell.
for (uint32 i = 0; i < sizeof(StealthPreventionSpellList) / sizeof(uint32); i++) {
if (Id == StealthPreventionSpellList[i]) {
for (uint32 i = 0; i < sizeof(StealthPreventionSpellList) / sizeof(uint32); i++)
{
if (Id == StealthPreventionSpellList[i])
{
return AURA_STATE_FAERIE_FIRE;
}
}
}
// Sting (hunter's pet ability)
@@ -2045,13 +2050,13 @@ AuraStateType SpellInfo::LoadAuraState() const
return AURA_STATE_ENRAGE;
// Bleeding aura state
if (GetAllEffectsMechanicMask() & 1<<MECHANIC_BLEED)
if (GetAllEffectsMechanicMask() & 1 << MECHANIC_BLEED)
return AURA_STATE_BLEEDING;
if (GetSchoolMask() & SPELL_SCHOOL_MASK_FROST)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (Effects[i].IsAura() && (Effects[i].ApplyAuraName == SPELL_AURA_MOD_STUN
|| Effects[i].ApplyAuraName == SPELL_AURA_MOD_ROOT))
|| Effects[i].ApplyAuraName == SPELL_AURA_MOD_ROOT))
return AURA_STATE_FROZEN;
switch (Id)
@@ -2076,141 +2081,141 @@ SpellSpecificType SpellInfo::LoadSpellSpecific() const
switch (SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
// Food / Drinks (mostly)
if (AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED)
{
bool food = false;
bool drink = false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
// Food / Drinks (mostly)
if (AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED)
{
if (!Effects[i].IsAura())
continue;
switch (Effects[i].ApplyAuraName)
bool food = false;
bool drink = false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
// Food
case SPELL_AURA_MOD_REGEN:
case SPELL_AURA_OBS_MOD_HEALTH:
food = true;
break;
// Drink
case SPELL_AURA_MOD_POWER_REGEN:
case SPELL_AURA_OBS_MOD_POWER:
drink = true;
break;
default:
break;
if (!Effects[i].IsAura())
continue;
switch (Effects[i].ApplyAuraName)
{
// Food
case SPELL_AURA_MOD_REGEN:
case SPELL_AURA_OBS_MOD_HEALTH:
food = true;
break;
// Drink
case SPELL_AURA_MOD_POWER_REGEN:
case SPELL_AURA_OBS_MOD_POWER:
drink = true;
break;
default:
break;
}
}
if (food && drink)
return SPELL_SPECIFIC_FOOD_AND_DRINK;
else if (food)
return SPELL_SPECIFIC_FOOD;
else if (drink)
return SPELL_SPECIFIC_DRINK;
}
// scrolls effects
else
{
SpellInfo const* firstRankSpellInfo = GetFirstRankSpell();
switch (firstRankSpellInfo->Id)
{
case 8118: // Strength
case 8099: // Stamina
case 8112: // Spirit
case 8096: // Intellect
case 8115: // Agility
case 8091: // Armor
return SPELL_SPECIFIC_SCROLL;
}
}
if (food && drink)
return SPELL_SPECIFIC_FOOD_AND_DRINK;
else if (food)
return SPELL_SPECIFIC_FOOD;
else if (drink)
return SPELL_SPECIFIC_DRINK;
break;
}
// scrolls effects
else
{
SpellInfo const* firstRankSpellInfo = GetFirstRankSpell();
switch (firstRankSpellInfo->Id)
{
case 8118: // Strength
case 8099: // Stamina
case 8112: // Spirit
case 8096: // Intellect
case 8115: // Agility
case 8091: // Armor
return SPELL_SPECIFIC_SCROLL;
}
}
break;
}
case SPELLFAMILY_MAGE:
{
// family flags 18(Molten), 25(Frost/Ice), 28(Mage)
if (SpellFamilyFlags[0] & 0x12040000)
return SPELL_SPECIFIC_MAGE_ARMOR;
{
// family flags 18(Molten), 25(Frost/Ice), 28(Mage)
if (SpellFamilyFlags[0] & 0x12040000)
return SPELL_SPECIFIC_MAGE_ARMOR;
// Arcane brillance and Arcane intelect (normal check fails because of flags difference)
if (SpellFamilyFlags[0] & 0x400)
return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE;
// Arcane brillance and Arcane intelect (normal check fails because of flags difference)
if (SpellFamilyFlags[0] & 0x400)
return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE;
if ((SpellFamilyFlags[0] & 0x1000000) && Effects[0].ApplyAuraName == SPELL_AURA_MOD_CONFUSE)
return SPELL_SPECIFIC_MAGE_POLYMORPH;
if ((SpellFamilyFlags[0] & 0x1000000) && Effects[0].ApplyAuraName == SPELL_AURA_MOD_CONFUSE)
return SPELL_SPECIFIC_MAGE_POLYMORPH;
break;
}
break;
}
case SPELLFAMILY_WARLOCK:
{
// only warlock curses have this
if (Dispel == DISPEL_CURSE)
return SPELL_SPECIFIC_CURSE;
{
// only warlock curses have this
if (Dispel == DISPEL_CURSE)
return SPELL_SPECIFIC_CURSE;
// Warlock (Demon Armor | Demon Skin | Fel Armor)
if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010)
return SPELL_SPECIFIC_WARLOCK_ARMOR;
// Warlock (Demon Armor | Demon Skin | Fel Armor)
if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010)
return SPELL_SPECIFIC_WARLOCK_ARMOR;
//seed of corruption and corruption
if (SpellFamilyFlags[1] & 0x10 || SpellFamilyFlags[0] & 0x2)
return SPELL_SPECIFIC_WARLOCK_CORRUPTION;
break;
}
//seed of corruption and corruption
if (SpellFamilyFlags[1] & 0x10 || SpellFamilyFlags[0] & 0x2)
return SPELL_SPECIFIC_WARLOCK_CORRUPTION;
break;
}
case SPELLFAMILY_PRIEST:
{
// Divine Spirit and Prayer of Spirit
if (SpellFamilyFlags[0] & 0x20)
return SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT;
{
// Divine Spirit and Prayer of Spirit
if (SpellFamilyFlags[0] & 0x20)
return SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT;
break;
}
break;
}
case SPELLFAMILY_HUNTER:
{
// only hunter stings have this
if (Dispel == DISPEL_POISON)
return SPELL_SPECIFIC_STING;
{
// only hunter stings have this
if (Dispel == DISPEL_POISON)
return SPELL_SPECIFIC_STING;
// only hunter aspects have this (but not all aspects in hunter family)
if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010))
return SPELL_SPECIFIC_ASPECT;
// only hunter aspects have this (but not all aspects in hunter family)
if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010))
return SPELL_SPECIFIC_ASPECT;
break;
}
break;
}
case SPELLFAMILY_PALADIN:
{
// Collection of all the seal family flags. No other paladin spell has any of those.
if (SpellFamilyFlags[1] & 0x26000C00
|| SpellFamilyFlags[0] & 0x0A000000)
return SPELL_SPECIFIC_SEAL;
{
// Collection of all the seal family flags. No other paladin spell has any of those.
if (SpellFamilyFlags[1] & 0x26000C00
|| SpellFamilyFlags[0] & 0x0A000000)
return SPELL_SPECIFIC_SEAL;
if (SpellFamilyFlags[0] & 0x00002190)
return SPELL_SPECIFIC_HAND;
if (SpellFamilyFlags[0] & 0x00002190)
return SPELL_SPECIFIC_HAND;
// Judgement of Wisdom, Judgement of Light, Judgement of Justice
if (Id == 20184 || Id == 20185 || Id == 20186)
return SPELL_SPECIFIC_JUDGEMENT;
// Judgement of Wisdom, Judgement of Light, Judgement of Justice
if (Id == 20184 || Id == 20185 || Id == 20186)
return SPELL_SPECIFIC_JUDGEMENT;
// only paladin auras have this (for palaldin class family)
if (SpellFamilyFlags[2] & 0x00000020)
return SPELL_SPECIFIC_AURA;
// only paladin auras have this (for palaldin class family)
if (SpellFamilyFlags[2] & 0x00000020)
return SPELL_SPECIFIC_AURA;
// Illidari Council Paladin (Gathios the Shatterer)
if (Id == 41459 || Id == 41469)
return SPELL_SPECIFIC_SEAL;
// Illidari Council Paladin (Gathios the Shatterer)
if (Id == 41459 || Id == 41469)
return SPELL_SPECIFIC_SEAL;
break;
}
break;
}
case SPELLFAMILY_SHAMAN:
{
// family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus
if (SpellFamilyFlags[1] & 0x420
|| SpellFamilyFlags[0] & 0x00000400
|| Id == 23552)
return SPELL_SPECIFIC_ELEMENTAL_SHIELD;
{
// family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus
if (SpellFamilyFlags[1] & 0x420
|| SpellFamilyFlags[0] & 0x00000400
|| Id == 23552)
return SPELL_SPECIFIC_ELEMENTAL_SHIELD;
break;
}
break;
}
case SPELLFAMILY_DEATHKNIGHT:
if (Id == 48266 || Id == 48263 || Id == 48265)
return SPELL_SPECIFIC_PRESENCE;
@@ -2466,9 +2471,9 @@ SpellInfo const* SpellInfo::GetAuraRankForLevel(uint8 level) const
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (IsPositiveEffect(i) &&
(Effects[i].Effect == SPELL_EFFECT_APPLY_AURA ||
Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID))
(Effects[i].Effect == SPELL_EFFECT_APPLY_AURA ||
Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_PARTY ||
Effects[i].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID))
{
needRankSelection = true;
break;
@@ -2590,157 +2595,157 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
return false;
case SPELL_EFFECT_SCHOOL_DAMAGE:
{
bool only = true;
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
{
if (Effects[effIndex].Effect > 0 && Effects[effIndex].Effect != SPELL_EFFECT_SCHOOL_DAMAGE)
only = false;
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
bool only = true;
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
{
if (Effects[effIndex].Effect > 0 && Effects[effIndex].Effect != SPELL_EFFECT_SCHOOL_DAMAGE)
only = false;
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
return false;
}
// effects with school damage only cannot be positive...
if (only)
return false;
break;
}
// effects with school damage only cannot be positive...
if (only)
return false;
break;
}
case SPELL_EFFECT_KNOCK_BACK:
case SPELL_EFFECT_KNOCK_BACK_DEST:
{
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
return false;
break;
}
{
for (int i = EFFECT_0; i <= EFFECT_2; ++i)
if (Effects[effIndex].Effect == SPELL_EFFECT_GAMEOBJECT_DAMAGE)
return false;
break;
}
// non-positive aura use
// non-positive aura use
case SPELL_EFFECT_APPLY_AURA:
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
{
switch (Effects[effIndex].ApplyAuraName)
{
case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative)
case SPELL_AURA_MOD_STAT:
case SPELL_AURA_MOD_SKILL:
case SPELL_AURA_MOD_DODGE_PERCENT:
case SPELL_AURA_MOD_HEALING_PCT:
case SPELL_AURA_MOD_HEALING_DONE:
case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE:
if (Effects[effIndex].CalcValue() < 0)
return false;
break;
case SPELL_AURA_MOD_DAMAGE_TAKEN: // dependent from bas point sign (positive -> negative)
if (Effects[effIndex].CalcValue() > 0)
return false;
break;
case SPELL_AURA_MOD_CRIT_PCT:
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
if (Effects[effIndex].CalcValue() > 0)
return true; // some expected positive spells have SPELL_ATTR1_NEGATIVE
break;
case SPELL_AURA_ADD_TARGET_TRIGGER:
return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
if (!deep)
{
if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(Effects[effIndex].TriggerSpell))
{
// negative targets of main spell return early
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!spellTriggeredProto->Effects[i].Effect)
continue;
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
if (_IsPositiveTarget(spellTriggeredProto->Effects[i].TargetA.GetTarget(), spellTriggeredProto->Effects[i].TargetB.GetTarget()) && !spellTriggeredProto->_IsPositiveEffect(i, true))
return false;
}
}
}
case SPELL_AURA_PROC_TRIGGER_SPELL:
// many positive auras have negative triggered spells at damage for example and this not make it negative (it can be canceled for example)
break;
case SPELL_AURA_MOD_STUN: //have positive and negative spells, we can't sort its correctly at this moment.
if (effIndex == 0 && Effects[1].Effect == 0 && Effects[2].Effect == 0)
return false; // but all single stun aura spells is negative
break;
case SPELL_AURA_MOD_PACIFY_SILENCE:
if (Id == 24740) // Wisp Costume
return true;
return false;
case SPELL_AURA_MOD_ROOT:
case SPELL_AURA_MOD_SILENCE:
case SPELL_AURA_GHOST:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_MOD_STALKED:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_PREVENT_RESURRECTION:
return false;
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
// part of negative spell if casted at self (prevent cancel)
if (Effects[effIndex].TargetA.GetTarget() == TARGET_UNIT_CASTER)
return false;
break;
case SPELL_AURA_MOD_DECREASE_SPEED: // used in positive spells also
// part of positive spell if casted at self
if (Effects[effIndex].TargetA.GetTarget() != TARGET_UNIT_CASTER)
return false;
// but not this if this first effect (didn't find better check)
if (Attributes & SPELL_ATTR0_NEGATIVE_1 && effIndex == 0)
return false;
break;
case SPELL_AURA_MECHANIC_IMMUNITY:
switch (Effects[effIndex].ApplyAuraName)
{
// non-positive immunities
switch (Effects[effIndex].MiscValue)
{
case MECHANIC_BANDAGE:
case MECHANIC_SHIELD:
case MECHANIC_MOUNT:
case MECHANIC_INVULNERABILITY:
case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative)
case SPELL_AURA_MOD_STAT:
case SPELL_AURA_MOD_SKILL:
case SPELL_AURA_MOD_DODGE_PERCENT:
case SPELL_AURA_MOD_HEALING_PCT:
case SPELL_AURA_MOD_HEALING_DONE:
case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE:
if (Effects[effIndex].CalcValue() < 0)
return false;
default:
break;
}
break;
}
case SPELL_AURA_ADD_FLAT_MODIFIER: // mods
case SPELL_AURA_ADD_PCT_MODIFIER:
{
// non-positive mods
switch (Effects[effIndex].MiscValue)
{
case SPELLMOD_COST: // dependent from bas point sign (negative -> positive)
if (Effects[effIndex].CalcValue() > 0)
break;
case SPELL_AURA_MOD_DAMAGE_TAKEN: // dependent from bas point sign (positive -> negative)
if (Effects[effIndex].CalcValue() > 0)
return false;
break;
case SPELL_AURA_MOD_CRIT_PCT:
case SPELL_AURA_MOD_SPELL_CRIT_CHANCE:
if (Effects[effIndex].CalcValue() > 0)
return true; // some expected positive spells have SPELL_ATTR1_NEGATIVE
break;
case SPELL_AURA_ADD_TARGET_TRIGGER:
return true;
case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
if (!deep)
{
if (SpellInfo const* spellTriggeredProto = sSpellMgr->GetSpellInfo(Effects[effIndex].TriggerSpell))
{
if (!deep)
// negative targets of main spell return early
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
bool negative = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (i != effIndex)
if (_IsPositiveEffect(i, true))
{
negative = false;
break;
}
}
if (negative)
if (!spellTriggeredProto->Effects[i].Effect)
continue;
// if non-positive trigger cast targeted to positive target this main cast is non-positive
// this will place this spell auras as debuffs
if (_IsPositiveTarget(spellTriggeredProto->Effects[i].TargetA.GetTarget(), spellTriggeredProto->Effects[i].TargetB.GetTarget()) && !spellTriggeredProto->_IsPositiveEffect(i, true))
return false;
}
}
}
case SPELL_AURA_PROC_TRIGGER_SPELL:
// many positive auras have negative triggered spells at damage for example and this not make it negative (it can be canceled for example)
break;
case SPELL_AURA_MOD_STUN: //have positive and negative spells, we can't sort its correctly at this moment.
if (effIndex == 0 && Effects[1].Effect == 0 && Effects[2].Effect == 0)
return false; // but all single stun aura spells is negative
break;
case SPELL_AURA_MOD_PACIFY_SILENCE:
if (Id == 24740) // Wisp Costume
return true;
return false;
case SPELL_AURA_MOD_ROOT:
case SPELL_AURA_MOD_SILENCE:
case SPELL_AURA_GHOST:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_MOD_STALKED:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_PREVENT_RESURRECTION:
return false;
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
// part of negative spell if casted at self (prevent cancel)
if (Effects[effIndex].TargetA.GetTarget() == TARGET_UNIT_CASTER)
return false;
break;
case SPELL_AURA_MOD_DECREASE_SPEED: // used in positive spells also
// part of positive spell if casted at self
if (Effects[effIndex].TargetA.GetTarget() != TARGET_UNIT_CASTER)
return false;
// but not this if this first effect (didn't find better check)
if (Attributes & SPELL_ATTR0_NEGATIVE_1 && effIndex == 0)
return false;
break;
case SPELL_AURA_MECHANIC_IMMUNITY:
{
// non-positive immunities
switch (Effects[effIndex].MiscValue)
{
case MECHANIC_BANDAGE:
case MECHANIC_SHIELD:
case MECHANIC_MOUNT:
case MECHANIC_INVULNERABILITY:
return false;
default:
break;
}
break;
default:
}
case SPELL_AURA_ADD_FLAT_MODIFIER: // mods
case SPELL_AURA_ADD_PCT_MODIFIER:
{
// non-positive mods
switch (Effects[effIndex].MiscValue)
{
case SPELLMOD_COST: // dependent from bas point sign (negative -> positive)
if (Effects[effIndex].CalcValue() > 0)
{
if (!deep)
{
bool negative = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (i != effIndex)
if (_IsPositiveEffect(i, true))
{
negative = false;
break;
}
}
if (negative)
return false;
}
}
break;
default:
break;
}
break;
}
break;
}
default:
break;
}
default:
break;
break;
}
break;
}
default:
break;
}

View File

@@ -54,7 +54,7 @@ enum SpellCastTargetFlags
TARGET_FLAG_UNIT_PASSENGER = 0x00100000, // guessed, used to validate target (if vehicle passenger)
TARGET_FLAG_UNIT_MASK = TARGET_FLAG_UNIT | TARGET_FLAG_UNIT_RAID | TARGET_FLAG_UNIT_PARTY
| TARGET_FLAG_UNIT_ENEMY | TARGET_FLAG_UNIT_ALLY | TARGET_FLAG_UNIT_DEAD | TARGET_FLAG_UNIT_MINIPET | TARGET_FLAG_UNIT_PASSENGER,
| TARGET_FLAG_UNIT_ENEMY | TARGET_FLAG_UNIT_ALLY | TARGET_FLAG_UNIT_DEAD | TARGET_FLAG_UNIT_MINIPET | TARGET_FLAG_UNIT_PASSENGER,
TARGET_FLAG_GAMEOBJECT_MASK = TARGET_FLAG_GAMEOBJECT | TARGET_FLAG_GAMEOBJECT_ITEM,
TARGET_FLAG_CORPSE_MASK = TARGET_FLAG_CORPSE_ALLY | TARGET_FLAG_CORPSE_ENEMY,
TARGET_FLAG_ITEM_MASK = TARGET_FLAG_TRADE_ITEM | TARGET_FLAG_ITEM | TARGET_FLAG_GAMEOBJECT_ITEM,
@@ -255,9 +255,9 @@ public:
std::list<Condition*>* ImplicitTargetConditions;
SpellEffectInfo() : _spellInfo(nullptr), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0),
RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0),
BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(nullptr), ChainTarget(0),
ItemType(0), TriggerSpell(0), ImplicitTargetConditions(nullptr) {}
RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0),
BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(nullptr), ChainTarget(0),
ItemType(0), TriggerSpell(0), ImplicitTargetConditions(nullptr) {}
SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex);
bool IsEffect() const;

File diff suppressed because it is too large Load Diff

View File

@@ -134,37 +134,37 @@ enum ProcFlags
// flag masks
AUTO_ATTACK_PROC_FLAG_MASK = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
| PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK,
| PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK,
MELEE_PROC_FLAG_MASK = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
| PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
| PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK,
| PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
| PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK,
RANGED_PROC_FLAG_MASK = PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK
| PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS,
| PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS,
SPELL_PROC_FLAG_MASK = PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
| PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG,
| PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG,
SPELL_CAST_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION | RANGED_PROC_FLAG_MASK,
PERIODIC_PROC_FLAG_MASK = PROC_FLAG_DONE_PERIODIC | PROC_FLAG_TAKEN_PERIODIC,
DONE_HIT_PROC_FLAG_MASK = PROC_FLAG_DONE_MELEE_AUTO_ATTACK | PROC_FLAG_DONE_RANGED_AUTO_ATTACK
| PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
| PROC_FLAG_DONE_PERIODIC | PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK,
| PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
| PROC_FLAG_DONE_PERIODIC | PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK,
TAKEN_HIT_PROC_FLAG_MASK = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK
| PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
| PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_TAKEN_DAMAGE,
| PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
| PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_TAKEN_DAMAGE,
REQ_SPELL_PHASE_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK & DONE_HIT_PROC_FLAG_MASK,
};
@@ -318,9 +318,9 @@ enum SpellGroupSpecialFlags
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_GUARDIAN = 0x002,
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_UNSTABLE = 0x004,
SPELL_GROUP_SPECIAL_FLAG_ELIXIR_SHATTRATH = 0x008,
SPELL_GROUP_SPECIAL_FLAG_STACK_EXCLUSIVE_MAX= 0x00F,
SPELL_GROUP_SPECIAL_FLAG_STACK_EXCLUSIVE_MAX = 0x00F,
SPELL_GROUP_SPECIAL_FLAG_FORCED_STRONGEST = 0x010, // xinef: specially helpful flag if some spells have different auras, but only one should be present
SPELL_GROUP_SPECIAL_FLAG_SKIP_STRONGER_CHECK= 0x020,
SPELL_GROUP_SPECIAL_FLAG_SKIP_STRONGER_CHECK = 0x020,
SPELL_GROUP_SPECIAL_FLAG_BASE_AMOUNT_CHECK = 0x040,
SPELL_GROUP_SPECIAL_FLAG_PRIORITY1 = 0x100,
SPELL_GROUP_SPECIAL_FLAG_PRIORITY2 = 0x200,
@@ -440,51 +440,51 @@ enum EffectRadiusIndex
// Spell pet auras
class PetAura
{
private:
typedef std::unordered_map<uint32, uint32> PetAuraMap;
private:
typedef std::unordered_map<uint32, uint32> PetAuraMap;
public:
PetAura() : removeOnChangePet(false), damage(0)
{
auras.clear();
}
public:
PetAura() : removeOnChangePet(false), damage(0)
{
auras.clear();
}
PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, int _damage) :
PetAura(uint32 petEntry, uint32 aura, bool _removeOnChangePet, int _damage) :
removeOnChangePet(_removeOnChangePet), damage(_damage)
{
auras[petEntry] = aura;
}
{
auras[petEntry] = aura;
}
uint32 GetAura(uint32 petEntry) const
{
PetAuraMap::const_iterator itr = auras.find(petEntry);
if (itr != auras.end())
return itr->second;
PetAuraMap::const_iterator itr2 = auras.find(0);
if (itr2 != auras.end())
return itr2->second;
return 0;
}
uint32 GetAura(uint32 petEntry) const
{
PetAuraMap::const_iterator itr = auras.find(petEntry);
if (itr != auras.end())
return itr->second;
PetAuraMap::const_iterator itr2 = auras.find(0);
if (itr2 != auras.end())
return itr2->second;
return 0;
}
void AddAura(uint32 petEntry, uint32 aura)
{
auras[petEntry] = aura;
}
void AddAura(uint32 petEntry, uint32 aura)
{
auras[petEntry] = aura;
}
bool IsRemovedOnChangePet() const
{
return removeOnChangePet;
}
bool IsRemovedOnChangePet() const
{
return removeOnChangePet;
}
int32 GetDamage() const
{
return damage;
}
int32 GetDamage() const
{
return damage;
}
private:
PetAuraMap auras;
bool removeOnChangePet;
int32 damage;
private:
PetAuraMap auras;
bool removeOnChangePet;
int32 damage;
};
typedef std::map<uint32, PetAura> SpellPetAuraMap;
@@ -601,159 +601,159 @@ typedef std::set<uint32> TalentAdditionalSet;
class SpellMgr
{
// Constructors
private:
SpellMgr();
~SpellMgr();
private:
SpellMgr();
~SpellMgr();
// Accessors (const or static functions)
public:
static SpellMgr* instance();
public:
static SpellMgr* instance();
// Spell correctness for client using
static bool ComputeIsSpellValid(SpellInfo const* spellInfo, bool msg = true);
static bool IsSpellValid(SpellInfo const* spellInfo);
static bool CheckSpellValid(SpellInfo const* spellInfo, uint32 spellId, bool isTalent);
// Spell correctness for client using
static bool ComputeIsSpellValid(SpellInfo const* spellInfo, bool msg = true);
static bool IsSpellValid(SpellInfo const* spellInfo);
static bool CheckSpellValid(SpellInfo const* spellInfo, uint32 spellId, bool isTalent);
// Spell difficulty
uint32 GetSpellDifficultyId(uint32 spellId) const;
void SetSpellDifficultyId(uint32 spellId, uint32 id);
uint32 GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) const;
SpellInfo const* GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const;
// Spell difficulty
uint32 GetSpellDifficultyId(uint32 spellId) const;
void SetSpellDifficultyId(uint32 spellId, uint32 id);
uint32 GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) const;
SpellInfo const* GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const;
// Spell Ranks table
SpellChainNode const* GetSpellChainNode(uint32 spell_id) const;
uint32 GetFirstSpellInChain(uint32 spell_id) const;
uint32 GetLastSpellInChain(uint32 spell_id) const;
uint32 GetNextSpellInChain(uint32 spell_id) const;
uint32 GetPrevSpellInChain(uint32 spell_id) const;
uint8 GetSpellRank(uint32 spell_id) const;
// not strict check returns provided spell if rank not avalible
uint32 GetSpellWithRank(uint32 spell_id, uint32 rank, bool strict = false) const;
// Spell Ranks table
SpellChainNode const* GetSpellChainNode(uint32 spell_id) const;
uint32 GetFirstSpellInChain(uint32 spell_id) const;
uint32 GetLastSpellInChain(uint32 spell_id) const;
uint32 GetNextSpellInChain(uint32 spell_id) const;
uint32 GetPrevSpellInChain(uint32 spell_id) const;
uint8 GetSpellRank(uint32 spell_id) const;
// not strict check returns provided spell if rank not avalible
uint32 GetSpellWithRank(uint32 spell_id, uint32 rank, bool strict = false) const;
// Spell Required table
SpellRequiredMapBounds GetSpellsRequiredForSpellBounds(uint32 spell_id) const;
SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const;
bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const;
// Spell Required table
SpellRequiredMapBounds GetSpellsRequiredForSpellBounds(uint32 spell_id) const;
SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const;
bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const;
// Spell learning
SpellLearnSkillNode const* GetSpellLearnSkill(uint32 spell_id) const;
// Spell learning
SpellLearnSkillNode const* GetSpellLearnSkill(uint32 spell_id) const;
// Spell target coordinates
SpellTargetPosition const* GetSpellTargetPosition(uint32 spell_id, SpellEffIndex effIndex) const;
// Spell target coordinates
SpellTargetPosition const* GetSpellTargetPosition(uint32 spell_id, SpellEffIndex effIndex) const;
// Spell Groups
uint32 GetSpellGroup(uint32 spellid) const;
SpellGroupSpecialFlags GetSpellGroupSpecialFlags(uint32 spell_id) const;
SpellGroupStackFlags GetGroupStackFlags(uint32 groupid) const;
SpellGroupStackFlags CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2, bool remove, bool areaAura) const;
void GetSetOfSpellsInSpellGroupWithFlag(uint32 group_id, SpellGroupSpecialFlags flag, std::set<uint32>& availableElixirs) const;
// Spell Groups
uint32 GetSpellGroup(uint32 spellid) const;
SpellGroupSpecialFlags GetSpellGroupSpecialFlags(uint32 spell_id) const;
SpellGroupStackFlags GetGroupStackFlags(uint32 groupid) const;
SpellGroupStackFlags CheckSpellGroupStackRules(SpellInfo const* spellInfo1, SpellInfo const* spellInfo2, bool remove, bool areaAura) const;
void GetSetOfSpellsInSpellGroupWithFlag(uint32 group_id, SpellGroupSpecialFlags flag, std::set<uint32>& availableElixirs) const;
// Spell proc event table
SpellProcEventEntry const* GetSpellProcEvent(uint32 spellId) const;
bool IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellInfo const* procSpell, uint32 procFlags, uint32 procExtra, bool active) const;
// Spell proc event table
SpellProcEventEntry const* GetSpellProcEvent(uint32 spellId) const;
bool IsSpellProcEventCanTriggeredBy(SpellInfo const* spellProto, SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellInfo const* procSpell, uint32 procFlags, uint32 procExtra, bool active) const;
// Spell proc table
SpellProcEntry const* GetSpellProcEntry(uint32 spellId) const;
bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
// Spell proc table
SpellProcEntry const* GetSpellProcEntry(uint32 spellId) const;
bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
// Spell bonus data table
SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const;
// Spell bonus data table
SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const;
// Spell threat table
SpellThreatEntry const* GetSpellThreatEntry(uint32 spellID) const;
// Spell threat table
SpellThreatEntry const* GetSpellThreatEntry(uint32 spellID) const;
// Spell mixology table
float GetSpellMixologyBonus(uint32 spellId) const;
// Spell mixology table
float GetSpellMixologyBonus(uint32 spellId) const;
SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds(uint32 spell_id) const;
SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds(uint32 spell_id) const;
PetAura const* GetPetAura(uint32 spell_id, uint8 eff) const;
PetAura const* GetPetAura(uint32 spell_id, uint8 eff) const;
SpellEnchantProcEntry const* GetSpellEnchantProcEvent(uint32 enchId) const;
bool IsArenaAllowedEnchancment(uint32 ench_id) const;
SpellEnchantProcEntry const* GetSpellEnchantProcEvent(uint32 enchId) const;
bool IsArenaAllowedEnchancment(uint32 ench_id) const;
const std::vector<int32> *GetSpellLinked(int32 spell_id) const;
const std::vector<int32>* GetSpellLinked(int32 spell_id) const;
PetLevelupSpellSet const* GetPetLevelupSpellList(uint32 petFamily) const;
PetDefaultSpellsEntry const* GetPetDefaultSpellsEntry(int32 id) const;
PetLevelupSpellSet const* GetPetLevelupSpellList(uint32 petFamily) const;
PetDefaultSpellsEntry const* GetPetDefaultSpellsEntry(int32 id) const;
// Spell area
SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const;
SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id) const;
SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const;
SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const;
SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const;
// Spell area
SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const;
SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id) const;
SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const;
SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const;
SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const;
// SpellInfo object management
SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); }
// SpellInfo object management
SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); }
// Talent Additional Set
bool IsAdditionalTalentSpell(uint32 spellId) const;
// Talent Additional Set
bool IsAdditionalTalentSpell(uint32 spellId) const;
private:
SpellInfo* _GetSpellInfo(uint32 spellId) { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
private:
SpellInfo* _GetSpellInfo(uint32 spellId) { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : nullptr; }
// Modifiers
public:
public:
// Loading data at server startup
void UnloadSpellInfoChains();
void LoadSpellTalentRanks();
void LoadSpellRanks();
void LoadSpellRequired();
void LoadSpellLearnSkills();
void LoadSpellTargetPositions();
void LoadSpellGroups();
void LoadSpellGroupStackRules();
void LoadSpellProcEvents();
void LoadSpellProcs();
void LoadSpellBonusess();
void LoadSpellThreats();
void LoadSpellMixology();
void LoadSkillLineAbilityMap();
void LoadSpellPetAuras();
void LoadEnchantCustomAttr();
void LoadSpellEnchantProcData();
void LoadSpellLinked();
void LoadPetLevelupSpellMap();
void LoadPetDefaultSpells();
void LoadSpellAreas();
void LoadSpellInfoStore();
void UnloadSpellInfoStore();
void UnloadSpellInfoImplicitTargetConditionLists();
void LoadSpellCustomAttr();
void LoadDbcDataCorrections();
void LoadSpellSpecificAndAuraState();
// Loading data at server startup
void UnloadSpellInfoChains();
void LoadSpellTalentRanks();
void LoadSpellRanks();
void LoadSpellRequired();
void LoadSpellLearnSkills();
void LoadSpellTargetPositions();
void LoadSpellGroups();
void LoadSpellGroupStackRules();
void LoadSpellProcEvents();
void LoadSpellProcs();
void LoadSpellBonusess();
void LoadSpellThreats();
void LoadSpellMixology();
void LoadSkillLineAbilityMap();
void LoadSpellPetAuras();
void LoadEnchantCustomAttr();
void LoadSpellEnchantProcData();
void LoadSpellLinked();
void LoadPetLevelupSpellMap();
void LoadPetDefaultSpells();
void LoadSpellAreas();
void LoadSpellInfoStore();
void UnloadSpellInfoStore();
void UnloadSpellInfoImplicitTargetConditionLists();
void LoadSpellCustomAttr();
void LoadDbcDataCorrections();
void LoadSpellSpecificAndAuraState();
private:
SpellDifficultySearcherMap mSpellDifficultySearcherMap;
SpellChainMap mSpellChains;
SpellsRequiringSpellMap mSpellsReqSpell;
SpellRequiredMap mSpellReq;
SpellLearnSkillMap mSpellLearnSkills;
SpellTargetPositionMap mSpellTargetPositions;
SpellGroupMap mSpellGroupMap;
SpellGroupStackMap mSpellGroupStackMap;
SpellProcEventMap mSpellProcEventMap;
SpellProcMap mSpellProcMap;
SpellBonusMap mSpellBonusMap;
SpellThreatMap mSpellThreatMap;
SpellMixologyMap mSpellMixologyMap;
SpellPetAuraMap mSpellPetAuraMap;
SpellLinkedMap mSpellLinkedMap;
SpellEnchantProcEventMap mSpellEnchantProcEventMap;
EnchantCustomAttribute mEnchantCustomAttr;
SpellAreaMap mSpellAreaMap;
SpellAreaForQuestMap mSpellAreaForQuestMap;
SpellAreaForQuestMap mSpellAreaForQuestEndMap;
SpellAreaForAuraMap mSpellAreaForAuraMap;
SpellAreaForAreaMap mSpellAreaForAreaMap;
SkillLineAbilityMap mSkillLineAbilityMap;
PetLevelupSpellMap mPetLevelupSpellMap;
PetDefaultSpellsMap mPetDefaultSpellsMap; // only spells not listed in related mPetLevelupSpellMap entry
SpellInfoMap mSpellInfoMap;
TalentAdditionalSet mTalentSpellAdditionalSet;
private:
SpellDifficultySearcherMap mSpellDifficultySearcherMap;
SpellChainMap mSpellChains;
SpellsRequiringSpellMap mSpellsReqSpell;
SpellRequiredMap mSpellReq;
SpellLearnSkillMap mSpellLearnSkills;
SpellTargetPositionMap mSpellTargetPositions;
SpellGroupMap mSpellGroupMap;
SpellGroupStackMap mSpellGroupStackMap;
SpellProcEventMap mSpellProcEventMap;
SpellProcMap mSpellProcMap;
SpellBonusMap mSpellBonusMap;
SpellThreatMap mSpellThreatMap;
SpellMixologyMap mSpellMixologyMap;
SpellPetAuraMap mSpellPetAuraMap;
SpellLinkedMap mSpellLinkedMap;
SpellEnchantProcEventMap mSpellEnchantProcEventMap;
EnchantCustomAttribute mEnchantCustomAttr;
SpellAreaMap mSpellAreaMap;
SpellAreaForQuestMap mSpellAreaForQuestMap;
SpellAreaForQuestMap mSpellAreaForQuestEndMap;
SpellAreaForAuraMap mSpellAreaForAuraMap;
SpellAreaForAreaMap mSpellAreaForAreaMap;
SkillLineAbilityMap mSkillLineAbilityMap;
PetLevelupSpellMap mPetLevelupSpellMap;
PetDefaultSpellsMap mPetDefaultSpellsMap; // only spells not listed in related mPetLevelupSpellMap entry
SpellInfoMap mSpellInfoMap;
TalentAdditionalSet mTalentSpellAdditionalSet;
};
#define sSpellMgr SpellMgr::instance()

View File

@@ -63,20 +63,20 @@ uint8 _SpellScript::EffectHook::GetAffectedEffectsMask(SpellInfo const* spellEnt
if ((effIndex == EFFECT_FIRST_FOUND) && mask)
return mask;
if (CheckEffect(spellEntry, i))
mask |= (uint8)1<<i;
mask |= (uint8)1 << i;
}
}
else
{
if (CheckEffect(spellEntry, effIndex))
mask |= (uint8)1<<effIndex;
mask |= (uint8)1 << effIndex;
}
return mask;
}
bool _SpellScript::EffectHook::IsEffectAffected(SpellInfo const* spellEntry, uint8 effIndex)
{
return GetAffectedEffectsMask(spellEntry) & 1<<effIndex;
return GetAffectedEffectsMask(spellEntry) & 1 << effIndex;
}
std::string _SpellScript::EffectHook::EffIndexToString()
@@ -169,7 +169,7 @@ SpellScript::EffectHandler::EffectHandler(SpellEffectFnType _pEffectHandlerScrip
std::string SpellScript::EffectHandler::ToString()
{
return "Index: " + EffIndexToString() + " Name: " +_SpellScript::EffectNameCheck::ToString();
return "Index: " + EffIndexToString() + " Name: " + _SpellScript::EffectNameCheck::ToString();
}
bool SpellScript::EffectHandler::CheckEffect(SpellInfo const* spellEntry, uint8 effIndex)
@@ -208,7 +208,7 @@ bool SpellScript::TargetHook::CheckEffect(SpellInfo const* spellEntry, uint8 eff
return false;
if (spellEntry->Effects[effIndex].TargetA.GetTarget() != targetType &&
spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType)
spellEntry->Effects[effIndex].TargetB.GetTarget() != targetType)
return false;
SpellImplicitTargetInfo targetInfo(targetType);
@@ -368,12 +368,12 @@ bool SpellScript::IsInEffectHook() const
Unit* SpellScript::GetCaster()
{
return m_spell->GetCaster();
return m_spell->GetCaster();
}
Unit* SpellScript::GetOriginalCaster()
{
return m_spell->GetOriginalCaster();
return m_spell->GetOriginalCaster();
}
SpellInfo const* SpellScript::GetSpellInfo()
@@ -756,7 +756,7 @@ bool AuraScript::EffectBase::CheckEffect(SpellInfo const* spellEntry, uint8 effI
std::string AuraScript::EffectBase::ToString()
{
return "Index: " + EffIndexToString() + " AuraName: " +_SpellScript::EffectAuraNameCheck::ToString();
return "Index: " + EffIndexToString() + " AuraName: " + _SpellScript::EffectAuraNameCheck::ToString();
}
AuraScript::EffectPeriodicHandler::EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName)

File diff suppressed because it is too large Load Diff