public override void Damage(Mobile m) { base.Damage(m); if (m.Alive) { Item item = m.FindItemOnLayer(Layer.OuterTorso); if (item is GMRobe) { AOS.Damage(m, 0, 0, 0, 0, 0, 0); } else { // Jungle noises if (Utility.RandomDouble() < 0.008) { m.PlaySound(Utility.RandomList(0x003, 0x004, 0x005)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Bird chirps if (Utility.RandomDouble() < 0.002) { m.PlaySound(Utility.RandomList(0x094, 0x095, 0x096, 0x097, 0x0D1, 0x0D2)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Cricket noises if (Utility.RandomDouble() < 0.003) { m.PlaySound(Utility.RandomList(0x00A, 0x00B)); AOS.Damage(m, 0, 0, 0, 0, 0, 0); } // Random Encounter 1 if (Utility.RandomDouble() < 0.0001) { if (m.Map == Map.Malas) { int x1 = m.X + 8; int y1 = m.Y + 8; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseCreature encountera; switch (Utility.Random(10)) { default: case 0: encountera = new AntLion(); break; case 1: encountera = new ForestOstard(); break; case 2: encountera = new Gryphon(); break; case 3: encountera = new IbongAdarna(); break; case 4: encountera = new Parrot(); break; case 5: encountera = new Qingniao(); break; case 6: encountera = new Ridgeback(); break; case 7: encountera = new SavageRidgeback(); break; case 8: encountera = new Shangyang(); break; case 9: encountera = new Qingniao(); break; } encountera.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Encounter 2 if (Utility.RandomDouble() < 0.0001) { if (m.Map == Map.Malas) { int x2 = m.X - 8; int y2 = m.Y - 8; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseCreature encountera; switch (Utility.Random(10)) { default: case 0: encountera = new AntLion(); break; case 1: encountera = new ForestOstard(); break; case 2: encountera = new Gryphon(); break; case 3: encountera = new IbongAdarna(); break; case 4: encountera = new Parrot(); break; case 5: encountera = new Qingniao(); break; case 6: encountera = new Ridgeback(); break; case 7: encountera = new SavageRidgeback(); break; case 8: encountera = new Shangyang(); break; case 9: encountera = new Qingniao(); break; } encountera.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(10.0), new TimerStateCallback(DeleteEncounterA), encountera); } } } // Random Treasure Chest 1 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x1 = m.X + 12; int y1 = m.Y + 12; int z1 = Map.Malas.GetAverageZ(x1, y1); if (Map.Malas.CanSpawnMobile(x1, y1, z1)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 24.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new GlimmerwoodTreasureChest1(); break; case 1: treasurechest = new GlimmerwoodTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x1, y1, z1), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } // Random Treasure Chest 2 if (Utility.RandomDouble() < 0.0005) { if (m.Map == Map.Malas) { int x2 = m.X - 12; int y2 = m.Y - 12; int z2 = Map.Malas.GetAverageZ(x2, y2); if (Map.Malas.CanSpawnMobile(x2, y2, z2)) { BaseContainer treasurechest; if (m.Skills.Tracking.Base > 24.9) { switch (Utility.Random(2)) { default: case 0: treasurechest = new GlimmerwoodTreasureChest1(); break; case 1: treasurechest = new GlimmerwoodTreasureChest1(); break; } treasurechest.MoveToWorld(new Point3D(x2, y2, z2), Map.Malas); AOS.Damage(m, 0, 0, 0, 0, 0, 0); Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(DeleteTreasureChest), treasurechest); } } } } } } }
public void BeastSetClass(Unit enemy) { var rng = new Random(); int beastNumber = rng.Next(0, 27); if (beastNumber == 0 || beastNumber == 1 || beastNumber == 2 || beastNumber == 3 || beastNumber == 4 || beastNumber == 5) { Beast beast = new Beast(); beast.StatIncrement(enemy, beast); beast.RarityRng(enemy); BeastSpellRepository repos = new BeastSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 6 || beastNumber == 7 || beastNumber == 8 || beastNumber == 9 || beastNumber == 10) { Reptile reptile = new Reptile(); reptile.StatIncrement(enemy, reptile); reptile.RarityRng(enemy); ReptileSpellRepository repos = new ReptileSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 19 || beastNumber == 20) { Wyrm wyrm = new Wyrm(); wyrm.StatIncrement(enemy, wyrm); wyrm.RarityRng(enemy); WyrmSpellRepository repos = new WyrmSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 21 || beastNumber == 22) { Giant giant = new Giant(); giant.StatIncrement(enemy, giant); giant.RarityRng(enemy); GiantSpellRepository repos = new GiantSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 11 || beastNumber == 12 || beastNumber == 13 || beastNumber == 14) { Zombie zombie = new Zombie(); zombie.StatIncrement(enemy, zombie); zombie.RarityRng(enemy); ZombieSpellRepository repos = new ZombieSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 23 || beastNumber == 24) { Gryphon gryphon = new Gryphon(); gryphon.StatIncrement(enemy, gryphon); gryphon.RarityRng(enemy); GryphonSpellRepository repos = new GryphonSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 15 || beastNumber == 16 || beastNumber == 17 || beastNumber == 18) { Skeleton skeleton = new Skeleton(); skeleton.StatIncrement(enemy, skeleton); skeleton.RarityRng(enemy); SkeletonSpellRepository repos = new SkeletonSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 25) { Saint saint = new Saint(); saint.StatIncrement(enemy, saint); saint.RarityRng(enemy); SaintSpellRepository repos = new SaintSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } if (beastNumber == 26) { Demon demon = new Demon(); demon.StatIncrement(enemy, demon); demon.RarityRng(enemy); DemonSpellRepository repos = new DemonSpellRepository(enemy); repos.SpellRepositoryInitilization(enemy, repos); } }