Beispiel #1
0
        public static void DeleteGuardian(DungeonTreasureChest tc)
        {
            if (tc == null || (tc as DungeonTreasureChest).Guardian == null || (tc as DungeonTreasureChest).Guardian.Alive == false || (tc as DungeonTreasureChest).Guardian.Deleted == true)
            {
                return;
            }

            if ((tc as DungeonTreasureChest).Guardian as BaseCreature == null)
            {
                return;
            }

            // say something!
            switch (Utility.Random(4))
            {
            case 0:
                (tc as DungeonTreasureChest).Guardian.Say("Thar be nothing left for me here.");
                break;

            case 1:
                (tc as DungeonTreasureChest).Guardian.Say("I done me best!");
                break;

            case 2:
                (tc as DungeonTreasureChest).Guardian.Say("Arr, me work be done here.");
                break;

            case 3:
                (tc as DungeonTreasureChest).Guardian.Say("Arr, I got to get back to me ale!");
                break;
            }

            // Frozen while casting
            (tc as DungeonTreasureChest).Guardian.CantWalk = true;

            // fake recall
            new NpcRecallSpell((tc as DungeonTreasureChest).Guardian, null, new Point3D(0, 0, 0)).Cast();

            // delete him
            DateTime DeleteTime = DateTime.Now + TimeSpan.FromSeconds(3.0);

            new DeleteGuardianTimer((tc as DungeonTreasureChest).Guardian, DeleteTime).Start();
        }
        public static void DeleteGuardian(DungeonTreasureChest tc)
        {
            if ( tc == null || (tc as DungeonTreasureChest).Guardian == null || (tc as DungeonTreasureChest).Guardian.Alive == false || (tc as DungeonTreasureChest).Guardian.Deleted == true )
                return;

            if ( (tc as DungeonTreasureChest).Guardian as BaseCreature == null )
                return;

            // say something!
            switch (Utility.Random(4))
            {
                case 0:
                    (tc as DungeonTreasureChest).Guardian.Say("Thar be nothing left for me here."); 
                    break;
                case 1:
                    (tc as DungeonTreasureChest).Guardian.Say("I done me best!"); 
                    break;
                case 2:
                    (tc as DungeonTreasureChest).Guardian.Say("Arr, me work be done here."); 
                    break;
                case 3:
                    (tc as DungeonTreasureChest).Guardian.Say("Arr, I got to get back to me ale!"); 
                    break;
            }

            // Frozen while casting
            (tc as DungeonTreasureChest).Guardian.CantWalk = true;

            // fake recall
            new NpcRecallSpell((tc as DungeonTreasureChest).Guardian, null, new Point3D(0, 0, 0)).Cast();

            // delete him
            DateTime DeleteTime = DateTime.Now + TimeSpan.FromSeconds(3.0);
            new DeleteGuardianTimer((tc as DungeonTreasureChest).Guardian, DeleteTime).Start();
        }