Skip to content

Commit 1e7dfad

Browse files
chemicstryShauren
authored andcommitted
Core/DataStores: Reduce differences between branches
(cherry picked from commit f847f55)
1 parent 69f3acf commit 1e7dfad

19 files changed

Lines changed: 90 additions & 90 deletions

src/server/game/Conditions/ConditionMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
17271727
if (!((1 << spellEffectInfo.EffectIndex) & cond->SourceGroup))
17281728
continue;
17291729

1730-
if (spellEffectInfo.ChainTarget > 0)
1730+
if (spellEffectInfo.ChainTargets > 0)
17311731
continue;
17321732

17331733
switch (spellEffectInfo.TargetA.GetSelectionCategory())

src/server/game/Entities/Player/Player.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13472,9 +13472,9 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
1347213472
&& !item->GetTemplate()->Socket[slot-SOCK_ENCHANTMENT_SLOT].Color)
1347313473
{
1347413474
// Check if the requirements for the prismatic socket are met before applying the gem stats
13475-
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
13476-
if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID)))
13477-
return;
13475+
SpellItemEnchantmentEntry const* pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
13476+
if (!pPrismaticEnchant || (pPrismaticEnchant->RequiredSkillID > 0 && pPrismaticEnchant->RequiredSkillRank > GetSkillValue(pPrismaticEnchant->RequiredSkillID)))
13477+
return;
1347813478
}
1347913479

1348013480
if (!item->IsBroken())

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4043,15 +4043,15 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
40434043
UpdateInterruptMask();
40444044
}
40454045

