private static void AnnounceAFK(PlayerMobile pm) { if (!isAFK(pm)) return; if (pm.Location.ToString() != GetAFKLocation(pm) || pm.NetState == null || pm.Deleted) { SetBack(pm); return; } TimeSpan ts = GetAFKTimeSpan(pm); pm.Emote("*{0}*", GetAFKMessage(pm)); if (ts.Hours != 0) { pm.Emote("*AFK for {0} hour{1} and {2} minute{3}*", ts.Hours.ToString(), (ts.Hours > 1 ? "s" : ""), ts.Minutes.ToString(), (ts.Minutes > 1 ? "s" : "")); } else if (ts.Minutes != 0) { pm.Emote("*AFK for {0} minute{1}*", ts.Minutes.ToString(), (ts.Minutes > 1 ? "s" : "")); } else if (ts.Seconds != 0) { pm.Emote("*AFK for {0} seconds*", ts.Seconds.ToString()); } Timer.DelayCall(TimeSpan.FromSeconds(10), delegate { AnnounceAFK(pm); }); }
public static void HandleShapeshift( PlayerMobile m, string choice ) { if( choice == "human" ) { if( m.BodyValue == 400 || m.BodyValue == 401 ) m.SendMessage( "You are already in human form." ); else { if( m.Female ) m.BodyValue = 401; else m.BodyValue = 400; m.Emote( "*turns back into human form*" ); m.HueMod = -1; m.NameMod = null; m.InvalidateProperties(); } } else if( choice == "wolf" || choice == "bat" || choice == "rat" || choice == "cat" ) { int cost = 10; if( m.Feats.GetFeatLevel( FeatList.Shapeshift ) > 2 ) cost = 1; else if( m.Feats.GetFeatLevel( FeatList.Shapeshift ) == 2 ) cost = 5; if( m.BPs < cost ) m.SendMessage( "You lack enough blood points to use that ability." ); else { m.Emote( "*turns into a " + choice + "*" ); m.HueMod = 2881; m.NameMod = "a black " + choice; int body = 225; if( choice == "cat" ) body = 201; else if( choice == "rat" ) body = 238; else if( choice == "bat" ) body = 317; m.BodyValue = body; m.BPs -= cost; m.InvalidateProperties(); } } else m.SendMessage( "Invalid option." ); }
public static void EndChew(PlayerMobile m) { Timer t = (Timer)m_Table[m]; if (t != null) t.Stop(); m_Table.Remove(m); m.SendMessage("You spit the chew out."); m.Emote("*spits!*"); if (m.Female) { m.PlaySound(820); } else { m.PlaySound(1094); } }
private static void SetBack(PlayerMobile pm) { ProTag.Del(pm, "AFK Message"); ProTag.Del(pm, "AFK Location"); ProTag.Del(pm, "AFK Time"); pm.Emote("*Returns to the game*"); }
private static void SetAFK(PlayerMobile pm, string message) { ProTag.Set(pm, "AFK Message", message); ProTag.Set(pm, "AFK Location", pm.Location.ToString()); ProTag.Set(pm, "AFK Time", DateTime.Now.ToString()); pm.Emote("*Is now AFK*"); }
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(); } }); }