public static void _OnCommand(CommandEventArgs e) { var caller = e.Mobile; if (caller.HasGump(typeof(CompendiumPageRenderer))) { caller.CloseGump(typeof(CompendiumPageRenderer)); } if (e.Arguments.Length > 0) { if (e.Arguments[0].IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) { caller.SendMessage("That page name has illegal characters in it."); return; } if (g_CompendiumRenderers.ContainsKey(e.Arguments[0])) { var gump = new CompendiumPageGump(caller, g_CompendiumRenderers[e.Arguments[0]]); gump.Send(); } else { caller.SendMessage("That page does not exist."); } } }
public static void Donate_OnCommand( CommandEventArgs e ) { string url = "http://www.defianceuo.com/donate/"; Mobile m = e.Mobile; m.LaunchBrowser( url ); }
private static void SpawnEIC_OnCommand( CommandEventArgs e ) { e.Mobile.SendMessage("Spawning Item Chests..."); ArrayList alChests = new ArrayList(); int counter = 0; foreach ( Item i in World.Items.Values ) { if( i is LockableContainer && !(i is BaseItemChest) && !(i is BaseTreasureChest) && !i.Movable ) { Region currentRegion = Region.Find( i.Location, i.Map ); if (currentRegion is DungeonRegion) alChests.Add( (LockableContainer)i ); } } foreach ( LockableContainer cont in alChests ) { for( int a=0;a<6;a++ ) for( int b=0;b<2;b++ ) if( cont.ItemID == ChestIds[a,b] ) { BaseItemChest chest = GetChest( a ); chest.ItemID = cont.ItemID; chest.Hue = cont.Hue; chest.MoveToWorld( cont.Location, cont.Map ); cont.Delete(); counter++; } } e.Mobile.SendMessage("Done... {0} Item Chests added.", counter); }
public static void ChangeCharacter_OnCommand(CommandEventArgs e) { Mobile from = e.Mobile; NetState ns = from.NetState; /* if (from.GetLogoutDelay() > TimeSpan.Zero) { from.SendMessage("You are unable to change characters at present. Make sure you are not in combat and that you are in a safe logout location."); return; } */ if (Spells.SpellHelper.CheckCombat(from)) { from.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle?? return; } else if (from.Spell != null) { from.SendLocalizedMessage(1049616); // You are too busy to do that at the moment. return; } ns.Mobile.SendGump(new gumpChangeCharacter(ns, from)); Console.WriteLine("Client: {0}: Returning to character select. [{1}]", ns.ToString(), ns.Account.Username); return; }
public override void Execute(CommandEventArgs e, object obj) { Mobile mob = (Mobile) obj; if (mob.IsDeadBondedPet) { BaseCreature bc = mob as BaseCreature; if (bc != null) bc.ResurrectPet(); } else if (!mob.Alive && mob is PlayerMobile) { ((PlayerMobile) mob).ForceResurrect(); CommandLogging.WriteLine(e.Mobile, "Refreshing and resurrecting " + mob.Name); } else if (!mob.Alive) { mob.Resurrect(); CommandLogging.WriteLine(e.Mobile, "Refreshing and resurrecting " + mob.Name); } CommandLogging.WriteLine(e.Mobile, "Refreshing but not resurrecting) " + mob.Name); mob.PublicOverheadMessage(MessageType.Regular, mob.SpeechHue, true, "I've been refreshed."); mob.Hits = mob.HitsMax; mob.Stam = mob.StamMax; mob.Mana = mob.ManaMax; mob.CurePoison(mob); }
public static void ResetScripts_Command(CommandEventArgs e) { GumpFileMap = new Dictionary<string, string>(); Gumps = new Dictionary<string, UberGumpBase>(); // should probably ensure all the timer stuff is restarted as appropriate UberScriptTimedScripts.ClearSubscriptions(); List<XmlScript> deletedScripts = new List<XmlScript>(); foreach (KeyValuePair<XmlScript, bool> scriptPair in XmlScript.AllScripts) { XmlScript script = scriptPair.Key; if (script.Deleted) { deletedScripts.Add(script); continue; } // hacky way to resubscribe the timers if at all possible XmlScript.TimerSubscriptionFlag temp = script.TimerSubscriptions; // unsubscribe them script.TimerSubscriptions = XmlScript.TimerSubscriptionFlag.None; // resubscribe them to what they were previously subscribed to script.TimerSubscriptions = temp; } foreach (XmlScript script in deletedScripts) { XmlScript.AllScripts.Remove(script); } }
private static void HelpInfo_OnCommand( CommandEventArgs e ) { if( e.Length > 0 ) { string arg = e.GetString( 0 ).ToLower(); CommandInfo c; if( m_HelpInfos.TryGetValue( arg, out c ) ) { Mobile m = e.Mobile; if( m.AccessLevel >= c.AccessLevel ) m.SendGump( new CommandInfoGump( c ) ); else m.SendMessage( "You don't have access to that command." ); return; } else e.Mobile.SendMessage( String.Format( "Command '{0}' not found!", arg ) ); } e.Mobile.SendGump( new CommandListGump( 0, e.Mobile, null ) ); }
public static void BandSelf_OnCommand(CommandEventArgs e) { Mobile from = e.Mobile; if (from.Alive) { if (from.AccessLevel >= AccessLevel.Counselor || DateTime.UtcNow >= from.NextActionTime) { var bandage = from.Backpack.FindItemByType(typeof(Bandage), true) as Bandage; if (bandage != null && !bandage.Deleted) { from.RevealingAction(); if (BandageContext.BeginHeal(from, from) != null) { bandage.Consume(); } from.NextActionTime = DateTime.UtcNow + TimeSpan.FromSeconds(0.5); } } else { from.SendActionMessage(); } } else { from.SendLocalizedMessage(500949); // You can't do that when you're dead. } }
public static void TownFinance_Command(CommandEventArgs e) { if (e.Arguments.Length == 0) { e.Mobile.SendMessage("You must provide a town name! e.g. [townfinance britain"); return; } if (!(e.Mobile is PlayerMobile)) { e.Mobile.SendMessage("You must be a playermobile to do this!"); } string townName = e.Arguments[0].ToLower(); foreach (Town town in Town.Towns) { if (town.Definition != null && town.Definition.TownName != null) { string testName = town.Definition.TownName.String.ToLower(); if (townName == testName) { if (town.Owner != null) { e.Mobile.SendGump(new FinanceGump((PlayerMobile) e.Mobile, town.Owner, town)); return; } else { e.Mobile.SendMessage("That town is not faction controlled."); return; } } } } e.Mobile.SendMessage(townName + " is not a valid town!"); }
public static void ValidateName_OnCommand( CommandEventArgs e ) { if ( Validate( e.ArgString, 2, 16, true, false, true, 1, SpaceDashPeriodQuote ) ) e.Mobile.SendMessage( 0x59, "That name is considered valid." ); else e.Mobile.SendMessage( 0x22, "That name is considered invalid." ); }
public override void Execute(Server.Commands.CommandEventArgs args, object o) { if (o is Mobile) { Mobile m = (Mobile)o; if (!m.Alive || m.Blessed || !m.CanBeDamaged()) { LogFailure("This command cannot work on that in its current state."); } else { m.BodyMod = 305; m.HueMod = 0; new Server.Items.Blood().MoveToWorld(m.Location, m.Map); Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(PlayEffects), new object[] { m, m.Map }); new InternalTimer(this, m).Start(); } } else { LogFailure("This command only works on mobiles."); } }
public override void Execute( CommandEventArgs args, object o ) { if( o is Item && !(o is AddonComponent) && !(o is BaseAddon) ) { Item i = (Item)o; SiegeMachineComponent newComponent = new SiegeMachineComponent(i.ItemID); newComponent.Hue = i.Hue; newComponent.Light = i.Light; newComponent.Movable = false; newComponent.Name = i.Name; newComponent.MoveToWorld(i.Location, i.Map); if( i.Parent == args.Mobile ) newComponent.Bounce(args.Mobile); if( i is Container ) ((Container)i).Destroy(); else i.Delete(); AddResponse("The item has been converted to a siege machine component."); } else { LogFailure("This command only works with items (no addons)."); } }
public static void Octant( CommandEventArgs e ) { Tour tour = delegate( Map map, int x, int y ) { int xLoc = e.Mobile.Location.X + x; int yLoc = e.Mobile.Location.Y + y; LandTile landTile = map.Tiles.GetLandTile( xLoc, yLoc ); Effects.SendLocationParticles( EffectItem.Create( new Point3D( xLoc, yLoc, landTile.Z ), map, EffectItem.DefaultDuration ), 0x37CC, 1, 40, 96, 3, 9917, 0 ); if( Math.Abs( x ) > 12 ) return true; // stop searching if( Math.Abs( y ) > 12 ) return true; // stop searching return false; }; Direction dir = (Direction)((int)(e.Mobile.Direction) & 0x0f); Search.Octant( e.Mobile.Map, dir, 1, SearchDirection.Outwards, tour ); }
private static void Use_OnCommand(CommandEventArgs e) { Mobile mob = e.Mobile; if (e.Arguments.Length >= 1) { string key = e.Arguments[0]; Type t; if (!m_SupportedTypes.TryGetValue(key.ToLower(), out t)) { SendMessage(mob, MessageType.UnknownType, key); //SendMessage(mob, MessageType.Usage); } else { Item item = mob.Backpack.FindItemByType(t); if(item != null) { mob.Use(item); } else { SendMessage(mob, MessageType.NotFound, key); } } } else { SendMessage(mob, MessageType.Usage); } }
public static void MyStats_OnCommand( CommandEventArgs e ) { Mobile from = e.Mobile; from.CloseGump( typeof( StatsGump ) ); from.SendGump( new StatsGump( from ) ); }
public static void OnCommand( CommandEventArgs e ) { if( e.Length >= 1 ) { switch( e.Arguments[0] ) { case "octant": Octant( e ); break; case "line": Line( e ); break; case "circle": Circle( e ); break; case "spiral": Spiral( e ); break; } } }
private static void GenGameDocs_OnCommand(CommandEventArgs e) { csv = new CsvFile(); AppDomain.CurrentDomain.GetAssemblies() .SelectMany(t => t.GetTypes()) .Where(t => t.IsClass && t.Namespace == "Server.Mobiles" && typeof(Mobiles.BaseCreature).IsAssignableFrom(t)) .ToList() .ForEach(t => ConsumeType(t, HandleBaseCreature)); csv.Write("Creatures.csv"); csv = new CsvFile(); AppDomain.CurrentDomain.GetAssemblies() .SelectMany(t => t.GetTypes()) .Where(t => t.IsClass && t.Namespace == "Server.Items" && typeof(Items.BaseWeapon).IsAssignableFrom(t)) .ToList() .ForEach(t => ConsumeType(t, HandleBaseWeapon)); csv.Write("Weapons.csv"); csv = new CsvFile(); AppDomain.CurrentDomain.GetAssemblies() .SelectMany(t => t.GetTypes()) .Where(t => t.IsClass && t.Namespace == "Server.Items" && typeof(Items.BaseArmor).IsAssignableFrom(t)) .ToList() .ForEach(t => ConsumeType(t, HandleBaseArmor)); csv.Write("Armor.csv"); }
private static void SetManeuver_OnCommand( CommandEventArgs e ) { if( e.Mobile == null || !( e.Mobile is PlayerMobile ) || e.Mobile.Deleted ) return; BaseCombatManeuver maneuver = null; PlayerMobile m = e.Mobile as PlayerMobile; string text = e.ArgString.ToLower().Replace( " ", "" ); foreach( KeyValuePair<string, BaseCombatManeuver> kvp in ValidManeuvers ) { if( kvp.Key.ToLower().Replace( " ", "" ) == text ) maneuver = kvp.Value; } if( maneuver != null) { if( text == "none" ) text = null; m.SendMessage( "Change the preferred maneuver of which of your followers?" ); m.Target = new SetManeuverTarget( maneuver, text ); } else { m.SendMessage( "Invalid option. The following uses of this command are valid:" ); foreach( KeyValuePair<string, BaseCombatManeuver> kvp in ValidManeuvers ) { m.SendMessage( ".SetManeuver " + kvp.Key ); } } }
public static void WriteProfiles_OnCommand(CommandEventArgs e) { try { using (StreamWriter sw = new StreamWriter("profiles.log", true)) { sw.WriteLine("# Dump on {0:f}", DateTime.Now); sw.WriteLine("# Core profiling for " + Core.ProfileTime); sw.WriteLine("# Packet send"); BaseProfile.WriteAll(sw, PacketSendProfile.Profiles); sw.WriteLine(); sw.WriteLine("# Packet receive"); BaseProfile.WriteAll(sw, PacketReceiveProfile.Profiles); sw.WriteLine(); sw.WriteLine("# Timer"); BaseProfile.WriteAll(sw, TimerProfile.Profiles); sw.WriteLine(); sw.WriteLine("# Gump response"); BaseProfile.WriteAll(sw, GumpProfile.Profiles); sw.WriteLine(); sw.WriteLine("# Target response"); BaseProfile.WriteAll(sw, TargetProfile.Profiles); sw.WriteLine(); } } catch { } }
private static void ViewGuilds_OnCommand(CommandEventArgs e) { string filter = e.ArgString; if (filter != null && (filter = filter.Trim()).Length == 0) filter = null; else if (filter != null) filter = filter.ToLower(); Mobile m_From = e.Mobile; List<Guild> guilds = new List<Guild>(); foreach (KeyValuePair<int, BaseGuild> keyValuePair in BaseGuild.List) { if (!(keyValuePair.Value is Guild)) continue; Guild g = keyValuePair.Value as Guild; if (g.Disbanded) continue; if ( filter != null && ( (g.Name == null || g.Name.ToLower().IndexOf(filter) < 0) && (g.Abbreviation == null || g.Abbreviation.ToLower().IndexOf(filter) < 0) ) ) continue; guilds.Add(g); } if (guilds.Count > 0) m_From.SendGump(new ViewGuildsGump(m_From, guilds)); }
private static void SetGuarded_OnCommand( CommandEventArgs e ) { Mobile from = e.Mobile; if ( e.Length == 1 ) { GuardedRegion reg = (GuardedRegion) from.Region.GetRegion( typeof( GuardedRegion ) ); if ( reg == null ) { from.SendMessage( "You are not in a guardable region." ); } else { reg.Disabled = !e.GetBoolean( 0 ); if ( reg.Disabled ) from.SendMessage( "The guards in this region have been disabled." ); else from.SendMessage( "The guards in this region have been enabled." ); } } else { from.SendMessage( "Format: SetGuarded <true|false>" ); } }
private static void OnUniqueIPCommand(CommandEventArgs e) { if (e.Mobile != null) { e.Mobile.SendMessage("There are {0:#,0} unique IP's currently connected.", GetUniqueStates().Count); } }
private static void GMTool_OnCommand( CommandEventArgs e ) { Mobile from = e.Mobile; from.CloseGump(typeof(IceGMTool)); from.SendGump(new IceGMTool(from)); Console.WriteLine("*****[{1}] {0} Useing Ice's GM Tool.*****", from.Name, from.AccessLevel); }
private static void WhoIs_OnCommand( CommandEventArgs e ) { if( e.Mobile == null || !( e.Mobile is PlayerMobile ) || e.Mobile.Deleted ) return; PlayerMobile m = e.Mobile as PlayerMobile; List<string> list = new List<string>(); foreach( NetState state in NetState.Instances ) { PlayerMobile player = state.Mobile as PlayerMobile; if( state.Mobile != null && state.Mobile != m && state.Mobile is PlayerMobile && player.DisplayGuildTitle && player.Name != null && player.Name.Length > 0 ) list.Add( player.Name ); } if( list.Count > 0 ) { m.SendMessage( "List of online characters:" ); foreach( string st in list ) m.SendMessage( st ); } else m.SendMessage( "There are currently no players visibly online." ); }
private static void LearnAllRecipes_OnCommand(CommandEventArgs e) { Mobile m = e.Mobile; m.SendMessage("Target a player to teach them all of the recipies."); m.BeginTarget( -1, false, TargetFlags.None, (from, targeted) => { if (targeted is PlayerMobile) { foreach (var kvp in Recipes) { ((PlayerMobile)targeted).AcquireRecipe(kvp.Key); } m.SendMessage("You teach them all of the recipies."); } else { m.SendMessage("That is not a player!"); } }); }
private static void Door_OnCommand(CommandEventArgs e) { if (!e.Mobile.Alive) { e.Mobile.SendMessage("You can't use this command while being dead!"); return; } BaseDoor doorToOpen = null; IPooledEnumerable eable = e.Mobile.GetObjectsInRange(3); foreach (object o in eable) if (o is BaseDoor && ((BaseDoor)o).GuildID <= 0) { //if (e.Mobile.InLOS(o)) //{ doorToOpen = (BaseDoor) o; break; //} } eable.Free(); if (doorToOpen == null) return; doorToOpen.Use(e.Mobile); }
public static void SpawnRareFromFile_Command(CommandEventArgs e) { Mobile from = e.Mobile; RaresFile value; if (ParsedFiles.TryGetValue(e.ArgString, out value)) { RaresFile file = value; Item spawned = file.GetRandomRareEntry(); if (spawned != null) { from.Backpack.AddItem(spawned); } else { from.SendMessage("There was some sort of problem so nothing was spawned. Check the file!"); } } else { from.SendMessage("file did not exist... existingfiles: "); foreach (var pair in ParsedFiles) { } } }
private static void OnCommand(CommandEventArgs args) { if (args.Mobile is PlayerMobile) { SendMessage(args.Mobile); } }
private static void ClearCycle_OnCommand(CommandEventArgs e) { if (visited.ContainsKey(e.Mobile.Serial) && visited[e.Mobile.Serial] != null) visited[e.Mobile.Serial].Clear(); e.Mobile.SendAsciiMessage("You cleared the cycle list"); }
private static void Msg(CommandEventArgs e) { Mobile from = e.Mobile; Guild theguild = from.Guild as Guild; if (theguild == null) { from.SendMessage("You are not in a guild!"); } else { string AbbreviationOrName; foreach (NetState state in NetState.Instances) { Mobile m = state.Mobile; bool found = false; int i = 0; while ((!found) && (i <= (theguild.Members.Count - 1))) { if (m != null && (theguild.IsMember(m))) {//an empty abbreviationname will allways be show as "none"at the server. no need for an if statement AbbreviationOrName = (from.Guild as Guild).Abbreviation; m.SendMessage(0x3C, String.Format("[Guild][{1}]: {2}", from.Name, e.ArgString)); found = true; } i++; } } } }
public static void GRP_OnCommand(CommandEventArgs e) { Mobile m = e.Mobile; if ( m != null ) { List<NetState> states = NetState.Instances; List<NetState> list = new List<NetState>(); for ( int i = 0; i < states.Count; ++i ) { NetState state = states[i]; if ( state.Mobile != null && state.Mobile.AccessLevel == AccessLevel.Player ) list.Add( state ); } if ( list.Count > 0 ) { NetState state = list[Utility.Random( list.Count )]; if ( state != null ) { Mobile to = state.Mobile; if ( to != null ) { m.MoveToWorld( to.Location, to.Map ); m.SendMessage( String.Format( "You have moved to {0}, at {1} in {2}", to.Name, to.Location, to.Map ) ); CommandLogging.WriteLine( m, "{0} {1} going to {2} Location {3}, Map {4}", m.AccessLevel, CommandLogging.Format( m ), CommandLogging.Format( to ), to.Location, to.Map ); } } else m.SendMessage("Random player logged off, please try again."); } } }
public static void Tile_OnCommand(Server.Commands.CommandEventArgs e) { if (e.Length >= 1) { BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(e.Arguments)); } else { e.Mobile.SendMessage("Format: Add <type> [params] [set {<propertyName> <value> ...}]"); } }
private static void CheckGuarded_OnCommand(Server.Commands.CommandEventArgs e) { Mobile from = e.Mobile; GuardedRegion reg = from.Region as GuardedRegion; if (reg == null) { from.SendAsciiMessage("You are not in a guardable region."); } else { reg.TellGuardStatus(from); } }
private static void ToggleGuarded_OnCommand(Server.Commands.CommandEventArgs e) { Mobile from = e.Mobile; GuardedRegion reg = from.Region as GuardedRegion; if (reg == null) { from.SendAsciiMessage("You are not in a guardable region."); } else { reg.Disabled = !reg.Disabled; from.SendAsciiMessage("After your changes:"); reg.TellGuardStatus(from); } }
public static void TileZ_OnCommand(Server.Commands.CommandEventArgs e) { if (e.Length >= 2) { string[] subArgs = new string[e.Length - 1]; for (int i = 0; i < subArgs.Length; ++i) { subArgs[i] = e.Arguments[i + 1]; } BoundingBoxPicker.Begin(e.Mobile, new BoundingBoxCallback(TileBox_Callback), new TileState(e.GetInt32(0), subArgs)); } else { e.Mobile.SendMessage("Format: TileZ <z> <type> [params] [set {<propertyName> <value> ...}]"); } }
public static void TileXYZ_OnCommand(Server.Commands.CommandEventArgs e) { if (e.Length >= 6) { Point3D p = new Point3D(e.GetInt32(0), e.GetInt32(1), e.GetInt32(4)); Point3D p2 = new Point3D(p.X + e.GetInt32(2) - 1, p.Y + e.GetInt32(3) - 1, e.GetInt32(4)); string[] subArgs = new string[e.Length - 5]; for (int i = 0; i < subArgs.Length; ++i) { subArgs[i] = e.Arguments[i + 5]; } Add.Invoke(e.Mobile, p, p2, subArgs); } else { e.Mobile.SendMessage("Format: TileXYZ <x> <y> <w> <h> <z> <type> [params] [set {<propertyName> <value> ...}]"); } }
void LinkAccountIngame(Server.Commands.CommandEventArgs e) { if (string.IsNullOrWhiteSpace(e.ArgString) || !_verificationCodes.TryGetValue(e.ArgString, out ulong userId)) { e.Mobile.SendMessage($"Verification code {e.ArgString} not found!"); return; } Accounting.Account acc = e.Mobile.Account as Accounting.Account; DiscordUserLink dul = DClient.UserManager[acc]; if (dul != null && dul.DiscordUserId == 0) { dul.DiscordUserId = userId; } else if (dul == null) { dul = new DiscordUserLink(acc, userId); } DClient.UserManager.AddOrUpdate(dul); e.Mobile.SendMessage("You successfully linked your account to user discord account"); }
private static void SetGuarded_OnCommand(Server.Commands.CommandEventArgs e) { Mobile from = e.Mobile; if (e.Length == 1) { GuardedRegion reg = from.Region as GuardedRegion; if (reg == null) { from.SendAsciiMessage("You are not in a guardable region."); } else { reg.Disabled = !e.GetBoolean(0); from.SendAsciiMessage("After your changes:"); reg.TellGuardStatus(from); } } else { from.SendAsciiMessage("Format: SetGuarded <true|false>"); } }
public static void AddDoor_OnCommand(Server.Commands.CommandEventArgs e) { e.Mobile.SendGump(new AddGateGump()); }
public static void CountObjects_OnCommand(CommandEventArgs e) { using (StreamWriter op = new StreamWriter("objects.log")) { Hashtable table = new Hashtable(); foreach (Item item in World.Items.Values) { Type type = item.GetType(); object o = table[type]; if (o == null) { table[type] = 1; } else { table[type] = 1 + (int)o; } } ArrayList items = new ArrayList(table); table.Clear(); foreach (Mobile m in World.Mobiles.Values) { Type type = m.GetType(); object o = table[type]; if (o == null) { table[type] = 1; } else { table[type] = 1 + (int)o; } } ArrayList mobiles = new ArrayList(table); items.Sort(new CountSorter()); mobiles.Sort(new CountSorter()); op.WriteLine("# Object count table generated on {0}", DateTime.UtcNow); op.WriteLine(); op.WriteLine(); op.WriteLine("# Items:"); for (var index = 0; index < items.Count; index++) { var de = (DictionaryEntry)items[index]; op.WriteLine("{0}\t{1:F2}%\t{2}", de.Value, (100 * (int)de.Value) / (double)World.Items.Count, de.Key); } op.WriteLine(); op.WriteLine(); op.WriteLine("#Mobiles:"); for (var index = 0; index < mobiles.Count; index++) { var de = (DictionaryEntry)mobiles[index]; op.WriteLine("{0}\t{1:F2}%\t{2}", de.Value, (100 * (int)de.Value) / (double)World.Mobiles.Count, de.Key); } } e.Mobile.SendMessage("Object table has been generated. See the file : <trueuo root>/objects.log"); }
public static void TraceExpanded_OnCommand(CommandEventArgs e) { Hashtable typeTable = new Hashtable(); foreach (Item item in World.Items.Values) { ExpandFlag flags = item.GetExpandFlags(); if ((flags & ~(ExpandFlag.TempFlag | ExpandFlag.SaveFlag)) == 0) { continue; } Type itemType = item.GetType(); do { int[] countTable = typeTable[itemType] as int[]; if (countTable == null) { typeTable[itemType] = countTable = new int[9]; } if ((flags & ExpandFlag.Name) != 0) { ++countTable[0]; } if ((flags & ExpandFlag.Items) != 0) { ++countTable[1]; } if ((flags & ExpandFlag.Bounce) != 0) { ++countTable[2]; } if ((flags & ExpandFlag.Holder) != 0) { ++countTable[3]; } if ((flags & ExpandFlag.Blessed) != 0) { ++countTable[4]; } /*if ( ( flags & ExpandFlag.TempFlag ) != 0 ) ++countTable[5]; * * if ( ( flags & ExpandFlag.SaveFlag ) != 0 ) ++countTable[6];*/ if ((flags & ExpandFlag.Weight) != 0) { ++countTable[7]; } if ((flags & ExpandFlag.Spawner) != 0) { ++countTable[8]; } itemType = itemType.BaseType; }while (itemType != typeof(object)); } try { using (StreamWriter op = new StreamWriter("expandedItems.log", true)) { string[] names = { "Name", "Items", "Bounce", "Holder", "Blessed", "TempFlag", "SaveFlag", "Weight", "Spawner" }; ArrayList list = new ArrayList(typeTable); list.Sort(new CountSorter()); for (var index = 0; index < list.Count; index++) { var de = (DictionaryEntry)list[index]; Type itemType = (Type)de.Key; int[] countTable = (int[])de.Value; op.WriteLine("# {0}", itemType.FullName); for (int i = 0; i < countTable.Length; ++i) { if (countTable[i] > 0) { op.WriteLine("{0}\t{1:N0}", names[i], countTable[i]); } } op.WriteLine(); } } } catch (Exception ex) { ExceptionLogging.LogException(ex); } }
public static void EventSink_Command(CommandEventArgs e) { WriteLine(e.Mobile, "{0} {1} used command '{2} {3}'", e.Mobile.AccessLevel, Format(e.Mobile), e.Command, e.ArgString); }
private static void OnAction(CommandEventArgs e) { var action = e.GetInt32(0); e.Mobile.Animate(AnimationType.Attack, action); }
public static void ProfileWorld_OnCommand(CommandEventArgs e) { ProfileWorld("items", "worldprofile_items.log"); ProfileWorld("mobiles", "worldprofile_mobiles.log"); }
private static void WipeItems_OnCommand(CommandEventArgs e) { BeginWipe(e.Mobile, WipeType.Items); }
public static void GenKhaldun_OnCommand(CommandEventArgs e) { m_Count = 0; // Generate Morph Items CreateMorphItem(5459, 1416, 0, 0x1D0, 0x1, 1); CreateMorphItem(5460, 1416, 0, 0x1D0, 0x1, 1); CreateMorphItem(5459, 1416, 0, 0x1, 0x53D, 1); CreateMorphItem(5460, 1416, 0, 0x1, 0x53B, 1); CreateMorphItem(5459, 1425, 0, 0x1, 0x53B, 2); CreateMorphItem(5459, 1426, 0, 0x1, 0x53B, 2); CreateMorphItem(5459, 1427, 0, 0x1, 0x53B, 2); CreateMorphItem(5460, 1425, 0, 0x1, 0x53B, 2); CreateMorphItem(5460, 1426, 0, 0x1, 0x53B, 2); CreateMorphItem(5460, 1427, 0, 0x1, 0x53B, 2); CreateMorphItem(5461, 1427, 0, 0x1, 0x53B, 2); CreateMorphItem(5460, 1422, 0, 0x1, 0x544, 2); CreateMorphItem(5460, 1419, 0, 0x1, 0x545, 2); CreateMorphItem(5460, 1420, 0, 0x1, 0x545, 2); CreateMorphItem(5460, 1423, 0, 0x1, 0x545, 2); CreateMorphItem(5460, 1424, 0, 0x1, 0x545, 2); CreateMorphItem(5461, 1426, 0, 0x1, 0x545, 2); CreateMorphItem(5460, 1417, 0, 0x1, 0x546, 1); CreateMorphItem(5460, 1418, 0, 0x1, 0x546, 2); CreateMorphItem(5460, 1421, 0, 0x1, 0x546, 2); CreateMorphItem(5461, 1425, 0, 0x1, 0x548, 2); CreateMorphItem(5459, 1420, 0, 0x1, 0x54A, 2); CreateMorphItem(5459, 1421, 0, 0x1, 0x54A, 2); CreateMorphItem(5459, 1423, 0, 0x1, 0x54A, 2); CreateMorphItem(5459, 1418, 0, 0x1, 0x54B, 2); CreateMorphItem(5459, 1422, 0, 0x1, 0x54B, 2); CreateMorphItem(5459, 1417, 0, 0x1, 0x54C, 1); CreateMorphItem(5459, 1419, 0, 0x1, 0x54C, 2); CreateMorphItem(5459, 1424, 0, 0x1, 0x54C, 2); CreateMorphItem(5458, 1426, 0, 0x1, 0x1D1, 2); CreateMorphItem(5459, 1427, 0, 0x1, 0x1E3, 2); CreateMorphItem(5458, 1425, 3, 0x1, 0x1E4, 2); CreateMorphItem(5458, 1427, 6, 0x1, 0x1E5, 2); CreateMorphItem(5461, 1427, 0, 0x1, 0x1E8, 2); CreateMorphItem(5460, 1427, 0, 0x1, 0x1E9, 2); CreateMorphItem(5458, 1425, 0, 0x1, 0x1EA, 2); CreateMorphItem(5458, 1427, 0, 0x1, 0x1EA, 2); CreateMorphItem(5458, 1427, 3, 0x1, 0x1EA, 2); // Generate Approach Lights CreateApproachLight(5393, 1417, 0, 0x1857, 0x1858, LightType.Circle150); CreateApproachLight(5393, 1420, 0, 0x1857, 0x1858, LightType.Circle150); CreateApproachLight(5395, 1421, 0, 0x1857, 0x1858, LightType.Circle150); CreateApproachLight(5396, 1417, 0, 0x1857, 0x1858, LightType.Circle150); CreateApproachLight(5397, 1419, 0, 0x1857, 0x1858, LightType.Circle150); CreateApproachLight(5441, 1393, 5, 0x1F2B, 0x19BB, LightType.Circle225); CreateApproachLight(5446, 1393, 5, 0x1F2B, 0x19BB, LightType.Circle225); // Generate Sound Effects CreateSoundEffect(5425, 1489, 5, 0x102, 1); CreateSoundEffect(5425, 1491, 5, 0x102, 1); CreateSoundEffect(5449, 1499, 10, 0xF5, 1); CreateSoundEffect(5451, 1499, 10, 0xF5, 1); CreateSoundEffect(5453, 1499, 10, 0xF5, 1); CreateSoundEffect(5524, 1367, 0, 0x102, 1); CreateSoundEffect(5450, 1370, 0, 0x220, 2); CreateSoundEffect(5450, 1372, 0, 0x220, 2); CreateSoundEffect(5460, 1416, 0, 0x244, 2); CreateSoundEffect(5483, 1439, 5, 0x14, 3); // Generate Big Teleporter CreateBigTeleporterItem(5387, 1325, true); CreateBigTeleporterItem(5388, 1326, true); CreateBigTeleporterItem(5388, 1325, false); CreateBigTeleporterItem(5387, 1326, false); // Generate Central Khaldun entrance DisappearingRaiseSwitch sw = TryCreateItem(5459, 1426, 10, new DisappearingRaiseSwitch()) as DisappearingRaiseSwitch; RaiseSwitch lv = TryCreateItem(5403, 1359, 0, new RaiseSwitch()) as RaiseSwitch; RaisableItem stone = TryCreateItem(5403, 1360, 0, new RaisableItem(0x788, 10, 0x477, 0x475, TimeSpan.FromMinutes(1.5))) as RaisableItem; RaisableItem door = TryCreateItem(5524, 1367, 0, new RaisableItem(0x1D0, 20, 0x477, 0x475, TimeSpan.FromMinutes(5.0))) as RaisableItem; sw.RaisableItem = stone; lv.RaisableItem = door; e.Mobile.SendMessage(String.Format("{0} dynamic Khaldun item{1} generated.", m_Count, m_Count == 1 ? "" : "s")); }
private static void FindCities_OnCommand(CommandEventArgs e) { e.Mobile.SendGump(new FindCitiesGump(0, null, null)); }
private static void WipeMultis_OnCommand(CommandEventArgs e) { BeginWipe(e.Mobile, WipeType.Multis); }
public static void OutlineAvg_OnCommand(CommandEventArgs e) { InternalAvg_OnCommand(e, true); }
public static void DropHolding_OnCommand(CommandEventArgs e) { e.Mobile.BeginTarget(-1, false, TargetFlags.None, DropHolding_OnTarget); e.Mobile.SendMessage("Target the player to drop what they are holding."); }
public static void TileRXYZ_OnCommand(CommandEventArgs e) { InternalRXYZ_OnCommand(e, false); }
private static void AddToBank_OnCommand(CommandEventArgs e) { e.Mobile.SendGump(new AddToBankGump()); }
public static void JaggedFire_OnCommand(CommandEventArgs e) { Ability.JaggedLineEffect(e.Mobile, 25, 500); Ability.JaggedLineEffect(e.Mobile, 25, 500); Ability.JaggedLineEffect(e.Mobile, 25, 500); }
public static void TileAvg_OnCommand(CommandEventArgs e) { InternalAvg_OnCommand(e, false); }
public static void FlameCross_OnCommand(CommandEventArgs e) { Ability.FlameCross(e.Mobile); }
public static void SignGen_OnCommand(CommandEventArgs c) { Parse(c.Mobile); }
public static void SoulDrain_OnCommand(CommandEventArgs e) { Ability.SoulDrain(e.Mobile); }
public static void CrimsonMeteor_OnCommand(CommandEventArgs e) { Ability.CrimsonMeteor(e.Mobile, 35); }
public static void SimpleFlame_OnCommand(CommandEventArgs e) { e.Mobile.BeginTarget(10, false, TargetFlags.Harmful, new TargetCallback(SimpleFlame_CallBack)); }
public static void FlameWave_OnCommand(CommandEventArgs e) { Ability.FlameWave(e.Mobile); }