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

@ -1,11 +1,12 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Server.Items
{
public class InvisibilityPotion : BasePotion
{
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
[Constructible]
public InvisibilityPotion() : base(0xF0A, PotionEffect.Invisibility)
@ -34,16 +35,10 @@ namespace Server.Items
}
Consume();
m_Table[from] = Timer.DelayCall(TimeSpan.FromSeconds(2), new TimerStateCallback(Hide_Callback), from);
m_Table[from] = Timer.DelayCall(TimeSpan.FromSeconds(2), Hide, from);
PlayDrinkEffect(from);
}
private static void Hide_Callback(object obj)
{
if (obj is Mobile mobile)
Hide(mobile);
}
public static void Hide(Mobile m)
{
Effects.SendLocationParticles(
@ -57,13 +52,7 @@ namespace Server.Items
RemoveTimer(m);
Timer.DelayCall(TimeSpan.FromSeconds(30), new TimerStateCallback(EndHide_Callback), m);
}
private static void EndHide_Callback(object obj)
{
if (obj is Mobile mobile)
EndHide(mobile);
Timer.DelayCall(TimeSpan.FromSeconds(30), EndHide, m);
}
public static void EndHide(Mobile m)
@ -79,11 +68,11 @@ namespace Server.Items
public static void RemoveTimer(Mobile m)
{
Timer t = (Timer)m_Table[m];
Timer timer = m_Table[m];
if (t != null)
if (timer != null)
{
t.Stop();
timer.Stop();
m_Table.Remove(m);
}
}
@ -108,4 +97,4 @@ namespace Server.Items
int version = reader.ReadInt();
}
}
}
}