mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-29 00:02:50 +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:
parent
4ac525afc2
commit
e4138b871b
@ -382,6 +382,8 @@ RULE_BOOL(Spells, AllowDoubleInvis, false, "Allows you to cast invisibility spel
|
|||||||
RULE_BOOL(Spells, AllowSpellMemorizeFromItem, false, "Allows players to memorize spells by right-clicking spell scrolls")
|
RULE_BOOL(Spells, AllowSpellMemorizeFromItem, false, "Allows players to memorize spells by right-clicking spell scrolls")
|
||||||
RULE_BOOL(Spells, InvisRequiresGroup, false, "Invis requires the the target to be in group.")
|
RULE_BOOL(Spells, InvisRequiresGroup, false, "Invis requires the the target to be in group.")
|
||||||
RULE_INT(Spells, ClericInnateHealFocus, 5, "Clerics on live get a 5 pct innate heal focus")
|
RULE_INT(Spells, ClericInnateHealFocus, 5, "Clerics on live get a 5 pct innate heal focus")
|
||||||
|
RULE_BOOL(Spells, DOTsScaleWithSpellDmg, false, "Allow SpellDmg stat to affect DoT spells")
|
||||||
|
RULE_BOOL(Spells, HOTsScaleWithHealAmt, false, "Allow HealAmt stat to affect HoT spells")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Combat)
|
RULE_CATEGORY(Combat)
|
||||||
|
|||||||
@ -196,7 +196,7 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
|
|
||||||
if (target == nullptr)
|
if (target == nullptr)
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
if (IsNPC()) {
|
if (IsNPC()) {
|
||||||
value += value * CastToNPC()->GetSpellFocusDMG() / 100;
|
value += value * CastToNPC()->GetSpellFocusDMG() / 100;
|
||||||
}
|
}
|
||||||
@ -226,9 +226,18 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
GetFocusEffect(focusFcDamageAmt, spell_id) +
|
GetFocusEffect(focusFcDamageAmt, spell_id) +
|
||||||
GetFocusEffect(focusFcDamageAmt2, spell_id) +
|
GetFocusEffect(focusFcDamageAmt2, spell_id) +
|
||||||
GetFocusEffect(focusFcAmplifyAmt, 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) {
|
if (extra_dmg) {
|
||||||
int duration = CalcBuffDuration(this, this, spell_id);
|
int duration = CalcBuffDuration(this, target, spell_id);
|
||||||
if (duration > 0)
|
if (duration > 0)
|
||||||
extra_dmg /= duration;
|
extra_dmg /= duration;
|
||||||
}
|
}
|
||||||
@ -248,9 +257,18 @@ int32 Mob::GetActDoTDamage(uint16 spell_id, int32 value, Mob* target) {
|
|||||||
GetFocusEffect(focusFcDamageAmt, spell_id) +
|
GetFocusEffect(focusFcDamageAmt, spell_id) +
|
||||||
GetFocusEffect(focusFcDamageAmt2, spell_id) +
|
GetFocusEffect(focusFcDamageAmt2, spell_id) +
|
||||||
GetFocusEffect(focusFcAmplifyAmt, 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) {
|
if (extra_dmg) {
|
||||||
int duration = CalcBuffDuration(this, this, spell_id);
|
int duration = CalcBuffDuration(this, target, spell_id);
|
||||||
if (duration > 0)
|
if (duration > 0)
|
||||||
extra_dmg /= duration;
|
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]
|
//Heal over time spells. [Heal Rate and Additional Healing effects do not increase this value]
|
||||||
else {
|
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))
|
if (critical_chance && zone->random.Roll(critical_chance))
|
||||||
value *= critical_modifier;
|
value *= critical_modifier;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user