public WandMenu(EmptyWand wand, string[] spells, SpellCircle circle) : base("Select a spell...", spells) { m_Wand = wand; m_SpellCircle = circle; }
protected override void OnTarget(Mobile from, object targeted) { if (from.Mana < from.ManaMax) { from.SendMessage("You must be fully rested to do this."); } else if (!(targeted is EmptyWand)) { from.SendMessage("You must target an empty wand!"); } else if (((EmptyWand)targeted).Spell != null) { from.SendMessage("You must target an empty wand!"); } else { EmptyWand wand = (EmptyWand)targeted; Spell s = null; Spells1.Clear(); Spells2.Clear(); Spells3.Clear(); Spells4.Clear(); Spells5.Clear(); Spells6.Clear(); Spells7.Clear(); Spells8.Clear(); for (int i = 0; i < 64; i++) { s = (Spell)Activator.CreateInstance((Type)SpellRegistry.Types.GetValue(i), new object[] { from, null }); if (s.Circle == SpellCircle.First) { Spells1.Add(s.Name); } else if (s.Circle == SpellCircle.Second) { Spells2.Add(s.Name); } else if (s.Circle == SpellCircle.Third) { Spells3.Add(s.Name); } else if (s.Circle == SpellCircle.Fourth) { Spells4.Add(s.Name); } else if (s.Circle == SpellCircle.Fifth) { Spells5.Add(s.Name); } else if (s.Circle == SpellCircle.Sixth) { Spells6.Add(s.Name); } else if (s.Circle == SpellCircle.Seventh) { Spells7.Add(s.Name); } else if (s.Circle == SpellCircle.Eighth) { Spells8.Add(s.Name); } } Spells1.Add("Next"); Spells2.Add("Next"); Spells3.Add("Next"); Spells4.Add("Next"); Spells5.Add("Next"); Spells6.Add("Next"); Spells7.Add("Next"); Spells8.Add("Next"); WandMenu menu = new WandMenu((EmptyWand)targeted, (string[])Spells1.ToArray(typeof(string)), SpellCircle.First); menu.SendTo(from.NetState); } }