fix: Fixes poison field duration, cleans up skill calculations and poison calculations (#1582)

### Summary
- [X] Fixes poison field duration
- [X] Adds SA+ poison spell calculations
- [X] Cleans up skill calculations
- [X] Adjusts poison level thresholds to properly reflect OSI
This commit is contained in:
Kamron Batman 2023-11-04 12:32:54 -07:00 • committed by GitHub
parent 54431f05b5
commit 1f04a13f67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 68 additions and 81 deletions

View file

@ -42,7 +42,7 @@ namespace Server.Spells.Fifth
{
Expansion.None => TimeSpan.FromSeconds(20),
< Expansion.LBR => TimeSpan.FromSeconds(15 + Caster.Skills.Magery.Value * 0.4),
_ => TimeSpan.FromSeconds(3 + Caster.Skills.Magery.Fixed * 0.4)
_ => TimeSpan.FromSeconds(3 + Caster.Skills.Magery.Value * 0.4)
};
for (var i = -2; i <= 2; ++i)
@ -142,24 +142,24 @@ namespace Server.Spells.Fifth
return;
}
Poison p;
int level;
if (Core.AOS)
{
p = ((m_Caster.Skills.Magery.Fixed + m_Caster.Skills.Poisoning.Fixed) / 2) switch
level = (m_Caster.Skills.Magery.Value + m_Caster.Skills.Poisoning.Value) switch
{
>= 1000 => Poison.Deadly,
> 850 => Poison.Greater,
> 650 => Poison.Regular,
_ => Poison.Lesser
> 199.8 => 3,
> 170.2 => 2,
> 130.2 => 1,
_ => 0
};
}
else
{
p = Poison.Regular;
level = 1;
}
if (m.ApplyPoison(m_Caster, p) == ApplyPoisonResult.Poisoned)
if (m.ApplyPoison(m_Caster, Poison.GetPoison(level)) is ApplyPoisonResult.Poisoned or ApplyPoisonResult.HigherPoisonActive)
{
if (SpellHelper.CanRevealCaster(m))
{

View file

@ -75,7 +75,7 @@ namespace Server.Spells.Fifth
var duration = Core.Expansion switch
{
Expansion.None => TimeSpan.FromSeconds(Caster.Skills.Magery.Value),
_ => TimeSpan.FromSeconds(2 * Caster.Skills.Magery.Fixed / 5.0)
_ => TimeSpan.FromSeconds((int)Caster.Skills.Magery.Value * 4)
};
SpellHelper.Summon(creature, Caster, 0x215, duration, false, false);