示例#1
0
        static void Main(string[] args)
        {
            Angel      angel      = new Angel();
            Devil      devil      = new Devil();
            Arbalester arbalester = new Arbalester();
            Lich       lich       = new Lich();

            UnitsStack        stack1      = new UnitsStack(angel, 3);
            UnitsStack        stack2      = new UnitsStack(devil, 3);
            UnitsStack        stack3      = new UnitsStack(arbalester, 3);
            UnitsStack        stack4      = new UnitsStack(lich, 3);
            List <UnitsStack> unitsStacks = new List <UnitsStack>()
            {
                stack1, stack2, stack3, stack4
            };
            Army usArmy = new Army(unitsStacks);
            List <BattleUnitsStack> battleUnitsStacks = new List <BattleUnitsStack>();

            foreach (var stack in usArmy.StacksList)
            {
                battleUnitsStacks.Add(new BattleUnitsStack(stack));
            }
            BattleArmy fbusArmy = new BattleArmy(battleUnitsStacks, "first");
            BattleArmy sbusArmy = new BattleArmy(battleUnitsStacks, "second");
            Battle     game     = new Battle(fbusArmy, sbusArmy);
        }
示例#2
0
        public void Spawn()
        {
            BaseCreature undead = null;

            switch (Utility.Random(12))
            {
            case 0:
            case 1:
            case 2: undead = new SkeletalMage(); break;

            case 3:
            case 4:
            case 5: undead = new BoneKnight(); break;

            case 6:
            case 7: undead = new Mummy(); break;

            case 8:
            case 9: undead = new Lich(); break;

            case 10: undead = new RottingCorpse(); break;

            case 11: undead = new LichLord(); break;
            }

            if (undead != null)
            {
                undead.MoveToWorld(this.Location, this.Map);
            }
        }
示例#3
0
文件: Congnhan.cs 项目: leson96/Demo
 public List <Lich> ViewLich(string sql)
 {
     try
     {
         List <Lich>   list = new List <Lich>();
         SqlDataReader dr   = p.View(sql);
         if (dr != null)
         {
             while (dr.Read())
             {
                 string MaCN;
                 bool   n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20, n21, n22, n23, n24, n25, n26, n27, n28, n29, n30, n31;
                 int    Thang, Nam;
                 MaCN  = dr.GetString(0);
                 n1    = dr.GetBoolean(1);
                 n2    = dr.GetBoolean(2);
                 n3    = dr.GetBoolean(3);
                 n4    = dr.GetBoolean(4);
                 n5    = dr.GetBoolean(5);
                 n6    = dr.GetBoolean(6);
                 n7    = dr.GetBoolean(7);
                 n8    = dr.GetBoolean(8);
                 n9    = dr.GetBoolean(9);
                 n10   = dr.GetBoolean(10);
                 n11   = dr.GetBoolean(11);
                 n12   = dr.GetBoolean(12);
                 n13   = dr.GetBoolean(13);
                 n14   = dr.GetBoolean(14);
                 n15   = dr.GetBoolean(15);
                 n16   = dr.GetBoolean(16);
                 n17   = dr.GetBoolean(17);
                 n18   = dr.GetBoolean(18);
                 n19   = dr.GetBoolean(19);
                 n20   = dr.GetBoolean(20);
                 n21   = dr.GetBoolean(21);
                 n22   = dr.GetBoolean(22);
                 n23   = dr.GetBoolean(23);
                 n24   = dr.GetBoolean(24);
                 n25   = dr.GetBoolean(25);
                 n26   = dr.GetBoolean(26);
                 n27   = dr.GetBoolean(27);
                 n28   = dr.GetBoolean(28);
                 n29   = dr.GetBoolean(29);
                 n30   = dr.GetBoolean(30);
                 n31   = dr.GetBoolean(31);
                 Thang = dr.GetInt32(32);
                 Nam   = dr.GetInt32(33);
                 Lich lic = new Lich(MaCN, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20, n21, n22, n23, n24, n25, n26, n27, n28, n29, n30, n31, Thang, Nam);
                 list.Add(lic);
             }
         }
         return(list);
     }
     catch (SqlException p)
     {
         throw p;
     }
 }
示例#4
0
文件: Congnhan.cs 项目: leson96/Demo
        public int DeleteLich(Lich lich)
        {
            List <SqlParameter> paras = new List <SqlParameter>();

            paras.Add(new SqlParameter("@macn", lich.MaCN));
            paras.Add(new SqlParameter("@macn", lich.MaCN));
            paras.Add(new SqlParameter("@macn", lich.MaCN));
            return(p.ExecNonQuery("", CommandType.StoredProcedure, paras));
        }
    public void Hit(GameObject target)
    {
        //Destroy enemy when it runs out of life
        if (WaveSwawner.spawnIterator == 1)
        {
            Skeleton temp = target.gameObject.GetComponent<Skeleton>();
            temp.skeletonlifePoints -= power;
            if (temp.skeletonlifePoints <= 0)
            {
                Destroy(target.gameObject);

                //Keep the number of the remained enemies for knowing the current level state
                WaveSwawner.remainedEnemies--;

                //Author:Denisa Dumitrica
                //Add money on dead enemy
                Currency.money += temp.value;
            }
        }
        else if (WaveSwawner.spawnIterator == 2)
        {
            Orc temp = target.gameObject.GetComponent<Orc>();
            temp.orclifePoints -= power;
            if (temp.orclifePoints <= 0)
            {
                Destroy(target.gameObject);

                //Keep the number of the remained enemies for knowing the current level state
                WaveSwawner.remainedEnemies--;

                //Author:Denisa Dumitrica
                //Add money on dead enemy
                Currency.money += temp.value;
            }
        }
        else if (WaveSwawner.spawnIterator == 3)
        {
            Lich temp = target.gameObject.GetComponent<Lich>();
            temp.lichlifePoints -= power;
            if (temp.lichlifePoints <= 0)
            {
                Destroy(target.gameObject);

                //Keep the number of the remained enemies for knowing the current level state
                WaveSwawner.remainedEnemies--;

                //Author:Denisa Dumitrica
                //Add money on dead enemy
                Currency.money += temp.value;
            }
        }
    }
