public override bool VerifyMove(Mobile from) { PlayerMobile From = from as PlayerMobile; if (From.Alive == true) { From.BoltEffect(0); From.SendMessage("You feel a jolt of electricity!"); From.PlaySound(From.Female ? 799 : 1071); From.Say("*huh?*"); From.Damage(Utility.Random(20, 55)); return(false); } From.SendMessage("You are dead and can not take that!"); return(false); }
public void OnBadDirection(PlayerMobile pm) { if (Utility.RandomBool()) { if (Door != null) { pm.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x35, 1156493, pm.NetState); //*A poisonous dart embeds itself into your neck!* } Effects.PlaySound(pm.Location, pm.Map, 0x22E); pm.Damage(Utility.RandomMinMax(20, 40)); pm.ApplyPoison(pm, Poison.Deadly); } else { if (Door != null) { pm.PrivateOverheadMessage(Server.Network.MessageType.Regular, 0x35, 1156494, pm.NetState); //*You are ambushed by attacking trappers!* } SpawnTrappers(pm); } }
public static void CheckThirst(Mobile m) { PlayerMobile pm = null; if (m != null && m is PlayerMobile) { pm = (PlayerMobile)m; } if (pm != null && pm.Thirst <= 10 && pm.AccessLevel == AccessLevel.Player && (DateTime.Now - pm.LastOnline > TimeSpan.FromSeconds(150))) { pm.SendMessage("La soif vous crispe de douleur."); int damages = (int)((11 - pm.Thirst) * (pm.Str / 40.0)); if (damages <= 0) { damages = 1; } if (damages > pm.Hits || !pm.Warmode || pm.Target == null) { pm.Damage(damages); } } }
public void CheckCode() { bool incomplete = false; int correct_souls = 0; for (int i = 0; i < m_Pads.Count; i++) { PuzzlePad pad = m_Pads[i] as PuzzlePad; if (pad == null || !pad.Busy) { incomplete = true; } } correct_souls = CompareCodes(m_PuzzleCode, m_Code); if (incomplete) { SayStatues(1050004, -1); // The circle is the key, the key is incomplete and so the gate remains closed. } else { // we don't guess code if (correct_souls >= 0 && correct_souls < 4) { ArrayList players = new ArrayList(); for (int i = 0; i < m_Pads.Count; i++) { PuzzlePad pad = m_Pads[i] as PuzzlePad; if (pad != null && pad.Stander != null && pad.Stander.Alive) { players.Add(pad.Stander); } } for (int j = 0; j < players.Count; j++) { PlayerMobile player = players[j] as PlayerMobile; if (player != null) { Point3D location1 = player.Location; location1.Z = 49; Point3D location2 = player.Location; location2.Z = -1; Effects.SendPacket(player, player.Map, new HuedEffect(EffectType.Moving, Serial.Zero, player.Serial, 0x11B7, location1, location2, 20, 0, true, true, 0, 0)); Effects.PlaySound(new Point3D(324, 64, -1), Map.Malas, 0x144); Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, Utility.RandomList(0x154, 0x14B)); player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "You are pinned down by the weight of the boulder!!!")); } } switch (correct_souls) { case 0: SayStatues(1050009, correct_souls); break; // The circle of souls has failed to turn the key. The gate remains closed... case 1: SayStatues(1050007, correct_souls); break; // ~1_NUM~ soul has turned the key correctly, but the rest have forsaken the circle... default: SayStatues(1050008, correct_souls); break; // ~1_NUM~ souls have turned the key correctly, but the rest have forsaken the circle... } for (int j = 0; j < players.Count; j++) { PlayerMobile player = players[j] as PlayerMobile; if (player != null) { Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x36BD, new Point3D(player.X, player.Y, 0), new Point3D(player.X, player.Y, 0), 20, 10, true, false)); Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.FixedFrom, player.Serial, Serial.Zero, 0x36BD, new Point3D(player.X, player.Y, -1), new Point3D(player.X, player.Y, -1), 20, 10, true, false)); Effects.PlaySound(new Point3D(player.X, player.Y, -1), player.Map, 0x307); for (int k = 0; k < 5; k++) { Effects.SendPacket(player, player.Map, new GraphicalEffect(EffectType.Moving, Serial.Zero, Serial.Zero, 0x1363 + Utility.Random(0, 11), new Point3D(player.X, player.Y, 0), new Point3D(player.X, player.Y, 0), 5, 0, false, false)); Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, 0x13F); Effects.PlaySound(new Point3D(player.X, player.Y, -1), Map.Malas, 0x154); player.Say("OUCH!"); } player.Damage(90, null); player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, 0x66D, 3, "", "A speeding rock hits you in the head!")); player.SendLocalizedMessage(502382); // You can move! } } } else { // we done it! PlayerMobile center = ((PuzzlePad)m_Pads[4]).Stander; for (int i = 0; i < m_Pads.Count; i++) { PuzzlePad pad = m_Pads[i] as PuzzlePad; if (pad != null && pad.Stander != null && pad.Stander.Alive) { Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D(325, 64, -1), new Point3D(325, 64, -1), 1, 60, true, false)); Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.FixedXYZ, Serial.Zero, Serial.Zero, 0x1153, new Point3D(325, 64, -1), new Point3D(325, 64, -1), 1, 60, true, false)); Effects.PlaySound(new Point3D(325, 64, -1), Map.Malas, 0x244); if (center != null) { Effects.SendPacket(pad.Stander, Map.Malas, new GraphicalEffect(EffectType.Lightning, center.Serial, Serial.Zero, 0x0, new Point3D(324, 64, -1), new Point3D(324, 64, -1), 0, 0, false, false)); Effects.SendPacket(pad.Stander, Map.Malas, new ParticleEffect(EffectType.FixedFrom, center.Serial, Serial.Zero, 0x0, new Point3D(324, 64, -1), new Point3D(324, 64, -1), 0, 0, false, false, 0, 0, 0x13A7, 0, 0, center.Serial, 3, 0)); } } } if (center != null) { center.MoveToWorld(new Point3D(467, 96, -1), Map.Malas); if (m_Timer != null) { m_Timer.Stop(); } m_Timer = new PoisonTimer(this); m_Timer.Start(); m_CanActive = false; m_Box.CanSummon = true; } } } FreeLevers(); }
public void DoExplode(PlayerMobile pm) { pm.Emote("*The gaze of the asylum guardian melts the flesh from your bones and causes your organs to explode.*"); int range = Utility.RandomMinMax(5, 7); int zOffset = pm.Mounted ? 20 : 10; Point3D src = pm.Location.Clone3D(0, 0, zOffset); Point3D[] points = src.GetAllPointsInRange(pm.Map, 0, range); Effects.PlaySound(pm.Location, pm.Map, 0x19C); pm.FixedParticles(0x36BD, 20, 10, 5044, 137, 0, EffectLayer.Head); pm.PlaySound(0x307); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { int i = 0; int place = 0; int[] BodyPartArray = { 7584, 7583, 7586, 7585, 7588, 7587 }; foreach (Point3D trg in points) { i++; int bodypartID = Utility.RandomMinMax(4650, 4655); if (Utility.RandomDouble() <= 0.1 && place < BodyPartArray.Count()) { bodypartID = BodyPartArray[place]; place++; } new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pm.Map, bodypartID).MovingImpact( info => { Item bodypart; if (bodypartID <= 4655 && bodypartID >= 4650) { bodypart = new Blood { ItemID = bodypartID }; bodypart.MoveToWorld(info.Target.Location, info.Map); } switch (bodypartID) { case 7584: bodypart = new Head(); bodypart.MoveToWorld(info.Target.Location, info.Map); break; case 7583: bodypart = new Torso(); bodypart.MoveToWorld(info.Target.Location, info.Map); break; case 7586: bodypart = new RightArm(); bodypart.MoveToWorld(info.Target.Location, info.Map); break; case 7585: bodypart = new LeftArm(); bodypart.MoveToWorld(info.Target.Location, info.Map); break; case 7588: bodypart = new RightLeg(); bodypart.MoveToWorld(info.Target.Location, info.Map); break; case 7587: bodypart = new LeftLeg(); bodypart.MoveToWorld(info.Target.Location, info.Map); break; } Effects.PlaySound(info.Target, info.Map, 0x028); }); } }); pm.Damage(pm.Hits + 5); Timer.DelayCall( TimeSpan.FromMilliseconds(100), () => { var corpse = pm.Corpse as Corpse; if (corpse != null && !corpse.Deleted) { corpse.TurnToBones(); } }); }