[Rules] Add DOT and HOT Rules (#3760)

* [Rules] Add DOT and HOT Rules

# Notes
- Add `Spells:DOTDamageBonusSplitOverDuration` rule.
- Allows operators to disable the DOT bonus damage being split over duration and instead adds the full amount every tic.
- Add `Spells:HOTBonusHealingSplitOverDuration` rule.
- Allows operators to disable the HOT bonus healing being split over duration and instead adds the full amount every tic.

* Update effects.cpp

* Update effects.cpp
This commit is contained in:
Alex King
2023-12-15 20:25:38 -05:00
committed by GitHub
parent aeeb350068
commit 77b88e3dec
2 changed files with 23 additions and 13 deletions
+21 -13
View File
@@ -285,10 +285,13 @@ int64 Mob::GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_
extra_dmg += GetSkillDmgAmt(spells[spell_id].skill) * ratio / 100;
}
if (extra_dmg) {
int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0)
extra_dmg /= duration;
if (RuleB(Spells, DOTBonusDamageSplitOverDuration)) {
if (extra_dmg) {
const int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0) {
extra_dmg /= duration;
}
}
}
value -= extra_dmg;
@@ -328,10 +331,13 @@ int64 Mob::GetActDoTDamage(uint16 spell_id, int64 value, Mob* target, bool from_
extra_dmg += GetSkillDmgAmt(spells[spell_id].skill);
}
if (extra_dmg) {
int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0)
extra_dmg /= duration;
if (RuleB(Spells, DOTBonusDamageSplitOverDuration)) {
if (extra_dmg) {
const int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0) {
extra_dmg /= duration;
}
}
}
value -= extra_dmg;
@@ -517,11 +523,13 @@ int64 Mob::GetActSpellHealing(uint16 spell_id, int64 value, Mob* target, bool fr
}
}
if (extra_heal) {
int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0) {
extra_heal /= duration;
value += extra_heal;
if (RuleB(Spells, HOTBonusHealingSplitOverDuration)) {
if (extra_heal) {
const int duration = CalcBuffDuration(this, target, spell_id);
if (duration > 0) {
extra_heal /= duration;
value += extra_heal;
}
}
}