コード例 #1
0
        public override bool VerifyMove(Mobile from)
        {
            PlayerMobile From = from as PlayerMobile;

            if (From.Alive == true)
            {
                From.BoltEffect(0);
                From.SendMessage("You feel a jolt of electricity!");
                From.PlaySound(From.Female ? 799 : 1071);
                From.Say("*huh?*");
                From.Damage(Utility.Random(20, 55));
                return(false);
            }
            From.SendMessage("You are dead and can not take that!");
            return(false);
        }
コード例 #2
0
ファイル: JailCommand.cs プロジェクト: Orion321/unknown-shard
        public static void JailThem(PlayerMobile player, JailOption option)
        {
            if (null == player || player.AccessLevel >= JailConfig.JailImmuneLevel)
            {
                return;
            }

            if (JailOption.Squelch == option)
            {
                player.Squelched = true;
            }

            foreach (Item item in player.Items)
            {
                if (item is JailHammer)                                                     // Jailed while jailed gets them another load of rock to mine
                {
                    if (0 > (((JailHammer)item).UsesRemaining += JailConfig.UsesRemaining)) // handle integer overflow
                    {
                        ((JailHammer)item).UsesRemaining *= -1;
                    }

                    Banker.Withdraw(player, JailConfig.FineAmount);
                    player.SendMessage("Your remaining sentence has been increased!");
                    player.SendMessage("You have been fined {0} gold and are being kicked!", JailConfig.FineAmount);

                    // This gives a nice little delay for the message to be read
                    s_KickProcessingQueue.Enqueue(player);
                    player.Squelched = true;
                    Server.Timer.DelayCall(TimeSpan.FromSeconds(kSecondsTillKick), new Server.TimerCallback(KickPlayerInQueue));
                    return;
                }
            }

            // If mounted, dismount them and stable mount
            if (player.Mounted)
            {
                if (player.Mount is EtherealMount)
                {
                    EtherealMount pet = player.Mount as EtherealMount;
                    pet.Internalize();
                    pet.Rider = null;
                }
                else if (player.Mount is BaseMount)
                {
                    BaseMount pet = player.Mount as BaseMount;
                    pet.Rider = null;
                    Jail.StablePet(player, pet);
                }
            }

            // Stable all other pets
            foreach (Mobile mobile in World.Mobiles.Values)
            {
                if (mobile is BaseCreature)
                {
                    BaseCreature bc = mobile as BaseCreature;

                    if (null != bc && (bc.Controlled && bc.ControlMaster == player) || (bc.Summoned && bc.SummonMaster == player))
                    {
                        Jail.StablePet(player, bc);
                    }
                }
            }

            // Move all items to a bag and move that to the bank
            Container backpack     = player.Backpack;
            Backpack  bag          = new Backpack(); bag.Hue = JailConfig.RobeHue;
            ArrayList equipedItems = new ArrayList(player.Items);

            foreach (Item item in equipedItems)
            {
                if (item.Layer == Layer.Bank || item.Layer == Layer.Backpack || item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || item is DeathShroud)
                {
                    continue;
                }
                bag.DropItem(item);
            }

            ArrayList backpackItems = new ArrayList(backpack.Items);

            foreach (Item item in backpackItems)
            {
                if (item is JailRock)
                {
                    item.Delete();
                }
                else if (item.Movable)                          // Non movable pack items must remain (i.e. skill balls)
                {
                    bag.DropItem(item);
                }
            }

            // Remember their access level and make them a player
            JailHammer hammer = new JailHammer();

            hammer.PlayerAccessLevel = player.AccessLevel;
            player.AccessLevel       = AccessLevel.Player;

            // Bank the bag of belongings, give them a hammer and welcome them
            player.BankBox.DropItem(bag);
            player.AddItem(hammer);

            // Explosively move player to jail
            player.BoltEffect(0);
            player.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Waist);
            player.PlaySound(0x307);
            player.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
            player.PlaySound(0x225);

            // This gives a nice little delay for the effect to complete
            s_JailProcessingQueue.Enqueue(player);
            Server.Timer.DelayCall(TimeSpan.FromSeconds(kSecondsTillJail), new Server.TimerCallback(JailPlayerInQueue));
        }