示例#6
0
        static void Main()
        {
            try
            {
                Angel      angel      = new Angel();
                Devil      devil      = new Devil();
                Arbalester arbalester = new Arbalester();
                Lich       lich       = new Lich();

                UnitsStack        stack1      = new UnitsStack(angel, 3);
                UnitsStack        stack2      = new UnitsStack(devil, 3);
                UnitsStack        stack3      = new UnitsStack(arbalester, 3);
                UnitsStack        stack4      = new UnitsStack(lich, 3);
                List <UnitsStack> unitsStacks = new List <UnitsStack>()
                {
                    stack1, stack2, stack3, stack4
                };

                Console.WriteLine("list before editing:");
                foreach (var stack in unitsStacks)
                {
                    Console.WriteLine(stack);
                }
                Console.WriteLine("\n\n");


                Army gg = new Army(unitsStacks);
                Console.WriteLine(gg);
                Console.WriteLine("\n\n");

                unitsStacks.Add(new UnitsStack(angel, 9));
                Console.WriteLine("list after editing:");
                foreach (var stack in unitsStacks)
                {
                    Console.WriteLine(stack);
                }
                Console.WriteLine("\n\n");

                Console.WriteLine("army after editing list:");
                Console.WriteLine(gg);

                var ex = gg.StacksList;
                ex.Add(new UnitsStack(angel, 3));
                Console.WriteLine("army after editing got list:");
                Console.WriteLine(gg);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#7
0
    void Awake () {
        maxX = +GameMgr.instance.maxWidth / 2f;
        minX = -GameMgr.instance.maxWidth / 2f;
        maxY = +GameMgr.instance.maxHeight / 2f;
        minY = -GameMgr.instance.maxHeight / 2f;

		stealables = GetComponentsInChildren<StealableObject>();
		m_Lich = GetComponentInChildren<Lich>();
		for(int i=0; i<stealables.Length; i++)
		{
			Vector3 currPos = stealables[i].gameObject.transform.position;
			currPos = new Vector3(currPos.x, currPos.y, currPos.y/10f);
		}
    }
示例#8
0
        private static IMapObject GetObjectByChar(char c, int y, int x)
        {
            var position = new Vector2(x + 0.5f, y + 0.5f);

            return(c switch
            {
                'R' => (IMapObject)Rat.Create(ResourceCachedLoader.Instance, position, 0),
                'S' => Skeleton.Create(ResourceCachedLoader.Instance, position, 0),
                'L' => Lich.Create(ResourceCachedLoader.Instance, position, 0),
                'H' => HealingPotion.Create(position),
                'M' => ManaPotion.Create(position),
                'A' => ArrowPack.Create(position),
                'D' => Ded.Create(position),
                _ => null
            });
示例#9
0
文件: Congnhan.cs 项目: leson96/Demo
        public int UpdateLich(Lich lich)
        {
            List <SqlParameter> paras = new List <SqlParameter>();

            paras.Add(new SqlParameter("@macn", lich.MaCN));
            paras.Add(new SqlParameter("@macn", lich.MaCN));
            paras.Add(new SqlParameter("@macn", lich.MaCN));
            try
            {
                return(p.ExecNonQuery("updatelich", CommandType.StoredProcedure, paras));
            }
            catch (SqlException p)
            {
                throw p;
            }
        }
        void ReadExcelLich(string path)
        {
            //Xóa toàn bộ lịch
            string query = "DELETE FROM Lich";

            db.ExecuteCommand(query);
            db.SubmitChanges();

            Excel.Application application = new Excel.Application();
            Excel.Workbook    workbook    = application.Workbooks.Open(path);
            Excel.Worksheet   worksheet   = workbook.ActiveSheet;
            Excel.Range       range       = worksheet.UsedRange;

            try
            {
                for (int row = 14; row <= range.Rows.Count; row++)
                {
                    if (((Excel.Range)range.Cells[row, 2]).Text == "" || ((Excel.Range)range.Cells[row, 37]).Text == "" || ((Excel.Range)range.Cells[row, 2]).Text == "Mã MH")
                    {
                        continue;
                    }
                    else
                    {
                        Lich _lich = new Lich();

                        _lich.Ma_MH     = ((Excel.Range)range.Cells[row, 2]).Text;
                        _lich.Ten_MH    = ((Excel.Range)range.Cells[row, 7]).Text;
                        _lich.Lop       = ((Excel.Range)range.Cells[row, 22]).Text;
                        _lich.Thu       = ((Excel.Range)range.Cells[row, 27]).Text;
                        _lich.Phong     = ((Excel.Range)range.Cells[row, 35]).Text;
                        _lich.Thoi_Gian = ((Excel.Range)range.Cells[row, 37]).Text;

                        db.Liches.InsertOnSubmit(_lich);
                        db.SubmitChanges();
                    }
                }

                workbook.Close(false);

                application.Quit();
            }
            catch (Exception)
            {
                TempData["file_lich"] = "Không thể đọc File.";
                Response.Redirect("/Admin/Lich");
            }
        }
示例#11
0
 public ActionResult Create(Lich idcd)
 {
     if (ModelState.IsValid)
     {
         var  dao = new LichDao();
         long id  = dao.Insert(idcd);
         if (id > 0)
         {
             return(RedirectToAction("Index", "Lich"));
         }
         else
         {
             ModelState.AddModelError("", "Thêm thất bại");
         }
     }
     return(View("Index"));
 }
示例#12
0
 public ActionResult Edit(Lich giai)
 {
     if (ModelState.IsValid)
     {
         var  cd     = new LichDao();
         bool result = cd.Update(giai);
         if (result)
         {
             return(RedirectToAction("Index", "Lich"));
         }
         else
         {
             ModelState.AddModelError("", "Cập nhật thất bại");
         }
     }
     return(RedirectToAction("Index"));
 }
示例#13
0
 public bool Update(Lich entity)
 {
     try
     {
         var item = db.Liches.Find(entity.ID_lich);
         item.NgayDau = entity.NgayDau;
         item.GioDau  = entity.GioDau;
         item.meta    = entity.meta;
         item.hide    = entity.hide;
         item.order   = entity.order;
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#14
0
        private static void Main(string[] args)
        {
            using var engine = EngineBuilder.BuildEngine25D(new EngineOptions("simple 3d game", 720, 1280, false, UiResourcesHelper.PressStart2PFontPath));
            var resourceLoader = new ResourceCachedLoader();
            var player         = new MyPlayer(new Vector2(2.0f, 7.0f), new Vector2(0.3f, 0.3f), MathF.PI, 10);
            var loader         = new ResourceCachedLoader();
            var wallTexture    = Sprite.Load("./sprites/wall2.png");
            var floorTexture   = Sprite.Load("./sprites/floor2.png");
            var ceilingTexture = Sprite.Load("./sprites/ceiling2.png");


            var sword = Sword.Create(loader);
            var bow   = Bow.Create(loader);

            player.Weapons = new Weapon[] { bow, sword };

            var storage = new MapTextureStorage(ceilingTexture, wallTexture, floorTexture);
            var objects = new IMapObject[]
            {
                Lamp1.Create(new Vector2(2f, 2f)),
                Lamp1.Create(new Vector2(12f, 2f)),
                Lamp1.Create(new Vector2(2f, 7f)),
                Lamp1.Create(new Vector2(12f, 7f)),
                Lich.Create(loader, new Vector2(8.5f, 2.5f), 0)
            };
            var map = Map.FromStrings(new[]
            {
                "##############",
                "#............#",
                "#............#",
                "#....###.....#",
                "#....###.....#",
                "#....###.....#",
                "#............#",
                "#............#",
                "##############"
            }, storage.GetCellByChar);

            var level = new Scene(player, map, objects);

            while (engine.Update(level))
            {
            }
        }
示例#15
0
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

                switch (Utility.Random(13))
                {
                default:
                case 0: spawn = new Skeleton(); break;

                case 1: spawn = new Zombie(); break;

                case 2: spawn = new Wraith(); break;

                case 3: spawn = new Spectre(); break;

                case 4: spawn = new Ghoul(); break;

                case 5: spawn = new Mummy(); break;

                case 6: spawn = new Bogle(); break;

                case 7: spawn = new RottingCorpse(); break;

                case 8: spawn = new BoneKnight(); break;

                case 9: spawn = new SkeletalKnight(); break;

                case 10: spawn = new Lich(); break;

                case 11: spawn = new LichLord(); break;

                case 12: spawn = new SkeletalMage(); break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                m_Item.Delete();
            }
示例#16
0
        ////25JUL2008 Lord_Greywolf fix for bad X *** END   ***

        protected virtual void SpawnGenerate(Point2D p, Map map)
        {
            BaseCreature spawn;

            switch (Utility.Random(4))
            {
            default:
            case 0: spawn = new Lich(); break;

            case 1: spawn = new Skeleton(); break;

            case 2: spawn = new Mongbat(); break;

            case 3: spawn = new Troll(); break;
            }

            Spawn(p, map, spawn);

            Delete();
        }
示例#17
0
        static void Main(string[] args)
        {
            Console.WriteLine($"Loading mods from {Environment.CurrentDirectory}");
            var unitsMod = UnitLoader.LoadUnits();

            Console.WriteLine($"Loaded {unitsMod.Count()} units: {unitsMod}");
            var devil = unitsMod.First();

            var angel   = new Angel();
            var lich    = new Lich();
            var shaman  = new Shaman();
            var fury    = new Fury();
            var cyclops = new Cyclops();

            var menu = new Menu(new List <Unit>()
            {
                devil, angel, lich, shaman, fury, cyclops
            });

            menu.Start();
        }
示例#18
0
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

                switch (Utility.Random(8))
                {
                default:
                case 0: spawn = new PatchworkSkeleton(); break;

                case 1: spawn = new Zombie(); break;

                case 2: spawn = new Wraith(); break;

                case 3: spawn = new SkeletalMage(); break;

                case 4: spawn = new Mummy(); break;

                case 5: spawn = new BoneKnight(); break;

                case 6: spawn = new SkeletalKnight(); break;

                case 7: spawn = new Lich(); break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                //Effects.PlaySound( p, map, 0x1FB );
                //Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 );

                m_Item.Delete();
            }
示例#19
0
        void TaoLichRanDom(bool flagAllGiangVien, bool flagAllNamHoc, bool flagAllHocKy)
        {
            List <int> ListMaPhanCong;

            if (flagAllGiangVien)
            {
                ListMaPhanCong = getAllTablePhanCong();
            }
            else
            {
                ListMaPhanCong = getAllTablePhanCongTheoGiangVien(cbbTenGV.SelectedValue.ToString());
            }

            var NamHoc = (from x in dbs.PhanCongs select new { x.NamHoc }).Distinct();
            var HocKy  = (from x in dbs.PhanCongs select new { x.HocKy }).Distinct();

            foreach (var nh in NamHoc)
            {
                if (ListMaPhanCong.Count() == 0)
                {
                    break;
                }

                foreach (var hk in HocKy)
                {
                    if (ListMaPhanCong.Count() == 0)
                    {
                        break;
                    }

                    List <int> lMaPC = new List <int>();

                    int inamHoc = (int)nh.NamHoc;
                    int ihocKy  = (int)hk.HocKy;
                    if (flagAllNamHoc == false)
                    {
                        inamHoc = Convert.ToInt32(cbbNamHoc.Text);
                    }
                    if (flagAllHocKy == false)
                    {
                        ihocKy = Convert.ToInt32(cbbHocKy.Text);
                    }

                    lMaPC = getListPhanCongTheo_NamHoc_HocKy(inamHoc, ihocKy, ListMaPhanCong);
                    if (lMaPC != null && lMaPC.Count() > 0)
                    {
                        int ngay = 1;

                        while (lMaPC.Count() != 0)  // ngay
                        {
                            int ca = 1;
                            while (lMaPC.Count() != 0 && ca < 6)  // ca
                            {
                                int   rdSLPhong  = RanDomSoLuongPhong(lMaPC.Count());
                                int[] checkPhong = new int[dbs.PhongHocs.Count() + 1];
                                for (int i = 1; i <= rdSLPhong; i++)
                                {
                                    int MaPhong = RanDomMaPhong(checkPhong);
                                    int MaPC    = RanDomMaPhanCong(ngay, ca, ref lMaPC, ref ListMaPhanCong, inamHoc, ihocKy);
                                    if (MaPC == -1)
                                    {
                                        break;
                                    }
                                    Lich li = new Lich();
                                    li.Ca    = ca;
                                    li.Ngay  = ngay;
                                    li.Phong = MaPhong;
                                    li.MaPC  = MaPC;
                                    dbs.Liches.InsertOnSubmit(li);
                                    dbs.SubmitChanges();
                                    if (lMaPC.Count() == 0)
                                    {
                                        break;
                                    }
                                }
                                if (ca == 6)
                                {
                                    break;
                                }
                                ca++;
                            }
                            ngay++;
                        }
                    }
                }
            }
        }
示例#20
0
        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            Map     map = from.Map;
            Point3D loc = from.Location;

            HarvestResource res = vein.PrimaryResource;

            if (res == resource)
            {
                try
                {
                    if (from.Karma > -2459)
                    {
                        Titles.AwardKarma(from, -50, true);
                    }

                    if (Utility.RandomMinMax(1, 100) < 3)                         // CHECK TO SEE IF THEY WERE WITNESSED DIGGING UP A GRAVE 2%
                    {
                        int caught = 1;
                        if (from.Skills[SkillName.Hiding].Value >= 30)
                        {
                            from.SendMessage("Someone passed by, but your stealthiness has avoided you from being seen.");
                            if (from.CheckSkill(SkillName.Stealth, 0, 100))
                            {
                                caught = 0;
                            }
                        }
                        if (caught > 0)
                        {
                            from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "Someone has spotted you in the distance!", from.NetState);
                            from.SendMessage("You have been reported as a criminal!");
                            from.Criminal = true;
                            Server.Items.DisguiseTimers.RemoveDisguise(from);
                        }
                    }

                    map = from.Map;

                    if (map == null)
                    {
                        return;
                    }

                    BaseCreature spawned = new Zombie();

                    switch (Utility.Random(19))
                    {
                    case 0: spawned = new Zombie(); break;

                    case 1: spawned = new Skeleton(); break;

                    case 2: spawned = new Ghoul(); break;

                    case 3: spawned = new Shade(); break;

                    case 4: spawned = new Spectre(); break;

                    case 5: spawned = new Wraith(); break;

                    case 6: spawned = new BoneKnight(); break;

                    case 7: spawned = new BoneMagi(); break;

                    case 8: spawned = new Ghostly(); break;

                    case 9: spawned = new Lich(); break;

                    case 10: spawned = new LichLord(); break;

                    case 11: spawned = new Mummy(); break;

                    case 12: spawned = new RottingCorpse(); break;

                    case 13: spawned = new Shade(); break;

                    case 14: spawned = new SkeletalKnight(); break;

                    case 15: spawned = new SkeletalWizard(); break;

                    case 16: spawned = new SkeletalMage(); break;

                    case 17: spawned = new Phantom(); break;

                    case 18: spawned = new Vampire(); break;
                    }

                    int nSpiritSpeak = (int)(from.Skills[SkillName.SpiritSpeak].Value / 10);

                    string sSaying = "";
                    switch (Utility.Random(9))
                    {
                    case 0: sSaying = "Who has disturbed me!"; break;

                    case 1: sSaying = "You dare steal from my grave?"; break;

                    case 2: sSaying = "Those that take from me will join me!"; break;

                    case 3: sSaying = "Your soul is now mine for the taking!"; break;

                    case 4: sSaying = "Who dares waken me?"; break;

                    case 5: sSaying = "Your life will be extinguished!"; break;

                    case 6: sSaying = "Do you have no respect for the dead?"; break;

                    case 7: sSaying = "I have been waiting to feast off the living!"; break;

                    case 8: sSaying = "Soon you will join my legion of the dead!"; break;
                    }

                    if ((spawned != null) && (Utility.Random(100) > (nSpiritSpeak + 85)))                             // 10% chance you will get a grave raiser
                    {
                        from.CheckSkill(SkillName.SpiritSpeak, 0, 100);
                        int offset = Utility.Random(8) * 2;

                        for (int i = 0; i < m_Offsets.Length; i += 2)
                        {
                            int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
                            int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

                            if (map.CanSpawnMobile(x, y, from.Z))
                            {
                                spawned.OnBeforeSpawn(new Point3D(x, y, from.Z), map);
                                spawned.Home      = new Point3D(x, y, from.Z);
                                spawned.RangeHome = 5;
                                spawned.Title    += " [Awakened]";
                                spawned.MoveToWorld(new Point3D(x, y, from.Z), map);
                                spawned.Say(sSaying);
                                spawned.ControlSlots = 666;
                                spawned.Combatant    = from;
                                return;
                            }
                            else
                            {
                                int z = map.GetAverageZ(x, y);

                                if (map.CanSpawnMobile(x, y, z))
                                {
                                    spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
                                    spawned.Home      = new Point3D(x, y, z);
                                    spawned.RangeHome = 5;
                                    spawned.Title    += " [Awakened]";
                                    spawned.MoveToWorld(new Point3D(x, y, z), map);
                                    spawned.Say(sSaying);
                                    spawned.ControlSlots = 666;
                                    spawned.Combatant    = from;
                                    return;
                                }
                            }
                        }
                        spawned.OnBeforeSpawn(from.Location, from.Map);
                        spawned.Home      = from.Location;
                        spawned.RangeHome = 5;
                        spawned.Title    += " [Awakened]";
                        spawned.MoveToWorld(from.Location, from.Map);
                        spawned.Say(sSaying);
                        spawned.ControlSlots = 666;
                        spawned.Combatant    = from;
                    }

                    int digger = (int)(from.Skills[SkillName.Forensics].Value / 10);
                    if ((2 + digger) > Utility.Random(100))                       // chance to dig up a box
                    {
                        if (from.CheckSkill(SkillName.Forensics, 0, 125))
                        {
                            Item chest = new GraveChest(6, from);
                            switch (Utility.Random(10 + digger))
                            {
                            case 0: chest = new GraveChest(1, from); break;

                            case 1: chest = new GraveChest(1, from); break;

                            case 2: chest = new GraveChest(1, from); break;

                            case 3: chest = new GraveChest(1, from); break;

                            case 4: chest = new GraveChest(1, from); break;

                            case 5: chest = new GraveChest(1, from); break;

                            case 6: chest = new GraveChest(2, from); break;

                            case 7: chest = new GraveChest(2, from); break;

                            case 8: chest = new GraveChest(2, from); break;

                            case 9: chest = new GraveChest(2, from); break;

                            case 10: chest = new GraveChest(2, from); break;

                            case 11: chest = new GraveChest(3, from); break;

                            case 12: chest = new GraveChest(3, from); break;

                            case 13: chest = new GraveChest(3, from); break;

                            case 14: chest = new GraveChest(3, from); break;

                            case 15: chest = new GraveChest(4, from); break;

                            case 16: chest = new GraveChest(4, from); break;

                            case 17: chest = new GraveChest(4, from); break;

                            case 18: chest = new GraveChest(5, from); break;

                            case 19: chest = new GraveChest(5, from); break;
                            }
                            if (chest != null)
                            {
                                chest.MoveToWorld(loc, map);
                                from.SendMessage("you dig up a graveyard chest.");
                            }
                        }
                    }
                }
                catch
                {
                }
            }
        }
            protected override void OnTick()
            {
                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

                if (!m_From.Alive)
                {
                    m_From.SendMessage("You cannot continue digging in this state.");
                    Stop();
                }
                else
                {
                    if (Utility.Random(100) < 35)
                    {
                        switch (Utility.Random(10))
                        {
                        case 0:
                            Skeleton skel = new Skeleton();
                            skel.Location  = m_From.Location;
                            skel.Map       = m_From.Map;
                            skel.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                skel.IsParagon = true;
                            }

                            World.AddMobile(skel);
                            break;

                        case 1:
                            Ghoul ghoul = new Ghoul();
                            ghoul.Location  = m_From.Location;
                            ghoul.Map       = m_From.Map;
                            ghoul.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                ghoul.IsParagon = true;
                            }

                            World.AddMobile(ghoul);
                            break;

                        case 2:
                            Lich lich = new Lich();
                            lich.Location  = m_From.Location;
                            lich.Map       = m_From.Map;
                            lich.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                lich.IsParagon = true;
                            }

                            World.AddMobile(lich);
                            break;

                        case 3:
                            LichLord lichl = new LichLord();
                            lichl.Location  = m_From.Location;
                            lichl.Map       = m_From.Map;
                            lichl.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                lichl.IsParagon = true;
                            }

                            World.AddMobile(lichl);
                            break;

                        case 4:
                            AncientLich alich = new AncientLich();
                            alich.Location  = m_From.Location;
                            alich.Map       = m_From.Map;
                            alich.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                alich.IsParagon = true;
                            }

                            World.AddMobile(alich);
                            break;

                        case 5:
                            Zombie zom = new Zombie();
                            zom.Location  = m_From.Location;
                            zom.Map       = m_From.Map;
                            zom.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                zom.IsParagon = true;
                            }

                            World.AddMobile(zom);
                            break;

                        case 6:
                            SkeletalKnight sk = new SkeletalKnight();
                            sk.Location  = m_From.Location;
                            sk.Map       = m_From.Map;
                            sk.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                sk.IsParagon = true;
                            }

                            World.AddMobile(sk);
                            break;

                        case 7:
                            SkeletalMage sm = new SkeletalMage();
                            sm.Location  = m_From.Location;
                            sm.Map       = m_From.Map;
                            sm.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                sm.IsParagon = true;
                            }

                            World.AddMobile(sm);
                            break;

                        case 8:
                            Spectre spec = new Spectre();
                            spec.Location  = m_From.Location;
                            spec.Map       = m_From.Map;
                            spec.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                spec.IsParagon = true;
                            }

                            World.AddMobile(spec);
                            break;

                        case 9:
                            Shade shade = new Shade();
                            shade.Location  = m_From.Location;
                            shade.Map       = m_From.Map;
                            shade.Combatant = m_From;

                            if (Utility.Random(100) < 50)
                            {
                                shade.IsParagon = true;
                            }

                            World.AddMobile(shade);
                            break;
                        }
                        m_From.SendMessage("You have angered the spirits.");
                    }
                    else if (m_From.Skills[SkillName.Mining].Base > 10)
                    {
                        if (Utility.Random(120) >= (m_From.Skills[SkillName.Mining].Base))
                        {
                            m_From.SendMessage("You fail to dig anything up.");
                        }
                        else
                        {
                            m_From.SendMessage("You dig up the hideous remains of the demon.  Unfortunately your shovel breaks in the process.");
                            m_From.AddToBackpack(new PumpkinheadRemains());
                            m_Item.Delete();
                        }
                    }
                    else if (m_From.Skills[SkillName.Mining].Base <= 10)
                    {
                        if (Utility.Random(120) > 10)
                        {
                            m_From.SendMessage("You fail to dig anything up.");
                        }
                        else
                        {
                            m_From.SendMessage("You dig up the hideous remains of the demon.  Unfortunately your shovel breaks in the process.");
                            m_From.AddToBackpack(new PumpkinheadRemains());
                            m_Item.Delete();
                        }
                    }
                    else
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }

                    Stop();
                }
            }
