Inheritance: Server.Mobiles.BaseBreedableCreature, IMount
コード例 #1
0
ファイル: BaseMount.cs プロジェクト: greeduomacro/last-wish
		public override void OnAfterDelete()
		{
			if ( m_Mount != null )
				m_Mount.Delete();

			m_Mount = null;

			base.OnAfterDelete();
		}
コード例 #2
0
ファイル: BaseMount.cs プロジェクト: greeduomacro/last-wish
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					m_Mount = reader.ReadMobile() as BaseMount;

					if ( m_Mount == null )
						Delete();

					break;
				}
			}
		}
コード例 #3
0
ファイル: BaseMount.cs プロジェクト: Crome696/ServUO
        public override void OnAfterDelete()
        {
            if (this.m_Mount != null)
                this.m_Mount.Delete();

            this.m_Mount = null;

            base.OnAfterDelete();
        }
コード例 #4
0
ファイル: BaseMount.cs プロジェクト: greeduomacro/last-wish
		public MountItem( BaseMount mount, int itemID ) : base( itemID )
		{
			Layer = Layer.Mount;
			Movable = false;

			m_Mount = mount;
		}
コード例 #5
0
 public MountClone(BaseMount original)
     : base(original.Name,  original.BodyValue, original.ItemID, original.AI, original.FightMode, original.RangePerception, original.RangeFight, original.ActiveSpeed, original.PassiveSpeed)
 {
     foreach (var property in (typeof(BaseMount)).GetProperties())
         if (property.CanRead && property.CanWrite && property.Name != "Rider")
             property.SetValue(this, property.GetValue(original, null), null);
 }
コード例 #6
0
ファイル: BaseMount.cs プロジェクト: Crome696/ServUO
        public MountItem(BaseMount mount, int itemID)
            : base(itemID)
        {
            this.Layer = Layer.Mount;
            this.Movable = false;

            this.m_Mount = mount;
        }
コード例 #7
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!(targeted is TeiravonMobile))
                {
                    from.SendMessage("You must target another player.");
                }
                else if (!(( TeiravonMobile )targeted).Alive || !from.Alive)
                {
                    from.SendMessage("You must target a living player.");
                }
                else if (( TeiravonMobile )targeted == ( TeiravonMobile )from)
                {
                    from.SendMessage("You must target another player.");
                }
                else if (from.Mounted)
                {
                    from.SendMessage("You must be on foot to initially grab a player.");
                }
                else if ((( TeiravonMobile )targeted).Mounted)
                {
                    from.SendMessage("Your target must be on foot to be grabbed.");
                }
                //else if ( ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.OneHanded ) != null || ( ( TeiravonMobile )targeted ).FindItemOnLayer( Layer.TwoHanded ) != null )
                //	from.SendMessage( "You must first disarm your target." );
                else if (Grabbers.Contains(from))                               // Sanity check
                {
                    from.SendMessage("You can only grab one person at a time.");
                }
                else if (Grabbers.Contains((( TeiravonMobile )targeted)))
                {
                    from.SendMessage("You can't get a hold on {0} right now.", (( TeiravonMobile )targeted).Female ? "her" : "him");
                }
                else
                {
                    TeiravonMobile grabbed = ( TeiravonMobile )targeted;

                    foreach (GrabTimer timer in Grabbers.Values)
                    {
                        if (timer.Grabbed == grabbed)
                        {
                            from.SendMessage("{0} is already being held.", grabbed.Name);
                            return;
                        }
                    }

                    int grabvalue   = 0;
                    int defendvalue = 0;

                    GetValues(( TeiravonMobile )from, grabbed, out grabvalue, out defendvalue);

                    // We grabbed them.
                    if (grabvalue > defendvalue || (grabvalue == defendvalue && Utility.RandomBool()))
                    {
                        GrabTimer timer = new GrabTimer(( TeiravonMobile )from, grabbed);

                        Grabbers.Add(( TeiravonMobile )from, timer);
                        timer.Start();

                        from.Emote("*successfully grabs {0}!*", grabbed.Name);
                        BaseWeapon.BlockEquip(from, TimeSpan.FromMinutes(10.0));
                        BasePotion.BlockEquip(from, TimeSpan.FromMinutes(10.0));
                        grabbed.ClearHands();
                        BaseWeapon.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0));
                        BasePotion.BlockEquip(grabbed, TimeSpan.FromMinutes(10.0));
                        grabbed.BeginAction(typeof(BaseMount));
                        grabbed.Freeze(TimeSpan.FromMinutes(10.0));

                        BaseMount.Dismount(grabbed);
                    }
                    else
                    {
                        from.Emote("*fails to grab {0}!*", grabbed.Name);
                    }
                }
            }
