mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Make ResistSpell aware of the level_override nerf
This commit is contained in:
parent
a41fd122bc
commit
0348c0817d
@ -211,7 +211,8 @@ public:
|
||||
virtual int32 GetActSpellDuration(uint16 spell_id, int32 duration);
|
||||
virtual int32 GetActSpellCasttime(uint16 spell_id, int32 casttime);
|
||||
float ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override = false,
|
||||
int resist_override = 0, bool CharismaCheck = false, bool CharmTick = false, bool IsRoot = false);
|
||||
int resist_override = 0, bool CharismaCheck = false, bool CharmTick = false, bool IsRoot = false,
|
||||
int level_override = -1);
|
||||
int ResistPhysical(int level_diff, uint8 caster_level);
|
||||
uint16 GetSpecializeSkillValue(uint16 spell_id) const;
|
||||
void SendSpellBarDisable();
|
||||
|
||||
@ -3665,9 +3665,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, bool reflect, bool use_r
|
||||
if(IsResistableSpell(spell_id))
|
||||
{
|
||||
if (IsCharmSpell(spell_id) || IsMezSpell(spell_id) || IsFearSpell(spell_id))
|
||||
spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resisttype, spell_id, this, use_resist_adjust, resist_adjust,true);
|
||||
spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resisttype, spell_id, this, use_resist_adjust, resist_adjust, true, false, false, level_override);
|
||||
else
|
||||
spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resisttype, spell_id, this, use_resist_adjust, resist_adjust);
|
||||
spell_effectiveness = spelltar->ResistSpell(spells[spell_id].resisttype, spell_id, this, use_resist_adjust, resist_adjust, false, false, false, level_override);
|
||||
|
||||
if(spell_effectiveness < 100)
|
||||
{
|
||||
@ -4208,7 +4208,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
|
||||
// pvp_resist_base
|
||||
// pvp_resist_calc
|
||||
// pvp_resist_cap
|
||||
float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool CharismaCheck, bool CharmTick, bool IsRoot)
|
||||
float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use_resist_override, int resist_override, bool CharismaCheck, bool CharmTick, bool IsRoot, int level_override)
|
||||
{
|
||||
|
||||
if(!caster)
|
||||
@ -4351,18 +4351,19 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
int level_mod = 0;
|
||||
|
||||
//Adjust our resist chance based on level modifiers
|
||||
int temp_level_diff = GetLevel() - caster->GetLevel();
|
||||
uint8 caster_level = level_override > 0 ? level_override : caster->GetLevel();
|
||||
int temp_level_diff = GetLevel() - caster_level;
|
||||
|
||||
//Physical Resists are calclated using their own formula derived from extensive parsing.
|
||||
if (resist_type == RESIST_PHYSICAL) {
|
||||
level_mod = ResistPhysical(temp_level_diff, caster->GetLevel());
|
||||
level_mod = ResistPhysical(temp_level_diff, caster_level);
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
if(IsNPC() && GetLevel() >= RuleI(Casting,ResistFalloff))
|
||||
{
|
||||
int a = (RuleI(Casting,ResistFalloff)-1) - caster->GetLevel();
|
||||
int a = (RuleI(Casting,ResistFalloff)-1) - caster_level;
|
||||
if(a > 0)
|
||||
{
|
||||
temp_level_diff = a;
|
||||
@ -4389,7 +4390,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
level_mod = -level_mod;
|
||||
}
|
||||
|
||||
if(IsNPC() && (caster->GetLevel() - GetLevel()) < -20)
|
||||
if(IsNPC() && (caster_level - GetLevel()) < -20)
|
||||
{
|
||||
level_mod = 1000;
|
||||
}
|
||||
@ -4400,7 +4401,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
int level_diff;
|
||||
if(GetLevel() >= RuleI(Casting,ResistFalloff))
|
||||
{
|
||||
level_diff = (RuleI(Casting,ResistFalloff)-1) - caster->GetLevel();
|
||||
level_diff = (RuleI(Casting,ResistFalloff)-1) - caster_level;
|
||||
if(level_diff < 0)
|
||||
{
|
||||
level_diff = 0;
|
||||
@ -4408,7 +4409,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
}
|
||||
else
|
||||
{
|
||||
level_diff = GetLevel() - caster->GetLevel();
|
||||
level_diff = GetLevel() - caster_level;
|
||||
}
|
||||
level_mod += (2 * level_diff);
|
||||
}
|
||||
@ -4519,14 +4520,14 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
|
||||
if(IsNPC())
|
||||
{
|
||||
if(GetLevel() > caster->GetLevel() && GetLevel() >= 17 && caster->GetLevel() <= 50)
|
||||
if(GetLevel() > caster_level && GetLevel() >= 17 && caster_level <= 50)
|
||||
{
|
||||
partial_modifier += 5;
|
||||
}
|
||||
|
||||
if(GetLevel() >= 30 && caster->GetLevel() < 50)
|
||||
if(GetLevel() >= 30 && caster_level < 50)
|
||||
{
|
||||
partial_modifier += (caster->GetLevel() - 25);
|
||||
partial_modifier += (caster_level - 25);
|
||||
}
|
||||
|
||||
if(GetLevel() < 15)
|
||||
@ -4537,9 +4538,9 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
||||
|
||||
if(caster->IsNPC())
|
||||
{
|
||||
if((GetLevel() - caster->GetLevel()) >= 20)
|
||||
if((GetLevel() - caster_level) >= 20)
|
||||
{
|
||||
partial_modifier += (GetLevel() - caster->GetLevel()) * 1.5;
|
||||
partial_modifier += (GetLevel() - caster_level) * 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user