示例#22
0
        public void Target(object obj)
        {
            if (CheckSequence())
            {
                // Scriptiz : Amélioration en ciblant un Mobile, le mort l'attaque
                Point3D location;

                if (obj is LandTarget)
                {
                    location = ((LandTarget)obj).Location;
                }
                else if (obj is Mobile)
                {
                    location = ((Mobile)obj).Location;
                }
                else
                {
                    Caster.SendMessage("Veuillez cibler une zone valide. (" + obj.GetType().ToString() + ")");
                    return;
                }

                SpellHelper.Turn(Caster, location);

                double getLich     = Caster.Skills.Necromancy.Value / 10;
                double getSkeleton = Caster.Skills.Necromancy.Value / 5;

                int chance = Utility.Random(100);

                BaseCreature undead;

                if (chance <= getLich)
                {
                    undead = new Lich();
                }
                else if (chance <= getSkeleton)
                {
                    undead = new Skeleton();
                }
                else
                {
                    undead = new Zombie();
                }

                undead.ControlSlots = 1;
                undead.Fame         = 0;
                undead.Karma        = -1500;

                Caster.Karma -= 500;
                Effects.PlaySound(location, Caster.Map, 0x1FB);
                Effects.SendLocationParticles(EffectItem.Create(location, Caster.Map, EffectItem.DefaultDuration), 0x3789, 1, 40, 0x3F, 3, 9907, 0);

                TimeSpan delay = TimeSpan.FromMinutes((Caster.Skills.Necromancy.Base + Caster.Skills.EvalInt.Base) * 3);
                BaseCreature.Summon(undead, false, Caster, location, 0x28, delay);

                // Si la cible est une mobile on l'attaque
                if (obj is Mobile)
                {
                    undead.Attack((Mobile)obj);
                }
            }

            FinishSequence();
        }
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;

                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

                if (equip is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (equip is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (equip is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max);
                }

                if (Utility.Random(100) < 85)
                {
                    switch (Utility.Random(15))
                    {
                    case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location  = m_From.Location;
                        skel.Map       = m_From.Map;
                        skel.Combatant = m_From;

                        World.AddMobile(skel);
                        break;

                    case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location  = m_From.Location;
                        ghoul.Map       = m_From.Map;
                        ghoul.Combatant = m_From;

                        World.AddMobile(ghoul);
                        break;

                    case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location  = m_From.Location;
                        wraith.Map       = m_From.Map;
                        wraith.Combatant = m_From;

                        World.AddMobile(wraith);
                        break;

                    case 3:
                        Lich lich = new Lich();
                        lich.Location  = m_From.Location;
                        lich.Map       = m_From.Map;
                        lich.Combatant = m_From;

                        World.AddMobile(lich);
                        break;

                    case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location  = m_From.Location;
                        lichl.Map       = m_From.Map;
                        lichl.Combatant = m_From;

                        World.AddMobile(lichl);
                        break;

                    case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location  = m_From.Location;
                        alich.Map       = m_From.Map;
                        alich.Combatant = m_From;

                        World.AddMobile(alich);
                        break;

                    case 6:
                        Mummy mum = new Mummy();
                        mum.Location  = m_From.Location;
                        mum.Map       = m_From.Map;
                        mum.Combatant = m_From;

                        World.AddMobile(mum);
                        break;

                    case 7:
                        Zombie zom = new Zombie();
                        zom.Location  = m_From.Location;
                        zom.Map       = m_From.Map;
                        zom.Combatant = m_From;

                        World.AddMobile(zom);
                        break;

                    case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location  = m_From.Location;
                        sk.Map       = m_From.Map;
                        sk.Combatant = m_From;

                        World.AddMobile(sk);
                        break;

                    case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location  = m_From.Location;
                        sm.Map       = m_From.Map;
                        sm.Combatant = m_From;

                        World.AddMobile(sm);
                        break;

                    case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location  = m_From.Location;
                        bk.Map       = m_From.Map;
                        bk.Combatant = m_From;

                        World.AddMobile(bk);
                        break;

                    case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location  = m_From.Location;
                        bm.Map       = m_From.Map;
                        bm.Combatant = m_From;

                        World.AddMobile(bm);
                        break;

                    case 12:
                        Spectre spec = new Spectre();
                        spec.Location  = m_From.Location;
                        spec.Map       = m_From.Map;
                        spec.Combatant = m_From;

                        World.AddMobile(spec);
                        break;

                    case 13:
                        Shade shade = new Shade();
                        shade.Location  = m_From.Location;
                        shade.Map       = m_From.Map;
                        shade.Combatant = m_From;

                        World.AddMobile(shade);
                        break;
                    }
                    m_From.SendMessage("The spirits have rose from the dead..");
                }
                else if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up a gem.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up a reagent.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 4);
                        reg.Amount = Utility.RandomMinMax(2, 4);

                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 10);
                        reg.Amount = Utility.RandomMinMax(2, 10);

                        switch (Utility.Random(6))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 20);
                        reg.Amount = Utility.RandomMinMax(2, 20);

                        switch (Utility.Random(7))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 85)
                    {
                        m_From.SendMessage("You fail to dig anything up.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(10, 30);
                        reg.Amount = Utility.RandomMinMax(10, 30);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(500) < 5)
                    {
                        m_From.SendMessage("You dig up and item of great value.");
                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(new ArmoredRobe());
                            break;

                        case 1:
                            m_From.AddToBackpack(new ButchersResolve());
                            break;

                        case 2:
                            m_From.AddToBackpack(new FollowerOfTheOldLord());
                            break;

                        case 3:
                            m_From.AddToBackpack(new SkirtOfTheAmazon());
                            break;

                        case 4:
                            m_From.AddToBackpack(new HolyHammerOfExorcism());
                            break;
                        }
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("You dig up some gems.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("You dig up some reagents.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("You dig up some equipment.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("You dig up a scroll.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("You dig up a bones.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("You fail to dig anything up.");
                }

                Stop();
            }
示例#24
0
            protected override void OnTick()
            {
                Item gem = Loot.RandomGem();
                Item reg = Loot.RandomPossibleReagent();

                Item equip;

                equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry();

                if (m_Item != null)
                {
                    m_Item.IsDigging = false;
                }

                if (equip is BaseWeapon)
                {
                    BaseWeapon weapon = (BaseWeapon)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                }
                else if (equip is BaseArmor)
                {
                    BaseArmor armor = (BaseArmor)equip;

                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                }
                else if (equip is BaseJewel)
                {
                    int attributeCount;
                    int min, max;

                    GetRandomAOSStats(out attributeCount, out min, out max);

                    BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max);
                }

                if (Utility.Random(100) < 45)
                {
                    switch (Utility.Random(16))
                    {
                    case 0:
                        Skeleton skel = new Skeleton();
                        skel.Location  = m_From.Location;
                        skel.Map       = m_From.Map;
                        skel.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            skel.IsParagon = true;
                        }

                        World.AddMobile(skel);
                        break;

                    case 1:
                        Ghoul ghoul = new Ghoul();
                        ghoul.Location  = m_From.Location;
                        ghoul.Map       = m_From.Map;
                        ghoul.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            ghoul.IsParagon = true;
                        }

                        World.AddMobile(ghoul);
                        break;

                    case 2:
                        Wraith wraith = new Wraith();
                        wraith.Location  = m_From.Location;
                        wraith.Map       = m_From.Map;
                        wraith.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            wraith.IsParagon = true;
                        }

                        World.AddMobile(wraith);
                        break;

                    case 3:
                        Lich lich = new Lich();
                        lich.Location  = m_From.Location;
                        lich.Map       = m_From.Map;
                        lich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lich.IsParagon = true;
                        }

                        World.AddMobile(lich);
                        break;

                    case 4:
                        LichLord lichl = new LichLord();
                        lichl.Location  = m_From.Location;
                        lichl.Map       = m_From.Map;
                        lichl.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            lichl.IsParagon = true;
                        }

                        World.AddMobile(lichl);
                        break;

                    case 5:
                        AncientLich alich = new AncientLich();
                        alich.Location  = m_From.Location;
                        alich.Map       = m_From.Map;
                        alich.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            alich.IsParagon = true;
                        }

                        World.AddMobile(alich);
                        break;

                    case 6:
                        Mummy mum = new Mummy();
                        mum.Location  = m_From.Location;
                        mum.Map       = m_From.Map;
                        mum.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            mum.IsParagon = true;
                        }

                        World.AddMobile(mum);
                        break;

                    case 7:
                        Zombie zom = new Zombie();
                        zom.Location  = m_From.Location;
                        zom.Map       = m_From.Map;
                        zom.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            zom.IsParagon = true;
                        }

                        World.AddMobile(zom);
                        break;

                    case 8:
                        SkeletalKnight sk = new SkeletalKnight();
                        sk.Location  = m_From.Location;
                        sk.Map       = m_From.Map;
                        sk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sk.IsParagon = true;
                        }

                        World.AddMobile(sk);
                        break;

                    case 9:
                        SkeletalMage sm = new SkeletalMage();
                        sm.Location  = m_From.Location;
                        sm.Map       = m_From.Map;
                        sm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            sm.IsParagon = true;
                        }

                        World.AddMobile(sm);
                        break;

                    case 10:
                        BoneKnight bk = new BoneKnight();
                        bk.Location  = m_From.Location;
                        bk.Map       = m_From.Map;
                        bk.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bk.IsParagon = true;
                        }

                        World.AddMobile(bk);
                        break;

                    case 11:
                        BoneMagi bm = new BoneMagi();
                        bm.Location  = m_From.Location;
                        bm.Map       = m_From.Map;
                        bm.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bm.IsParagon = true;
                        }

                        World.AddMobile(bm);
                        break;

                    case 12:
                        Spectre spec = new Spectre();
                        spec.Location  = m_From.Location;
                        spec.Map       = m_From.Map;
                        spec.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            spec.IsParagon = true;
                        }

                        World.AddMobile(spec);
                        break;

                    case 13:
                        Shade shade = new Shade();
                        shade.Location  = m_From.Location;
                        shade.Map       = m_From.Map;
                        shade.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            shade.IsParagon = true;
                        }

                        World.AddMobile(shade);
                        break;

                    case 14:
                        Bogle bog = new Bogle();
                        bog.Location  = m_From.Location;
                        bog.Map       = m_From.Map;
                        bog.Combatant = m_From;

                        if (Utility.Random(100) < 50)
                        {
                            bog.IsParagon = true;
                        }

                        World.AddMobile(bog);
                        break;

                    case 15:
                        FrostDragon fDragon = new FrostDragon();
                        fDragon.PackGold(50000);
                        fDragon.Location  = m_From.Location;
                        fDragon.Map       = m_From.Map;
                        fDragon.Combatant = m_From;
                        if (Utility.Random(100) < 20)
                        {
                            fDragon.IsParagon = true;
                            fDragon.PackItem(new SoulweaponBox());
                        }
                        break;
                    }
                    m_From.SendMessage(6, "你驚醒了沉睡中的亡靈.");
                }
                else if (m_From.Skills[SkillName.Mining].Base < 15.0)
                {
                    if (Utility.Random(100) < 55)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        switch (Utility.Random(3))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 35.0)
                {
                    if (Utility.Random(100) < 45)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 4);
                        reg.Amount = Utility.RandomMinMax(2, 4);

                        switch (Utility.Random(5))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 50.0)
                {
                    if (Utility.Random(100) < 35)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 10);
                        reg.Amount = Utility.RandomMinMax(2, 10);

                        switch (Utility.Random(6))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 75.0)
                {
                    if (Utility.Random(100) < 25)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 20);
                        reg.Amount = Utility.RandomMinMax(2, 20);

                        switch (Utility.Random(7))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 90.0)
                {
                    if (Utility.Random(100) < 15)
                    {
                        m_From.SendMessage("你什麽都沒有挖掘到.");
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 30);
                        reg.Amount = Utility.RandomMinMax(2, 30);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else if (m_From.Skills[SkillName.Mining].Base < 150.0)
                {
                    if (Utility.Random(10) < 1)//概率 zp
                    {
                        Item i;
                        switch (Utility.Random(13))
                        {
                        case 0: { i = new ArmoredNinjaBelt(); break; }

                        case 1: { i = new ButchersResolve(); break; }

                        case 2: { i = new FollowerOfTheOldLord(); break; }

                        case 3: { i = new SkirtOfTheAmazon(); break; }

                        case 4: { i = new HolyHammerOfExorcism(); break; }

                        case 5: { i = new ArmoredCloak(); break; }

                        case 6: { i = new SoulweaponBox(); break; }

                        default:
                        case 7:
                        case 8:
                        case 9:
                        case 10:
                        case 11:
                        case 12: { i = new AutoResPotion(); break; }
                        }
                        m_From.SendMessage(25, "你挖到了一些很有價值的東西.");
                        m_From.PlaySound(0x41e);
                        m_From.AddToBackpack(i);
                        m_From.SendGump(new totGump(i));
                    }
                    else
                    {
                        gem.Amount = Utility.RandomMinMax(2, 40);
                        reg.Amount = Utility.RandomMinMax(2, 40);

                        switch (Utility.Random(8))
                        {
                        case 0:
                            m_From.AddToBackpack(gem);
                            m_From.SendMessage("你挖到了一些寶石.");
                            break;

                        case 1:
                            m_From.AddToBackpack(reg);
                            m_From.SendMessage("你挖到了一些藥材.");
                            break;

                        case 2:
                            m_From.AddToBackpack(equip);
                            m_From.SendMessage("你挖到了一些裝備.");
                            break;

                        case 3:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 4:
                            m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer));
                            m_From.SendMessage("你挖到了一些卷軸.");
                            break;

                        case 5:
                            m_From.AddToBackpack(new Bones());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 6:
                            m_From.AddToBackpack(new BonePile());
                            m_From.SendMessage("你挖到了一些骨頭.");
                            break;

                        case 7:
                            m_From.AddToBackpack(new GraveItem());
                            m_From.SendMessage("你挖到了一些前人留下的寶藏.");
                            break;
                        }
                    }
                }
                else
                {
                    m_From.SendMessage("你什麽都沒有挖掘到.");
                }

                Stop();
            }
