[Spells] Added constant labeling to all StatBonuses that use as arrays. (#1485)

* constexpr labels added

* more updates

* more updates

* completed

* Update common.h

* Namespace constants, few minor spelling tweaks

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
KayenEQ 2021-08-01 14:13:14 -04:00 committed by GitHub
parent 72056ffba3
commit 38beb804a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 554 additions and 500 deletions

View File

@ -1547,12 +1547,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
////// Send Attack Damage ////// Send Attack Damage
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
if (my_hit.damage_done > 0 && aabonuses.SkillAttackProc[0] && aabonuses.SkillAttackProc[1] == my_hit.skill && if (my_hit.damage_done > 0 && aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] && aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SKILL] == my_hit.skill &&
IsValidSpell(aabonuses.SkillAttackProc[2])) { IsValidSpell(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID])) {
float chance = aabonuses.SkillAttackProc[0] / 1000.0f; float chance = aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] / 1000.0f;
if (zone->random.Roll(chance)) if (zone->random.Roll(chance))
SpellFinished(aabonuses.SkillAttackProc[2], other, EQ::spells::CastingSlot::Item, 0, -1, SpellFinished(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID], other, EQ::spells::CastingSlot::Item, 0, -1,
spells[aabonuses.SkillAttackProc[2]].ResistDiff); spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].ResistDiff);
} }
other->Damage(this, my_hit.damage_done, SPELL_UNKNOWN, my_hit.skill, true, -1, false, m_specialattacks); other->Damage(this, my_hit.damage_done, SPELL_UNKNOWN, my_hit.skill, true, -1, false, m_specialattacks);
@ -2746,9 +2746,9 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
if (damage > GetHP()) if (damage > GetHP())
damage = GetHP(); damage = GetHP();
if (spellbonuses.ImprovedTaunt[1] && (GetLevel() < spellbonuses.ImprovedTaunt[0]) if (spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_AGGRO_MOD] && (GetLevel() < spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL])
&& other && (buffs[spellbonuses.ImprovedTaunt[2]].casterid != other->GetID())) && other && (buffs[spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT]].casterid != other->GetID()))
hate = (hate*spellbonuses.ImprovedTaunt[1]) / 100; hate = (hate*spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_AGGRO_MOD]) / 100;
hate_list.AddEntToHateList(other, hate, damage, bFrenzy, !iBuffTic); hate_list.AddEntToHateList(other, hate, damage, bFrenzy, !iBuffTic);
@ -3122,8 +3122,8 @@ int32 Mob::ReduceDamage(int32 damage)
int32 slot = -1; int32 slot = -1;
bool DisableMeleeRune = false; bool DisableMeleeRune = false;
if (spellbonuses.NegateAttacks[0]) { if (spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_EXISTS]) {
slot = spellbonuses.NegateAttacks[1]; slot = spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT];
if (slot >= 0) { if (slot >= 0) {
if (--buffs[slot].numhits == 0) { if (--buffs[slot].numhits == 0) {
@ -3131,21 +3131,21 @@ int32 Mob::ReduceDamage(int32 damage)
BuffFadeBySlot(slot, true); BuffFadeBySlot(slot, true);
} }
if (spellbonuses.NegateAttacks[2] && (damage > spellbonuses.NegateAttacks[2])) if (spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] && (damage > spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT]))
damage -= spellbonuses.NegateAttacks[2]; damage -= spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT];
else else
return DMG_RUNE; return DMG_RUNE;
} }
} }
//Only mitigate if damage is above the minimium specified. //Only mitigate if damage is above the minimium specified.
if (spellbonuses.MeleeThresholdGuard[0]) { if (spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT]) {
slot = spellbonuses.MeleeThresholdGuard[1]; slot = spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT];
if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[2])) if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER]))
{ {
DisableMeleeRune = true; DisableMeleeRune = true;
int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] / 100;
if (damage_to_reduce >= buffs[slot].melee_rune) if (damage_to_reduce >= buffs[slot].melee_rune)
{ {
LogSpells("Mob::ReduceDamage SE_MeleeThresholdGuard [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].melee_rune); LogSpells("Mob::ReduceDamage SE_MeleeThresholdGuard [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].melee_rune);
@ -3162,16 +3162,16 @@ int32 Mob::ReduceDamage(int32 damage)
} }
} }
if (spellbonuses.MitigateMeleeRune[0] && !DisableMeleeRune) { if (spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] && !DisableMeleeRune) {
slot = spellbonuses.MitigateMeleeRune[1]; slot = spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_BUFFSLOT];
if (slot >= 0) if (slot >= 0)
{ {
int damage_to_reduce = damage * spellbonuses.MitigateMeleeRune[0] / 100; int damage_to_reduce = damage * spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
if (spellbonuses.MitigateMeleeRune[2] && (damage_to_reduce > spellbonuses.MitigateMeleeRune[2])) if (spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] && (damage_to_reduce > spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT]))
damage_to_reduce = spellbonuses.MitigateMeleeRune[2]; damage_to_reduce = spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT];
if (spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) if (spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] && (damage_to_reduce >= buffs[slot].melee_rune))
{ {
LogSpells("Mob::ReduceDamage SE_MitigateMeleeDamage [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].melee_rune); LogSpells("Mob::ReduceDamage SE_MitigateMeleeDamage [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].melee_rune);
damage -= buffs[slot].melee_rune; damage -= buffs[slot].melee_rune;
@ -3182,7 +3182,7 @@ int32 Mob::ReduceDamage(int32 damage)
{ {
LogSpells("Mob::ReduceDamage SE_MitigateMeleeDamage [{}] damage negated, [{}] damage remaining", damage_to_reduce, buffs[slot].melee_rune); LogSpells("Mob::ReduceDamage SE_MitigateMeleeDamage [{}] damage negated, [{}] damage remaining", damage_to_reduce, buffs[slot].melee_rune);
if (spellbonuses.MitigateMeleeRune[3]) if (spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT])
buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce);
damage -= damage_to_reduce; damage -= damage_to_reduce;
@ -3193,7 +3193,7 @@ int32 Mob::ReduceDamage(int32 damage)
if (damage < 1) if (damage < 1)
return DMG_RUNE; return DMG_RUNE;
if (spellbonuses.MeleeRune[0] && spellbonuses.MeleeRune[1] >= 0) if (spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && spellbonuses.MeleeRune[SBIndex::POSITIONAL_DAMAGE_MOD] >= 0)
damage = RuneAbsorb(damage, SE_Rune); damage = RuneAbsorb(damage, SE_Rune);
if (damage < 1) if (damage < 1)
@ -3211,8 +3211,8 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
int32 slot = -1; int32 slot = -1;
// See if we block the spell outright first // See if we block the spell outright first
if (!iBuffTic && spellbonuses.NegateAttacks[0]) { if (!iBuffTic && spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_EXISTS]) {
slot = spellbonuses.NegateAttacks[1]; slot = spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT];
if (slot >= 0) { if (slot >= 0) {
if (--buffs[slot].numhits == 0) { if (--buffs[slot].numhits == 0) {
@ -3220,8 +3220,8 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
BuffFadeBySlot(slot, true); BuffFadeBySlot(slot, true);
} }
if (spellbonuses.NegateAttacks[2] && (damage > spellbonuses.NegateAttacks[2])) if (spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] && (damage > spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT]))
damage -= spellbonuses.NegateAttacks[2]; damage -= spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT];
else else
return 0; return 0;
} }
@ -3231,16 +3231,16 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
if (iBuffTic) { if (iBuffTic) {
damage -= (damage * itembonuses.DoTShielding / 100); damage -= (damage * itembonuses.DoTShielding / 100);
if (spellbonuses.MitigateDotRune[0]) { if (spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT]) {
slot = spellbonuses.MitigateDotRune[1]; slot = spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_BUFFSLOT];
if (slot >= 0) if (slot >= 0)
{ {
int damage_to_reduce = damage * spellbonuses.MitigateDotRune[0] / 100; int damage_to_reduce = damage * spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
if (spellbonuses.MitigateDotRune[2] && (damage_to_reduce > spellbonuses.MitigateDotRune[2])) if (spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] && (damage_to_reduce > spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT]))
damage_to_reduce = spellbonuses.MitigateDotRune[2]; damage_to_reduce = spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT];
if (spellbonuses.MitigateDotRune[3] && (damage_to_reduce >= buffs[slot].dot_rune)) if (spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] && (damage_to_reduce >= buffs[slot].dot_rune))
{ {
damage -= buffs[slot].dot_rune; damage -= buffs[slot].dot_rune;
if (!TryFadeEffect(slot)) if (!TryFadeEffect(slot))
@ -3248,7 +3248,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
} }
else else
{ {
if (spellbonuses.MitigateDotRune[3]) if (spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT])
buffs[slot].dot_rune = (buffs[slot].dot_rune - damage_to_reduce); buffs[slot].dot_rune = (buffs[slot].dot_rune - damage_to_reduce);
damage -= damage_to_reduce; damage -= damage_to_reduce;
@ -3264,13 +3264,13 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
damage -= (damage * itembonuses.SpellShield / 100); damage -= (damage * itembonuses.SpellShield / 100);
//Only mitigate if damage is above the minimium specified. //Only mitigate if damage is above the minimium specified.
if (spellbonuses.SpellThresholdGuard[0]) { if (spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT]) {
slot = spellbonuses.SpellThresholdGuard[1]; slot = spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT];
if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[2])) if (slot >= 0 && (damage > spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER]))
{ {
DisableSpellRune = true; DisableSpellRune = true;
int damage_to_reduce = damage * spellbonuses.SpellThresholdGuard[0] / 100; int damage_to_reduce = damage * spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] / 100;
if (damage_to_reduce >= buffs[slot].magic_rune) if (damage_to_reduce >= buffs[slot].magic_rune)
{ {
damage -= buffs[slot].magic_rune; damage -= buffs[slot].magic_rune;
@ -3286,16 +3286,16 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
} }
// Do runes now. // Do runes now.
if (spellbonuses.MitigateSpellRune[0] && !DisableSpellRune) { if (spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] && !DisableSpellRune) {
slot = spellbonuses.MitigateSpellRune[1]; slot = spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_BUFFSLOT];
if (slot >= 0) if (slot >= 0)
{ {
int damage_to_reduce = damage * spellbonuses.MitigateSpellRune[0] / 100; int damage_to_reduce = damage * spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] / 100;
if (spellbonuses.MitigateSpellRune[2] && (damage_to_reduce > spellbonuses.MitigateSpellRune[2])) if (spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] && (damage_to_reduce > spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT]))
damage_to_reduce = spellbonuses.MitigateSpellRune[2]; damage_to_reduce = spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT];
if (spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) if (spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] && (damage_to_reduce >= buffs[slot].magic_rune))
{ {
LogSpells("Mob::ReduceDamage SE_MitigateSpellDamage [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].magic_rune); LogSpells("Mob::ReduceDamage SE_MitigateSpellDamage [{}] damage negated, [{}] damage remaining, fading buff", damage_to_reduce, buffs[slot].magic_rune);
damage -= buffs[slot].magic_rune; damage -= buffs[slot].magic_rune;
@ -3306,7 +3306,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
{ {
LogSpells("Mob::ReduceDamage SE_MitigateMeleeDamage [{}] damage negated, [{}] damage remaining", damage_to_reduce, buffs[slot].magic_rune); LogSpells("Mob::ReduceDamage SE_MitigateMeleeDamage [{}] damage negated, [{}] damage remaining", damage_to_reduce, buffs[slot].magic_rune);
if (spellbonuses.MitigateSpellRune[3]) if (spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT])
buffs[slot].magic_rune = (buffs[slot].magic_rune - damage_to_reduce); buffs[slot].magic_rune = (buffs[slot].magic_rune - damage_to_reduce);
damage -= damage_to_reduce; damage -= damage_to_reduce;
@ -3318,10 +3318,10 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi
return 0; return 0;
//Regular runes absorb spell damage (except dots) - Confirmed on live. //Regular runes absorb spell damage (except dots) - Confirmed on live.
if (spellbonuses.MeleeRune[0] && spellbonuses.MeleeRune[1] >= 0) if (spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && spellbonuses.MeleeRune[SBIndex::POSITIONAL_DAMAGE_MOD] >= 0)
damage = RuneAbsorb(damage, SE_Rune); damage = RuneAbsorb(damage, SE_Rune);
if (spellbonuses.AbsorbMagicAtt[0] && spellbonuses.AbsorbMagicAtt[1] >= 0) if (spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] && spellbonuses.AbsorbMagicAtt[SBIndex::POSITIONAL_DAMAGE_MOD] >= 0)
damage = RuneAbsorb(damage, SE_AbsorbMagicAtt); damage = RuneAbsorb(damage, SE_AbsorbMagicAtt);
if (damage < 1) if (damage < 1)
@ -3344,9 +3344,9 @@ int32 Mob::ReduceAllDamage(int32 damage)
} }
} }
if (spellbonuses.EnduranceAbsorbPercentDamage[0]) { if (spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION]) {
int32 damage_reduced = damage * spellbonuses.EnduranceAbsorbPercentDamage[0] / 10000; //If hit for 1000, at 10% then lower damage by 100; int32 damage_reduced = damage * spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] / 10000; //If hit for 1000, at 10% then lower damage by 100;
int32 endurance_drain = damage_reduced * spellbonuses.EnduranceAbsorbPercentDamage[1] / 10000; //Reduce endurance by 0.05% per HP loss int32 endurance_drain = damage_reduced * spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_DRAIN_PER_HP] / 10000; //Reduce endurance by 0.05% per HP loss
if (endurance_drain < 1) if (endurance_drain < 1)
endurance_drain = 1; endurance_drain = 1;
@ -4384,12 +4384,12 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *
// 1: Try Slay Undead // 1: Try Slay Undead
if (defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || if (defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead ||
defender->GetBodyType() == BT_Vampire) { defender->GetBodyType() == BT_Vampire) {
int SlayRateBonus = aabonuses.SlayUndead[0] + itembonuses.SlayUndead[0] + spellbonuses.SlayUndead[0]; int SlayRateBonus = aabonuses.SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] + itembonuses.SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] + spellbonuses.SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD];
if (SlayRateBonus) { if (SlayRateBonus) {
float slayChance = static_cast<float>(SlayRateBonus) / 10000.0f; float slayChance = static_cast<float>(SlayRateBonus) / 10000.0f;
if (zone->random.Roll(slayChance)) { if (zone->random.Roll(slayChance)) {
int SlayDmgBonus = std::max( int SlayDmgBonus = std::max(
{ aabonuses.SlayUndead[1], itembonuses.SlayUndead[1], spellbonuses.SlayUndead[1] }); {aabonuses.SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD], itembonuses.SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD], spellbonuses.SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] });
hit.damage_done = std::max(hit.damage_done, hit.base_damage) + 5; hit.damage_done = std::max(hit.damage_done, hit.base_damage) + 5;
hit.damage_done = (hit.damage_done * SlayDmgBonus) / 100; hit.damage_done = (hit.damage_done * SlayDmgBonus) / 100;
@ -4560,18 +4560,18 @@ bool Mob::TryFinishingBlow(Mob *defender, int &damage)
if (defender && !defender->IsClient() && defender->GetHPRatio() < 10) { if (defender && !defender->IsClient() && defender->GetHPRatio() < 10) {
uint32 FB_Dmg = uint32 FB_Dmg =
aabonuses.FinishingBlow[1] + spellbonuses.FinishingBlow[1] + itembonuses.FinishingBlow[1]; aabonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] + spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] + itembonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_DMG];
uint32 FB_Level = 0; uint32 FB_Level = 0;
FB_Level = aabonuses.FinishingBlowLvl[0]; FB_Level = aabonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX];
if (FB_Level < spellbonuses.FinishingBlowLvl[0]) if (FB_Level < spellbonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX])
FB_Level = spellbonuses.FinishingBlowLvl[0]; FB_Level = spellbonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX];
else if (FB_Level < itembonuses.FinishingBlowLvl[0]) else if (FB_Level < itembonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX])
FB_Level = itembonuses.FinishingBlowLvl[0]; FB_Level = itembonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX];
// modern AA description says rank 1 (500) is 50% chance // modern AA description says rank 1 (500) is 50% chance
int ProcChance = int ProcChance =
aabonuses.FinishingBlow[0] + spellbonuses.FinishingBlow[0] + spellbonuses.FinishingBlow[0]; aabonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE];
if (FB_Level && FB_Dmg && (defender->GetLevel() <= FB_Level) && if (FB_Level && FB_Dmg && (defender->GetLevel() <= FB_Level) &&
(ProcChance >= zone->random.Int(1, 1000))) { (ProcChance >= zone->random.Int(1, 1000))) {
@ -4622,8 +4622,8 @@ void Mob::DoRiposte(Mob *defender)
return; return;
} }
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[0] + defender->spellbonuses.GiveDoubleRiposte[0] + DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] + defender->spellbonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] +
defender->itembonuses.GiveDoubleRiposte[0]; defender->itembonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE];
// Live AA - Double Riposte // Live AA - Double Riposte
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) { if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
@ -4636,15 +4636,15 @@ void Mob::DoRiposte(Mob *defender)
// Double Riposte effect, allows for a chance to do RIPOSTE with a skill specific special attack (ie Return Kick). // Double Riposte effect, allows for a chance to do RIPOSTE with a skill specific special attack (ie Return Kick).
// Coded narrowly: Limit to one per client. Limit AA only. [1 = Skill Attack Chance, 2 = Skill] // Coded narrowly: Limit to one per client. Limit AA only. [1 = Skill Attack Chance, 2 = Skill]
DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE];
if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) { if (DoubleRipChance && zone->random.Roll(DoubleRipChance)) {
LogCombat("Preforming a return SPECIAL ATTACK ([{}] percent chance)", DoubleRipChance); LogCombat("Preforming a return SPECIAL ATTACK ([{}] percent chance)", DoubleRipChance);
if (defender->GetClass() == MONK) if (defender->GetClass() == MONK)
defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL]);
else if (defender->IsClient()) // so yeah, even if you don't have the skill you can still do the attack :P (and we don't crash anymore) else if (defender->IsClient()) // so yeah, even if you don't have the skill you can still do the attack :P (and we don't crash anymore)
defender->CastToClient()->DoClassAttacks(this, defender->aabonuses.GiveDoubleRiposte[2], true); defender->CastToClient()->DoClassAttacks(this, defender->aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL], true);
} }
} }
@ -5067,13 +5067,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
- Root break chance values obtained from live parses. - Root break chance values obtained from live parses.
*/ */
if (!attacker || !spellbonuses.Root[0] || spellbonuses.Root[1] < 0) if (!attacker || !spellbonuses.Root[SBIndex::ROOT_EXISTS] || spellbonuses.Root[SBIndex::ROOT_BUFFSLOT] < 0)
return false; return false;
if (IsDetrimentalSpell(spellbonuses.Root[1]) && spellbonuses.Root[1] != buffslot) { if (IsDetrimentalSpell(spellbonuses.Root[SBIndex::ROOT_BUFFSLOT]) && spellbonuses.Root[SBIndex::ROOT_BUFFSLOT] != buffslot) {
int BreakChance = RuleI(Spells, RootBreakFromSpells); int BreakChance = RuleI(Spells, RootBreakFromSpells);
BreakChance -= BreakChance*buffs[spellbonuses.Root[1]].RootBreakChance / 100; BreakChance -= BreakChance * buffs[spellbonuses.Root[SBIndex::ROOT_BUFFSLOT]].RootBreakChance / 100;
int level_diff = attacker->GetLevel() - GetLevel(); int level_diff = attacker->GetLevel() - GetLevel();
//Use baseline if level difference <= 1 (ie. If target is (1) level less than you, or equal or greater level) //Use baseline if level difference <= 1 (ie. If target is (1) level less than you, or equal or greater level)
@ -5092,8 +5092,8 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) {
if (zone->random.Roll(BreakChance)) { if (zone->random.Roll(BreakChance)) {
if (!TryFadeEffect(spellbonuses.Root[1])) { if (!TryFadeEffect(spellbonuses.Root[SBIndex::ROOT_BUFFSLOT])) {
BuffFadeBySlot(spellbonuses.Root[1]); BuffFadeBySlot(spellbonuses.Root[SBIndex::ROOT_BUFFSLOT]);
LogCombat("Spell broke root! BreakChance percent chance"); LogCombat("Spell broke root! BreakChance percent chance");
return true; return true;
} }
@ -5109,7 +5109,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
uint32 buff_max = GetMaxTotalSlots(); uint32 buff_max = GetMaxTotalSlots();
if (type == SE_Rune) { if (type == SE_Rune) {
for (uint32 slot = 0; slot < buff_max; slot++) { for (uint32 slot = 0; slot < buff_max; slot++) {
if (slot == spellbonuses.MeleeRune[1] && spellbonuses.MeleeRune[0] && buffs[slot].melee_rune && IsValidSpell(buffs[slot].spellid)) { if (slot == spellbonuses.MeleeRune[SBIndex::POSITIONAL_DAMAGE_MOD] && spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] && buffs[slot].melee_rune && IsValidSpell(buffs[slot].spellid)) {
int melee_rune_left = buffs[slot].melee_rune; int melee_rune_left = buffs[slot].melee_rune;
if (melee_rune_left > damage) if (melee_rune_left > damage)
@ -5133,7 +5133,7 @@ int32 Mob::RuneAbsorb(int32 damage, uint16 type)
else { else {
for (uint32 slot = 0; slot < buff_max; slot++) { for (uint32 slot = 0; slot < buff_max; slot++) {
if (slot == spellbonuses.AbsorbMagicAtt[1] && spellbonuses.AbsorbMagicAtt[0] && buffs[slot].magic_rune && IsValidSpell(buffs[slot].spellid)) { if (slot == spellbonuses.AbsorbMagicAtt[SBIndex::POSITIONAL_DAMAGE_MOD] && spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] && buffs[slot].magic_rune && IsValidSpell(buffs[slot].spellid)) {
int magic_rune_left = buffs[slot].magic_rune; int magic_rune_left = buffs[slot].magic_rune;
if (magic_rune_left > damage) if (magic_rune_left > damage)
{ {
@ -5255,7 +5255,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
spec_mod = mod; spec_mod = mod;
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) { if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
//SE_PC_Pet_Rampage SPA 464 on pet, damage modifier //SE_PC_Pet_Rampage SPA 464 on pet, damage modifier
int spell_mod = spellbonuses.PC_Pet_Rampage[1] + itembonuses.PC_Pet_Rampage[1] + aabonuses.PC_Pet_Rampage[1]; int spell_mod = spellbonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] + itembonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] + aabonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD];
if (spell_mod > spec_mod) if (spell_mod > spec_mod)
spec_mod = spell_mod; spec_mod = spell_mod;
} }
@ -5266,7 +5266,7 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
spec_mod = mod; spec_mod = mod;
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) { if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
//SE_PC_Pet_AE_Rampage SPA 465 on pet, damage modifier //SE_PC_Pet_AE_Rampage SPA 465 on pet, damage modifier
int spell_mod = spellbonuses.PC_Pet_AE_Rampage[1] + itembonuses.PC_Pet_AE_Rampage[1] + aabonuses.PC_Pet_AE_Rampage[1]; int spell_mod = spellbonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] + itembonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] + aabonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD];
if (spell_mod > spec_mod) if (spell_mod > spec_mod)
spec_mod = spell_mod; spec_mod = spell_mod;
} }
@ -5487,20 +5487,20 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
if (hand == EQ::invslot::slotPrimary) { if (hand == EQ::invslot::slotPrimary) {
if (HasTwoHanderEquipped()) { if (HasTwoHanderEquipped()) {
auto extraattackchance = aabonuses.ExtraAttackChance[0] + spellbonuses.ExtraAttackChance[0] + auto extraattackchance = aabonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] + spellbonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] +
itembonuses.ExtraAttackChance[0]; itembonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE];
if (extraattackchance && zone->random.Roll(extraattackchance)) { if (extraattackchance && zone->random.Roll(extraattackchance)) {
auto extraattackamt = std::max({ aabonuses.ExtraAttackChance[1], spellbonuses.ExtraAttackChance[1], itembonuses.ExtraAttackChance[1] }); auto extraattackamt = std::max({aabonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS], spellbonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS], itembonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] });
for (int i = 0; i < extraattackamt; i++) { for (int i = 0; i < extraattackamt; i++) {
Attack(target, hand, false, false, IsFromSpell); Attack(target, hand, false, false, IsFromSpell);
} }
} }
} }
else { else {
auto extraattackchance_primary = aabonuses.ExtraAttackChancePrimary[0] + spellbonuses.ExtraAttackChancePrimary[0] + auto extraattackchance_primary = aabonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] + spellbonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] +
itembonuses.ExtraAttackChancePrimary[0]; itembonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE];
if (extraattackchance_primary && zone->random.Roll(extraattackchance_primary)) { if (extraattackchance_primary && zone->random.Roll(extraattackchance_primary)) {
auto extraattackamt_primary = std::max({ aabonuses.ExtraAttackChancePrimary[1], spellbonuses.ExtraAttackChancePrimary[1], itembonuses.ExtraAttackChancePrimary[1] }); auto extraattackamt_primary = std::max({aabonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS], spellbonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS], itembonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] });
for (int i = 0; i < extraattackamt_primary; i++) { for (int i = 0; i < extraattackamt_primary; i++) {
Attack(target, hand, false, false, IsFromSpell); Attack(target, hand, false, false, IsFromSpell);
} }
@ -5509,10 +5509,10 @@ void Client::DoAttackRounds(Mob *target, int hand, bool IsFromSpell)
} }
if (hand == EQ::invslot::slotSecondary) { if (hand == EQ::invslot::slotSecondary) {
auto extraattackchance_secondary = aabonuses.ExtraAttackChanceSecondary[0] + spellbonuses.ExtraAttackChanceSecondary[0] + auto extraattackchance_secondary = aabonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] + spellbonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] +
itembonuses.ExtraAttackChanceSecondary[0]; itembonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE];
if (extraattackchance_secondary && zone->random.Roll(extraattackchance_secondary)) { if (extraattackchance_secondary && zone->random.Roll(extraattackchance_secondary)) {
auto extraattackamt_secondary = std::max({ aabonuses.ExtraAttackChanceSecondary[1], spellbonuses.ExtraAttackChanceSecondary[1], itembonuses.ExtraAttackChanceSecondary[1] }); auto extraattackamt_secondary = std::max({aabonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS], spellbonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS], itembonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] });
for (int i = 0; i < extraattackamt_secondary; i++) { for (int i = 0; i < extraattackamt_secondary; i++) {
Attack(target, hand, false, false, IsFromSpell); Attack(target, hand, false, false, IsFromSpell);
} }

