Formula fixes
This commit is contained in:
KayenEQ
2021-07-13 10:18:43 -04:00
parent 463f03f9f4
commit 89bac9999c
3 changed files with 12 additions and 9 deletions
+8 -5
View File
@@ -2916,10 +2916,11 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) {
DS -= DS*mitigation / 100;
}
int mitigation_pct = attacker->aabonuses.DS_Mitigation_Percentage + attacker->itembonuses.DS_Mitigation_Percentage + attacker->spellbonuses.DS_Mitigation_Percentage; //Negative value to reduce
// Subtract mitigations b/c mitigation_pct is a negative value when reducing total DS
DS -= DS * ((attacker->itembonuses.DSMitigation - mitigation_pct) / 100);
int ds_mitigation = attacker->itembonuses.DSMitigation;
// Subtract mitigations because DS_Mitigation_Percentage is a negative value when reducing total, thus final value will be positive
ds_mitigation -= attacker->aabonuses.DS_Mitigation_Percentage + attacker->itembonuses.DS_Mitigation_Percentage + attacker->spellbonuses.DS_Mitigation_Percentage; //Negative value to reduce
DS -= DS * ds_mitigation / 100;
}
attacker->Damage(this, -DS, spellid, EQ::skills::SkillAbjuration/*hackish*/, false);
//we can assume there is a spell now
@@ -5278,7 +5279,9 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
if (spec_mod > 0)
hit.damage_done = (hit.damage_done * spec_mod) / 100;
hit.damage_done += (hit.damage_done * (defender->GetSkillDmgTaken(hit.skill, opts) + defender->GetPositionalDmgTaken(this)) / 100) + (defender->GetFcDamageAmtIncoming(this, 0, true, hit.skill));
int pct_damage_reduction = defender->GetSkillDmgTaken(hit.skill, opts) + defender->GetPositionalDmgTaken(this);
hit.damage_done += (hit.damage_done * pct_damage_reduction / 100) + (defender->GetFcDamageAmtIncoming(this, 0, true, hit.skill));
CheckNumHitsRemaining(NumHit::OutgoingHitSuccess);
}
+2 -2
View File
@@ -3797,7 +3797,7 @@ int32 Mob::GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining)
return value;
}
int16 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts)
int32 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts)
{
int skilldmg_mod = 0;
@@ -3816,7 +3816,7 @@ int16 Mob::GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackO
return skilldmg_mod;
}
int16 Mob::GetPositionalDmgTaken(Mob *attacker)
int32 Mob::GetPositionalDmgTaken(Mob *attacker)
{
if (!attacker)
return 0;
+2 -2
View File
@@ -803,8 +803,8 @@ public:
int32 GetVulnerability(Mob* caster, uint32 spell_id, uint32 ticsremaining);
int32 GetFcDamageAmtIncoming(Mob *caster, uint32 spell_id, bool use_skill = false, uint16 skill=0);
int32 GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spell_id);
int16 GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts = nullptr);
int16 GetPositionalDmgTaken(Mob *attacker);
int32 GetSkillDmgTaken(const EQ::skills::SkillType skill_used, ExtraAttackOptions *opts = nullptr);
int32 GetPositionalDmgTaken(Mob *attacker);
void DoKnockback(Mob *caster, uint32 pushback, uint32 pushup);
int16 CalcResistChanceBonus();
int16 CalcFearResistChance();