示例#25
0
        private void pushData()
        {
            getFullDate();
            var maxDay = DateTime.DaysInMonth(year, month);

            int[] a = new int[maxDay + 1]; //Lưu số lịch của ngày
            for (int i = 0; i < Commons.lstLichHoc.Count; i++)
            {
                Lich lich = Commons.lstLichHoc[i] as Lich;
                var  ngay = Convert.ToDateTime(lich.Ngay);
                if (ngay.Month == month && ngay.Year == year)
                {
                    a[ngay.Day]++;
                    if (lich.LoaiLich == "LichThi")
                    {
                        a[ngay.Day] = -1;
                    }
                }
            }
            for (int i = 0; i < gCalender.Children.Count; i++)
            {
                if (gCalender.Children[i] != null)
                {
                    StackPanel stack = (StackPanel)gCalender.Children[i];
                    Label      lbl   = (Label)stack.Children[0];
                    for (int j = 0; j < a.Length; j++)
                    {
                        if ((int)lbl.Content == j)
                        {
                            Label cal = new Label()
                            {
                                FontSize   = 14,
                                FontWeight = FontWeights.Bold,
                                HorizontalContentAlignment = HorizontalAlignment.Center,
                                VerticalContentAlignment   = VerticalAlignment.Center,
                                Padding = new Thickness(0)
                            };
                            if (a[j] == 0)
                            {
                                lbl.MinHeight = 50;
                                lbl.Padding   = new Thickness(0);
                            }
                            if (a[j] == 1)
                            {
                                cal.Content    = "●";
                                cal.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#1abc5c"));
                                stack.Children.Add(cal);
                            }
                            if (a[j] == 2)
                            {
                                cal.Content    = "●●";
                                cal.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#1abc5c"));
                                stack.Children.Add(cal);
                            }
                            if (a[j] == 3)
                            {
                                cal.Content    = "●●●";
                                cal.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#1abc5c"));
                                stack.Children.Add(cal);
                            }
                            if (a[j] > 3)
                            {
                                cal.Content    = "●●+";
                                cal.Foreground = (SolidColorBrush)(new BrushConverter().ConvertFrom("#1abc5c"));
                                stack.Children.Add(cal);
                            }
                            if (a[j] == -1)
                            {
                                cal.Content    = "●";
                                cal.Foreground = Brushes.Red;
                                stack.Children.Add(cal);
                            }
                        }
                    }
                }
            }
            getFullDate();
            if (day == DateTime.Now.Day && month == DateTime.Now.Month && year == DateTime.Now.Year)
            {
                MouseButtonEventArgs mouse = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left);
                LblDay_MouseLeftButtonDown(lblNow, mouse);
            }
        }
