Esempio n. 1
0
                public override void OnResponse(Server.Network.NetState state, int index)
                {
                    if (this.Answers[index] == "Next")
                    {
                        WandMenu menu = null;

                        if (m_SpellCircle == SpellCircle.First)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells2.ToArray(typeof(string)), SpellCircle.Second);
                        }
                        else if (m_SpellCircle == SpellCircle.Second)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells3.ToArray(typeof(string)), SpellCircle.Third);
                        }
                        else if (m_SpellCircle == SpellCircle.Third)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells4.ToArray(typeof(string)), SpellCircle.Fourth);
                        }
                        else if (m_SpellCircle == SpellCircle.Fourth)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells5.ToArray(typeof(string)), SpellCircle.Fifth);
                        }
                        else if (m_SpellCircle == SpellCircle.Fifth)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells6.ToArray(typeof(string)), SpellCircle.Sixth);
                        }
                        else if (m_SpellCircle == SpellCircle.Sixth)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells7.ToArray(typeof(string)), SpellCircle.Seventh);
                        }
                        else if (m_SpellCircle == SpellCircle.Seventh)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells8.ToArray(typeof(string)), SpellCircle.Eighth);
                        }
                        else if (m_SpellCircle == SpellCircle.Eighth)
                        {
                            menu = new WandMenu(m_Wand, (string[])Spells1.ToArray(typeof(string)), SpellCircle.First);
                        }

                        state.Mobile.CloseAllGumps();
                        menu.SendTo(state);

                        return;
                    }

                    TeiravonMobile m_Player = (TeiravonMobile)state.Mobile;

                    if (m_Player.CanCast(this.Answers[index]))
                    {
                        m_Player.Mana = 0;
                        m_Wand.Spell  = this.Answers[index];

                        m_Player.SendMessage("You charge the wand!");
                    }
                    else
                    {
                        m_Player.SendMessage("You can't cast this spell!");
                    }
                }
Esempio n. 2
0
            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);
                }
            }