コード例 #1
0
        public override void Drink(Mobile from)
        {
            TeiravonMobile m_Player = (TeiravonMobile)from;

            if (m_Player.CanDrink(PEffect))
            {
                StatMod OrcGrowthSTRMod = new StatMod(StatType.Str, (int)m_Player.Serial + " Growth Str", 50, TimeSpan.FromMinutes(10));
                m_Player.AddStatMod(OrcGrowthSTRMod);

                if (m_Player.IsOrc())
                {
                    m_Player.OBody = 0xBD;                     // orc brute
                }
                else if (m_Player.IsDwarf())
                {
                    m_Player.OBody = 0x4C;                     // Titan
                }
                else if (m_Player.IsDrow())
                {
                    m_Player.OBody = 0xAD;                     //Mephitis
                }
                else if (m_Player.IsElf())
                {
                    m_Player.OBody = 0x12D;                     // tree fellow
                }
                else if (m_Player.IsHuman())
                {
                    m_Player.OBody = 0x137;                     // shadow knight
                }
            }

            base.Drink(from);
        }
コード例 #2
0
        public override void Drink(Mobile from)
        {
            TeiravonMobile m_Player = (TeiravonMobile)from;

            if (m_Player.CanDrink(PEffect))
            {
                StatMod DwarvenRageSTRMod = new StatMod(StatType.Str, (int)m_Player.Serial + " Rage Str", 50, TimeSpan.FromSeconds(30));
                m_Player.AddStatMod(DwarvenRageSTRMod);

                StatMod DwarvenRageDEXMod = new StatMod(StatType.Dex, (int)m_Player.Serial + " Rage Dex", 50, TimeSpan.FromSeconds(30));
                m_Player.AddStatMod(DwarvenRageDEXMod);

                StatMod DwarvenRageINTMod = new StatMod(StatType.Int, (int)m_Player.Serial + " Rage Int", 50, TimeSpan.FromSeconds(30));
                m_Player.AddStatMod(DwarvenRageINTMod);
            }

            base.Drink(from);
        }
コード例 #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from is TeiravonMobile)
            {
                TeiravonMobile m_Player = (TeiravonMobile)from;

                if (m_Player.IsOrc() && !(this is Horngoth) && !(this is Warg) && !(this is WarMount))
                {
                    m_Player.SendMessage("You cannot ride that.");
                    return;
                }

                if (!m_Player.IsFrostling() && this is FrostlingPolarBear)
                {
                    m_Player.SendMessage("You can't ride a bear! What do you think you are, some kind of frozen viking?");
                    return;
                }

                //Prevent the usage of scytches, bardiches, pikes and halberds on horses
                if (m_Player.Weapon is BasePoleArm || m_Player.Weapon is Pike)
                {
                    m_Player.SendMessage("You cannot ride with your weapon.");
                    return;
                }

                //Prevent usage of spears and lances on horses unless the player has the mounted combat feat
                if ((m_Player.Weapon is BaseSpear || m_Player.Weapon is Lance) && !m_Player.HasFeat(TeiravonMobile.Feats.MountedCombat))
                {
                    m_Player.SendMessage("You must have the Mounted Combat Feat to ride with that weapon.");
                    return;
                }


                //Prevent usage of certain "heavy bows" on horses

                bool heavybow = false;

                Type[] m_HeavyBows = new Type[]
                {
                    typeof(Recurve),
                    typeof(Crossbow),
                    typeof(Longbow),
                    typeof(CompositeBow),
                    typeof(HeavyCrossbow),
                    typeof(RepeatingCrossbow)
                };

                for (int i = 0; i < m_HeavyBows.Length; i++)
                {
                    if (m_Player.Weapon.GetType() == m_HeavyBows[i])
                    {
                        heavybow = true;
                        break;
                    }
                }

                if (heavybow)
                {
                    m_Player.SendMessage("Your bow is too unwieldy to be used while mounted.");
                    return;
                }
            }

            if (IsDeadPet)
            {
                return;
            }

            if (from.IsBodyMod && !from.Body.IsHuman)
            {
                if (Core.AOS)                   // You cannot ride a mount in your current form.
                {
                    PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 1062061, from.NetState);
                }
                else
                {
                    from.SendLocalizedMessage(1061628);                       // You can't do that while polymorphed.
                }
                return;
            }

            if (Core.AOS && Server.Items.Bola.UnderEffect(from))
            {
                from.SendLocalizedMessage(1062910);                   // You cannot mount while recovering from a bola throw.
                return;
            }

            if (!from.CanBeginAction(typeof(BaseMount)))
            {
                from.SendLocalizedMessage(1040024);                   // You are still too dazed from being knocked off your mount to ride!
                return;
            }

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

            if (from.Female ? !AllowFemaleRider : !AllowMaleRider)
            {
                OnDisallowedRider(from);
                return;
            }

            if (!Multis.DesignContext.Check(from))
            {
                return;
            }

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

            if (from.InRange(this, 1))
            {
                bool canAccess = (from.AccessLevel >= AccessLevel.GameMaster) ||
                                 (Controled && ControlMaster == from) ||
                                 (Summoned && SummonMaster == from);

                if (canAccess)
                {
                    if (this.Poisoned)
                    {
                        PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 1049692, from.NetState);                           // This mount is too ill to ride.
                    }
                    else
                    {
                        Rider = from;
                        if (from.AccessLevel == AccessLevel.Player)
                        {
                            from.Hidden = false;
                        }
                        if (from is TeiravonMobile)
                        {
                            TeiravonMobile m       = (TeiravonMobile)from;
                            int            dexb    = 0;
                            int            intb    = 0;
                            string         modName = m.Serial.ToString();
                            switch (m.RidingSkill)
                            {
                            case 0:
                                dexb = -25;
                                intb = -25;
                                break;

                            case 1:
                                dexb = -15;
                                intb = -15;
                                break;

                            case 2:
                                dexb = -5;
                                intb = -5;
                                break;

                            case 3:
                                break;

                            case 4:
                                dexb = 10;
                                intb = 5;
                                break;
                            }

                            if (dexb != 0)
                            {
                                m.AddStatMod(new StatMod(StatType.Dex, modName + "MntDex", dexb, TimeSpan.Zero));
                            }
                            if (intb != 0)
                            {
                                m.AddStatMod(new StatMod(StatType.Int, modName + "MntInt", intb, TimeSpan.Zero));
                            }
                        }
                    }
                }
                else if (!Controled && !Summoned)
                {
                    // That mount does not look broken! You would have to tame it to ride it.
                    PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 501263, from.NetState);
                }
                else
                {
                    // This isn't your mount; it refuses to let you ride.
                    PrivateOverheadMessage(Network.MessageType.Regular, 0x3B2, 501264, from.NetState);
                }
            }
            else
            {
                from.SendLocalizedMessage(500206);                   // That is too far away to ride.
            }
        }