diff --git a/common/ruletypes.h b/common/ruletypes.h index 459882038..d45975e22 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -478,6 +478,7 @@ RULE_BOOL(Spells, CharmAggroOverLevel, false, "Enabling this rule will cause Cha RULE_BOOL(Spells, RequireMnemonicRetention, true, "Enabling will require spell slots 9-12 to have the appropriate Mnemonic Retention AA learned.") RULE_BOOL(Spells, EvacClearCharmPet, false, "Enable to have evac in zone clear charm from charm pets and detach buffs.") RULE_BOOL(Spells, ManaTapsRequireNPCMana, false, "Enabling will require target to have mana to tap. Default off as many npc's are caster class with 0 mana and need fixed.") +RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/common/spdat.cpp b/common/spdat.cpp index 2b92838c3..aa2946145 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -769,6 +769,13 @@ bool IsValidSpell(uint32 spell_id) return false; } +bool IsHarmTouchSpell(uint16 spell_id) +{ + return spell_id == SPELL_HARM_TOUCH || + spell_id == SPELL_HARM_TOUCH2 || + spell_id == SPELL_IMP_HARM_TOUCH; +} + // returns the lowest level of any caster which can use the spell uint8 GetSpellMinimumLevel(uint16 spell_id) { diff --git a/common/spdat.h b/common/spdat.h index 4f8717f4b..7cf7d1346 100644 --- a/common/spdat.h +++ b/common/spdat.h @@ -1547,6 +1547,7 @@ bool IsSummonSpell(uint16 spell_id); bool IsDamageSpell(uint16 spell_id); bool IsFearSpell(uint16 spell_id); bool IsCureSpell(uint16 spell_id); +bool IsHarmTouchSpell(uint16 spell_id); int GetSpellEffectIndex(uint16 spell_id, int effect_id); uint8 GetSpellMinimumLevel(uint16 spell_id); uint8 GetSpellLevel(uint16 spell_id, uint8 class_id); diff --git a/zone/effects.cpp b/zone/effects.cpp index 3854005c4..dc9a4e87b 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -40,7 +40,6 @@ float Mob::GetActSpellRange(uint16 spell_id, float range) } int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) { - if (spells[spell_id].target_type == ST_Self) { return value; } @@ -96,6 +95,10 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) { ratio += RuleI(Spells, WizCritRatio); //Default is zero } + if (IsClient() && IsHarmTouchSpell(spell_id)) { + ratio += RuleI(Spells, HarmTouchCritRatio); //Default is zero + } + if (Critical) { value = base_value*ratio/100; @@ -146,7 +149,7 @@ int64 Mob::GetActSpellDamage(uint16 spell_id, int64 value, Mob* target) { } // 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 ((spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || spell_id == SPELL_IMP_HARM_TOUCH) && GetLevel() > 40) { + if (IsHarmTouchSpell(spell_id) && GetLevel() > 40) { value -= (GetLevel() - 40) * 20; } diff --git a/zone/spells.cpp b/zone/spells.cpp index 78dcd30e8..c1674e503 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2799,15 +2799,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration); - } - else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].is_discipline) { + } else if (spells[spell_id].recast_time > 1000 && !spells[spell_id].is_discipline) { int recast = spells[spell_id].recast_time/1000; - if (spell_id == SPELL_LAY_ON_HANDS) //lay on hands - { + if (spell_id == SPELL_LAY_ON_HANDS) { //lay on hands recast -= GetAA(aaFervrentBlessing) * 420; - } - else if (spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2) //harm touch - { + } else if (IsHarmTouchSpell(spell_id)) { //harm touch recast -= GetAA(aaTouchoftheWicked) * 420; } @@ -5196,13 +5192,12 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use // Special case. If the caster has the Unholy Aura Discipline activated and the spell is HT, // or improved HT then the resist type is disease. - if ((spell_id == SPELL_HARM_TOUCH || spell_id == SPELL_HARM_TOUCH2 || spell_id == SPELL_IMP_HARM_TOUCH) && caster->IsClient() && caster->CastToClient()->FindBuff(DISC_UNHOLY_AURA)) { + if (IsHarmTouchSpell(spell_id) && caster->IsClient() && caster->CastToClient()->FindBuff(DISC_UNHOLY_AURA)) { resist_type = RESIST_DISEASE; } //Get the resist chance for the target - if(resist_type == RESIST_NONE || spells[spell_id].no_resist) - { + if (resist_type == RESIST_NONE || spells[spell_id].no_resist) { LogSpells("Spell was unresistable"); return 100; }