コード例 #8
0
        public virtual bool Validate(Mobile from)
        {
            #region SA
            if (from.Race == Race.Gargoyle)
            {
                from.SendLocalizedMessage(1112281); // gargs can't mount
                return(false);
            }
            #endregion

            if (Parent == null)
            {
                from.SayTo(from, 1010095); // This must be on your person to use.
                return(false);
            }

            if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null))
            {
                // CheckIsUsableBy sends the message
                return(false);
            }

            if (!BaseMount.CheckMountAllowed(from, true))
            {
                // CheckMountAllowed sends the message
                return(false);
            }

            if (from.Mount is BaseBoat)
            {
                PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042146, from.NetState); // You cannot use this while mounted.
                return(false);
            }

            if (from.Mounted)
            {
                from.SendLocalizedMessage(1005583); // Please dismount first.
                return(false);
            }

            if (from.IsBodyMod && !from.Body.IsHuman)
            {
                from.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
                return(false);
            }

            if (from.HasTrade)
            {
                from.SendLocalizedMessage(1042317, "", 0x41); // You may not ride at this time
                return(false);
            }

            if ((from.Followers + FollowerSlots) > from.FollowersMax)
            {
                from.SendLocalizedMessage(1049679); // You have too many followers to summon your mount.
                return(false);
            }

            if (!DesignContext.Check(from))
            {
                // Check sends the message
                return(false);
            }

            return(true);
        }
