Ejemplo n.º 1
0
        public override void OnDoubleClick(Mobile from)
        {
            string world = Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y);

            Target t;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1060640);                   // The item must be in your backpack to use it.
            }
            else if (from is PlayerMobile && world == "the Bottle World of Kuldar" && !(Server.Items.CharacterDatabase.GetKeys(from, "VordoKey")))
            {
                from.SendMessage("This magical gate doesn't seem to do anything.");
            }
            else if (Worlds.AllowEscape(from, from.Map, from.Location, from.X, from.Y) == false && Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) != "the Bottle World of Kuldar")
            {
                from.SendMessage("This magical gate doesn't seem to do anything.");
            }
            else if (Worlds.RegionAllowedRecall(from.Map, from.Location, from.X, from.Y) == false && Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) != "the Land of Ambrosia" && Worlds.GetMyWorld(from.Map, from.Location, from.X, from.Y) != "the Bottle World of Kuldar")
            {
                from.SendMessage("This magical gate doesn't seem to do anything.");
            }
            else
            {
                Effects.PlaySound(from.Location, from.Map, 0x20E);
                m_MoonTimer = new InternalTimer(from);
                m_MoonTimer.Start();
                this.Delete();
            }
        }
Ejemplo n.º 2
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
            {
            }
            else if (Worlds.AllowEscape(Caster, Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That ability does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedRecall(Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That ability does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedTeleport(map, loc, loc.X, loc.Y) == false)
            {
                Caster.SendMessage("The destination seems magically unreachable.");
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
            {
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0)
            {
                Caster.SendLocalizedMessage(502412);                   // There are no charges left on that item.
            }
            else if (CheckSequence())
            {
                BaseCreature.TeleportPets(Caster, loc, map, false);

                if (m_Book != null)
                {
                    --m_Book.CurCharges;
                }

                Caster.PlaySound(0x0F7);
                Effects.SendLocationEffect(Caster.Location, Caster.Map, 0x373A, 60, 10, 0xB65, 0);

                Caster.MoveToWorld(loc, map);

                Caster.PlaySound(0x0F7);
                Effects.SendLocationEffect(Caster.Location, Caster.Map, 0x373A, 60, 10, 0xB65, 0);
            }

            FinishSequence();
        }
Ejemplo n.º 3
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!SpellHelper.CheckTravel(Caster, TravelCheckType.GateFrom))
            {
            }
            else if (Worlds.AllowEscape(Caster, Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That spell does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedRecall(Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That spell does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedTeleport(map, loc, loc.X, loc.Y) == false)
            {
                Caster.SendMessage("The destination seems magically unreachable.");
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.GateTo))
            {
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                                                   // That location is blocked.
            }
            else if (Core.SE && (GateExistsAt(map, loc) || GateExistsAt(Caster.Map, Caster.Location))) // SE restricted stacking gates
            {
                Caster.SendLocalizedMessage(1071242);                                                  // There is already a gate there.
            }
            else if (CheckSequence())
            {
                Caster.SendLocalizedMessage(501024);                   // You open a magical gate to another location

                Effects.PlaySound(Caster.Location, Caster.Map, 0x20E);
                InternalItem firstGate = new InternalItem(loc, map);
                firstGate.Hue = Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0);
                firstGate.MoveToWorld(Caster.Location, Caster.Map);

                if (Worlds.RegionAllowedTeleport(Caster.Map, Caster.Location, Caster.X, Caster.Y) == true)
                {
                    Effects.PlaySound(loc, map, 0x20E);
                    InternalItem secondGate = new InternalItem(Caster.Location, Caster.Map);
                    secondGate.Hue = Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0);
                    secondGate.MoveToWorld(loc, map);
                }
            }

            FinishSequence();
        }