示例#26
0
 public long Insert(Lich entity)
 {
     db.Liches.Add(entity);
     db.SaveChanges();
     return(entity.ID_lich);
 }
示例#27
0
        private static unsafe void Main(string[] args)
        {
            var options = new EngineOptions(
                "simple 3d game",
                720, 1280,
                true,
                UiResourcesHelper.PressStart2PFontPath,
                UiResourcesHelper.CrossSpritePath,
                UiResourcesHelper.ScrollSpritePath);

            using var engine = EngineBuilder.BuildEngine25D(options);
            var resourceLoader = ResourceCachedLoader.Instance;
            var player         = new MyPlayer(new Vector2(2.0f, 2.0f), new Vector2(0.3f, 0.3f), MathF.PI / 2, 10);
            var wallTexture    = Sprite.Load("./sprites/greystone.png");
            var floorTexture   = Sprite.Load("./sprites/colorstone.png");
            var windowTexture  = Sprite.Load("./sprites/window.png");
            var ceilingTexture = Sprite.Load("./sprites/wood.png");
            var bedTexture     = Sprite.Load("./sprites/bed.png");
            var sword          = Sword.Create(resourceLoader);
            var bow            = Bow.Create(resourceLoader);
            var doorAnimation  = resourceLoader.GetAnimation("./animations/door");

            player.Weapons = new Weapon[] { sword, bow };
            var backGroundMusic = resourceLoader.GetMusic(MusicResourceHelper.EnvironmentDungeonMusic);
            var objects         = new IMapObject[]
            {
                Lich.Create(resourceLoader, new Vector2(6f, 6f), 0.0f),
                Skeleton.Create(resourceLoader, new Vector2(6f, 6f), 0.0f),
                GreenLight.Create(resourceLoader, new Vector2(8.0f, 8.0f), new Vector2(0, 0), 0),
                HealingPotion.Create(new Vector2(6f, 6f)),
                ArrowPack.Create(new Vector2(7f, 7f)),
                Note.Create(new Vector2(5f, 5f), "о, привет!\nследующая строка\nотвратительно длинная строка с кучей слов капец\nа вот это уже максимум по длине лучше бы его не переступать ага га гус")
            };

            backGroundMusic.Play(-1);
            var storage = new MapTextureStorage(ceilingTexture, wallTexture, floorTexture, windowTexture, bedTexture, doorAnimation);
            var map     = Map.FromStrings(new[]
            {
                "###############################",
                "#.............................#",
                "#.............................#",
                "#.............................#",
                "##...................#........#",
                "#b...................###......#",
                "#b...................#........#",
                "####......##########.#........#",
                "##...................#......###",
                "#........####........#........#",
                "#........#..#........#........#",
                "#........#..#........###......#",
                "#####.####..####.....#........#",
                "#####.####..####.....#........#",
                "#....................#......###",
                "#....................#........#",
                "#####.####..####.....###......#",
                "#####.####..####.....#........#",
                "#....................#........#",
                "###############################"
            }, storage.GetCellByChar);
            var level = new Scene(player, map, objects);

            while (engine.Update(level))
            {
            }
        }
        private void thongBaoLich()
        {
            var    date    = DateTime.Now;
            int    count   = 0;
            string content = "";

            if (Commons.lstLichHoc.Count > 1)
            {
                int soMon = 1;
                for (int i = 0; i < Commons.lstLichHoc.Count; i++)
                {
                    Lich lich = Commons.lstLichHoc[i] as Lich;
                    var  ngay = Convert.ToDateTime(lich.Ngay);
                    if (date.AddDays(1).Date == ngay.Date)
                    {
                        count++;
                        if (lich.LoaiLich == "LichHoc")
                        {
                            content += "(" + soMon++ + ") " + Commons.dicMonHoc[lich.MaMon] + "\n"
                                       + "   Tiết " + lich.ThoiGian + " tại " + lich.DiaDiem + "\n";
                            //+ "GV: " + lich.GiaoVien+ "\n";
                        }
                        else
                        {
                            content += "KIỂM TRA: " + Commons.dicMonHoc[lich.MaMon] + "\n"
                                       + "   " + lich.ThoiGian + " tại " + lich.DiaDiem + "\n"
                                       + "   Hình thức: " + lich.HinhThuc + "\n"
                                       + "   SBD: " + lich.SoBaoDanh;
                        }
                    }
                }
            }
            //MEDIA
            var amthanh = File.ReadAllText(Paths.amthanh);

            if (amthanh == "voice")
            {
                if (count == 0)
                {
                    mediaPlayer.Open(new Uri(Paths.audio + "/ranh.mp3", UriKind.Relative));
                }
                if (count == 1)
                {
                    mediaPlayer.Open(new Uri(Paths.audio + "/1.mp3", UriKind.Relative));
                }
                if (count == 2)
                {
                    mediaPlayer.Open(new Uri(Paths.audio + "/2.mp3", UriKind.Relative));
                }
                if (count == 3)
                {
                    mediaPlayer.Open(new Uri(Paths.audio + "/3.mp3", UriKind.Relative));
                }
                if (count == 4)
                {
                    mediaPlayer.Open(new Uri(Paths.audio + "/4.mp3", UriKind.Relative));
                }
            }
            else if (amthanh != "default")
            {
                if (count != 0)
                {
                    mediaPlayer.Open(new Uri(amthanh.Substring(0, amthanh.IndexOf(";"))));
                }
                else
                {
                    mediaPlayer.Open(new Uri(amthanh.Substring(amthanh.IndexOf(";") + 1)));
                }
            }
            //END MEDIA
            if (count == 0)
            {
                content = "Ngày mai bạn rảnh!";
            }
            string title = "Student Social: ";

            title += count >= 1 ? "Ngày mai bạn có " + count + " lịch" : "Ngày mai";
            mediaPlayer.Play();
            notifyIcon.ShowBalloonTip(5000, title, content, WF.ToolTipIcon.Info);
        }