View File

@ -1145,9 +1145,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_SkillAttackProc: { case SE_SkillAttackProc: {
// You can only have one of these per client. [AA Dragon Punch] // You can only have one of these per client. [AA Dragon Punch]
newbon->SkillAttackProc[0] = base1; // Chance base 1000 = 100% proc rate newbon->SkillAttackProc[SBIndex::SKILLPROC_CHANCE] = base1; // Chance base 1000 = 100% proc rate
newbon->SkillAttackProc[1] = base2; // Skill to Proc Off newbon->SkillAttackProc[SBIndex::SKILLPROC_SKILL] = base2; // Skill to Proc Off
newbon->SkillAttackProc[2] = rank.spell; // spell to proc newbon->SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID] = rank.spell; // spell to proc
break; break;
} }
@ -1185,9 +1185,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
} }
case SE_SlayUndead: { case SE_SlayUndead: {
if (newbon->SlayUndead[1] < base1) if (newbon->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] < base1)
newbon->SlayUndead[0] = base1; // Rate newbon->SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = base1; // Rate
newbon->SlayUndead[1] = base2; // Damage Modifier newbon->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = base2; // Damage Modifier
break; break;
} }
@ -1199,13 +1199,13 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_GiveDoubleRiposte: { case SE_GiveDoubleRiposte: {
// 0=Regular Riposte 1=Skill Attack Riposte 2=Skill // 0=Regular Riposte 1=Skill Attack Riposte 2=Skill
if (base2 == 0) { if (base2 == 0) {
if (newbon->GiveDoubleRiposte[0] < base1) if (newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] < base1)
newbon->GiveDoubleRiposte[0] = base1; newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = base1;
} }
// Only for special attacks. // Only for special attacks.
else if (base2 > 0 && (newbon->GiveDoubleRiposte[1] < base1)) { else if (base2 > 0 && (newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE] < base1)) {
newbon->GiveDoubleRiposte[1] = base1; newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL_ATK_CHANCE] = base1;
newbon->GiveDoubleRiposte[2] = base2; newbon->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_SKILL] = base2;
} }
break; break;
@ -1239,9 +1239,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
} }
case SE_DivineSave: { case SE_DivineSave: {
if (newbon->DivineSaveChance[0] < base1) { if (newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] < base1) {
newbon->DivineSaveChance[0] = base1; newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] = base1;
newbon->DivineSaveChance[1] = base2; newbon->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = base2;
} }
break; break;
} }
@ -1272,18 +1272,18 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_FinishingBlow: { case SE_FinishingBlow: {
// base1 = chance, base2 = damage // base1 = chance, base2 = damage
if (newbon->FinishingBlow[1] < base2) { if (newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] < base2) {
newbon->FinishingBlow[0] = base1; newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base1;
newbon->FinishingBlow[1] = base2; newbon->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = base2;
} }
break; break;
} }
case SE_FinishingBlowLvl: { case SE_FinishingBlowLvl: {
// base1 = level, base2 = ??? (Set to 200 in AA data, possible proc rate mod?) // base1 = level, base2 = ??? (Set to 200 in AA data, possible proc rate mod?)
if (newbon->FinishingBlowLvl[0] < base1) { if (newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base1) {
newbon->FinishingBlowLvl[0] = base1; newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base1;
newbon->FinishingBlowLvl[1] = base2; newbon->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2;
} }
break; break;
} }
@ -1344,32 +1344,32 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
} }
case SE_HeadShot: { case SE_HeadShot: {
if (newbon->HeadShot[1] < base2) { if (newbon->HeadShot[SBIndex::FINISHING_EFFECT_DMG] < base2) {
newbon->HeadShot[0] = base1; newbon->HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base1;
newbon->HeadShot[1] = base2; newbon->HeadShot[SBIndex::FINISHING_EFFECT_DMG] = base2;
} }
break; break;
} }
case SE_HeadShotLevel: { case SE_HeadShotLevel: {
if (newbon->HSLevel[0] < base1) if (newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base1)
newbon->HSLevel[0] = base1; newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base1;
newbon->HSLevel[1] = base2; newbon->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2;
break; break;
} }
case SE_Assassinate: { case SE_Assassinate: {
if (newbon->Assassinate[1] < base2) { if (newbon->Assassinate[SBIndex::FINISHING_EFFECT_DMG] < base2) {
newbon->Assassinate[0] = base1; newbon->Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = base1;
newbon->Assassinate[1] = base2; newbon->Assassinate[SBIndex::FINISHING_EFFECT_DMG] = base2;
} }
break; break;
} }
case SE_AssassinateLevel: { case SE_AssassinateLevel: {
if (newbon->AssassinateLevel[0] < base1) { if (newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < base1) {
newbon->AssassinateLevel[0] = base1; newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = base1;
newbon->AssassinateLevel[1] = base2; newbon->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2;
} }
break; break;
} }
@ -1439,16 +1439,16 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
break; break;
case SE_PC_Pet_Rampage: { case SE_PC_Pet_Rampage: {
newbon->PC_Pet_Rampage[0] += base1; //Chance to rampage newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += base1; //Chance to rampage
if (newbon->PC_Pet_Rampage[1] < base2) if (newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2)
newbon->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest newbon->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest
break; break;
} }
case SE_PC_Pet_AE_Rampage: { case SE_PC_Pet_AE_Rampage: {
newbon->PC_Pet_AE_Rampage[0] += base1; //Chance to rampage newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += base1; //Chance to rampage
if (newbon->PC_Pet_AE_Rampage[1] < base2) if (newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2)
newbon->PC_Pet_AE_Rampage[1] = base2; //Damage modifer - take highest newbon->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest
break; break;
} }
@ -1570,18 +1570,18 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_ExtraAttackChance: case SE_ExtraAttackChance:
{ {
if (newbon->ExtraAttackChance[0] < base1) { if (newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] < base1) {
newbon->ExtraAttackChance[0] = base1; newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = base1;
newbon->ExtraAttackChance[1] = base2 ? base2 : 1; newbon->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
break; break;
} }
case SE_AddExtraAttackPct_1h_Primary: case SE_AddExtraAttackPct_1h_Primary:
{ {
if (newbon->ExtraAttackChancePrimary[0] < base1) { if (newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] < base1) {
newbon->ExtraAttackChancePrimary[0] = base1; newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = base1;
newbon->ExtraAttackChancePrimary[1] = base2 ? base2 : 1; newbon->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
break; break;
} }
@ -1589,9 +1589,9 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_AddExtraAttackPct_1h_Secondary: case SE_AddExtraAttackPct_1h_Secondary:
{ {
if (newbon->ExtraAttackChanceSecondary[0] < base1) { if (newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] < base1) {
newbon->ExtraAttackChanceSecondary[0] = base1; newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = base1;
newbon->ExtraAttackChanceSecondary[1] = base2 ? base2 : 1; newbon->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
break; break;
} }
@ -2412,12 +2412,12 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_ExtraAttackChance: case SE_ExtraAttackChance:
{ {
if (AdditiveWornBonus) { if (AdditiveWornBonus) {
new_bonus->ExtraAttackChance[0] += effect_value; new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] += effect_value;
new_bonus->ExtraAttackChance[1] = base2 ? base2 : 1; new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
if (new_bonus->ExtraAttackChance[0] < effect_value) { if (new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] < effect_value) {
new_bonus->ExtraAttackChance[0] = effect_value; new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
new_bonus->ExtraAttackChance[1] = base2 ? base2 : 1; new_bonus->ExtraAttackChance[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
break; break;
} }
@ -2425,13 +2425,13 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_AddExtraAttackPct_1h_Primary: case SE_AddExtraAttackPct_1h_Primary:
{ {
if (AdditiveWornBonus) { if (AdditiveWornBonus) {
new_bonus->ExtraAttackChancePrimary[0] += effect_value; new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] += effect_value;
new_bonus->ExtraAttackChancePrimary[1] = base2 ? base2 : 1; new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
if (new_bonus->ExtraAttackChancePrimary[0] < effect_value) { if (new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] < effect_value) {
new_bonus->ExtraAttackChancePrimary[0] = effect_value; new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
new_bonus->ExtraAttackChancePrimary[1] = base2 ? base2 : 1; new_bonus->ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
break; break;
} }
@ -2439,13 +2439,13 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_AddExtraAttackPct_1h_Secondary: case SE_AddExtraAttackPct_1h_Secondary:
{ {
if (AdditiveWornBonus) { if (AdditiveWornBonus) {
new_bonus->ExtraAttackChanceSecondary[0] += effect_value; new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] += effect_value;
new_bonus->ExtraAttackChanceSecondary[1] = base2 ? base2 : 1; new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
if (new_bonus->ExtraAttackChanceSecondary[0] < effect_value) { if (new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] < effect_value) {
new_bonus->ExtraAttackChanceSecondary[0] = effect_value; new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
new_bonus->ExtraAttackChanceSecondary[1] = base2 ? base2 : 1; new_bonus->ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_NUM_ATKS] = base2 ? base2 : 1;
} }
break; break;
} }
@ -2459,13 +2459,13 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_DeathSave: case SE_DeathSave:
{ {
if(new_bonus->DeathSave[0] < effect_value) if(new_bonus->DeathSave[SBIndex::DEATH_SAVE_TYPE] < effect_value)
{ {
new_bonus->DeathSave[0] = effect_value; //1='Partial' 2='Full' new_bonus->DeathSave[SBIndex::DEATH_SAVE_TYPE] = effect_value; //1='Partial' 2='Full'
new_bonus->DeathSave[1] = buffslot; new_bonus->DeathSave[SBIndex::DEATH_SAVE_BUFFSLOT] = buffslot;
//These are used in later expansion spell effects. //These are used in later expansion spell effects.
new_bonus->DeathSave[2] = base2;//Min level for HealAmt new_bonus->DeathSave[SBIndex::DEATH_SAVE_MIN_LEVEL_FOR_HEAL] = base2;//Min level for HealAmt
new_bonus->DeathSave[3] = max;//HealAmt new_bonus->DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT] = max;//HealAmt
} }
break; break;
} }
@ -2473,14 +2473,14 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_DivineSave: case SE_DivineSave:
{ {
if (AdditiveWornBonus) { if (AdditiveWornBonus) {
new_bonus->DivineSaveChance[0] += effect_value; new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] += effect_value;
new_bonus->DivineSaveChance[1] = 0; new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = 0;
} }
else if(new_bonus->DivineSaveChance[0] < effect_value) else if(new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] < effect_value)
{ {
new_bonus->DivineSaveChance[0] = effect_value; new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] = effect_value;
new_bonus->DivineSaveChance[1] = base2; new_bonus->DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID] = base2;
} }
break; break;
} }
@ -2712,39 +2712,39 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_LimitHPPercent: case SE_LimitHPPercent:
{ {
if(new_bonus->HPPercCap[0] != 0 && new_bonus->HPPercCap[0] > effect_value){ if(new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] != 0 && new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] > effect_value){
new_bonus->HPPercCap[0] = effect_value; new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value;
new_bonus->HPPercCap[1] = base2; new_bonus->HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2;
} }
else if(new_bonus->HPPercCap[0] == 0){ else if(new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] == 0){
new_bonus->HPPercCap[0] = effect_value; new_bonus->HPPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value;
new_bonus->HPPercCap[1] = base2; new_bonus->HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2;
} }
break; break;
} }
case SE_LimitManaPercent: case SE_LimitManaPercent:
{ {
if(new_bonus->ManaPercCap[0] != 0 && new_bonus->ManaPercCap[0] > effect_value){ if(new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] != 0 && new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] > effect_value){
new_bonus->ManaPercCap[0] = effect_value; new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value;
new_bonus->ManaPercCap[1] = base2; new_bonus->ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2;
} }
else if(new_bonus->ManaPercCap[0] == 0) { else if(new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] == 0) {
new_bonus->ManaPercCap[0] = effect_value; new_bonus->ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value;
new_bonus->ManaPercCap[1] = base2; new_bonus->ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2;
} }
break; break;
} }
case SE_LimitEndPercent: case SE_LimitEndPercent:
{ {
if(new_bonus->EndPercCap[0] != 0 && new_bonus->EndPercCap[0] > effect_value) { if(new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] != 0 && new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] > effect_value) {
new_bonus->EndPercCap[0] = effect_value; new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value;
new_bonus->EndPercCap[1] = base2; new_bonus->EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2;
} }
else if(new_bonus->EndPercCap[0] == 0){ else if(new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] == 0){
new_bonus->EndPercCap[0] = effect_value; new_bonus->EndPercCap[SBIndex::RESOURCE_PERCENT_CAP] = effect_value;
new_bonus->EndPercCap[1] = base2; new_bonus->EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] = base2;
} }
break; break;
@ -2802,22 +2802,22 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_NegateAttacks: case SE_NegateAttacks:
{ {
if (!new_bonus->NegateAttacks[0] || if (!new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] ||
((new_bonus->NegateAttacks[0] && new_bonus->NegateAttacks[2]) && (new_bonus->NegateAttacks[2] < max))){ ((new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] && new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT]) && (new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] < max))){
new_bonus->NegateAttacks[0] = 1; new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] = 1;
new_bonus->NegateAttacks[1] = buffslot; new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT] = buffslot;
new_bonus->NegateAttacks[2] = max; new_bonus->NegateAttacks[SBIndex::NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT] = max;
} }
break; break;
} }
case SE_MitigateMeleeDamage: case SE_MitigateMeleeDamage:
{ {
if (new_bonus->MitigateMeleeRune[0] < effect_value){ if (new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] < effect_value){
new_bonus->MitigateMeleeRune[0] = effect_value; new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value;
new_bonus->MitigateMeleeRune[1] = buffslot; new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = buffslot;
new_bonus->MitigateMeleeRune[2] = base2; new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = base2;
new_bonus->MitigateMeleeRune[3] = max; new_bonus->MitigateMeleeRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max;
} }
break; break;
} }
@ -2825,42 +2825,42 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_MeleeThresholdGuard: case SE_MeleeThresholdGuard:
{ {
if (new_bonus->MeleeThresholdGuard[0] < effect_value){ if (new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] < effect_value){
new_bonus->MeleeThresholdGuard[0] = effect_value; new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] = effect_value;
new_bonus->MeleeThresholdGuard[1] = buffslot; new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = buffslot;
new_bonus->MeleeThresholdGuard[2] = base2; new_bonus->MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER] = base2;
} }
break; break;
} }
case SE_SpellThresholdGuard: case SE_SpellThresholdGuard:
{ {
if (new_bonus->SpellThresholdGuard[0] < effect_value){ if (new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] < effect_value){
new_bonus->SpellThresholdGuard[0] = effect_value; new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] = effect_value;
new_bonus->SpellThresholdGuard[1] = buffslot; new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = buffslot;
new_bonus->SpellThresholdGuard[2] = base2; new_bonus->SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MIN_DMG_TO_TRIGGER] = base2;
} }
break; break;
} }
case SE_MitigateSpellDamage: case SE_MitigateSpellDamage:
{ {
if (new_bonus->MitigateSpellRune[0] < effect_value){ if (new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] < effect_value){
new_bonus->MitigateSpellRune[0] = effect_value; new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value;
new_bonus->MitigateSpellRune[1] = buffslot; new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = buffslot;
new_bonus->MitigateSpellRune[2] = base2; new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = base2;
new_bonus->MitigateSpellRune[3] = max; new_bonus->MitigateSpellRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max;
} }
break; break;
} }
case SE_MitigateDotDamage: case SE_MitigateDotDamage:
{ {
if (new_bonus->MitigateDotRune[0] < effect_value){ if (new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] < effect_value){
new_bonus->MitigateDotRune[0] = effect_value; new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value;
new_bonus->MitigateDotRune[1] = buffslot; new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = buffslot;
new_bonus->MitigateDotRune[2] = base2; new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT] = base2;
new_bonus->MitigateDotRune[3] = max; new_bonus->MitigateDotRune[SBIndex::MITIGATION_RUNE_MAX_HP_AMT] = max;
} }
break; break;
} }
@ -2875,9 +2875,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_Endurance_Absorb_Pct_Damage: case SE_Endurance_Absorb_Pct_Damage:
{ {
if (new_bonus->EnduranceAbsorbPercentDamage[0] < effect_value) { if (new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] < effect_value) {
new_bonus->EnduranceAbsorbPercentDamage[0] = effect_value; new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] = effect_value;
new_bonus->EnduranceAbsorbPercentDamage[1] = base2; new_bonus->EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_DRAIN_PER_HP] = base2;
} }
break; break;
} }
@ -3117,17 +3117,17 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
{ {
//Only allow for regular double riposte chance. //Only allow for regular double riposte chance.
if(new_bonus->GiveDoubleRiposte[base2] == 0){ if(new_bonus->GiveDoubleRiposte[base2] == 0){
if(new_bonus->GiveDoubleRiposte[0] < effect_value) if(new_bonus->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] < effect_value)
new_bonus->GiveDoubleRiposte[0] = effect_value; new_bonus->GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = effect_value;
} }
break; break;
} }
case SE_SlayUndead: case SE_SlayUndead:
{ {
if(new_bonus->SlayUndead[1] < effect_value) if(new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] < effect_value)
new_bonus->SlayUndead[0] = effect_value; // Rate new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = effect_value; // Rate
new_bonus->SlayUndead[1] = base2; // Damage Modifier new_bonus->SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = base2; // Damage Modifier
break; break;
} }
@ -3141,10 +3141,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break; break;
case SE_ImprovedTaunt: case SE_ImprovedTaunt:
if (new_bonus->ImprovedTaunt[0] < effect_value) { if (new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL] < effect_value) {
new_bonus->ImprovedTaunt[0] = effect_value; new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL] = effect_value;
new_bonus->ImprovedTaunt[1] = base2; new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_AGGRO_MOD] = base2;
new_bonus->ImprovedTaunt[2] = buffslot; new_bonus->ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT] = buffslot;
} }
break; break;
@ -3158,38 +3158,38 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break; break;
case SE_Root: case SE_Root:
if (new_bonus->Root[0] && (new_bonus->Root[1] > buffslot)){ if (new_bonus->Root[SBIndex::ROOT_EXISTS] && (new_bonus->Root[SBIndex::ROOT_BUFFSLOT] > buffslot)){
new_bonus->Root[0] = 1; new_bonus->Root[SBIndex::ROOT_EXISTS] = 1;
new_bonus->Root[1] = buffslot; new_bonus->Root[SBIndex::ROOT_BUFFSLOT] = buffslot;
} }
else if (!new_bonus->Root[0]){ else if (!new_bonus->Root[SBIndex::ROOT_EXISTS]){
new_bonus->Root[0] = 1; new_bonus->Root[SBIndex::ROOT_EXISTS] = 1;
new_bonus->Root[1] = buffslot; new_bonus->Root[SBIndex::ROOT_BUFFSLOT] = buffslot;
} }
break; break;
case SE_Rune: case SE_Rune:
if (new_bonus->MeleeRune[0] && (new_bonus->MeleeRune[1] > buffslot)){ if (new_bonus->MeleeRune[SBIndex::RUNE_AMOUNT] && (new_bonus->MeleeRune[SBIndex::RUNE_BUFFSLOT] > buffslot)){
new_bonus->MeleeRune[0] = effect_value; new_bonus->MeleeRune[SBIndex::RUNE_AMOUNT] = effect_value;
new_bonus->MeleeRune[1] = buffslot; new_bonus->MeleeRune[SBIndex::RUNE_BUFFSLOT] = buffslot;
} }
else if (!new_bonus->MeleeRune[0]){ else if (!new_bonus->MeleeRune[SBIndex::RUNE_AMOUNT]){
new_bonus->MeleeRune[0] = effect_value; new_bonus->MeleeRune[SBIndex::RUNE_AMOUNT] = effect_value;
new_bonus->MeleeRune[1] = buffslot; new_bonus->MeleeRune[SBIndex::RUNE_BUFFSLOT] = buffslot;
} }
break; break;
case SE_AbsorbMagicAtt: case SE_AbsorbMagicAtt:
if (new_bonus->AbsorbMagicAtt[0] && (new_bonus->AbsorbMagicAtt[1] > buffslot)){ if (new_bonus->AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] && (new_bonus->AbsorbMagicAtt[SBIndex::RUNE_BUFFSLOT] > buffslot)){
new_bonus->AbsorbMagicAtt[0] = effect_value; new_bonus->AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] = effect_value;
new_bonus->AbsorbMagicAtt[1] = buffslot; new_bonus->AbsorbMagicAtt[SBIndex::RUNE_BUFFSLOT] = buffslot;
} }
else if (!new_bonus->AbsorbMagicAtt[0]){ else if (!new_bonus->AbsorbMagicAtt[SBIndex::RUNE_AMOUNT]){
new_bonus->AbsorbMagicAtt[0] = effect_value; new_bonus->AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] = effect_value;
new_bonus->AbsorbMagicAtt[1] = buffslot; new_bonus->AbsorbMagicAtt[SBIndex::RUNE_BUFFSLOT] = buffslot;
} }
break; break;
@ -3222,23 +3222,23 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break; break;
case SE_AStacker: case SE_AStacker:
new_bonus->AStacker[0] = 1; new_bonus->AStacker[SBIndex::BUFFSTACKER_EXISTS] = 1;
new_bonus->AStacker[1] = effect_value; new_bonus->AStacker[SBIndex::BUFFSTACKER_VALUE] = effect_value;
break; break;
case SE_BStacker: case SE_BStacker:
new_bonus->BStacker[0] = 1; new_bonus->BStacker[SBIndex::BUFFSTACKER_EXISTS] = 1;
new_bonus->BStacker[1] = effect_value; new_bonus->BStacker[SBIndex::BUFFSTACKER_VALUE] = effect_value;
break; break;
case SE_CStacker: case SE_CStacker:
new_bonus->CStacker[0] = 1; new_bonus->CStacker[SBIndex::BUFFSTACKER_EXISTS] = 1;
new_bonus->CStacker[1] = effect_value; new_bonus->CStacker[SBIndex::BUFFSTACKER_VALUE] = effect_value;
break; break;
case SE_DStacker: case SE_DStacker:
new_bonus->DStacker[0] = 1; new_bonus->DStacker[SBIndex::BUFFSTACKER_EXISTS] = 1;
new_bonus->DStacker[1] = effect_value; new_bonus->DStacker[SBIndex::BUFFSTACKER_VALUE] = effect_value;
break; break;
case SE_Berserk: case SE_Berserk:
@ -3262,36 +3262,36 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_HeadShot: case SE_HeadShot:
{ {
if(new_bonus->HeadShot[1] < base2){ if(new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_DMG] < base2){
new_bonus->HeadShot[0] = effect_value; new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
new_bonus->HeadShot[1] = base2; new_bonus->HeadShot[SBIndex::FINISHING_EFFECT_DMG] = base2;
} }
break; break;
} }
case SE_HeadShotLevel: case SE_HeadShotLevel:
{ {
if(new_bonus->HSLevel[0] < effect_value) { if(new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < effect_value) {
new_bonus->HSLevel[0] = effect_value; new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
new_bonus->HSLevel[1] = base2; new_bonus->HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2;
} }
break; break;
} }
case SE_Assassinate: case SE_Assassinate:
{ {
if(new_bonus->Assassinate[1] < base2){ if(new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_DMG] < base2){
new_bonus->Assassinate[0] = effect_value; new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
new_bonus->Assassinate[1] = base2; new_bonus->Assassinate[SBIndex::FINISHING_EFFECT_DMG] = base2;
} }
break; break;
} }
case SE_AssassinateLevel: case SE_AssassinateLevel:
{ {
if(new_bonus->AssassinateLevel[0] < effect_value) { if(new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < effect_value) {
new_bonus->AssassinateLevel[0] = effect_value; new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
new_bonus->AssassinateLevel[1] = base2; new_bonus->AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2;
} }
break; break;
} }
@ -3299,9 +3299,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_FinishingBlow: case SE_FinishingBlow:
{ {
//base1 = chance, base2 = damage //base1 = chance, base2 = damage
if (new_bonus->FinishingBlow[1] < base2){ if (new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] < base2){
new_bonus->FinishingBlow[0] = effect_value; new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
new_bonus->FinishingBlow[1] = base2; new_bonus->FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = base2;
} }
break; break;
} }
@ -3309,9 +3309,9 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_FinishingBlowLvl: case SE_FinishingBlowLvl:
{ {
//base1 = level, base2 = ??? (Set to 200 in AA data, possible proc rate mod?) //base1 = level, base2 = ??? (Set to 200 in AA data, possible proc rate mod?)
if (new_bonus->FinishingBlowLvl[0] < effect_value){ if (new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] < effect_value){
new_bonus->FinishingBlowLvl[0] = effect_value; new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
new_bonus->FinishingBlowLvl[1] = base2; new_bonus->FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = base2;
} }
break; break;
} }
@ -3379,16 +3379,16 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
} }
case SE_PC_Pet_Rampage: { case SE_PC_Pet_Rampage: {
new_bonus->PC_Pet_Rampage[0] += effect_value; //Chance to rampage new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += effect_value; //Chance to rampage
if (new_bonus->PC_Pet_Rampage[1] < base2) if (new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2)
new_bonus->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest new_bonus->PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest
break; break;
} }
case SE_PC_Pet_AE_Rampage: { case SE_PC_Pet_AE_Rampage: {
new_bonus->PC_Pet_AE_Rampage[0] += effect_value; //Chance to rampage new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] += effect_value; //Chance to rampage
if (new_bonus->PC_Pet_AE_Rampage[1] < base2) if (new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] < base2)
new_bonus->PC_Pet_AE_Rampage[1] = base2; //Damage modifer - take highest new_bonus->PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = base2; //Damage modifer - take highest
break; break;
} }
@ -4367,21 +4367,21 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_ExtraAttackChance: case SE_ExtraAttackChance:
spellbonuses.ExtraAttackChance[0] = effect_value; spellbonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
aabonuses.ExtraAttackChance[0] = effect_value; aabonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
itembonuses.ExtraAttackChance[0] = effect_value; itembonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
break; break;
case SE_AddExtraAttackPct_1h_Primary: case SE_AddExtraAttackPct_1h_Primary:
spellbonuses.ExtraAttackChancePrimary[0] = effect_value; spellbonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
aabonuses.ExtraAttackChancePrimary[0] = effect_value; aabonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
itembonuses.ExtraAttackChancePrimary[0] = effect_value; itembonuses.ExtraAttackChancePrimary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
break; break;
case SE_AddExtraAttackPct_1h_Secondary: case SE_AddExtraAttackPct_1h_Secondary:
spellbonuses.ExtraAttackChanceSecondary[0] = effect_value; spellbonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
aabonuses.ExtraAttackChanceSecondary[0] = effect_value; aabonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
itembonuses.ExtraAttackChanceSecondary[0] = effect_value; itembonuses.ExtraAttackChanceSecondary[SBIndex::EXTRA_ATTACK_CHANCE] = effect_value;
break; break;
case SE_PercentXPIncrease: case SE_PercentXPIncrease:
@ -4616,35 +4616,35 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
} }
case SE_NegateAttacks: case SE_NegateAttacks:
spellbonuses.NegateAttacks[0] = effect_value; spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_EXISTS] = effect_value;
spellbonuses.NegateAttacks[1] = effect_value; spellbonuses.NegateAttacks[SBIndex::NEGATE_ATK_BUFFSLOT] = effect_value;
break; break;
case SE_MitigateMeleeDamage: case SE_MitigateMeleeDamage:
spellbonuses.MitigateMeleeRune[0] = effect_value; spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value;
spellbonuses.MitigateMeleeRune[1] = -1; spellbonuses.MitigateMeleeRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = -1;
break; break;
case SE_MeleeThresholdGuard: case SE_MeleeThresholdGuard:
spellbonuses.MeleeThresholdGuard[0] = effect_value; spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] = effect_value;
spellbonuses.MeleeThresholdGuard[1] = -1; spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = -1;
spellbonuses.MeleeThresholdGuard[1] = effect_value; spellbonuses.MeleeThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = effect_value;
break; break;
case SE_SpellThresholdGuard: case SE_SpellThresholdGuard:
spellbonuses.SpellThresholdGuard[0] = effect_value; spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_MITIGATION_PERCENT] = effect_value;
spellbonuses.SpellThresholdGuard[1] = -1; spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = -1;
spellbonuses.SpellThresholdGuard[1] = effect_value; spellbonuses.SpellThresholdGuard[SBIndex::THRESHOLDGUARD_BUFFSLOT] = effect_value;
break; break;
case SE_MitigateSpellDamage: case SE_MitigateSpellDamage:
spellbonuses.MitigateSpellRune[0] = effect_value; spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value;
spellbonuses.MitigateSpellRune[1] = -1; spellbonuses.MitigateSpellRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = -1;
break; break;
case SE_MitigateDotDamage: case SE_MitigateDotDamage:
spellbonuses.MitigateDotRune[0] = effect_value; spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_PERCENT] = effect_value;
spellbonuses.MitigateDotRune[1] = -1; spellbonuses.MitigateDotRune[SBIndex::MITIGATION_RUNE_BUFFSLOT] = -1;
break; break;
case SE_ManaAbsorbPercentDamage: case SE_ManaAbsorbPercentDamage:
@ -4652,8 +4652,8 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_Endurance_Absorb_Pct_Damage: case SE_Endurance_Absorb_Pct_Damage:
spellbonuses.EnduranceAbsorbPercentDamage[0] = effect_value; spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_MITIGIATION] = effect_value;
spellbonuses.EnduranceAbsorbPercentDamage[1] = effect_value; spellbonuses.EnduranceAbsorbPercentDamage[SBIndex::ENDURANCE_ABSORD_DRAIN_PER_HP] = effect_value;
break; break;
case SE_ShieldBlock: case SE_ShieldBlock:
@ -4894,18 +4894,18 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_GiveDoubleRiposte: case SE_GiveDoubleRiposte:
spellbonuses.GiveDoubleRiposte[0] = effect_value; spellbonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = effect_value;
itembonuses.GiveDoubleRiposte[0] = effect_value; itembonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = effect_value;
aabonuses.GiveDoubleRiposte[0] = effect_value; aabonuses.GiveDoubleRiposte[SBIndex::DOUBLE_RIPOSTE_CHANCE] = effect_value;
break; break;
case SE_SlayUndead: case SE_SlayUndead:
spellbonuses.SlayUndead[0] = effect_value; spellbonuses.SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = effect_value;
spellbonuses.SlayUndead[1] = effect_value; spellbonuses.SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = effect_value;
itembonuses.SlayUndead[0] = effect_value; itembonuses.SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = effect_value;
itembonuses.SlayUndead[1] = effect_value; itembonuses.SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = effect_value;
aabonuses.SlayUndead[0] = effect_value; aabonuses.SlayUndead[SBIndex::SLAYUNDEAD_RATE_MOD] = effect_value;
aabonuses.SlayUndead[1] = effect_value; aabonuses.SlayUndead[SBIndex::SLAYUNDEAD_DMG_MOD] = effect_value;
break; break;
case SE_DoubleRangedAttack: case SE_DoubleRangedAttack:
@ -4955,9 +4955,9 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_ImprovedTaunt: case SE_ImprovedTaunt:
spellbonuses.ImprovedTaunt[0] = effect_value; spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL] = effect_value;
spellbonuses.ImprovedTaunt[1] = effect_value; spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_AGGRO_MOD] = effect_value;
spellbonuses.ImprovedTaunt[2] = -1; spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT] = -1;
break; break;
case SE_FrenziedDevastation: case SE_FrenziedDevastation:
@ -4967,18 +4967,18 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_Root: case SE_Root:
spellbonuses.Root[0] = effect_value; spellbonuses.Root[SBIndex::ROOT_EXISTS] = effect_value;
spellbonuses.Root[1] = -1; spellbonuses.Root[SBIndex::ROOT_BUFFSLOT] = -1;
break; break;
case SE_Rune: case SE_Rune:
spellbonuses.MeleeRune[0] = effect_value; spellbonuses.MeleeRune[SBIndex::RUNE_AMOUNT] = effect_value;
spellbonuses.MeleeRune[1] = -1; spellbonuses.MeleeRune[SBIndex::RUNE_BUFFSLOT] = -1;
break; break;
case SE_AbsorbMagicAtt: case SE_AbsorbMagicAtt:
spellbonuses.AbsorbMagicAtt[0] = effect_value; spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_AMOUNT] = effect_value;
spellbonuses.AbsorbMagicAtt[1] = -1; spellbonuses.AbsorbMagicAtt[SBIndex::RUNE_BUFFSLOT] = -1;
break; break;
case SE_Berserk: case SE_Berserk:
@ -5006,57 +5006,57 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_HeadShot: case SE_HeadShot:
spellbonuses.HeadShot[0] = effect_value; spellbonuses.HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
aabonuses.HeadShot[0] = effect_value; aabonuses.HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
itembonuses.HeadShot[0] = effect_value; itembonuses.HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
spellbonuses.HeadShot[1] = effect_value; spellbonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
aabonuses.HeadShot[1] = effect_value; aabonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
itembonuses.HeadShot[1] = effect_value; itembonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
break; break;
case SE_HeadShotLevel: case SE_HeadShotLevel:
spellbonuses.HSLevel[0] = effect_value; spellbonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
aabonuses.HSLevel[0] = effect_value; aabonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
itembonuses.HSLevel[0] = effect_value; itembonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
spellbonuses.HSLevel[1] = effect_value; spellbonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
aabonuses.HSLevel[1] = effect_value; aabonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
itembonuses.HSLevel[1] = effect_value; itembonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
break; break;
case SE_Assassinate: case SE_Assassinate:
spellbonuses.Assassinate[0] = effect_value; spellbonuses.Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
aabonuses.Assassinate[0] = effect_value; aabonuses.Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
itembonuses.Assassinate[0] = effect_value; itembonuses.Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
spellbonuses.Assassinate[1] = effect_value; spellbonuses.Assassinate[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
aabonuses.Assassinate[1] = effect_value; aabonuses.Assassinate[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
itembonuses.Assassinate[1] = effect_value; itembonuses.Assassinate[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
break; break;
case SE_AssassinateLevel: case SE_AssassinateLevel:
spellbonuses.AssassinateLevel[0] = effect_value; spellbonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
aabonuses.AssassinateLevel[0] = effect_value; aabonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
itembonuses.AssassinateLevel[0] = effect_value; itembonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
spellbonuses.AssassinateLevel[1] = effect_value; spellbonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
aabonuses.AssassinateLevel[1] = effect_value; aabonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
itembonuses.AssassinateLevel[1] = effect_value; itembonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
break; break;
case SE_FinishingBlow: case SE_FinishingBlow:
spellbonuses.FinishingBlow[0] = effect_value; spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
aabonuses.FinishingBlow[0] = effect_value; aabonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
itembonuses.FinishingBlow[0] = effect_value; itembonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_PROC_CHANCE] = effect_value;
spellbonuses.FinishingBlow[1] = effect_value; spellbonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
aabonuses.FinishingBlow[1] = effect_value; aabonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
itembonuses.FinishingBlow[1] = effect_value; itembonuses.FinishingBlow[SBIndex::FINISHING_EFFECT_DMG] = effect_value;
break; break;
case SE_FinishingBlowLvl: case SE_FinishingBlowLvl:
spellbonuses.FinishingBlowLvl[0] = effect_value; spellbonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
aabonuses.FinishingBlowLvl[0] = effect_value; aabonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
itembonuses.FinishingBlowLvl[0] = effect_value; itembonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_MAX] = effect_value;
spellbonuses.FinishingBlowLvl[1] = effect_value; spellbonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
aabonuses.FinishingBlowLvl[1] = effect_value; aabonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
itembonuses.FinishingBlowLvl[1] = effect_value; itembonuses.FinishingBlowLvl[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS] = effect_value;
break; break;
case SE_Sanctuary: case SE_Sanctuary:
@ -5095,21 +5095,21 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_Melee_Damage_Position_Mod: case SE_Melee_Damage_Position_Mod:
spellbonuses.Melee_Damage_Position_Mod[0] = effect_value; spellbonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] = effect_value;
aabonuses.Melee_Damage_Position_Mod[0] = effect_value; aabonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] = effect_value;
itembonuses.Melee_Damage_Position_Mod[0] = effect_value; itembonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] = effect_value;
spellbonuses.Melee_Damage_Position_Mod[1] = effect_value; spellbonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_LOCATION] = effect_value;
aabonuses.Melee_Damage_Position_Mod[1] = effect_value; aabonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_LOCATION] = effect_value;
itembonuses.Melee_Damage_Position_Mod[1] = effect_value; itembonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_LOCATION] = effect_value;
break; break;
case SE_Damage_Taken_Position_Mod: case SE_Damage_Taken_Position_Mod:
spellbonuses.Damage_Taken_Position_Mod[0] = effect_value; spellbonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] = effect_value;
aabonuses.Damage_Taken_Position_Mod[0] = effect_value; aabonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] = effect_value;
itembonuses.Damage_Taken_Position_Mod[0] = effect_value; itembonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] = effect_value;
spellbonuses.Damage_Taken_Position_Mod[1] = effect_value; spellbonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_LOCATION] = effect_value;
aabonuses.Damage_Taken_Position_Mod[1] = effect_value; aabonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_LOCATION] = effect_value;
itembonuses.Damage_Taken_Position_Mod[1] = effect_value; itembonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_LOCATION] = effect_value;
break; break;
@ -5138,21 +5138,21 @@ void Mob::NegateSpellsBonuses(uint16 spell_id)
break; break;
case SE_PC_Pet_Rampage: case SE_PC_Pet_Rampage:
spellbonuses.PC_Pet_Rampage[0] = effect_value; spellbonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] = effect_value;
itembonuses.PC_Pet_Rampage[0] = effect_value; itembonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] = effect_value;
aabonuses.PC_Pet_Rampage[0] = effect_value; aabonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] = effect_value;
spellbonuses.PC_Pet_Rampage[1] = effect_value; spellbonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = effect_value;
itembonuses.PC_Pet_Rampage[1] = effect_value; itembonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = effect_value;
aabonuses.PC_Pet_Rampage[1] = effect_value; aabonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = effect_value;
break; break;
case SE_PC_Pet_AE_Rampage: case SE_PC_Pet_AE_Rampage:
spellbonuses.PC_Pet_AE_Rampage[0] = effect_value; spellbonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] = effect_value;
itembonuses.PC_Pet_AE_Rampage[0] = effect_value; itembonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] = effect_value;
aabonuses.PC_Pet_AE_Rampage[0] = effect_value; aabonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] = effect_value;
spellbonuses.PC_Pet_AE_Rampage[1] = effect_value; spellbonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = effect_value;
itembonuses.PC_Pet_AE_Rampage[1] = effect_value; itembonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = effect_value;
aabonuses.PC_Pet_AE_Rampage[1] = effect_value; aabonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_DMG_MOD] = effect_value;
break; break;