Ejemplo n.º 4
0
        public virtual void UseGate(Mobile m)
        {
            ClientFlags flags = m.NetState == null ? ClientFlags.None : m.NetState.Flags;

            if (Factions.Sigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else if (this.Name == "Mangar's Gate")
            {
                BaseCreature.TeleportPets(m, m_Target, m_TargetMap);

                m.MoveToWorld(m_Target, m_TargetMap);

                if (m.AccessLevel == AccessLevel.Player || !m.Hidden)
                {
                    m.PlaySound(0x1FE);
                }

                OnGateUsed(m);
            }
            else if (Worlds.AllowEscape(m, m.Map, m.Location, m.X, m.Y) == false)
            {
                m.SendMessage("The gate does not seem to let you enter.");
            }
            else if (m_TargetMap == Map.Lodor && m is PlayerMobile && ((PlayerMobile)m).Young)
            {
                m.SendLocalizedMessage(1049543);                   // You decide against traveling to Lodor while you are still young.
            }
            else if (m.Spell != null)
            {
                m.SendLocalizedMessage(1049616);                   // You are too busy to do that at the moment.
            }
            else if (m_TargetMap != null && m_TargetMap != Map.Internal)
            {
                BaseCreature.TeleportPets(m, m_Target, m_TargetMap);

                m.MoveToWorld(m_Target, m_TargetMap);

                if (m.AccessLevel == AccessLevel.Player || !m.Hidden)
                {
                    m.PlaySound(0x1FE);
                }

                OnGateUsed(m);
            }
            else
            {
                m.SendMessage("This moongate does not seem to go anywhere.");
            }
        }
Ejemplo n.º 5
0
        public override bool OnMoveOver(Mobile m)
        {
            if (m is PlayerMobile)
            {
                string world = Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y);

                if (m is PlayerMobile && world == "the Bottle World of Kuldar" && !(Server.Items.CharacterDatabase.GetKeys(m, "VordoKey")))
                {
                    m.SendMessage("This magical gate doesn't seem to do anything.");
                }
                else if (Worlds.AllowEscape(m, m.Map, m.Location, m.X, m.Y) == false && Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y) != "the Bottle World of Kuldar")
                {
                    m.SendMessage("This magical gate doesn't seem to do anything.");
                }
                else if (Worlds.RegionAllowedRecall(m.Map, m.Location, m.X, m.Y) == false && Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y) != "the Land of Ambrosia" && Worlds.GetMyWorld(m.Map, m.Location, m.X, m.Y) != "the Bottle World of Kuldar")
                {
                    m.SendMessage("This magical gate doesn't seem to do anything.");
                }
                else
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(0.5), (delegate
                    {
                        foreach (Mobile pet in World.Mobiles.Values)
                        {
                            if (pet is BaseCreature)
                            {
                                BaseCreature bc = (BaseCreature)pet;
                                if (bc.Controlled && bc.ControlMaster == m)
                                {
                                    pet.Hidden = true;
                                }
                            }
                        }
                        m.Hidden = true;
                    }));

                    m.PlaySound(0x20E);
                    m.CloseGump(typeof(MoonGateGump));
                    m.SendGump(new MoonGateGump(m, false));
                    m.SendMessage("Choose a destination.");
                }
            }
            return(true);
        }
Ejemplo n.º 6
0
 public void ReturnToBoat(Point3D loc, Map map, Mobile from)
 {
     if (!SpellHelper.CheckTravel(from, TravelCheckType.RecallFrom))
     {
     }
     else if (Worlds.AllowEscape(from, from.Map, from.Location, from.X, from.Y) == false)
     {
         this.SayTo(from, "Your ship is somewhere I cannot send you.");
     }
     else if (Worlds.RegionAllowedRecall(from.Map, from.Location, from.X, from.Y) == false)
     {
         this.SayTo(from, "Your ship is somewhere I cannot send you.");
     }
     else if (Worlds.RegionAllowedTeleport(map, loc, loc.X, loc.Y) == false)
     {
         this.SayTo(from, "Your ship is somewhere I cannot send you.");
     }
     else if (!SpellHelper.CheckTravel(from, map, loc, TravelCheckType.RecallTo))
     {
     }
     else if (Server.Misc.WeightOverloading.IsOverloaded(from))
     {
         from.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
     }
     else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
     {
         from.SendLocalizedMessage(501942);                   // That location is blocked.
     }
     else
     {
         BaseCreature.TeleportPets(from, loc, map, false);
         from.PlaySound(0x13);
         Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 0, 0, 5024, 0);
         from.MoveToWorld(loc, map);
         from.PlaySound(0x13);
         Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 0, 0, 5024, 0);
     }
 }