示例#29
0
        protected virtual void FinishEffect(Point3D p, Map map, Mobile from)
        {
            from.RevealingAction();

            int spawncount = GetSpawnCount();
            int z          = p.Z;
            //Ghost ship Z, should be 10 lower than the spawn Z
            int gsZ = z - 30; //Set to -30 so it spawns under the sea and then emerges up
            //Spawn Z, needs to be 10 higher than ghost ship Z so they get on top of the boat
            int spawnZ = z - 20;

            //Create the ghost ship here
            GhostShip gs = new GhostShip();

            //Add treasure
            MetalChest tc = new MetalChest {
                ItemID = 0xE7C, LiftOverride = true
            };

            TreasureMapChest.Fill(tc, 5);

            //Now declare an area the same size as the ship, to look for items that might block
            Point2D     start = new Point2D(p.X - 10, p.Y - 7); //Starting location of the area
            Point2D     end   = new Point2D(p.X + 10, p.Y + 7); //Ending location of the area
            Rectangle2D rect  = new Rectangle2D(start, end);    //Declaring the entire area as a rectangle

            //Create a new list that will contain all items in the rectangle
            List <Item> list = new List <Item>();

            IPooledEnumerable eable = map.GetItemsInBounds(rect); //Get all items in the rectangle

            foreach (Item item in eable)                          //Add all items in the rectangle to the list
            {
                list.Add(item);
            }

            eable.Free();

            //While an item exists in the rectangle, move the spawnlocation of the boat/monsters
            while (list.Count > 0)
            {
                if (Utility.RandomDouble() < 0.5)
                {
                    p.X += 1;
                }
                else
                {
                    p.X -= 1;
                }

                if (Utility.RandomDouble() < 0.5)
                {
                    p.Y += 1;
                }
                else
                {
                    p.Y -= 1;
                }

                start = new Point2D(p.X - 10, p.Y - 7);
                end   = new Point2D(p.X + 10, p.Y + 7);
                rect  = new Rectangle2D(start, end);

                eable = map.GetItemsInBounds(rect);

                //Clear the list as we need to create a new one with the new location of the ship
                list.Clear();

                foreach (Item item in eable)
                {
                    list.Add(item); //Add the items (if any) in the new spawnlocation to the list
                }
                eable.Free();
            }

            //No items blocking, move the ship to the world
            p.Z = gsZ;
            gs.MoveToWorld(p, map);

            //Move the treasure chest to the world
            p.Z  = spawnZ + 2;
            p.X -= 9;
            tc.MoveToWorld(p, map);

            //Add the boat and all items inside the boat here
            gs.Itemlist.Add(gs);
            gs.Itemlist.Add(tc);

            //Add as many spawns as spawncount allows
            for (int i = 0; i < spawncount; ++i)
            {
                BaseCreature spawn;

                switch (Utility.Random(4))
                {
                default:
                    spawn = new LichLord();
                    break;

                case 1:
                    spawn = new AncientLich();
                    break;

                case 2:
                    spawn = new Lich();
                    break;

                case 3:
                    spawn = new SkeletalCaptain();
                    break;
                }

                p.Z = spawnZ;
                Spawn(p, map, spawn);

                spawn.Combatant = from;

                //Add the spawn to the list "spawns", needed for the boat decay timer and emerge timer
                gs.Spawnlist.Add(spawn);
            }

            //Start the emerge timer, so the boat doesn't just appear instantly on top of the water
            new EmergeTimer(gs.Itemlist, gs.Spawnlist).Start();

            Delete();
        }
