Пример #1
0
        private Sapphired20 GetDice()
        {
            if (Dice == null || Dice.Deleted)
            {
                Sapphired20 dice = null;

                foreach (Item item in GetEnumeratedItems())
                {
                    if (item is Sapphired20 i && (!i.Deleted))
                    {
                        dice = i;
                        break;
                    }
                }

                if (dice != null)
                {
                    Dice = dice;
                    Dice.MoveToWorld(_DiceLoc, Map.Malas);
                }
                else
                {
                    Dice = new Sapphired20
                    {
                        Movable = false
                    };

                    Dice.MoveToWorld(_DiceLoc, Map.Malas);
                }
            }

            return(Dice);
        }
Пример #2
0
        private Sapphired20 GetDice()
        {
            if (Dice == null || Dice.Deleted)
            {
                Sapphired20 dice = this.GetEnumeratedItems().OfType <Sapphired20>().FirstOrDefault(i => !i.Deleted);

                if (dice != null)
                {
                    Dice = dice;
                    Dice.MoveToWorld(_DiceLoc, Map.Malas);
                }
                else
                {
                    Dice         = new Sapphired20();
                    Dice.Movable = false;
                    Dice.MoveToWorld(_DiceLoc, Map.Malas);
                }
            }

            return(Dice);
        }
Пример #3
0
        public void DoRoll()
        {
            GaryTheDungeonMaster g = GetGary();
            Sapphired20          d = GetDice();
            int roll = ForceRoll >= 0 && ForceRoll < 20 ? ForceRoll : Utility.Random(20);

            g.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1080099); // *Gary rolls the sapphire d20*

            BaseDoor door1 = GetDoor1();
            BaseDoor door2 = GetDoor2();

            door1.Locked = true;
            door2.Locked = true;

            Timer.DelayCall(TimeSpan.FromMinutes(2), () =>
            {
                door1.Locked = false;
                door2.Locked = false;
            });

            Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
            {
                if (d != null)
                {
                    d.Roll(roll);
                }
                else
                {
                    foreach (PlayerMobile m in GetEnumeratedMobiles().OfType <PlayerMobile>())
                    {
                        m.SendMessage("- {0} -", (roll + 1).ToString());
                    }
                }
            });

            Timer.DelayCall(TimeSpan.FromSeconds(2), () =>
            {
                if (roll == 19)
                {
                    DoStaffSpawn();
                }
                else
                {
                    Spawn       = Activator.CreateInstance(_MonsterList[roll]) as BaseCreature;
                    Spawn.Kills = 100;

                    if (Spawn is Dragon)
                    {
                        Spawn.Body = 155;
                        Spawn.CorpseNameOverride = "a rotting corpse";
                    }

                    Spawn.MoveToWorld(_SpawnLoc, Map.Malas);
                    Spawn.Home      = _SpawnLoc;
                    Spawn.RangeHome = 7;
                }

                ChangeStatues();
            });

            ForceRoll = -1;
        }