コード例 #9
0
        public static bool MountCheck(Mobile m, BaseMount mnt)
        {
            Setup set = new Setup();
            PlayerMobile pm = m as PlayerMobile;

            if (set.LTREveryMount > 0)
            {
                if (!(pm.Level >= set.LTREveryMount))
                {
                    mnt.OnDisallowedRider(pm);
                    pm.SendMessage("You are not level {0}!", set.LTREveryMount);
                    return false;
                }
                return true;
            }
            else
            {
                if (mnt is Beetle)
                {
                    if (set.LTRBeetle > 0 && !(pm.Level >= set.LTRBeetle))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRBeetle);
                        return false;
                    }
                    return true;
                }
                else if (mnt is DesertOstard)
                {
                    if (set.LTRDesertOstard > 0 && !(pm.Level >= set.LTRDesertOstard))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRDesertOstard);
                        return false;
                    }
                    return true;
                }
                else if (mnt is FireSteed)
                {
                    if (set.LTRFireSteed > 0 && !(pm.Level >= set.LTRFireSteed))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRFireSteed);
                        return false;
                    }
                    return true;
                }
                else if (mnt is ForestOstard)
                {
                    if (set.LTRForestOstard > 0 && !(pm.Level >= set.LTRForestOstard))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRForestOstard);
                        return false;
                    }
                    return true;
                }
                else if (mnt is FrenziedOstard)
                {
                    if (set.LTRFrenziedOstard > 0 && !(pm.Level >= set.LTRFrenziedOstard))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRFrenziedOstard);
                        return false;
                    }
                    return true;
                }
                else if (mnt is HellSteed)
                {
                    if (set.LTRHellSteed > 0 && !(pm.Level >= set.LTRHellSteed))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRHellSteed);
                        return false;
                    }
                    return true;
                }
                else if (mnt is Hiryu)
                {
                    if (set.LTRHiryu > 0 && !(pm.Level >= set.LTRHiryu))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRHiryu);
                        return false;
                    }
                    return true;
                }
                else if (mnt is Horse)
                {
                    if (set.LTRHorse > 0 && !(pm.Level >= set.LTRHorse))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRHorse);
                        return false;
                    }
                    return true;
                }
                else if (mnt is Kirin)
                {
                    if (set.LTRKirin > 0 && !(pm.Level >= set.LTRKirin))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRKirin);
                        return false;
                    }
                    return true;
                }
                else if (mnt is LesserHiryu)
                {
                    if (set.LTRLesserHiryu > 0 && !(pm.Level >= set.LTRLesserHiryu))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRLesserHiryu);
                        return false;
                    }
                    return true;
                }
                else if (mnt is Nightmare)
                {
                    if (set.LTRNightMare > 0 && !(pm.Level >= set.LTRNightMare))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRNightMare);
                        return false;
                    }
                    return true;
                }
                else if (mnt is RidableLlama)
                {
                    if (set.LTRRidableLlama > 0 && !(pm.Level >= set.LTRRidableLlama))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRRidableLlama);
                        return false;
                    }
                    return true;
                }
                else if (mnt is Ridgeback)
                {
                    if (set.LTRRidgeback > 0 && !(pm.Level >= set.LTRRidgeback))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRRidgeback);
                        return false;
                    }
                    return true;
                }
                else if (mnt is SavageRidgeback)
                {
                    if (set.LTRSavageRidgeback > 0 && !(pm.Level >= set.LTRSavageRidgeback))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRSavageRidgeback);
                        return false;
                    }
                    return true;
                }
                else if (mnt is ScaledSwampDragon)
                {
                    if (set.LTRScaledSwampDragon > 0 && !(pm.Level >= set.LTRScaledSwampDragon))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRScaledSwampDragon);
                        return false;
                    }
                    return true;
                }
                else if (mnt is SeaHorse)
                {
                    if (set.LTRSeaHorse > 0 && !(pm.Level >= set.LTRSeaHorse))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRSeaHorse);
                        return false;
                    }
                    return true;
                }
                else if (mnt is SilverSteed)
                {
                    if (set.LTRSilverSteed > 0 && !(pm.Level >= set.LTRSilverSteed))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRSilverSteed);
                        return false;
                    }
                    return true;
                }
                else if (mnt is SkeletalMount)
                {
                    if (set.LTRSkeletalMount > 0 && !(pm.Level >= set.LTRSkeletalMount))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRSkeletalMount);
                        return false;
                    }
                    return true;
                }
                else if (mnt is SwampDragon)
                {
                    if (set.LTRSwampDragon > 0 && !(pm.Level >= set.LTRSwampDragon))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRSwampDragon);
                        return false;
                    }
                    return true;
                }
                else if (mnt is Unicorn)
                {
                    if (set.LTRUnicorn > 0 && !(pm.Level >= set.LTRUnicorn))
                    {
                        mnt.OnDisallowedRider(pm);
                        pm.SendMessage("You are not level {0}!", set.LTRUnicorn);
                        return false;
                    }
                    return true;
                }
                return true;
            }
        }