示例#30
0
        public static void OpenCoffin(Mobile from, int item, int level)
        {
            if (Utility.RandomMinMax(1, 10) == 1)                 // 10% CHANCE FOR RAISING DEAD IN COFFINS
            {
                if (item == 0x2800 || item == 0x2801 || item == 0x27E9 || item == 0x27EA || item == 0x27E0 || item == 0x280A || item == 0x2802 || item == 0x2803)
                {
                    int seance = (int)(from.Skills[SkillName.SpiritSpeak].Value);

                    if (!Server.Misc.GetPlayerInfo.LuckyPlayer(from.Luck) && Utility.RandomMinMax(1, 100) > seance)
                    {
                        if (level > 6)
                        {
                            level = 6;
                        }
                        level = level * 3;

                        from.RevealingAction();

                        BaseCreature spawned = new Zombie();

                        switch (Utility.Random(level))
                        {
                        case 0: spawned = new Skeleton(); break;

                        case 1: spawned = new Zombie(); break;

                        case 2: spawned = new Ghoul(); break;

                        case 3: spawned = new Shade(); break;

                        case 4: spawned = new Spectre(); break;

                        case 5: spawned = new Wraith(); break;

                        case 6: spawned = new Phantom(); break;

                        case 7: spawned = new SkeletalWizard(); break;

                        case 8: spawned = new BoneKnight(); break;

                        case 9: spawned = new BoneMagi(); break;

                        case 10: spawned = new SkeletalKnight(); break;

                        case 11: spawned = new SkeletalMage(); break;

                        case 12: spawned = new Mummy(); break;

                        case 13: spawned = new Vampire(); break;

                        case 14: spawned = new Ghostly(); break;

                        case 15: spawned = new Lich(); break;

                        case 16: spawned = new LichLord(); break;

                        case 17: spawned = new RottingCorpse(); break;
                        }

                        string sSaying = "";
                        switch (Utility.Random(9))
                        {
                        case 0: sSaying = "Who has disturbed me!"; break;

                        case 1: sSaying = "You dare steal from my grave?"; break;

                        case 2: sSaying = "Those that take from me will join me!"; break;

                        case 3: sSaying = "Your soul is now mine for the taking!"; break;

                        case 4: sSaying = "Who dares waken me?"; break;

                        case 5: sSaying = "Your life will be extinguished!"; break;

                        case 6: sSaying = "Do you have no respect for the dead?"; break;

                        case 7: sSaying = "I have been waiting to feast off the living!"; break;

                        case 8: sSaying = "Soon you will join my legion of the dead!"; break;
                        }

                        spawned.OnBeforeSpawn(from.Location, from.Map);
                        spawned.Home      = from.Location;
                        spawned.RangeHome = 5;
                        spawned.Title    += " [Awakened]";
                        spawned.MoveToWorld(from.Location, from.Map);
                        spawned.Say(sSaying);
                        spawned.ControlSlots = 666;
                        spawned.Combatant    = from;
                    }
                }
            }
        }