Example #1
0
 public void GenieMenu()
 {
     Genie.Clicks();
 }
Example #2
0
        public override void OnDoubleClick(Mobile m)
        {
            Map map = m.Map;

            if (!IsChildOf(m.Backpack))
            {
                m.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
                return;
            }

            if (Server.Misc.AutoRestart.ServerWars == true && m.AccessLevel < AccessLevel.GameMaster)
            {   // no genie during server wars
                m.SendMessage("The genie refuses to be awoken at this time.");
                return;
            }

            if (m_summoned == false)
            {
                BaseCreature Genie = new Genie(m);
                m.SendMessage("You bring forth the genie of the lamp.");
                bool spawned = false;
                for (int i = 0; !spawned && i < 10; ++i)
                {
                    int x = m.X - 3 + Utility.Random(7);
                    int y = m.Y - 3 + Utility.Random(7);

                    if (map.CanSpawnMobile(x, y, m.Z))
                    {
                        m.PlaySound(0x208);
                        Effects.SendLocationEffect(new Point3D(x + 1, y, m.Z + 4), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x + 1, y, m.Z), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x + 1, y, m.Z - 4), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x, y + 1, m.Z + 4), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x, y + 1, m.Z), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x, y + 1, m.Z - 4), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z + 11), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z + 7), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z + 3), m.Map, 0x3728, 13);
                        Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z - 1), m.Map, 0x3728, 13);
                        m_summoned = true;
                        Genie.MoveToWorld(new Point3D(x, y, m.Z), m.Map);
                        this.Delete();
                        spawned = true;
                        Genie.Say("How dare a mortal such as you disturb my slumber!");
                    }
                    else
                    {
                        int z = map.GetAverageZ(x, y);

                        if (map.CanSpawnMobile(x, y, z))
                        {
                            m.PlaySound(0x208);
                            Effects.SendLocationEffect(new Point3D(x + 1, y, m.Z + 4), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x + 1, y, m.Z), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x + 1, y, m.Z - 4), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x, y + 1, m.Z + 4), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x, y + 1, m.Z), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x, y + 1, m.Z - 4), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z + 11), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z + 7), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z + 3), m.Map, 0x3728, 13);
                            Effects.SendLocationEffect(new Point3D(x + 1, y + 1, m.Z - 1), m.Map, 0x3728, 13);
                            m_summoned = true;
                            this.Delete();
                            Genie.MoveToWorld(new Point3D(x, y, z), m.Map);
                            spawned = true;
                            Genie.Say(true, "How dare a mortal such as you disturb my slumber!");
                        }
                    }
                }

                if (!spawned)
                {
                    m.SendMessage("You fail to release anything.");
                    Genie.Delete();
                }
            }
            else
            {
                m.SendMessage("You rub the lamp, but nothing exciting happens.");
            }
        }