Ejemplo n.º 7
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (Worlds.AllowEscape(Caster, Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That spell does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedRecall(Caster.Map, Caster.Location, Caster.X, Caster.Y) == false)
            {
                Caster.SendMessage("That potion does not seem to work in this place.");
            }
            else if (Worlds.RegionAllowedTeleport(map, loc, loc.X, loc.Y) == false)
            {
                Caster.SendMessage("The destination seems magically unreachable with this potion.");
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (CheckSequence())
            {
                Caster.SendMessage("You open a mystical portal in a mushroom circle");                   // You open a magical gate to another location

                Effects.PlaySound(Caster.Location, Caster.Map, 0x1);
                int          mushx;
                int          mushy;
                int          mushz;
                InternalItem firstGatea = new InternalItem(loc, map);
                mushx             = Caster.X;
                mushy             = Caster.Y;
                mushz             = Caster.Z;
                firstGatea.ItemID = 0xD10;
                Point3D mushxyz = new Point3D(mushx, mushy, mushz);
                firstGatea.MoveToWorld(mushxyz, Caster.Map);
                InternalItem firstGateb = new InternalItem(loc, map);
                mushx             = Caster.X;
                mushy             = Caster.Y;
                firstGateb.ItemID = 0x373A;
                mushz             = Caster.Z + 1;
                Point3D mushxyza = new Point3D(mushx, mushy, mushz);
                firstGateb.MoveToWorld(mushxyza, Caster.Map);
                InternalItem firstGatec = new InternalItem(loc, map);
                mushx             = Caster.X - 1;
                firstGatec.ItemID = 0xD11;
                mushy             = Caster.Y + 1;
                mushz             = Caster.Z;
                Point3D mushxyzb = new Point3D(mushx, mushy, mushz);
                firstGatec.MoveToWorld(mushxyzb, Caster.Map);
                InternalItem firstGated = new InternalItem(loc, map);
                firstGated.ItemID = 0xD0C;
                mushx             = Caster.X;
                mushy             = Caster.Y + 2;
                mushz             = Caster.Z;
                Point3D mushxyzc = new Point3D(mushx, mushy, mushz);
                firstGated.MoveToWorld(mushxyzc, Caster.Map);
                InternalItem firstGatee = new InternalItem(loc, map);
                mushx             = Caster.X + 1;
                firstGatee.ItemID = 0xD0D;
                mushy             = Caster.Y + 1;
                mushz             = Caster.Z;
                Point3D mushxyzd = new Point3D(mushx, mushy, mushz);
                firstGatee.MoveToWorld(mushxyzd, Caster.Map);
                InternalItem firstGatef = new InternalItem(loc, map);
                firstGatef.ItemID = 0xD0E;
                mushx             = Caster.X + 2;
                mushy             = Caster.Y;
                mushz             = Caster.Z;
                Point3D mushxyze = new Point3D(mushx, mushy, mushz);
                firstGatef.MoveToWorld(mushxyze, Caster.Map);
                InternalItem firstGateg = new InternalItem(loc, map);
                mushx             = Caster.X + 1;
                firstGateg.ItemID = 0xD0F;
                mushy             = Caster.Y - 1;
                mushz             = Caster.Z;
                Point3D mushxyzf = new Point3D(mushx, mushy, mushz);
                firstGateg.MoveToWorld(mushxyzf, Caster.Map);

                if (Worlds.RegionAllowedTeleport(Caster.Map, Caster.Location, Caster.X, Caster.Y) == true)
                {
                    Effects.PlaySound(loc, map, 0x1);
                    InternalItem secondGatea = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X;
                    mushy = loc.Y;
                    mushz = loc.Z;
                    secondGatea.ItemID = 0xD10;
                    Point3D mushaxyz = new Point3D(mushx, mushy, mushz);
                    secondGatea.MoveToWorld(mushaxyz, map);
                    InternalItem secondGateb = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X;
                    mushy = loc.Y;
                    secondGateb.ItemID = 0x373A;
                    mushz = loc.Z + 1;
                    Point3D mushaxyza = new Point3D(mushx, mushy, mushz);
                    secondGateb.MoveToWorld(mushaxyza, map);
                    InternalItem secondGatec = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X - 1;
                    secondGatec.ItemID = 0xD11;
                    mushy = loc.Y + 1;
                    mushz = loc.Z - 1;
                    Point3D mushaxyzb = new Point3D(mushx, mushy, mushz);
                    secondGatec.MoveToWorld(mushaxyzb, map);
                    InternalItem secondGated = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X;
                    mushy = loc.Y + 2;
                    secondGated.ItemID = 0xD0C;
                    mushz = loc.Z;
                    Point3D mushaxyzc = new Point3D(mushx, mushy, mushz);
                    secondGated.MoveToWorld(mushaxyzc, map);
                    InternalItem secondGatee = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X + 1;
                    mushy = loc.Y + 1;
                    mushz = loc.Z;
                    secondGatee.ItemID = 0xD0D;
                    Point3D mushaxyzd = new Point3D(mushx, mushy, mushz);
                    secondGatee.MoveToWorld(mushaxyzd, map);
                    InternalItem secondGatef = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X + 2;
                    mushy = loc.Y;
                    mushz = loc.Z;
                    secondGatef.ItemID = 0xD0E;
                    Point3D mushaxyze = new Point3D(mushx, mushy, mushz);
                    secondGatef.MoveToWorld(mushaxyze, map);
                    InternalItem secondGateg = new InternalItem(Caster.Location, Caster.Map);
                    mushx = loc.X + 1;
                    secondGateg.ItemID = 0xD0F;
                    mushy = loc.Y - 1;
                    mushz = loc.Z;
                    Point3D mushaxyzf = new Point3D(mushx, mushy, mushz);
                    secondGateg.MoveToWorld(mushaxyzf, map);
                }
            }

            FinishSequence();
        }