View File

@ -328,10 +328,10 @@ int32 Client::CalcMaxHP()
if (current_hp > max_hp) { if (current_hp > max_hp) {
current_hp = max_hp; current_hp = max_hp;
} }
int hp_perc_cap = spellbonuses.HPPercCap[0]; int hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if (hp_perc_cap) { if (hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100; int curHP_cap = (max_hp * hp_perc_cap) / 100;
if (current_hp > curHP_cap || (spellbonuses.HPPercCap[1] && current_hp > spellbonuses.HPPercCap[1])) { if (current_hp > curHP_cap || (spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_hp > spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
current_hp = curHP_cap; current_hp = curHP_cap;
} }
@ -591,10 +591,10 @@ int32 Client::CalcMaxMana()
if (current_mana > max_mana) { if (current_mana > max_mana) {
current_mana = max_mana; current_mana = max_mana;
} }
int mana_perc_cap = spellbonuses.ManaPercCap[0]; int mana_perc_cap = spellbonuses.ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if (mana_perc_cap) { if (mana_perc_cap) {
int curMana_cap = (max_mana * mana_perc_cap) / 100; int curMana_cap = (max_mana * mana_perc_cap) / 100;
if (current_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && current_mana > spellbonuses.ManaPercCap[1])) { if (current_mana > curMana_cap || (spellbonuses.ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_mana > spellbonuses.ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
current_mana = curMana_cap; current_mana = curMana_cap;
} }
} }
@ -1614,10 +1614,10 @@ void Client::CalcMaxEndurance()
if (current_endurance > max_end) { if (current_endurance > max_end) {
current_endurance = max_end; current_endurance = max_end;
} }
int end_perc_cap = spellbonuses.EndPercCap[0]; int end_perc_cap = spellbonuses.EndPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if (end_perc_cap) { if (end_perc_cap) {
int curEnd_cap = (max_end * end_perc_cap) / 100; int curEnd_cap = (max_end * end_perc_cap) / 100;
if (current_endurance > curEnd_cap || (spellbonuses.EndPercCap[1] && current_endurance > spellbonuses.EndPercCap[1])) { if (current_endurance > curEnd_cap || (spellbonuses.EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_endurance > spellbonuses.EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP])) {
current_endurance = curEnd_cap; current_endurance = curEnd_cap;
} }
} }

View File

@ -512,7 +512,7 @@ struct StatBonuses {
bool CriticalDotDecay; // increase critical dot chance, decays based on spell level cast bool CriticalDotDecay; // increase critical dot chance, decays based on spell level cast
bool DivineAura; // invulnerability bool DivineAura; // invulnerability
bool DistanceRemoval; // Check if Cancle if Moved effect is present bool DistanceRemoval; // Check if Cancle if Moved effect is present
int32 ImprovedTaunt[3]; // 0 = Max Level 1 = Aggro modifier 2 = buffid int32 ImprovedTaunt[3]; // 0 = Max Level 1 = Aggro modifier 2 = buff slot
int8 Root[2]; // The lowest buff slot a root can be found. [0] = Bool if has root [1] = buff slot int8 Root[2]; // The lowest buff slot a root can be found. [0] = Bool if has root [1] = buff slot
int32 FrenziedDevastation; // base1= AArank(used) base2= chance increase spell criticals + all DD spells 2x mana. int32 FrenziedDevastation; // base1= AArank(used) base2= chance increase spell criticals + all DD spells 2x mana.
uint32 AbsorbMagicAtt[2]; // 0 = magic rune value 1 = buff slot uint32 AbsorbMagicAtt[2]; // 0 = magic rune value 1 = buff slot
@ -616,6 +616,58 @@ struct StatBonuses {
bool hunger; // Song of Sustenance -- min caps to 3500 bool hunger; // Song of Sustenance -- min caps to 3500
}; };
// StatBonus Indexes
namespace SBIndex {
constexpr uint16 BUFFSTACKER_EXISTS = 0; // SPA 446-449
constexpr uint16 BUFFSTACKER_VALUE = 1; // SPA 446-449
constexpr uint16 EXTRA_ATTACK_CHANCE = 0; // SPA 266,498,499
constexpr uint16 EXTRA_ATTACK_NUM_ATKS = 1; // SPA 266,498,499
constexpr uint16 DIVINE_SAVE_CHANCE = 0; // SPA 232
constexpr uint16 DIVINE_SAVE_SPELL_TRIGGER_ID = 1; // SPA 232
constexpr uint16 DEATH_SAVE_TYPE = 0; // SPA 150
constexpr uint16 DEATH_SAVE_BUFFSLOT = 1; // SPA 150
constexpr uint16 DEATH_SAVE_MIN_LEVEL_FOR_HEAL = 2; // SPA 150
constexpr uint16 DEATH_SAVE_HEAL_AMT = 3; // SPA 150
constexpr uint16 RESOURCE_PERCENT_CAP = 0; // SPA 408-410
constexpr uint16 RESOURCE_AMOUNT_CAP = 1; // SPA 408-419
constexpr uint16 NEGATE_ATK_EXISTS = 0; // SPA 163
constexpr uint16 NEGATE_ATK_BUFFSLOT = 1; // SPA 163
constexpr uint16 NEGATE_ATK_MAX_DMG_ABSORB_PER_HIT = 2; // SPA 163
constexpr uint16 MITIGATION_RUNE_PERCENT = 0; // SPA 161,162,450
constexpr uint16 MITIGATION_RUNE_BUFFSLOT = 1; // SPA 161,162,450
constexpr uint16 MITIGATION_RUNE_MAX_DMG_ABSORB_PER_HIT = 2; // SPA 161,162,450
constexpr uint16 MITIGATION_RUNE_MAX_HP_AMT = 3; // SPA 161,162,450
constexpr uint16 THRESHOLDGUARD_MITIGATION_PERCENT = 0; // SPA 451,452
constexpr uint16 THRESHOLDGUARD_BUFFSLOT = 1; // SPA 451,452
constexpr uint16 THRESHOLDGUARD_MIN_DMG_TO_TRIGGER = 2; // SPA 451,452
constexpr uint16 ENDURANCE_ABSORD_MITIGIATION = 0; // SPA 521
constexpr uint16 ENDURANCE_ABSORD_DRAIN_PER_HP = 1; // SPA 521
constexpr uint16 IMPROVED_TAUNT_MAX_LVL = 0; // SPA 444
constexpr uint16 IMPROVED_TAUNT_AGGRO_MOD = 1; // SPA 444
constexpr uint16 IMPROVED_TAUNT_BUFFSLOT = 2; // SPA 444
constexpr uint16 ROOT_EXISTS = 0; // SPA 99
constexpr uint16 ROOT_BUFFSLOT = 1; // SPA 99
constexpr uint16 RUNE_AMOUNT = 0; // SPA 55
constexpr uint16 RUNE_BUFFSLOT = 1; // SPA 78
constexpr uint16 POSITIONAL_DAMAGE_MOD = 0; // SPA 503-506
constexpr uint16 POSITIONAL_LOCATION = 1; // SPA 503-506
constexpr uint16 PET_RAMPAGE_CHANCE = 0; // SPA 464,465
constexpr uint16 PET_RAMPAGE_DMG_MOD = 1; // SPA 465,465
constexpr uint16 SKILLPROC_CHANCE = 0; // SPA 427
constexpr uint16 SKILLPROC_SKILL = 1; // SPA 427
constexpr uint16 SKILLPROC_SPELL_ID = 2; // SPA 427
constexpr uint16 SLAYUNDEAD_RATE_MOD = 0; // SPA 219
constexpr uint16 SLAYUNDEAD_DMG_MOD = 1; // SPA 219
constexpr uint16 DOUBLE_RIPOSTE_CHANCE = 0; // SPA 223
constexpr uint16 DOUBLE_RIPOSTE_SKILL_ATK_CHANCE = 1; // SPA 223
constexpr uint16 DOUBLE_RIPOSTE_SKILL = 2; // SPA 223
constexpr uint16 FINISHING_EFFECT_PROC_CHANCE = 0; // SPA 278, 439, 217
constexpr uint16 FINISHING_EFFECT_DMG = 1; // SPA 278, 439, 217
constexpr uint16 FINISHING_EFFECT_LEVEL_MAX = 0; // SPA 440, 345, 346
constexpr uint16 FINISHING_EFFECT_LEVEL_CHANCE_BONUS = 1; // SPA 440, 345, 346
};
typedef struct typedef struct
{ {
uint16 spellID; uint16 spellID;

View File

@ -862,10 +862,10 @@ int32 Merc::CalcMaxHP() {
if (current_hp > max_hp) if (current_hp > max_hp)
current_hp = max_hp; current_hp = max_hp;
int hp_perc_cap = spellbonuses.HPPercCap[0]; int hp_perc_cap = spellbonuses.HPPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if(hp_perc_cap) { if(hp_perc_cap) {
int curHP_cap = (max_hp * hp_perc_cap) / 100; int curHP_cap = (max_hp * hp_perc_cap) / 100;
if (current_hp > curHP_cap || (spellbonuses.HPPercCap[1] && current_hp > spellbonuses.HPPercCap[1])) if (current_hp > curHP_cap || (spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_hp > spellbonuses.HPPercCap[SBIndex::RESOURCE_AMOUNT_CAP]))
current_hp = curHP_cap; current_hp = curHP_cap;
} }
@ -904,10 +904,10 @@ int32 Merc::CalcMaxMana()
current_mana = max_mana; current_mana = max_mana;
} }
int mana_perc_cap = spellbonuses.ManaPercCap[0]; int mana_perc_cap = spellbonuses.ManaPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if(mana_perc_cap) { if(mana_perc_cap) {
int curMana_cap = (max_mana * mana_perc_cap) / 100; int curMana_cap = (max_mana * mana_perc_cap) / 100;
if (current_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && current_mana > spellbonuses.ManaPercCap[1])) if (current_mana > curMana_cap || (spellbonuses.ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && current_mana > spellbonuses.ManaPercCap[SBIndex::RESOURCE_AMOUNT_CAP]))
current_mana = curMana_cap; current_mana = curMana_cap;
} }
@ -999,10 +999,10 @@ void Merc::CalcMaxEndurance()
cur_end = max_end; cur_end = max_end;
} }
int end_perc_cap = spellbonuses.EndPercCap[0]; int end_perc_cap = spellbonuses.EndPercCap[SBIndex::RESOURCE_PERCENT_CAP];
if(end_perc_cap) { if(end_perc_cap) {
int curEnd_cap = (max_end * end_perc_cap) / 100; int curEnd_cap = (max_end * end_perc_cap) / 100;
if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1])) if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP] && cur_end > spellbonuses.EndPercCap[SBIndex::RESOURCE_AMOUNT_CAP]))
cur_end = curEnd_cap; cur_end = curEnd_cap;
} }
} }
@ -1624,7 +1624,7 @@ void Merc::AI_Process() {
} }
} }
int16 ExtraAttackChanceBonus = spellbonuses.ExtraAttackChance[0] + itembonuses.ExtraAttackChance[0] + aabonuses.ExtraAttackChance[0]; int16 ExtraAttackChanceBonus = spellbonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] + itembonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE] + aabonuses.ExtraAttackChance[SBIndex::EXTRA_ATTACK_CHANCE];
if (GetTarget() && ExtraAttackChanceBonus) { if (GetTarget() && ExtraAttackChanceBonus) {
if(zone->random.Roll(ExtraAttackChanceBonus)) if(zone->random.Roll(ExtraAttackChanceBonus))

View File

@ -3903,8 +3903,8 @@ int32 Mob::GetPositionalDmgTaken(Mob *attacker)
int back_arc = 0; int back_arc = 0;
int total_mod = 0; int total_mod = 0;
back_arc += itembonuses.Damage_Taken_Position_Mod[0] + aabonuses.Damage_Taken_Position_Mod[0] + spellbonuses.Damage_Taken_Position_Mod[0]; back_arc += itembonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] + aabonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] + spellbonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD];
front_arc += itembonuses.Damage_Taken_Position_Mod[1] + aabonuses.Damage_Taken_Position_Mod[1] + spellbonuses.Damage_Taken_Position_Mod[1]; front_arc += itembonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_LOCATION] + aabonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_LOCATION] + spellbonuses.Damage_Taken_Position_Mod[SBIndex::POSITIONAL_LOCATION];
if (back_arc || front_arc) { //Do they have this bonus? if (back_arc || front_arc) { //Do they have this bonus?
if (attacker->BehindMob(this, attacker->GetX(), attacker->GetY()))//Check if attacker is striking from behind if (attacker->BehindMob(this, attacker->GetX(), attacker->GetY()))//Check if attacker is striking from behind
@ -4897,8 +4897,8 @@ int16 Mob::GetMeleeDmgPositionMod(Mob* defender)
int back_arc = 0; int back_arc = 0;
int total_mod = 0; int total_mod = 0;
back_arc += itembonuses.Melee_Damage_Position_Mod[0] + aabonuses.Melee_Damage_Position_Mod[0] + spellbonuses.Melee_Damage_Position_Mod[0]; back_arc += itembonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] + aabonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD] + spellbonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_DAMAGE_MOD];
front_arc += itembonuses.Melee_Damage_Position_Mod[1] + aabonuses.Melee_Damage_Position_Mod[1] + spellbonuses.Melee_Damage_Position_Mod[1]; front_arc += itembonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_LOCATION] + aabonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_LOCATION] + spellbonuses.Melee_Damage_Position_Mod[SBIndex::POSITIONAL_LOCATION];
if (back_arc || front_arc) { //Do they have this bonus? if (back_arc || front_arc) { //Do they have this bonus?
if (BehindMob(defender, GetX(), GetY()))//Check if attacker is striking from behind if (BehindMob(defender, GetX(), GetY()))//Check if attacker is striking from behind

View File

@ -1224,7 +1224,7 @@ void Mob::AI_Process() {
//SE_PC_Pet_Rampage SPA 464 on pet, chance modifier //SE_PC_Pet_Rampage SPA 464 on pet, chance modifier
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) { if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
int chance = spellbonuses.PC_Pet_Rampage[0] + itembonuses.PC_Pet_Rampage[0] + aabonuses.PC_Pet_Rampage[0]; int chance = spellbonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] + itembonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE] + aabonuses.PC_Pet_Rampage[SBIndex::PET_RAMPAGE_CHANCE];
if (chance && zone->random.Roll(chance)) { if (chance && zone->random.Roll(chance)) {
Rampage(nullptr); Rampage(nullptr);
} }
@ -1267,7 +1267,7 @@ void Mob::AI_Process() {
//SE_PC_Pet_Rampage SPA 465 on pet, chance modifier //SE_PC_Pet_Rampage SPA 465 on pet, chance modifier
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) { if ((IsPet() || IsTempPet()) && IsPetOwnerClient()) {
int chance = spellbonuses.PC_Pet_AE_Rampage[0] + itembonuses.PC_Pet_AE_Rampage[0] + aabonuses.PC_Pet_AE_Rampage[0]; int chance = spellbonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] + itembonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE] + aabonuses.PC_Pet_AE_Rampage[SBIndex::PET_RAMPAGE_CHANCE];
if (chance && zone->random.Roll(chance)) { if (chance && zone->random.Roll(chance)) {
Rampage(nullptr); Rampage(nullptr);
} }

