public static void RemoveContext(Mobile m, EodonPotionContext context) { if (context == null) { return; } if (context.Potion != null) { context.Potion.RemoveBuff(m); } if (Contexts.ContainsKey(m)) { if (Contexts[m] != null && Contexts[m].Contains(context)) { Contexts[m].Remove(context); } if (Contexts[m] == null || Contexts[m].Count == 0) { Contexts.Remove(m); } if (Contexts.Count == 0) { EndTimer(); } m.Delta(MobileDelta.WeaponDamage); } }
public static void OnTick() { if (Contexts == null) { EndTimer(); } else { Dictionary <Mobile, List <EodonPotionContext> > dictionary = new Dictionary <Mobile, List <EodonPotionContext> >(Contexts); foreach (KeyValuePair <Mobile, List <EodonPotionContext> > kvp in dictionary) { List <EodonPotionContext> contexts = new List <EodonPotionContext>(kvp.Value); for (var index = 0; index < contexts.Count; index++) { EodonPotionContext context = contexts[index]; context.OnTick(kvp.Key); } ColUtility.Free(contexts); } dictionary.Clear(); } }
public void RemoveContext(Mobile m) { EodonPotionContext context = GetContext(m, this.PotionEffect); if (context != null) { RemoveContext(m, context); } }
public override void OnTick(Mobile m) { EodonPotionContext context = GetContext(m, PotionEffect); if (context != null && context.StartTime + TimeSpan.FromMinutes(10) > DateTime.UtcNow) { m.Mana += 10; //TODO: Message? } }
public static int GetManaBuff(Mobile m) { EodonPotionContext c = GetContext(m, PotionEffect.Urali); if (c != null && c.StartTime + TimeSpan.FromMinutes(5) > DateTime.UtcNow) { return(10); } return(0); }
public static int HPRegenBonus(Mobile m) { EodonPotionContext c = GetContext(m, PotionEffect.Barrab); if (c != null && c.StartTime + TimeSpan.FromMinutes(10) > DateTime.UtcNow) { return(100); } return(0); }