mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
refactor(Core/Spell): Pascal Case some SpellEntry types (#4432)
This commit is contained in:
@@ -42,7 +42,7 @@ class Aura;
|
||||
// AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK set - aura is recalculated or is just applied/removed - need to redo all things related to m_amount
|
||||
// AURA_EFFECT_HANDLE_CHANGE_AMOUNT_SEND_FOR_CLIENT_MASK - logical or of above conditions
|
||||
// AURA_EFFECT_HANDLE_STAT - set when stats are reapplied
|
||||
// such checks will speedup trinity change amount/send for client operations
|
||||
// such checks will Speedup trinity change amount/send for client operations
|
||||
// because for change amount operation packets will not be send
|
||||
// aura effect handlers shouldn't contain any AuraEffect or Aura object modifications
|
||||
|
||||
@@ -241,7 +241,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS] =
|
||||
&AuraEffect::HandleNoImmediateEffect, //190 SPELL_AURA_MOD_FACTION_REPUTATION_GAIN implemented in Player::CalculateReputationGain
|
||||
&AuraEffect::HandleAuraModUseNormalSpeed, //191 SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
|
||||
&AuraEffect::HandleModMeleeRangedSpeedPct, //192 SPELL_AURA_MOD_MELEE_RANGED_HASTE
|
||||
&AuraEffect::HandleModCombatSpeedPct, //193 SPELL_AURA_MELEE_SLOW (in fact combat (any type attack) speed pct)
|
||||
&AuraEffect::HandleModCombatSpeedPct, //193 SPELL_AURA_MELEE_SLOW (in fact combat (any type attack) Speed pct)
|
||||
&AuraEffect::HandleNoImmediateEffect, //194 SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist
|
||||
&AuraEffect::HandleNoImmediateEffect, //195 SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL implemented in Unit::CalcAbsorbResist
|
||||
&AuraEffect::HandleNoImmediateEffect, //196 SPELL_AURA_MOD_COOLDOWN - flat mod of spell cooldowns
|
||||
@@ -4227,15 +4227,15 @@ void AuraEffect::HandleAuraModIncreaseEnergy(AuraApplication const* aurApp, uint
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
Powers PowerType = Powers(GetMiscValue());
|
||||
// do not check power type, we can always modify the maximum
|
||||
// as the client will not see any difference
|
||||
// also, placing conditions that may change during the aura duration
|
||||
// inside effect handlers is not a good idea
|
||||
//if (int32(powerType) != GetMiscValue())
|
||||
//if (int32(PowerType) != GetMiscValue())
|
||||
// return;
|
||||
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + PowerType);
|
||||
|
||||
target->HandleStatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
}
|
||||
@@ -4247,25 +4247,25 @@ void AuraEffect::HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurAp
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
Powers PowerType = Powers(GetMiscValue());
|
||||
// do not check power type, we can always modify the maximum
|
||||
// as the client will not see any difference
|
||||
// also, placing conditions that may change during the aura duration
|
||||
// inside effect handlers is not a good idea
|
||||
//if (int32(powerType) != GetMiscValue())
|
||||
//if (int32(PowerType) != GetMiscValue())
|
||||
// return;
|
||||
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + PowerType);
|
||||
float amount = float(GetAmount());
|
||||
|
||||
if (apply)
|
||||
{
|
||||
target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
|
||||
target->ModifyPowerPct(powerType, amount, apply);
|
||||
target->ModifyPowerPct(PowerType, amount, apply);
|
||||
}
|
||||
else
|
||||
{
|
||||
target->ModifyPowerPct(powerType, amount, apply);
|
||||
target->ModifyPowerPct(PowerType, amount, apply);
|
||||
target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
|
||||
}
|
||||
}
|
||||
@@ -4715,7 +4715,7 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode,
|
||||
}
|
||||
}
|
||||
|
||||
// Skip non magic case for speedup
|
||||
// Skip non magic case for Speedup
|
||||
if ((GetMiscValue() & SPELL_SCHOOL_MASK_MAGIC) == 0)
|
||||
return;
|
||||
|
||||
@@ -6511,9 +6511,9 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
|
||||
|
||||
void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
Powers PowerType = Powers(GetMiscValue());
|
||||
|
||||
if (!caster || !caster->IsAlive() || !target->IsAlive() || target->getPowerType() != powerType)
|
||||
if (!caster || !caster->IsAlive() || !target->IsAlive() || target->getPowerType() != PowerType)
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamageOrSchool(GetSpellInfo()))
|
||||
@@ -6534,8 +6534,8 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
if (m_spellInfo->ManaCostPercentage)
|
||||
{
|
||||
// max value
|
||||
int32 maxmana = CalculatePct(caster->GetMaxPower(powerType), drainAmount * 2.0f);
|
||||
ApplyPct(drainAmount, target->GetMaxPower(powerType));
|
||||
int32 maxmana = CalculatePct(caster->GetMaxPower(PowerType), drainAmount * 2.0f);
|
||||
ApplyPct(drainAmount, target->GetMaxPower(PowerType));
|
||||
if (drainAmount > maxmana)
|
||||
drainAmount = maxmana;
|
||||
}
|
||||
@@ -6545,10 +6545,10 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId());
|
||||
#endif
|
||||
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
|
||||
if (powerType == POWER_MANA)
|
||||
if (PowerType == POWER_MANA)
|
||||
drainAmount -= target->GetSpellCritDamageReduction(drainAmount);
|
||||
|
||||
int32 drainedAmount = -target->ModifyPower(powerType, -drainAmount);
|
||||
int32 drainedAmount = -target->ModifyPower(PowerType, -drainAmount);
|
||||
|
||||
float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
|
||||
|
||||
@@ -6559,7 +6559,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
int32 gainedAmount = 0;
|
||||
if (gainAmount)
|
||||
{
|
||||
gainedAmount = caster->ModifyPower(powerType, gainAmount);
|
||||
gainedAmount = caster->ModifyPower(PowerType, gainAmount);
|
||||
target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
|
||||
}
|
||||
|
||||
@@ -6586,13 +6586,13 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
|
||||
|
||||
void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
Powers powerType;
|
||||
Powers PowerType;
|
||||
if (GetMiscValue() == POWER_ALL)
|
||||
powerType = target->getPowerType();
|
||||
PowerType = target->getPowerType();
|
||||
else
|
||||
powerType = Powers(GetMiscValue());
|
||||
PowerType = Powers(GetMiscValue());
|
||||
|
||||
if (!target->IsAlive() || !target->GetMaxPower(powerType))
|
||||
if (!target->IsAlive() || !target->GetMaxPower(PowerType))
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
@@ -6602,11 +6602,11 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
}
|
||||
|
||||
// don't regen when permanent aura target has full power
|
||||
if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
|
||||
if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
|
||||
return;
|
||||
|
||||
// ignore negative values (can be result apply spellmods to aura damage
|
||||
uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) / 100;
|
||||
uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(PowerType) / 100;
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
|
||||
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId());
|
||||
@@ -6614,7 +6614,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false);
|
||||
target->SendPeriodicAuraLog(&pInfo);
|
||||
|
||||
int32 gain = target->ModifyPower(powerType, amount);
|
||||
int32 gain = target->ModifyPower(PowerType, amount);
|
||||
|
||||
if (caster)
|
||||
target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
@@ -6622,12 +6622,12 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const
|
||||
|
||||
void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
Powers PowerType = Powers(GetMiscValue());
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() != powerType && !m_spellInfo->HasAttribute(SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() != PowerType && !m_spellInfo->HasAttribute(SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
|
||||
return;
|
||||
|
||||
if (!target->IsAlive() || !target->GetMaxPower(powerType))
|
||||
if (!target->IsAlive() || !target->GetMaxPower(PowerType))
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED))
|
||||
@@ -6637,7 +6637,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
}
|
||||
|
||||
// don't regen when permanent aura target has full power
|
||||
if (GetBase()->IsPermanent() && target->GetPower(powerType) == target->GetMaxPower(powerType))
|
||||
if (GetBase()->IsPermanent() && target->GetPower(PowerType) == target->GetMaxPower(PowerType))
|
||||
return;
|
||||
|
||||
// ignore negative values (can be result apply spellmods to aura damage
|
||||
@@ -6650,7 +6650,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u",
|
||||
GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId());
|
||||
#endif
|
||||
int32 gain = target->ModifyPower(powerType, amount);
|
||||
int32 gain = target->ModifyPower(PowerType, amount);
|
||||
|
||||
if (caster)
|
||||
target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellInfo());
|
||||
@@ -6658,9 +6658,9 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
|
||||
|
||||
void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) const
|
||||
{
|
||||
Powers powerType = Powers(GetMiscValue());
|
||||
Powers PowerType = Powers(GetMiscValue());
|
||||
|
||||
if (!caster || !target->IsAlive() || target->getPowerType() != powerType)
|
||||
if (!caster || !target->IsAlive() || target->getPowerType() != PowerType)
|
||||
return;
|
||||
|
||||
if (target->HasUnitState(UNIT_STATE_ISOLATED) || target->IsImmunedToDamageOrSchool(GetSpellInfo()))
|
||||
@@ -6673,10 +6673,10 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con
|
||||
int32 damage = std::max(m_amount, 0);
|
||||
|
||||
// resilience reduce mana draining effect at spell crit damage reduction (added in 2.4)
|
||||
if (powerType == POWER_MANA)
|
||||
if (PowerType == POWER_MANA)
|
||||
damage -= target->GetSpellCritDamageReduction(damage);
|
||||
|
||||
uint32 gain = uint32(-target->ModifyPower(powerType, -damage));
|
||||
uint32 gain = uint32(-target->ModifyPower(PowerType, -damage));
|
||||
|
||||
float dmgMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user