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); } }
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(); }
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 { } } }
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; } } } }
public void OnChop(Mobile from) { if (from.InRange(this.GetWorldLocation(), 2)) { Effects.SendLocationEffect(Location, Map, 0x3728, 20, 10); //smoke or dust Effects.PlaySound(Location, Map, 0x11C); switch (Utility.Random(12)) { case 0: Effects.SendLocationEffect(from, from.Map, 0x113A, 20, 10); //Posion Player from.PlaySound(0x231); from.ApplyPoison(from, Poison.Regular); break; case 1: Effects.SendLocationEffect(from, from.Map, 0x3709, 30); //Burn Player from.PlaySound(0x54); AOS.Damage(from, from, Utility.RandomMinMax(10, 40), 0, 100, 0, 0, 0); break; case 2: new BarrelLid().MoveToWorld(Location, Map); new BarrelHoops().MoveToWorld(Location, Map); break; case 3: Bandage b = new Bandage(Utility.RandomMinMax(50, 100)); b.MoveToWorld(Location, Map); break; case 4: new BarrelStaves().MoveToWorld(Location, Map); new BarrelHoops().MoveToWorld(Location, Map); break; case 5: Gold g = new Gold(Utility.RandomMinMax(100, 1000)); g.MoveToWorld(Location, Map); break; case 6: new CurePotion().MoveToWorld(Location, Map); break; case 7: new GreaterCurePotion().MoveToWorld(Location, Map); break; case 8: new HealPotion().MoveToWorld(Location, Map); break; case 9: new GreaterHealPotion().MoveToWorld(Location, Map); break; case 10: CoralSnake S1 = new CoralSnake(); CoralSnake S2 = new CoralSnake(); S1.MoveToWorld(new Point3D(((DungeonBarrel)this).X, ((DungeonBarrel)this).Y, ((DungeonBarrel)this).Z), ((DungeonBarrel)this).Map); S2.MoveToWorld(new Point3D(((DungeonBarrel)this).X, ((DungeonBarrel)this).Y, ((DungeonBarrel)this).Z), ((DungeonBarrel)this).Map); from.SendMessage("The barrel was infested with snakes!"); break; case 11: RottingCorpse S3 = new RottingCorpse(); S3.MoveToWorld(new Point3D(((DungeonBarrel)this).X, ((DungeonBarrel)this).Y, ((DungeonBarrel)this).Z), ((DungeonBarrel)this).Map); from.SendMessage("You have awakened a rotting corpse!"); break; } Destroy(); } else { from.SendLocalizedMessage(500446); // That is too far away. } }