View File

@ -193,12 +193,12 @@ void Mob::DoSpecialAttackDamage(Mob *who, EQ::skills::SkillType skill, int32 bas
DoAttack(who, my_hit); DoAttack(who, my_hit);
who->AddToHateList(this, hate, 0); who->AddToHateList(this, hate, 0);
if (my_hit.damage_done > 0 && aabonuses.SkillAttackProc[0] && aabonuses.SkillAttackProc[1] == skill && if (my_hit.damage_done > 0 && aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] && aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SKILL] == skill &&
IsValidSpell(aabonuses.SkillAttackProc[2])) { IsValidSpell(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID])) {
float chance = aabonuses.SkillAttackProc[0] / 1000.0f; float chance = aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] / 1000.0f;
if (zone->random.Roll(chance)) if (zone->random.Roll(chance))
SpellFinished(aabonuses.SkillAttackProc[2], who, EQ::spells::CastingSlot::Item, 0, -1, SpellFinished(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID], who, EQ::spells::CastingSlot::Item, 0, -1,
spells[aabonuses.SkillAttackProc[2]].ResistDiff); spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].ResistDiff);
} }
who->Damage(this, my_hit.damage_done, SPELL_UNKNOWN, skill, false); who->Damage(this, my_hit.damage_done, SPELL_UNKNOWN, skill, false);
@ -2061,9 +2061,9 @@ int Mob::TryHeadShot(Mob *defender, EQ::skills::SkillType skillInUse)
// Only works on YOUR target. // Only works on YOUR target.
if (defender && defender->GetBodyType() == BT_Humanoid && !defender->IsClient() && if (defender && defender->GetBodyType() == BT_Humanoid && !defender->IsClient() &&
skillInUse == EQ::skills::SkillArchery && GetTarget() == defender) { skillInUse == EQ::skills::SkillArchery && GetTarget() == defender) {
uint32 HeadShot_Dmg = aabonuses.HeadShot[1] + spellbonuses.HeadShot[1] + itembonuses.HeadShot[1]; uint32 HeadShot_Dmg = aabonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] + spellbonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG] + itembonuses.HeadShot[SBIndex::FINISHING_EFFECT_DMG];
uint8 HeadShot_Level = 0; // Get Highest Headshot Level uint8 HeadShot_Level = 0; // Get Highest Headshot Level
HeadShot_Level = std::max({aabonuses.HSLevel[0], spellbonuses.HSLevel[0], itembonuses.HSLevel[0]}); HeadShot_Level = std::max({aabonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX], spellbonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX], itembonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX]});
if (HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)) { if (HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)) {
int chance = GetDEX(); int chance = GetDEX();
@ -2071,10 +2071,10 @@ int Mob::TryHeadShot(Mob *defender, EQ::skills::SkillType skillInUse)
if (IsClient()) if (IsClient())
chance += CastToClient()->GetHeroicDEX() / 25; chance += CastToClient()->GetHeroicDEX() / 25;
chance *= 10; chance *= 10;
int norm = aabonuses.HSLevel[1]; int norm = aabonuses.HSLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS];
if (norm > 0) if (norm > 0)
chance = chance * norm / 100; chance = chance * norm / 100;
chance += aabonuses.HeadShot[0] + spellbonuses.HeadShot[0] + itembonuses.HeadShot[0]; chance += aabonuses.HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + spellbonuses.HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + itembonuses.HeadShot[SBIndex::FINISHING_EFFECT_PROC_CHANCE];
if (zone->random.Int(1, 1000) <= chance) { if (zone->random.Int(1, 1000) <= chance) {
entity_list.MessageCloseString( entity_list.MessageCloseString(
this, false, 200, Chat::MeleeCrit, FATAL_BOW_SHOT, this, false, 200, Chat::MeleeCrit, FATAL_BOW_SHOT,
@ -2097,7 +2097,7 @@ int Mob::TryAssassinate(Mob *defender, EQ::skills::SkillType skillInUse)
if (IsClient()) if (IsClient())
chance += CastToClient()->GetHeroicDEX(); chance += CastToClient()->GetHeroicDEX();
chance *= 10; chance *= 10;
int norm = aabonuses.AssassinateLevel[1]; int norm = aabonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_CHANCE_BONUS];
if (norm > 0) if (norm > 0)
chance = chance * norm / 100; chance = chance * norm / 100;
} else if (skillInUse == EQ::skills::SkillThrowing) { } else if (skillInUse == EQ::skills::SkillThrowing) {
@ -2107,14 +2107,14 @@ int Mob::TryAssassinate(Mob *defender, EQ::skills::SkillType skillInUse)
chance += 5; chance += 5;
} }
chance += aabonuses.Assassinate[0] + spellbonuses.Assassinate[0] + itembonuses.Assassinate[0]; chance += aabonuses.Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + spellbonuses.Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE] + itembonuses.Assassinate[SBIndex::FINISHING_EFFECT_PROC_CHANCE];
uint32 Assassinate_Dmg = uint32 Assassinate_Dmg =
aabonuses.Assassinate[1] + spellbonuses.Assassinate[1] + itembonuses.Assassinate[1]; aabonuses.Assassinate[SBIndex::FINISHING_EFFECT_DMG] + spellbonuses.Assassinate[SBIndex::FINISHING_EFFECT_DMG] + itembonuses.Assassinate[SBIndex::FINISHING_EFFECT_DMG];
uint8 Assassinate_Level = 0; // Get Highest Headshot Level uint8 Assassinate_Level = 0; // Get Highest Headshot Level
Assassinate_Level = std::max( Assassinate_Level = std::max(
{aabonuses.AssassinateLevel[0], spellbonuses.AssassinateLevel[0], itembonuses.AssassinateLevel[0]}); {aabonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX], spellbonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX], itembonuses.AssassinateLevel[SBIndex::FINISHING_EFFECT_LEVEL_MAX]});
// revamped AAs require AA line I believe? // revamped AAs require AA line I believe?
if (!Assassinate_Level) if (!Assassinate_Level)
@ -2198,12 +2198,12 @@ void Mob::DoMeleeSkillAttackDmg(Mob *other, uint16 weapon_damage, EQ::skills::Sk
} }
other->AddToHateList(this, hate, 0); other->AddToHateList(this, hate, 0);
if (damage > 0 && aabonuses.SkillAttackProc[0] && aabonuses.SkillAttackProc[1] == skillinuse && if (damage > 0 && aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] && aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SKILL] == skillinuse &&
IsValidSpell(aabonuses.SkillAttackProc[2])) { IsValidSpell(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID])) {
float chance = aabonuses.SkillAttackProc[0] / 1000.0f; float chance = aabonuses.SkillAttackProc[SBIndex::SKILLPROC_CHANCE] / 1000.0f;
if (zone->random.Roll(chance)) if (zone->random.Roll(chance))
SpellFinished(aabonuses.SkillAttackProc[2], other, EQ::spells::CastingSlot::Item, 0, -1, SpellFinished(aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID], other, EQ::spells::CastingSlot::Item, 0, -1,
spells[aabonuses.SkillAttackProc[2]].ResistDiff); spells[aabonuses.SkillAttackProc[SBIndex::SKILLPROC_SPELL_ID]].ResistDiff);
} }
other->Damage(this, damage, SPELL_UNKNOWN, skillinuse); other->Damage(this, damage, SPELL_UNKNOWN, skillinuse);

