mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Rule] Classic Harm Touch Formula (#4394)
* [Rule] Classic Harm Touch Formula Pre 2007 Harm Touch was handled differently with base harm Touch ( Ability or 2 ranks aa) and Improved Harm Touch AA. It was converted into 10 ranks of Harm Touch - http://www.tski.co.jp/baldio/patch/20071113.html It was further refined in 2008 to have a DoT component. http://www.tski.co.jp/baldio/patch/20080709.html This rule focuses on the pre 2007 version and allows the damage to properly scale * Updated logic * Update per feedback.
This commit is contained in:
+31
-32
@@ -71,20 +71,20 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
||||
int32 ratio = RuleI(Spells, BaseCritRatio); //Critical modifier is applied from spell effects only. Keep at 100 for live like criticals.
|
||||
|
||||
//Improved Harm Touch is a guaranteed crit if you have at least one level of SCF.
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH && IsOfClientBot() && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0))
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH && IsOfClientBot() && (GetAA(aaSpellCastingFury) > 0) && (GetAA(aaUnholyTouch) > 0)) {
|
||||
chance = 100;
|
||||
}
|
||||
|
||||
if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance)
|
||||
if (spells[spell_id].override_crit_chance > 0 && chance > spells[spell_id].override_crit_chance) {
|
||||
chance = spells[spell_id].override_crit_chance;
|
||||
}
|
||||
|
||||
if (zone->random.Roll(chance)) {
|
||||
Critical = true;
|
||||
ratio += itembonuses.SpellCritDmgIncrease + spellbonuses.SpellCritDmgIncrease + aabonuses.SpellCritDmgIncrease;
|
||||
ratio += itembonuses.SpellCritDmgIncNoStack + spellbonuses.SpellCritDmgIncNoStack + aabonuses.SpellCritDmgIncNoStack;
|
||||
}
|
||||
|
||||
else if ((IsOfClientBot() && GetClass() == Class::Wizard) || (IsMerc() && GetClass() == CASTERDPS)) {
|
||||
if ((GetLevel() >= RuleI(Spells, WizCritLevel)) && zone->random.Roll(RuleI(Spells, WizCritChance))){
|
||||
} else if ((IsOfClientBot() && GetClass() == Class::Wizard) || (IsMerc() && GetClass() == CASTERDPS)) {
|
||||
if ((GetLevel() >= RuleI(Spells, WizCritLevel)) && zone->random.Roll(RuleI(Spells, WizCritChance))) {
|
||||
//Wizard innate critical chance is calculated seperately from spell effect and is not a set ratio. (20-70 is parse confirmed)
|
||||
ratio += zone->random.Int(RuleI(Spells, WizardCritMinimumRandomRatio), RuleI(Spells, WizardCritMaximumRandomRatio));
|
||||
Critical = true;
|
||||
@@ -100,21 +100,32 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
||||
}
|
||||
|
||||
if (Critical) {
|
||||
|
||||
value = base_value*ratio/100;
|
||||
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage, spell_id)/100;
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage2, spell_id)/100;
|
||||
if (RuleB(Spells, UseClassicHarmTouchDamage)) {
|
||||
// Need to scale HT damage differently after level 40! It no longer scales by the constant value in the spell file. It scales differently, instead of 10 more damage per level, it does 30 more damage per level. So we multiply the level minus 40 times 20 if they are over level 40.
|
||||
if (IsHarmTouchSpell(spell_id) && GetLevel() > 40) {
|
||||
value -= (GetLevel() - 40) * 20;
|
||||
}
|
||||
|
||||
value += int(base_value*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100)*ratio/100;
|
||||
value += int(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id) / 100)*ratio / 100;
|
||||
//This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm TOuch.
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH && IsOfClientBotMerc()) { //Improved Harm Touch
|
||||
value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch
|
||||
}
|
||||
}
|
||||
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage, spell_id) / 100;
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage2, spell_id) / 100;
|
||||
|
||||
value += int(base_value*GetFocusEffect(focusFcDamagePctCrit, spell_id) / 100) * ratio / 100;
|
||||
value += int(base_value*GetFocusEffect(focusFcAmplifyMod, spell_id) / 100) * ratio / 100;
|
||||
|
||||
if (target) {
|
||||
value += int(base_value*target->GetVulnerability(this, spell_id, 0)/100)*ratio/100;
|
||||
value += int(base_value*target->GetVulnerability(this, spell_id, 0) / 100) * ratio / 100;
|
||||
value -= target->GetFcDamageAmtIncoming(this, spell_id);
|
||||
}
|
||||
|
||||
value -= GetFocusEffect(focusFcDamageAmtCrit, spell_id)*ratio/100;
|
||||
value -= GetFocusEffect(focusFcDamageAmtCrit, spell_id) * ratio / 100;
|
||||
|
||||
value -= GetFocusEffect(focusFcDamageAmt, spell_id);
|
||||
value -= GetFocusEffect(focusFcDamageAmt2, spell_id);
|
||||
@@ -127,9 +138,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
||||
if (RuleB(Spells, IgnoreSpellDmgLvlRestriction) && !spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg) {
|
||||
value -= 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) {
|
||||
} else if (!spells[spell_id].no_heal_damage_item_mod && itembonuses.SpellDmg && spells[spell_id].classes[(GetClass() % 17) - 1] >= GetLevel() - 5) {
|
||||
value -= GetExtraSpellAmt(spell_id, itembonuses.SpellDmg, base_value) * ratio / 100;
|
||||
}
|
||||
|
||||
@@ -148,30 +157,20 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) {
|
||||
MessageString(Chat::SpellCrit, YOU_CRIT_BLAST, itoa(-value));
|
||||
}
|
||||
|
||||
// Need to scale HT damage differently after level 40! It no longer scales by the constant value in the spell file. It scales differently, instead of 10 more damage per level, it does 30 more damage per level. So we multiply the level minus 40 times 20 if they are over level 40.
|
||||
if (IsHarmTouchSpell(spell_id) && GetLevel() > 40) {
|
||||
value -= (GetLevel() - 40) * 20;
|
||||
}
|
||||
|
||||
//This adds the extra damage from the AA Unholy Touch, 450 per level to the AA Improved Harm Touch.
|
||||
if (spell_id == SPELL_IMP_HARM_TOUCH && IsOfClientBot()) { //Improved Harm Touch
|
||||
value -= GetAA(aaUnholyTouch) * 450; //Unholy Touch
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
//Non Crtical Hit Calculation pathway
|
||||
value = base_value;
|
||||
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage, spell_id)/100;
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage2, spell_id)/100;
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage, spell_id) / 100;
|
||||
value += base_value*GetFocusEffect(focusImprovedDamage2, spell_id) / 100;
|
||||
|
||||
value += base_value*GetFocusEffect(focusFcDamagePctCrit, spell_id)/100;
|
||||
value += base_value*GetFocusEffect(focusFcAmplifyMod, spell_id)/100;
|
||||
value += base_value*GetFocusEffect(focusFcDamagePctCrit, spell_id) / 100;
|
||||
value += base_value*GetFocusEffect(focusFcAmplifyMod, spell_id) / 100;
|
||||
|
||||
if (target) {
|
||||
value += base_value*target->GetVulnerability(this, spell_id, 0)/100;
|
||||
value += base_value*target->GetVulnerability(this, spell_id, 0) / 100;
|
||||
value -= target->GetFcDamageAmtIncoming(this, spell_id);
|
||||
}
|
||||
|
||||
@@ -614,7 +613,7 @@ int32 Mob::GetActSpellDuration(uint16 spell_id, int32 duration)
|
||||
{
|
||||
// focuses don't affect discipline duration (Except War Cries)
|
||||
if (
|
||||
IsDiscipline(spell_id) &&
|
||||
IsDiscipline(spell_id) &&
|
||||
(
|
||||
spell_id != SPELL_BATTLE_CRY &&
|
||||
spell_id != SPELL_WAR_CRY &&
|
||||
|
||||
Reference in New Issue
Block a user