protected override void Event(params string[] list) { string acc; if (list.Length > 1) { acc = list[1]; } else { Console.Write("Input acc name: "); acc = Console.ReadLine(); } if (acc.Length <= 0) { Console.WriteLine("Wrong name"); return; } Account a = ConsoleCommander.GetAccountByName(acc); if (a == null) { Console.WriteLine("Cant find acc"); return; } Console.WriteLine("Current plevel: {0}", a.AccessLevel); Console.Write("Input account plevel (0-player, 1-gm, 2-admin): "); string plevel = Console.ReadLine(); if (plevel.Length <= 0) { return; } switch (plevel) { case "2": a.AccessLevel = AccessLevels.Admin; break; case "1": a.AccessLevel = AccessLevels.GM; break; default: a.AccessLevel = AccessLevels.PlayerLevel; break; } Console.WriteLine("User: \"{0}\"; plevel: \"{1}\"", a.Username, a.AccessLevel); }
protected override void Event(params string[] list) { string name; if (list.Length > 1) { name = list[1]; } else { Console.Write("Input account name: "); name = Console.ReadLine(); } if (ConsoleCommander.AccountExists(name)) { Console.WriteLine("This name already exists, try another.."); return; } Console.Write("Input account password: "******"Input account plevel (0-player, 1-gm, 2-admin): "); string splevel = Console.ReadLine(); AccessLevels plevel = AccessLevels.PlayerLevel; switch (splevel) { case "2": { plevel = AccessLevels.Admin; break; } case "1": { plevel = AccessLevels.GM; break; } default: { plevel = AccessLevels.PlayerLevel; break; } } World.allAccounts.Add(new Account(name, pass, plevel)); Console.WriteLine("Account: \"{0}\", pass: \"{1}\", plevel: \"{2}\" created", name, pass, plevel); }
protected override void Event(params string[] list) { string cname; if (list.Length > 1) { cname = list[1]; } else { Console.Write("Input character name: "); cname = Console.ReadLine(); } if (cname.Length <= 0) { Console.WriteLine("Wrong name"); return; } Character c = ConsoleCommander.GetConnectedCharByName(cname); if (c == null) { Console.WriteLine("\"{0}\" is offline or not exist.", cname); return; } Console.WriteLine("==========[ GUID: {0} ]==========", c.Guid); Console.WriteLine("Name: {0}", c.Name); Console.WriteLine("Level: {0}", c.Level); Console.WriteLine("Race: {0}", c.Race); Console.WriteLine("Class: {0}", c.Classe); Console.WriteLine("Zone: {0}", c.ZoneId); Console.WriteLine("Map: {0}", c.MapId); Console.WriteLine("Coord X: {0}", c.X); Console.WriteLine("Coord Y: {0}", c.Y); Console.WriteLine("Coord Z: {0}", c.Z); Console.WriteLine("Size: {0}", c.Size); Console.WriteLine(" "); Console.Write("Show full info[y/n]: "); if (Console.ReadLine().ToLower() != "y") { return; } Console.WriteLine(" "); Console.Write("Show account info[y/n]: "); if (Console.ReadLine().ToLower() == "y") { Console.WriteLine("==========[Account]=========="); if (c.Player != null) { Console.WriteLine("Login: {0}", c.Player.Username); Console.WriteLine("AccessLevel: [{0}]{1}", (int)c.Player.AccessLevel, c.Player.AccessLevel); Console.WriteLine("IP: {0}", c.Player.Ip); Console.WriteLine("Port: {0}", c.Player.Port); } else { Console.WriteLine("cant find info"); } } Console.WriteLine(" "); Console.Write("Show states[y/n]: "); if (Console.ReadLine().ToLower() == "y") { Console.WriteLine("==========[States]=========="); Console.WriteLine("Hit points: {0}", c.HitPoints); Console.WriteLine("Mana: {0}", c.Mana); Console.WriteLine("Rage: {0}", c.Rage); Console.WriteLine("Str: {0}", c.Str); Console.WriteLine(" "); Console.WriteLine("PVP active: {0}", c.PvpActive); Console.WriteLine("In combat: {0}", c.InCombat); Console.WriteLine("Is in duel: {0}", c.IsInDuel); Console.WriteLine(" "); Console.WriteLine("Running: {0}", c.Running); Console.WriteLine("Run speed: {0}", c.RunSpeed); Console.WriteLine("Speed: {0}", c.Speed); Console.WriteLine(" "); Console.WriteLine("Resist arcane: {0}", c.ResistArcane); Console.WriteLine("Resist fire: {0}", c.ResistFire); Console.WriteLine("Resist frost: {0}", c.ResistFrost); Console.WriteLine("Resist holy: {0}", c.ResistHoly); Console.WriteLine("Resist nature: {0}", c.ResistNature); Console.WriteLine("Resist shadow: {0}", c.ResistShadow); Console.WriteLine(" "); Console.WriteLine("Immune all spells and abilites: {0}", c.ImmuneAllSpellsAndAbilites); Console.WriteLine("Immune attack: {0}", c.ImmuneAttack); Console.WriteLine("Immune disease: {0}", c.ImmuneDisease); Console.WriteLine("Immune fire spell: {0}", c.ImmuneFireSpell); Console.WriteLine("Immune frost spell: {0}", c.ImmuneFrostSpell); Console.WriteLine("Immune magic: {0}", c.ImmuneMagic); Console.WriteLine("Immune physical damage: {0}", c.ImmunePhysicalDamage); Console.WriteLine("Immune poison: {0}", c.ImmunePoison); Console.WriteLine("Immune to disarm: {0}", c.ImmuneToDisarm); Console.WriteLine("Immune to fear: {0}", c.ImmuneToFear); Console.WriteLine("Immune to immobilization: {0}", c.ImmuneToImmobilization); Console.WriteLine("Immune to knock back: {0}", c.ImmuneToKnockBack); } Console.WriteLine(" "); Console.Write("Show skills[y/n]: "); if (Console.ReadLine().ToLower() == "y") { Console.WriteLine("==========[Skills]=========="); if (c.AllSkills != null && c.AllSkills.Count > 0) { foreach (Skill sk in c.AllSkills.Values) { Console.WriteLine("[{0}]=({1})", (qSkills)sk.Id, sk.Current); } } else { Console.WriteLine("skills is empty"); } } Console.WriteLine(" "); Console.Write("Show talents[y/n]: "); if (Console.ReadLine().ToLower() == "y") { Console.WriteLine("==========[Talents]=========="); if (c.TalentList != null && c.TalentList.Count > 0) { foreach (Talents tal in c.TalentList.Keys) { Console.WriteLine("[{0}] = {1}", tal, c.TalentLevel(tal)); } } else { Console.WriteLine("talents is empty"); } } Console.WriteLine(" "); Console.Write("Show target info[y/n]: "); if (Console.ReadLine().ToLower() == "y") { Console.WriteLine("==========[Target]=========="); if (c.Selection != null) { Console.WriteLine("GUID: {0}", c.Selection.Guid); Console.WriteLine("Zone: {0}", c.Selection.ZoneId); Console.WriteLine("Map: {0}", c.Selection.MapId); Console.WriteLine("Coord X: {0}", c.Selection.X); Console.WriteLine("Coord Y: {0}", c.Selection.Y); Console.WriteLine("Coord Z: {0}", c.Selection.Z); Console.WriteLine("Type: {0}", c.Selection.GetType()); } else { Console.WriteLine("none selected"); } } }
public static void Initialize() { ConsoleCommander.AddCommand(new CharacterInfoCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new WhoIsCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new AccountListCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new SetPlevelCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new ShutdownCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new CreateAccountCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new BroadcastCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new RestartCommand()); }
public static void Initialize() { ConsoleCommander.AddCommand(new ErrorListGenCommand()); }