4046-
void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID)
4046+
void Unit::RemoveAurasWithFamily(SpellFamilyNames family, flag96 const& familyFlag, ObjectGuid casterGUID)
40474047
{
40484048
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
40494049
{
40504050
Aura const* aura = iter->second->GetBase();
40514051
if (!casterGUID || aura->GetCasterGUID() == casterGUID)
40524052
{
40534053
SpellInfo const* spell = aura->GetSpellInfo();
4054-
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
4054+
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & familyFlag)
40554055
{
40564056
RemoveAura(iter);
40574057
continue;
@@ -4397,7 +4397,7 @@ AuraEffect* Unit::GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 f
43974397
for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
43984398
{
43994399
SpellInfo const* spell = (*i)->GetSpellInfo();
4400-
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags.HasFlag(familyFlag1, familyFlag2, familyFlag3))
4400+
if (spell->SpellFamilyName == uint32(family) && spell->SpellFamilyFlags & flag96(familyFlag1, familyFlag2, familyFlag3))
44014401
{
44024402
if (!casterGUID.IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
44034403
continue;
@@ -6532,7 +6532,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
65326532
DoneAdvertisedBenefit += static_cast<Guardian const*>(this)->GetBonusDamage();
65336533

65346534
// Check for table values
6535-
float coeff = spellEffectInfo.BonusMultiplier;
6535+
float coeff = spellEffectInfo.BonusCoefficient;
65366536
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
65376537
{
65386538
WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
@@ -7401,7 +7401,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
74017401
DoneAdvertisedBenefit += static_cast<Guardian const*>(this)->GetBonusDamage();
74027402

74037403
// Check for table values
7404-
float coeff = spellEffectInfo.BonusMultiplier;
7404+
float coeff = spellEffectInfo.BonusCoefficient;
74057405
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
74067406
{
74077407
WeaponAttackType const attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;

src/server/game/Entities/Unit/Unit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ class TC_GAME_API Unit : public WorldObject
13631363
void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0);
13641364
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
13651365
void RemoveAurasWithAttribute(uint32 flags);
1366-
void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID);
1366+
void RemoveAurasWithFamily(SpellFamilyNames family, flag96 const& familyFlag, ObjectGuid casterGUID);
13671367
void RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId = 0, bool withEffectMechanics = false);
13681368
void RemoveMovementImpairingAuras(bool withRoot);
13691369
void RemoveAurasByShapeShift();

src/server/game/Spells/Auras/SpellAuraEffects.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
378378
&AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic
379379
};
380380

381-
AuraEffect::AuraEffect(Aura* base, SpellEffectInfo const& spellEfffectInfo, int32 const* baseAmount, Unit* caster):
382-
m_base(base), m_spellInfo(base->GetSpellInfo()), m_spellEffectInfo(spellEfffectInfo),
381+
AuraEffect::AuraEffect(Aura* base, SpellEffectInfo const& spellEfffectInfo, int32 const* baseAmount, Unit* caster) :
382+
m_base(base), m_spellInfo(base->GetSpellInfo()), m_effectInfo(spellEfffectInfo), m_spellmod(nullptr),
383383
m_baseAmount(baseAmount ? *baseAmount : spellEfffectInfo.BasePoints),
384-
_amount(), m_spellmod(nullptr), _periodicTimer(0), _amplitude(0), _ticksDone(0),
384+
_amount(), _periodicTimer(0), _period(0), _ticksDone(0),
385385
m_canBeRecalculated(true), m_isPeriodic(false)
386386
{
387387
CalculatePeriodic(caster, true, false);
@@ -538,9 +538,9 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
538538
uint32 AuraEffect::GetTotalTicks() const
539539
{
540540
uint32 totalTicks = 0;
541-
if (_amplitude && !GetBase()->IsPermanent())
541+
if (_period && !GetBase()->IsPermanent())
542542
{
543-
totalTicks = static_cast<uint32>(GetBase()->GetMaxDuration() / _amplitude);
543+
totalTicks = static_cast<uint32>(GetBase()->GetMaxDuration() / _period);
544544
if (m_spellInfo->HasAttribute(SPELL_ATTR5_START_PERIODIC_AT_APPLY))
545545
++totalTicks;
546546
}
@@ -556,13 +556,13 @@ void AuraEffect::ResetPeriodic(bool resetPeriodicTimer /*= false*/)
556556
_periodicTimer = 0;
557557
// Start periodic on next tick or at aura apply
558558
if (m_spellInfo->HasAttribute(SPELL_ATTR5_START_PERIODIC_AT_APPLY))
559-
_periodicTimer = _amplitude;
559+
_periodicTimer = _period;
560560
}
561561
}
562562

563563
void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= true*/, bool load /*= false*/)
564564
{
565-
_amplitude = GetSpellEffectInfo().Amplitude;
565+
_period = GetSpellEffectInfo().ApplyAuraPeriod;
566566

567567
// prepare periodics
568568
switch (GetAuraType())
@@ -588,39 +588,39 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool resetPeriodicTimer /*= tru
588588
break;
589589
}
590590

591-
GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, _amplitude);
591+
GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, _period);
592592

593593
if (!m_isPeriodic)
594594
return;
595595

596596
Player* modOwner = caster ? caster->GetSpellModOwner() : nullptr;
597597
// Apply casting time mods
598-
if (_amplitude)
598+
if (_period)
599599
{
600600
// Apply periodic time mod
601601
if (modOwner)
602-
modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, _amplitude);
602+
modOwner->ApplySpellMod(GetId(), SPELLMOD_ACTIVATION_TIME, _period);
603603

604604
if (caster)
605605
{
606606
// Haste modifies periodic time of channeled spells
607607
if (m_spellInfo->IsChanneled())
608-
caster->ModSpellDurationTime(m_spellInfo, _amplitude);
608+
caster->ModSpellDurationTime(m_spellInfo, _period);
609609
// and periodic time of auras affected by SPELL_AURA_PERIODIC_HASTE
610610
else if (caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION))
611-
_amplitude = int32(_amplitude * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
611+
_period = int32(_period * caster->GetFloatValue(UNIT_MOD_CAST_SPEED));
612612
}
613613
}
614614
else // prevent infinite loop on Update
615615
m_isPeriodic = false;
616616

617617
if (load) // aura loaded from db
618618
{
619-
if (_amplitude && !GetBase()->IsPermanent())
619+
if (_period && !GetBase()->IsPermanent())
620620
{
621621
uint32 elapsedTime = GetBase()->GetMaxDuration() - GetBase()->GetDuration();
622-
_ticksDone = elapsedTime / uint32(_amplitude);
623-
_periodicTimer = elapsedTime % uint32(_amplitude);
622+
_ticksDone = elapsedTime / uint32(_period);
623+
_periodicTimer = elapsedTime % uint32(_period);
624624
}
625625

626626
if (m_spellInfo->HasAttribute(SPELL_ATTR5_START_PERIODIC_AT_APPLY))
@@ -818,9 +818,9 @@ void AuraEffect::Update(uint32 diff, Unit* caster)
818818
uint32 totalTicks = GetTotalTicks();
819819

820820
_periodicTimer += diff;
821-
while (_periodicTimer >= _amplitude)
821+
while (_periodicTimer >= _period)
822822
{
823-
_periodicTimer -= _amplitude;
823+
_periodicTimer -= _period;
824824

825825
if (!GetBase()->IsPermanent() && (_ticksDone + 1) > totalTicks)
826826
break;
@@ -1075,7 +1075,7 @@ void AuraEffect::CleanupTriggeredSpells(Unit* target)
10751075
// needed for spell 43680, maybe others
10761076
/// @todo is there a spell flag, which can solve this in a more sophisticated way?
10771077
if (GetSpellEffectInfo().ApplyAuraName == SPELL_AURA_PERIODIC_TRIGGER_SPELL &&
1078-
uint32(m_spellInfo->GetDuration()) == GetSpellEffectInfo().Amplitude)
1078+
uint32(m_spellInfo->GetDuration()) == GetSpellEffectInfo().ApplyAuraPeriod)
10791079
return;
10801080

10811081
target->RemoveAurasDueToSpell(tSpellId, GetCasterGUID());

src/server/game/Spells/Auras/SpellAuraEffects.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class TC_GAME_API AuraEffect
4848

4949
SpellInfo const* GetSpellInfo() const { return m_spellInfo; }
5050
uint32 GetId() const { return m_spellInfo->Id; }
51-
SpellEffIndex GetEffIndex() const { return m_spellEffectInfo.EffectIndex; }
51+
SpellEffIndex GetEffIndex() const { return m_effectInfo.EffectIndex; }
5252
int32 GetBaseAmount() const { return m_baseAmount; }
53-
int32 GetAmplitude() const { return _amplitude; }
53+
int32 GetPeriod() const { return _period; }
5454

5555
int32 GetMiscValueB() const { return GetSpellEffectInfo().MiscValueB; }
5656
int32 GetMiscValue() const { return GetSpellEffectInfo().MiscValue; }
@@ -97,22 +97,22 @@ class TC_GAME_API AuraEffect
9797
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
9898
void HandleShapeshiftBoosts(Unit* target, bool apply) const;
9999

100-
SpellEffectInfo const& GetSpellEffectInfo() const { return m_spellEffectInfo; }
100+
SpellEffectInfo const& GetSpellEffectInfo() const { return m_effectInfo; }
101101

102102
private:
103103
Aura* const m_base;
104104

105105
SpellInfo const* const m_spellInfo;
106-
SpellEffectInfo const& m_spellEffectInfo;
107-
int32 const m_baseAmount;
108-
109-
int32 _amount;
106+
SpellEffectInfo const& m_effectInfo;
110107

111108
SpellModifier* m_spellmod;
112109

110+
int32 const m_baseAmount;
111+
int32 _amount;
112+
113113
// periodic stuff
114114
int32 _periodicTimer;
115-
int32 _amplitude; // time between consecutive ticks
115+
int32 _period; // time between consecutive ticks
116116
uint32 _ticksDone; // ticks counter
117117

118118
bool m_canBeRecalculated;

src/server/game/Spells/Auras/SpellAuras.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
15481548
for (std::list<Unit*>::iterator itr = PartyMembers.begin(); itr != PartyMembers.end(); ++itr)
15491549
{
15501550
if ((*itr)!= target)
1551-
(*itr)->RemoveAurasWithFamily(SPELLFAMILY_WARRIOR, 0, 0x2, 0, GetCasterGUID());
1551+
(*itr)->RemoveAurasWithFamily(SPELLFAMILY_WARRIOR, flag96(0, 0x2, 0), GetCasterGUID());
15521552
}
15531553
}
15541554
}
@@ -1678,7 +1678,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
16781678
case SPELLFAMILY_ROGUE:
16791679
// Remove Vanish on stealth remove
16801680
if (GetId() == 1784)
1681-
target->RemoveAurasWithFamily(SPELLFAMILY_ROGUE, 0x0000800, 0, 0, target->GetGUID());
1681+
target->RemoveAurasWithFamily(SPELLFAMILY_ROGUE, flag96(0x0000800, 0, 0), target->GetGUID());
16821682
break;
16831683
case SPELLFAMILY_PALADIN:
16841684
// Remove the immunity shield marker on Forbearance removal if AW marker is not present

src/server/game/Spells/Spell.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ void Spell::SelectImplicitTargetObjectTargets(SpellEffectInfo const& spellEffect
16051605

16061606
void Spell::SelectImplicitChainTargets(SpellEffectInfo const& spellEffectInfo, SpellImplicitTargetInfo const& targetType, WorldObject* target, uint32 effMask)
16071607
{
1608-
uint32 maxTargets = spellEffectInfo.ChainTarget;
1608+
uint32 maxTargets = spellEffectInfo.ChainTargets;
16091609
if (Player* modOwner = m_caster->GetSpellModOwner())
16101610
modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_JUMP_TARGETS, maxTargets, this);
16111611

@@ -5165,7 +5165,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGoT
51655165
destTarget = &m_destTargets[spellEffectInfo.EffectIndex]._position;
51665166
effectInfo = &spellEffectInfo;
51675167

5168-
// we do not need DamageMultiplier here.
5168+
// we do not need ChainAmplitude here.
51695169
damage = CalculateDamage(spellEffectInfo);
51705170

51715171
bool preventDefault = CallScriptEffectHandlers(spellEffectInfo.EffectIndex, mode);
@@ -5291,7 +5291,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
52915291
{
52925292
if (m_spellInfo->CasterAuraState && !unitCaster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraState), m_spellInfo, unitCaster))
52935293
return SPELL_FAILED_CASTER_AURASTATE;
5294-
if (m_spellInfo->CasterAuraStateNot && unitCaster->HasAuraState(AuraStateType(m_spellInfo->CasterAuraStateNot), m_spellInfo, unitCaster))
5294+
if (m_spellInfo->ExcludeCasterAuraState && unitCaster->HasAuraState(AuraStateType(m_spellInfo->ExcludeCasterAuraState), m_spellInfo, unitCaster))
52955295
return SPELL_FAILED_CASTER_AURASTATE;
52965296

52975297
// Note: spell 62473 requres casterAuraSpell = triggering spell
@@ -6086,7 +6086,7 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
60866086
InstanceTemplate const* it = sObjectMgr->GetInstanceTemplate(unitCaster->GetMapId());
60876087
if (it)
60886088
allowMount = it->AllowMount;
6089-
if (unitCaster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->AreaGroupId)
6089+
if (unitCaster->GetTypeId() == TYPEID_PLAYER && !allowMount && !m_spellInfo->RequiredAreasID)
60906090
return SPELL_FAILED_NO_MOUNTS_ALLOWED;
60916091

60926092
if (unitCaster->IsInDisallowedMountForm())

src/server/game/Spells/SpellEffects.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void Spell::EffectSchoolDMG()
483483
{
484484
// converts each extra point of energy into ($f1+$AP/410) additional damage
485485
float ap = unitCaster->GetTotalAttackPowerValue(BASE_ATTACK);
486-
float multiple = ap / 410 + effectInfo->DamageMultiplier;
486+
float multiple = ap / 410 + effectInfo->ChainAmplitude;
487487
int32 energy = -(unitCaster->ModifyPower(POWER_ENERGY, -30));
488488
damage += int32(energy * multiple);
489489
damage += int32(CalculatePct(unitCaster->ToPlayer()->GetComboPoints() * ap, 7));
@@ -959,7 +959,7 @@ void Spell::CalculateJumpSpeeds(SpellEffectInfo const& spellEffectInfo, float di
959959
if (Creature* creature = unitCaster->ToCreature())
960960
runSpeed *= creature->GetCreatureTemplate()->speed_run;
961961

962-
float multiplier = spellEffectInfo.ValueMultiplier;
962+
float multiplier = spellEffectInfo.Amplitude;
963963
if (multiplier <= 0.0f)
964964
multiplier = 1.0f;
965965

0 commit comments

Comments
 (0)