mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 20:41:33 +00:00
Fixed many bugs with partial resist calculations, targets with higher resist should have a more natural curve when it comes to resisting spells
This commit is contained in:
parent
a3b54e5cae
commit
579294fbf0
@ -4501,13 +4501,12 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
resist_chance -= roll;
|
|
||||||
if(resist_chance < 1)
|
if(resist_chance < 1)
|
||||||
{
|
{
|
||||||
resist_chance = 1;
|
resist_chance = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int partial_modifier = ((150 * (roll - resist_chance)) / resist_chance);
|
int partial_modifier = ((150 * (resist_chance - roll)) / resist_chance);
|
||||||
|
|
||||||
if(IsNPC())
|
if(IsNPC())
|
||||||
{
|
{
|
||||||
@ -4535,17 +4534,16 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(partial_modifier < 0)
|
if(partial_modifier <= 0)
|
||||||
|
{
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
else if(partial_modifier >= 100)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(partial_modifier > 100)
|
return (100.0f - partial_modifier);
|
||||||
{
|
|
||||||
return 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
return partial_modifier;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user