View File

@ -6192,16 +6192,16 @@ bool Mob::TryDivineSave()
-If desired, additional spells can be triggered from the AA/item/spell effect, generally a heal. -If desired, additional spells can be triggered from the AA/item/spell effect, generally a heal.
*/ */
int32 SuccessChance = aabonuses.DivineSaveChance[0] + itembonuses.DivineSaveChance[0] + spellbonuses.DivineSaveChance[0]; int32 SuccessChance = aabonuses.DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] + itembonuses.DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE] + spellbonuses.DivineSaveChance[SBIndex::DIVINE_SAVE_CHANCE];
if (SuccessChance && zone->random.Roll(SuccessChance)) if (SuccessChance && zone->random.Roll(SuccessChance))
{ {
SetHP(1); SetHP(1);
int32 EffectsToTry[] = int32 EffectsToTry[] =
{ {
aabonuses.DivineSaveChance[1], aabonuses.DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID],
itembonuses.DivineSaveChance[1], itembonuses.DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID],
spellbonuses.DivineSaveChance[1] spellbonuses.DivineSaveChance[SBIndex::DIVINE_SAVE_SPELL_TRIGGER_ID]
}; };
//Fade the divine save effect here after saving the old effects off. //Fade the divine save effect here after saving the old effects off.
//That way, if desired, the effect could apply SE_DivineSave again. //That way, if desired, the effect could apply SE_DivineSave again.
@ -6236,10 +6236,10 @@ bool Mob::TryDeathSave() {
-In later expansions this SE_DeathSave was given a level limit and a heal value in its effect data. -In later expansions this SE_DeathSave was given a level limit and a heal value in its effect data.
*/ */
if (spellbonuses.DeathSave[0]){ if (spellbonuses.DeathSave[SBIndex::DEATH_SAVE_TYPE]){
int SuccessChance = 0; int SuccessChance = 0;
int buffSlot = spellbonuses.DeathSave[1]; int buffSlot = spellbonuses.DeathSave[SBIndex::DEATH_SAVE_BUFFSLOT];
int32 UD_HealMod = 0; int32 UD_HealMod = 0;
int HealAmt = 300; //Death Pact max Heal int HealAmt = 300; //Death Pact max Heal
@ -6254,12 +6254,12 @@ bool Mob::TryDeathSave() {
if(zone->random.Roll(SuccessChance)) { if(zone->random.Roll(SuccessChance)) {
if(spellbonuses.DeathSave[0] == 2) if(spellbonuses.DeathSave[SBIndex::DEATH_SAVE_TYPE] == 2)
HealAmt = RuleI(Spells, DivineInterventionHeal); //8000HP is how much LIVE Divine Intervention max heals HealAmt = RuleI(Spells, DivineInterventionHeal); //8000HP is how much LIVE Divine Intervention max heals
//Check if bonus Heal amount can be applied ([3] Bonus Heal [2] Level limit) //Check if bonus Heal amount can be applied ([3] Bonus Heal [2] Level limit)
if (spellbonuses.DeathSave[3] && (GetLevel() >= spellbonuses.DeathSave[2])) if (spellbonuses.DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT] && (GetLevel() >= spellbonuses.DeathSave[SBIndex::DEATH_SAVE_MIN_LEVEL_FOR_HEAL]))
HealAmt += spellbonuses.DeathSave[3]; HealAmt += spellbonuses.DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT];
if ((GetMaxHP() - GetHP()) < HealAmt) if ((GetMaxHP() - GetHP()) < HealAmt)
HealAmt = GetMaxHP() - GetHP(); HealAmt = GetMaxHP() - GetHP();
@ -6267,7 +6267,7 @@ bool Mob::TryDeathSave() {
SetHP((GetHP()+HealAmt)); SetHP((GetHP()+HealAmt));
Message(263, "The gods have healed you for %i points of damage.", HealAmt); Message(263, "The gods have healed you for %i points of damage.", HealAmt);
if(spellbonuses.DeathSave[0] == 2) if(spellbonuses.DeathSave[SBIndex::DEATH_SAVE_TYPE] == 2)
entity_list.MessageCloseString( entity_list.MessageCloseString(
this, this,
false, false,
@ -6291,12 +6291,12 @@ bool Mob::TryDeathSave() {
if(zone->random.Roll(SuccessChance)) { if(zone->random.Roll(SuccessChance)) {
if(spellbonuses.DeathSave[0] == 2) if(spellbonuses.DeathSave[SBIndex::DEATH_SAVE_TYPE] == 2)
HealAmt = RuleI(Spells, DivineInterventionHeal); HealAmt = RuleI(Spells, DivineInterventionHeal);
//Check if bonus Heal amount can be applied ([3] Bonus Heal [2] Level limit) //Check if bonus Heal amount can be applied ([3] Bonus Heal [2] Level limit)
if (spellbonuses.DeathSave[3] && (GetLevel() >= spellbonuses.DeathSave[2])) if (spellbonuses.DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT] && (GetLevel() >= spellbonuses.DeathSave[SBIndex::DEATH_SAVE_MIN_LEVEL_FOR_HEAL]))
HealAmt += spellbonuses.DeathSave[3]; HealAmt += spellbonuses.DeathSave[SBIndex::DEATH_SAVE_HEAL_AMT];
HealAmt = HealAmt*UD_HealMod/100; HealAmt = HealAmt*UD_HealMod/100;
@ -6306,7 +6306,7 @@ bool Mob::TryDeathSave() {
SetHP((GetHP()+HealAmt)); SetHP((GetHP()+HealAmt));
Message(263, "The gods have healed you for %i points of damage.", HealAmt); Message(263, "The gods have healed you for %i points of damage.", HealAmt);
if(spellbonuses.DeathSave[0] == 2) if(spellbonuses.DeathSave[SBIndex::DEATH_SAVE_TYPE] == 2)
entity_list.MessageCloseString( entity_list.MessageCloseString(
this, this,
false, false,
@ -6645,22 +6645,22 @@ bool Mob::TryDispel(uint8 caster_level, uint8 buff_level, int level_modifier){
bool Mob::ImprovedTaunt(){ bool Mob::ImprovedTaunt(){
if (spellbonuses.ImprovedTaunt[0]){ if (spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL]){
if (GetLevel() > spellbonuses.ImprovedTaunt[0]) if (GetLevel() > spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_MAX_LVL])
return false; return false;
if (spellbonuses.ImprovedTaunt[2] >= 0){ if (spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT] >= 0){
target = entity_list.GetMob(buffs[spellbonuses.ImprovedTaunt[2]].casterid); target = entity_list.GetMob(buffs[spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT]].casterid);
if (target){ if (target){
SetTarget(target); SetTarget(target);
return true; return true;
} }
else { else {
if(!TryFadeEffect(spellbonuses.ImprovedTaunt[2])) if(!TryFadeEffect(spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT]))
BuffFadeBySlot(spellbonuses.ImprovedTaunt[2], true); //If caster killed removed effect. BuffFadeBySlot(spellbonuses.ImprovedTaunt[SBIndex::IMPROVED_TAUNT_BUFFSLOT], true); //If caster killed removed effect.
} }
} }
} }

View File

@ -2945,31 +2945,33 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2,
} }
} }
/*Buff stacking prevention spell effects (446 - 449) works as follows... If B prevent A, if C prevent B, if D prevent C. /*
Buff stacking prevention spell effects (446 - 449) works as follows... If B prevent A, if C prevent B, if D prevent C.
If checking same type ie A vs A, which ever effect base value is higher will take hold. If checking same type ie A vs A, which ever effect base value is higher will take hold.
Special check is added to make sure the buffs stack properly when applied from fade on duration effect, since the buff Special check is added to make sure the buffs stack properly when applied from fade on duration effect, since the buff
is not fully removed at the time of the trgger*/ is not fully removed at the time of the trigger
if (spellbonuses.AStacker[0]) { */
if ((effect2 == SE_AStacker) && (sp2.effectid[i] <= spellbonuses.AStacker[1])) if (spellbonuses.AStacker[SBIndex::BUFFSTACKER_EXISTS]) {
if ((effect2 == SE_AStacker) && (sp2.effectid[i] <= spellbonuses.AStacker[SBIndex::BUFFSTACKER_VALUE]))
return -1; return -1;
} }
if (spellbonuses.BStacker[0]) { if (spellbonuses.BStacker[SBIndex::BUFFSTACKER_EXISTS]) {
if ((effect2 == SE_BStacker) && (sp2.effectid[i] <= spellbonuses.BStacker[1])) if ((effect2 == SE_BStacker) && (sp2.effectid[i] <= spellbonuses.BStacker[SBIndex::BUFFSTACKER_VALUE]))
return -1; return -1;
if ((effect2 == SE_AStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_BStacker))) if ((effect2 == SE_AStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_BStacker)))
return -1; return -1;
} }
if (spellbonuses.CStacker[0]) { if (spellbonuses.CStacker[SBIndex::BUFFSTACKER_EXISTS]) {
if ((effect2 == SE_CStacker) && (sp2.effectid[i] <= spellbonuses.CStacker[1])) if ((effect2 == SE_CStacker) && (sp2.effectid[i] <= spellbonuses.CStacker[SBIndex::BUFFSTACKER_VALUE]))
return -1; return -1;
if ((effect2 == SE_BStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_CStacker))) if ((effect2 == SE_BStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_CStacker)))
return -1; return -1;
} }
if (spellbonuses.DStacker[0]) { if (spellbonuses.DStacker[SBIndex::BUFFSTACKER_EXISTS]) {
if ((effect2 == SE_DStacker) && (sp2.effectid[i] <= spellbonuses.DStacker[1])) if ((effect2 == SE_DStacker) && (sp2.effectid[i] <= spellbonuses.DStacker[SBIndex::BUFFSTACKER_VALUE]))
return -1; return -1;
if ((effect2 == SE_CStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_DStacker))) if ((effect2 == SE_CStacker) && (!IsCastonFadeDurationSpell(spellid1) && buffs[buffslot].ticsremaining != 1 && IsEffectInSpell(spellid1, SE_DStacker)))
return -1; return -1;