bojangles2872
Member
I have this line of code that I created
But the issue I am having is when I am in Felucca and have Magic Res set to 200 my character doesn't have -20 resistance, instead I have 30 resistance. What I am aiming for is Magic Res to add onto the players current resistance based on what map they are on.
I have also changed my Magic Res algorithm to this.
C#:
for (int i = 0; i < Resistances.Length; ++i)
{
Resistances[i] = 0;
if (base.Map == Map.Felucca)//bojangles resists by facet
{
Resistances[i] -= 50;
}
if (base.Map == Map.Ilshenar)
{
Resistances[i] -= 10;
}
if (base.Map == Map.Trammel)
{
Resistances[i] += 10;
}
}
But the issue I am having is when I am in Felucca and have Magic Res set to 200 my character doesn't have -20 resistance, instead I have 30 resistance. What I am aiming for is Magic Res to add onto the players current resistance based on what map they are on.
I have also changed my Magic Res algorithm to this.
C#:
public override int GetMinResistance(ResistanceType type)
{
int magicResist = (int)(Skills[SkillName.MagicResist].Value * 10);
int min = int.MinValue;
if (magicResist >= 1000)
{
min = 10 + ((magicResist - 1000) / 50);
}
else if (magicResist >= 400)
{
min = (magicResist - 400) / 15;
}
return Math.Max(MinPlayerResistance, Math.Min(MaxPlayerResistance, min));
}