Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 • committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -85,7 +85,7 @@ namespace Server.Spells.Fourth
if (poison != null)
{
int chanceToCure = 10000 + (int)(Caster.Skills[SkillName.Magery].Value * 75) -
int chanceToCure = 10000 + (int)(Caster.Skills.Magery.Value * 75) -
(poison.Level + 1) * 1750;
chanceToCure /= 100;
chanceToCure -= 1;

View file

@ -77,14 +77,14 @@ namespace Server.Spells.Fourth
{
Effects.PlaySound(p, Caster.Map, 0x299);
int val = (int)(Caster.Skills[SkillName.Magery].Value / 10.0 + 1);
int val = (int)(Caster.Skills.Magery.Value / 10.0 + 1);
if (targets.Count > 0)
for (int i = 0; i < targets.Count; ++i)
{
Mobile m = targets[i];
if (m.BeginAction(typeof(ArchProtectionSpell)))
if (m.BeginAction<ArchProtectionSpell>())
{
Caster.DoBeneficial(m);
m.VirtualArmorMod += val;
@ -113,7 +113,7 @@ namespace Server.Spells.Fourth
{
int v = _Table[m];
_Table.Remove(m);
m.EndAction(typeof(ArchProtectionSpell));
m.EndAction<ArchProtectionSpell>();
m.VirtualArmorMod -= v;
if (m.VirtualArmorMod < 0)
m.VirtualArmorMod = 0;
@ -126,7 +126,7 @@ namespace Server.Spells.Fourth
public InternalTimer(Mobile target, Mobile caster) : base(TimeSpan.FromSeconds(0))
{
double time = caster.Skills[SkillName.Magery].Value * 1.2;
double time = caster.Skills.Magery.Value * 1.2;
if (time > 144)
time = 144;
Delay = TimeSpan.FromSeconds(time);

View file

@ -1,5 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Targeting;
namespace Server.Spells.Fourth
@ -15,7 +16,7 @@ namespace Server.Spells.Fourth
Reagent.SulfurousAsh
);
private static Hashtable m_UnderEffect = new Hashtable();
private static Dictionary<Mobile, Timer> m_UnderEffect = new Dictionary<Mobile, Timer>();
public CurseSpell(Mobile caster, Item scroll) : base(caster, scroll, m_Info)
{
@ -28,10 +29,8 @@ namespace Server.Spells.Fourth
Caster.Target = new InternalTarget(this);
}
public static void RemoveEffect(object state)
public static void RemoveEffect(Mobile m)
{
Mobile m = (Mobile)state;
m_UnderEffect.Remove(m);
m.UpdateResistances();
@ -39,7 +38,7 @@ namespace Server.Spells.Fourth
public static bool UnderEffect(Mobile m)
{
return m_UnderEffect.Contains(m);
return m_UnderEffect.ContainsKey(m);
}
public void Target(Mobile m)
@ -60,13 +59,13 @@ namespace Server.Spells.Fourth
SpellHelper.AddStatCurse(Caster, m, StatType.Int);
SpellHelper.DisableSkillCheck = false;
Timer t = (Timer)m_UnderEffect[m];
Timer t = m_UnderEffect[m];
if (Caster.Player && m.Player /*&& Caster != m */ && t == null
) //On OSI you CAN curse yourself and get this effect.
{
TimeSpan duration = SpellHelper.GetDuration(Caster, m);
m_UnderEffect[m] = Timer.DelayCall(duration, new TimerStateCallback(RemoveEffect), m);
m_UnderEffect[m] = Timer.DelayCall(duration, RemoveEffect, m);
m.UpdateResistances();
}
@ -111,4 +110,4 @@ namespace Server.Spells.Fourth
}
}
}
}
}

View file

@ -67,7 +67,7 @@ namespace Server.Spells.Fourth
if (Core.AOS)
duration = TimeSpan.FromSeconds((15 + Caster.Skills.Magery.Fixed / 5) / 4);
else
duration = TimeSpan.FromSeconds(4.0 + Caster.Skills[SkillName.Magery].Value * 0.5);
duration = TimeSpan.FromSeconds(4.0 + Caster.Skills.Magery.Value * 0.5);
for (int i = -2; i <= 2; ++i)
{

View file

@ -68,7 +68,7 @@ namespace Server.Spells.Fourth
// Algorithm: (40% of magery) + (1-10)
int toHeal = (int)(Caster.Skills[SkillName.Magery].Value * 0.4);
int toHeal = (int)(Caster.Skills.Magery.Value * 0.4);
toHeal += Utility.Random(1, 10);
//m.Heal( toHeal, Caster );

View file

@ -28,13 +28,8 @@ namespace Server.Spells.Fourth
Caster.Target = new InternalTarget(this);
}
private void AosDelay_Callback(object state)
private void AosDelay_Callback(Mobile m, int mana)
{
object[] states = (object[])state;
Mobile m = (Mobile)states[0];
int mana = (int)states[1];
if (m.Alive && !m.IsDeadBondedPet)
{
m.Mana += mana;
@ -81,8 +76,7 @@ namespace Server.Spells.Fourth
{
m.Mana -= toDrain;
m_Table[m] = Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerStateCallback(AosDelay_Callback),
new object[] { m, toDrain });
m_Table[m] = Timer.DelayCall(TimeSpan.FromSeconds(5.0), () => AosDelay_Callback(m, toDrain));
}
}
else