Dismount() public static method

public static Dismount ( Server.Mobile m ) : void
m Server.Mobile
return void
コード例 #1
0
        public override void OnThink()
        {
            base.OnThink();

            if (0.1 > Utility.RandomDouble() && DateTime.UtcNow > m_NextAbilityTime && Combatant != null && this.InRange(Combatant, RangePerception))                 // as per OSI, no check for LOS
            {
                Mobile to = Combatant;

                switch (Utility.Random(2))
                {
                case 0:                         // Niporailem's Treasure
                {
                    Effects.SendPacket(Location, Map, new HuedEffect(EffectType.Moving, this.Serial, to.Serial, 0xEEF, this.Location, to.Location, 10, 0, false, false, 0, 0));
                    Effects.PlaySound(to.Location, to.Map, 0x37);

                    int amount = Utility.RandomMinMax(2, 4);

                    for (int i = 0; i < amount; i++)
                    {
                        Item treasure = new NiporailemsTreasure();

                        if (!to.Player || !to.PlaceInBackpack(treasure))
                        {
                            treasure.MoveToWorld(to.Location, to.Map);
                            treasure.OnDroppedToWorld(this, to.Location);
                        }
                    }

                    BaseMount.Dismount(to);
                    to.Damage(Utility.Random(18, 27), this);

                    m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(MinAbilityTime, MaxAbilityTime));

                    break;
                }

                case 1:                         // Strangle
                {
                    if (!Spells.Necromancy.StrangleSpell.UnderEffect(to))
                    {
                        to.PlaySound(0x22F);
                        to.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
                        to.FixedParticles(0x374A, 1, 17, 9502, 1108, 4, (EffectLayer)255);

                        Spells.Necromancy.StrangleSpell.StartTimer(this, to);
                    }

                    break;
                }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// https://uo.com/wiki/ultima-online-wiki/world/dungeons/tomb-of-kings/
        /// Niporailem the thief, a formidable foe who will summon spectral armor and throw overweight,
        /// damaging gold piles which dismount an attacker. These piles turn into treasure sand after a period of time or when dropped. Dropping
        /// the gold piles, or being hidden when they are thrown, can result in a spawn of cursed metallic knights and mages.
        /// </summary>
        public override void OnThink()
        {
            base.OnThink();                                                                                                                      // Fool’s Gold

            if (0.1 > Utility.RandomDouble() && DateTime.UtcNow > m_NextAbilityTime && Combatant != null && InRange(Combatant, RangePerception)) // as per OSI, no check for LOS
            {
                Mobile to = (Mobile)Combatant;

                switch (Utility.Random(1))
                {
                case 0:     // Niporailem's Treasure
                {
                    Effects.SendPacket(Location, Map, new HuedEffect(EffectType.Moving, Serial, to.Serial, 0xEEF, Location, to.Location, 10, 0, false, false, 0, 0));
                    Effects.PlaySound(to.Location, to.Map, 0x37);

                    int amount = Utility.RandomMinMax(2, 4);

                    for (int i = 0; i < amount; i++)
                    {
                        Item treasure = new NiporailemsTreasure();

                        if (!to.Player || !to.PlaceInBackpack(treasure))
                        {
                            treasure.MoveToWorld(to.Location, to.Map);
                            treasure.OnDroppedToWorld(this, to.Location);
                        }
                    }
                    to.SendLocalizedMessage(1112112);         // To carry the burden of greed!

                    BaseMount.Dismount(to);
                    to.Damage(Utility.Random(18, 27), this);

                    m_NextAbilityTime = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(MinAbilityTime, MaxAbilityTime));

                    break;
                }
                }
            }
        }
コード例 #3
0
ファイル: TormentedMinotaur.cs プロジェクト: dpisanu/xrunuo
        public void GroundSlap()
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            ArrayList targets = new ArrayList();

            foreach (Mobile m in this.GetMobilesInRange(8))
            {
                if (m == this || !CanBeHarmful(m))
                {
                    continue;
                }

                if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team))
                {
                    targets.Add(m);
                }
                else if (m.Player)
                {
                    targets.Add(m);
                }
            }

            PlaySound(0x140);


            for (int i = 0; i < targets.Count; ++i)
            {
                Mobile m = (Mobile)targets[i];

                int distance = (int)m.GetDistanceToSqrt(this);

                if (distance == 0)
                {
                    distance = 1;
                }

                double damage = 75 / distance;
                damage = targets.Count * damage;

                damage = 10 * targets.Count;

                if (damage < 40.0)
                {
                    damage = 40.0;
                }
                else if (damage > 75.0)
                {
                    damage = 75.0;
                }

                DoHarmful(m);

                AOS.Damage(m, this, (int)damage, 100, 0, 0, 0, 0);

                m.FixedParticles(0x3728, 10, 15, 9955, EffectLayer.Waist);
                BaseMount.Dismount(m);

                if (m.Alive && m.Body.IsHuman && !m.Mounted)
                {
                    m.Animate(20, 7, 1, true, false, 0);                       // take hit
                }
            }
        }
コード例 #4
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);
                    }
                }
            }