[Bots] Apply Spells:IgnoreSpellDmgLvlRestriction to bots (#2024)

* Correct bot spell damage and healing pathways to account for rule Spell:IgnoreSpellDmgLvlRestriction

* Corrected to be more consistent in regard to the 'spells[spell_id].no_heal_damage_item_mod' modifier. This modifier doesn't seem to actually exist on any content, and bots didn't use it to begin with.

This restriction is present on players - do we want it on bots also?
This commit is contained in:
catapultam-habeo 2022-03-06 16:40:21 -08:00 committed by GitHub
parent fd878e7b16
commit ac214f71d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6734,8 +6734,8 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetBotFocusEffect(focusFcDamageAmt, spell_id);
value -= GetBotFocusEffect(focusFcDamageAmt2, spell_id);
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
if ((RuleB(Spells, IgnoreSpellDmgLvlRestriction) || spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) && itembonuses.SpellDmg)
value += (GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value) * ratio / 100);
entity_list.MessageClose(this, false, 100, Chat::SpellCrit, "%s delivers a critical blast! (%d)", GetName(), -value);
@ -6756,7 +6756,8 @@ int32 Bot::GetActSpellDamage(uint16 spell_id, int32 value, Mob* target) {
value -= GetBotFocusEffect(focusFcDamageAmtCrit, spell_id);
value -= GetBotFocusEffect(focusFcDamageAmt, spell_id);
value -= GetBotFocusEffect(focusFcDamageAmt2, spell_id);
if(itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
if ((RuleB(Spells, IgnoreSpellDmgLvlRestriction) || spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) && itembonuses.SpellDmg)
value += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, value);
return value;
@ -6788,16 +6789,31 @@ int32 Bot::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
value += (GetBotFocusEffect(focusFcHealAmtCrit, spell_id) * modifier);
value += GetBotFocusEffect(focusFcHealAmt, spell_id);
value += target->GetFocusIncoming(focusFcHealAmtIncoming, SE_FcHealAmtIncoming, this, spell_id);
if(itembonuses.HealAmt && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5)
//Using IgnoreSpellDmgLvlRestriction
if ((RuleB(Spells, IgnoreSpellDmgLvlRestriction) || spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) && itembonuses.HealAmt)
value += (GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value) * modifier);
value += (value * target->GetHealRate() / 100);
if (Critical)
entity_list.MessageClose(this, false, 100, Chat::SpellCrit, "%s performs an exceptional heal! (%d)", GetName(), value);
return value;
} else {
} else {
int32 extra_heal = 0;
//Using IgnoreSpellDmgLvlRestriction to also allow healing to scale
if (RuleB(Spells, HOTsScaleWithHealAmt)) {
if ((RuleB(Spells, IgnoreSpellDmgLvlRestriction) || spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) && itembonuses.HealAmt)
extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, value);
}
if (extra_heal) {
int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0) {
extra_heal /= duration;
value += extra_heal;
}
}
chance = (itembonuses.CriticalHealOverTime + spellbonuses.CriticalHealOverTime + aabonuses.CriticalHealOverTime);
chance += target->GetFocusIncoming(focusFcHealPctCritIncoming, SE_FcHealPctCritIncoming, this, spell_id);
if (spellbonuses.CriticalRegenDecay)