コード例 #10
0
        public virtual bool Validate(Mobile from)
        {
            if (Parent == null)
            {
                from.SayTo(from, 1010095);                   // This must be on your person to use.
                return(false);
            }
            else if ((this is PaladinWarhorse) && (from.Skills[SkillName.Chivalry].Base < 100 || from.Karma < 0))
            {
                from.SendMessage("Only grandmaster knights may ride this holy steed.");
                return(false);
            }
            else if (this is Warhorse && (
                         from.Skills[SkillName.Tactics].Base < 100 &&
                         from.Skills[SkillName.Swords].Base < 100 &&
                         from.Skills[SkillName.Macing].Base < 100 &&
                         from.Skills[SkillName.Archery].Base < 100 &&
                         from.Skills[SkillName.Fencing].Base < 100
                         ))
            {
                from.SendMessage("Only grandmaster warriors may ride this warhorse.");
                return(false);
            }
            else if ((this is DeathKnightWarhorse) && (from.Skills[SkillName.Chivalry].Base < 100 || from.Karma > 0))
            {
                from.SendMessage("Only grandmaster death knights may ride this evil steed.");
                return(false);
            }
            else if ((this is NecroHorse) && (from.Skills[SkillName.Necromancy].Base < 100))
            {
                from.SendMessage("Only a grandmaster in necromancy may ride this undead steed.");
                return(false);
            }
            else if ((this is DaemonMount) && (from.Skills[SkillName.Necromancy].Base < 100) && (from.Skills[SkillName.Magery].Base < 100))
            {
                from.SendMessage("Only a grandmaster in necromancy and magery may ride this evil being.");
                return(false);
            }
            else if (m_IsRewardItem && !Engines.VeteranRewards.RewardSystem.CheckIsUsableBy(from, this, null))
            {
                // CheckIsUsableBy sends the message
                return(false);
            }
            else if (!BaseMount.CheckMountAllowed(from, true))
            {
                // CheckMountAllowed sends the message
                return(false);
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1005583);                   // Please dismount first.
                return(false);
            }
            else if (from.IsBodyMod && !from.Body.IsHuman)
            {
                from.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }
            else if (from.HasTrade)
            {
                from.SendLocalizedMessage(1042317, "", 0x41);                   // You may not ride at this time
                return(false);
            }
            else if ((from.Followers + FollowerSlots) > from.FollowersMax)
            {
                from.SendLocalizedMessage(1049679);                   // You have too many followers to summon your mount.
                return(false);
            }
            else if (!Multis.DesignContext.Check(from))
            {
                // Check sends the message
                return(false);
            }

            return(true);
        }
コード例 #11
0
        protected override void OnExpansionChanged(Expansion old)
        {
            base.OnExpansionChanged(old);

            if (ExpansionInfo.GetInfo(Expansion).Name != "Third Dawn")
            {
                this.SendNotification <ExpansionNotifyGump>(
                    String.Format(
                        "You are now bound by the rules and physics of the [b]{0}[/b] era!",
                        ExpansionInfo.GetInfo(Expansion).Name),
                    true,
                    1.0,
                    10.0,
                    Color.LawnGreen);
            }
            else
            {
                this.SendNotification <ExpansionNotifyGump>(
                    String.Format(
                        "Welcome to Zombie Land!"),
                    true,
                    1.0,
                    10.0,
                    Color.LawnGreen);
            }

            if (Expansion <= Expansion.T2A && AccessLevel < AccessLevel.Counselor || Expansion == Expansion.UOTD && AccessLevel < AccessLevel.Counselor)
            {
                BaseMount.SetMountPrevention(this, BlockMountType.MapRestricted, TimeSpan.FromDays(365));
            }
            else
            {
                BaseMount.ClearMountPrevention(this);
            }

            if (!Snapshot.Pull(old))
            {
                return;
            }

            var leaveEquip = new List <Item>();

            if (Alive)
            {
                leaveEquip.AddRange(
                    Items.Where(i => i != null && !i.Deleted && i.IsPhased && i != BankBox && i != Backpack));
            }

            foreach (Item item in leaveEquip)
            {
                Backpack.DropItem(item);
            }

            Item holding = Holding;

            if (holding != null)
            {
                if (!holding.Deleted && holding.HeldBy == this && holding.Map == Map.Internal)
                {
                    Backpack.DropItem(holding);
                }

                Holding = null;
                holding.ClearBounce();
            }

            Dictionary <Item, Point3D> takePack = Backpack.FindItemsByType <Item>(true,
                                                                                  i => i != null && !i.Deleted && !i.IsPhased)
                                                  .ToDictionary(i => i, i => i.Location);

            if (!Snapshot.Push(Expansion))
            {
                foreach (Item item in leaveEquip)
                {
                    EquipItem(item);
                }

                return;
            }

            foreach (Item item in leaveEquip)
            {
                Send(item.RemovePacket);
            }

            foreach (KeyValuePair <Item, Point3D> kv in takePack)
            {
                Backpack.DropItem(kv.Key);
                kv.Key.Location = kv.Value;
            }

            UpdateTotals();
            ProcessDelta();

            SendMessage(0x22, "Character snapshots synced successfully.");
        }