mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[Rules] Add optional rules for HealAmt and SpellAmt to scale DoTs/HoTs. (#1661)
* Add optional rules for itembonuses HealAmt and SpellAmt to scale for DoTs/HoTs * Fix typo * Only 1 rulecheck * Apply +healingitems and +dmgitems after focus effects so they scale properly * Fix dots / hots to not always use PVPScaling for extra_dmg / extra_healing Adjust +healamt and +spelldmg to scale over the full duration of the spell, Thanks Kayen
This commit is contained in:
+40
-3
@@ -196,7 +196,7 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
|
||||
if (target == nullptr)
|
||||
return value;
|
||||
|
||||
|
||||
if (IsNPC()) {
|
||||
value += value * CastToNPC()->GetSpellFocusDMG() / 100;
|
||||
}
|
||||
@@ -226,9 +226,18 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
GetFocusEffect(focusFcDamageAmt, spell_id) +
|
||||
GetFocusEffect(focusFcDamageAmt2, spell_id) +
|
||||
GetFocusEffect(focusFcAmplifyAmt, spell_id);
|
||||
|
||||
if (RuleB(Spells, DOTsScaleWithSpellDmg)) {
|
||||
if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) {
|
||||
extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value)*ratio/100;
|
||||
}
|
||||
else if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) {
|
||||
extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value)*ratio/100;
|
||||
}
|
||||
}
|
||||
|
||||
if (extra_dmg) {
|
||||
int duration = CalcBuffDuration(this, this, spell_id);
|
||||
int duration = CalcBuffDuration(this, target, spell_id);
|
||||
if (duration > 0)
|
||||
extra_dmg /= duration;
|
||||
}
|
||||
@@ -248,9 +257,18 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
||||
GetFocusEffect(focusFcDamageAmt, spell_id) +
|
||||
GetFocusEffect(focusFcDamageAmt2, spell_id) +
|
||||
GetFocusEffect(focusFcAmplifyAmt, spell_id);
|
||||
|
||||
if (RuleB(Spells, DOTsScaleWithSpellDmg)) {
|
||||
if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) {
|
||||
extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value);
|
||||
}
|
||||
else if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) {
|
||||
extra_dmg += GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (extra_dmg) {
|
||||
int duration = CalcBuffDuration(this, this, spell_id);
|
||||
int duration = CalcBuffDuration(this, target, spell_id);
|
||||
if (duration > 0)
|
||||
extra_dmg /= duration;
|
||||
}
|
||||
@@ -383,6 +401,25 @@ int32 Mob::GetActSpellHealing(uint16 spell_id, int32 value, Mob* target) {
|
||||
|
||||
//Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value]
|
||||
else {
|
||||
//Using IgnoreSpellDmgLvlRestriction to also allow healing to scale
|
||||
int32 extra_heal = 0;
|
||||
if (RuleB(Spells, HOTsScaleWithHealAmt)) {
|
||||
if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt) {
|
||||
extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, base_value);
|
||||
}
|
||||
else if(!spells[spell_id].no_heal_damage_item_mod && itembonuses.HealAmt && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) {
|
||||
extra_heal += GetExtraSpellAmt(spell_id, itembonuses.HealAmt, base_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (extra_heal) {
|
||||
int duration = CalcBuffDuration(this, target, spell_id);
|
||||
if (duration > 0) {
|
||||
extra_heal /= duration;
|
||||
value += extra_heal;
|
||||
}
|
||||
}
|
||||
|
||||
if (critical_chance && zone->random.Roll(critical_chance))
|
||||
value *= critical_modifier;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user