Reformat of GameCommand.cs
This commit is contained in:
parent
1efa5a7624
commit
55da2d1691
@ -113,12 +113,13 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
for (int i = 0; i < amount; i++)
|
for (int i = 0; i < amount; i++)
|
||||||
{
|
{
|
||||||
var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f,
|
var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f,
|
||||||
player.Position.Y + (float)RandomHelper.NextDouble() * 20f,
|
player.Position.Y + (float)RandomHelper.NextDouble() * 20f,
|
||||||
player.Position.Z);
|
player.Position.Z);
|
||||||
|
|
||||||
var monster = player.World.SpawnMonster((ActorSno)actorSNO, position);
|
var monster = player.World.SpawnMonster((ActorSno)actorSNO, position);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"Spawned {amount} mobs with ActorSNO: {actorSNO}";
|
return $"Spawned {amount} mobs with ActorSNO: {actorSNO}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +210,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandGroup("platinum", "Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
[CommandGroup("platinum",
|
||||||
|
"Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
||||||
public class PlatinumCommand : CommandGroup
|
public class PlatinumCommand : CommandGroup
|
||||||
{
|
{
|
||||||
[DefaultCommand]
|
[DefaultCommand]
|
||||||
@ -290,7 +292,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandGroup("achiplatinum", "Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
[CommandGroup("achiplatinum",
|
||||||
|
"Platinum for your character.\nOptionally specify the number of levels: !platinum [count]")]
|
||||||
public class PlatinumAchiCommand : CommandGroup
|
public class PlatinumAchiCommand : CommandGroup
|
||||||
{
|
{
|
||||||
[DefaultCommand]
|
[DefaultCommand]
|
||||||
@ -389,8 +392,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
for (int i = 0; i < amount; i++)
|
for (int i = 0; i < amount; i++)
|
||||||
{
|
{
|
||||||
var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f,
|
var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f,
|
||||||
player.Position.Y + (float)RandomHelper.NextDouble() * 20f,
|
player.Position.Y + (float)RandomHelper.NextDouble() * 20f,
|
||||||
player.Position.Z);
|
player.Position.Z);
|
||||||
|
|
||||||
var item = ItemGenerator.Cook(player, name);
|
var item = ItemGenerator.Cook(player, name);
|
||||||
item.EnterWorld(position);
|
item.EnterWorld(position);
|
||||||
@ -432,8 +435,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
for (int i = 0; i < amount; i++)
|
for (int i = 0; i < amount; i++)
|
||||||
{
|
{
|
||||||
var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f,
|
var position = new Vector3D(player.Position.X + (float)RandomHelper.NextDouble() * 20f,
|
||||||
player.Position.Y + (float)RandomHelper.NextDouble() * 20f,
|
player.Position.Y + (float)RandomHelper.NextDouble() * 20f,
|
||||||
player.Position.Z);
|
player.Position.Z);
|
||||||
|
|
||||||
var item = ItemGenerator.GenerateRandom(player, type);
|
var item = ItemGenerator.GenerateRandom(player, type);
|
||||||
item.EnterWorld(position);
|
item.EnterWorld(position);
|
||||||
@ -461,6 +464,7 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
var msg = new InventoryDropItemMessage { ItemID = item.DynamicID(player) };
|
var msg = new InventoryDropItemMessage { ItemID = item.DynamicID(player) };
|
||||||
player.Inventory.Consume(invokerClient.InGameClient, msg);
|
player.Inventory.Consume(invokerClient.InGameClient, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"Dropped {bpItems.Count} Items for you";
|
return $"Dropped {bpItems.Count} Items for you";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -495,8 +499,10 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
|
|
||||||
invokerClient.InGameClient.Player.ChangeWorld(world, world.StartingPoints.First().Position);
|
invokerClient.InGameClient.Player.ChangeWorld(world, world.StartingPoints.First().Position);
|
||||||
|
|
||||||
var proximity = new System.Drawing.RectangleF(invokerClient.InGameClient.Player.Position.X - 1f, invokerClient.InGameClient.Player.Position.Y - 1f, 2f, 2f);
|
var proximity = new System.Drawing.RectangleF(invokerClient.InGameClient.Player.Position.X - 1f,
|
||||||
var scenes = invokerClient.InGameClient.Player.World.QuadTree.Query<GSSystem.MapSystem.Scene>(proximity);
|
invokerClient.InGameClient.Player.Position.Y - 1f, 2f, 2f);
|
||||||
|
var scenes =
|
||||||
|
invokerClient.InGameClient.Player.World.QuadTree.Query<GSSystem.MapSystem.Scene>(proximity);
|
||||||
if (scenes.Count == 0) return ""; // cork (is it real?)
|
if (scenes.Count == 0) return ""; // cork (is it real?)
|
||||||
|
|
||||||
var scene = scenes[0]; // Parent scene /fasbat
|
var scene = scenes[0]; // Parent scene /fasbat
|
||||||
@ -510,18 +516,23 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
var levelArea = scene.Specification.SNOLevelAreas[0];
|
var levelArea = scene.Specification.SNOLevelAreas[0];
|
||||||
|
|
||||||
//handling quest triggers
|
//handling quest triggers
|
||||||
if (invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers.ContainsKey(levelArea)) //EnterLevelArea
|
if (invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers
|
||||||
|
.ContainsKey(levelArea)) //EnterLevelArea
|
||||||
{
|
{
|
||||||
var trigger = invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers[levelArea];
|
var trigger =
|
||||||
|
invokerClient.InGameClient.Player.World.Game.SideQuestProgress.GlobalQuestTriggers[levelArea];
|
||||||
if (trigger.triggerType == QuestStepObjectiveType.EnterLevelArea)
|
if (trigger.triggerType == QuestStepObjectiveType.EnterLevelArea)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
trigger.questEvent.Execute(invokerClient.InGameClient.Player.World); // launch a questEvent
|
trigger.questEvent.Execute(invokerClient.InGameClient.Player.World); // launch a questEvent
|
||||||
}
|
}
|
||||||
catch { }
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var bounty in invokerClient.InGameClient.Player.World.Game.QuestManager.Bounties)
|
foreach (var bounty in invokerClient.InGameClient.Player.World.Game.QuestManager.Bounties)
|
||||||
bounty.CheckLevelArea(levelArea);
|
bounty.CheckLevelArea(levelArea);
|
||||||
return $"Teleported to: {MPQStorage.Data.Assets[SNOGroup.Worlds][worldId].Name} [id: {worldId}]";
|
return $"Teleported to: {MPQStorage.Data.Assets[SNOGroup.Worlds][worldId].Name} [id: {worldId}]";
|
||||||
@ -569,7 +580,8 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
return "This command can only be used in-game.";
|
return "This command can only be used in-game.";
|
||||||
|
|
||||||
if (@params == null)
|
if (@params == null)
|
||||||
return "Change the movement speed. Min 0 (Base), Max 2.\n You can use decimal values like 1,3 for example.";
|
return
|
||||||
|
"Change the movement speed. Min 0 (Base), Max 2.\n You can use decimal values like 1,3 for example.";
|
||||||
float speedValue;
|
float speedValue;
|
||||||
|
|
||||||
const float maxSpeed = 3; // 2;
|
const float maxSpeed = 3; // 2;
|
||||||
@ -601,401 +613,407 @@ namespace DiIiS_NA.GameServer.CommandManager
|
|||||||
return $"Speed changed to {speedValue}";
|
return $"Speed changed to {speedValue}";
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandGroup("quest", "Retrieves information about quest states and manipulates quest progress.\n Usage: quest [triggers | trigger eventType eventValue | advance snoQuest]")]
|
[CommandGroup("quest",
|
||||||
public class QuestCommand : CommandGroup
|
"Retrieves information about quest states and manipulates quest progress.\n Usage: quest [triggers | trigger eventType eventValue | advance snoQuest]")]
|
||||||
{
|
public class QuestCommand : CommandGroup
|
||||||
[DefaultCommand]
|
|
||||||
public string Quest(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
{
|
||||||
if (invokerClient == null)
|
[DefaultCommand]
|
||||||
return "You can not invoke this command from console.";
|
public string Quest(string[] @params, BattleClient invokerClient)
|
||||||
|
|
||||||
if (invokerClient.InGameClient == null)
|
|
||||||
return "You can only invoke this command while ingame.";
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("advance", "Advances a quest by a single step\n Usage: advance")]
|
|
||||||
public string Advance(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
invokerClient.InGameClient.Game.QuestManager.Advance();
|
if (invokerClient == null)
|
||||||
return String.Format("Advancing main quest line");
|
return "You can not invoke this command from console.";
|
||||||
|
|
||||||
|
if (invokerClient.InGameClient == null)
|
||||||
|
return "You can only invoke this command while ingame.";
|
||||||
|
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
|
[Command("advance", "Advances a quest by a single step\n Usage: advance")]
|
||||||
|
public string Advance(string[] @params, BattleClient invokerClient)
|
||||||
{
|
{
|
||||||
return e.Message;
|
try
|
||||||
|
{
|
||||||
|
invokerClient.InGameClient.Game.QuestManager.Advance();
|
||||||
|
return String.Format("Advancing main quest line");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("sideadvance", "Advances a side-quest by a single step\n Usage: sideadvance")]
|
||||||
|
public string SideAdvance(string[] @params, BattleClient invokerClient)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
invokerClient.InGameClient.Game.QuestManager.SideAdvance();
|
||||||
|
return String.Format("Advancing side quest line");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("event", "Launches chosen side-quest by snoID\n Usage: event snoId")]
|
||||||
|
public string Event(string[] @params, BattleClient invokerClient)
|
||||||
|
{
|
||||||
|
if (@params == null)
|
||||||
|
return Fallback();
|
||||||
|
|
||||||
|
if (@params.Count() != 1)
|
||||||
|
return "Invalid arguments. Type 'help text public' to get help.";
|
||||||
|
|
||||||
|
int questId = Int32.Parse(@params[0]);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
invokerClient.InGameClient.Game.QuestManager.LaunchSideQuest(questId, true);
|
||||||
|
return String.Format("Advancing side quest line");
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return e.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("timer", "Send broadcasted text message.\n Usage: public 'message'")]
|
||||||
|
public string Timer(string[] @params, BattleClient invokerClient)
|
||||||
|
{
|
||||||
|
if (@params == null)
|
||||||
|
return Fallback();
|
||||||
|
|
||||||
|
if (@params.Count() != 2)
|
||||||
|
return "Invalid arguments. Type 'help text public' to get help.";
|
||||||
|
|
||||||
|
int eventId = Int32.Parse(@params[0]);
|
||||||
|
int duration = Int32.Parse(@params[1]);
|
||||||
|
|
||||||
|
invokerClient.InGameClient.Game.QuestManager.LaunchQuestTimer(eventId, (float)duration,
|
||||||
|
new Action<int>((q) => { }));
|
||||||
|
|
||||||
|
return String.Format("Message sended.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Command("sideadvance", "Advances a side-quest by a single step\n Usage: sideadvance")]
|
[CommandGroup("lookup",
|
||||||
public string SideAdvance(string[] @params, BattleClient invokerClient)
|
"Searches in sno databases.\nUsage: lookup [actor|conv|power|scene|la|sp|weather] <pattern>")]
|
||||||
|
public class LookupCommand : CommandGroup
|
||||||
{
|
{
|
||||||
try
|
[DefaultCommand]
|
||||||
|
public string Search(string[] @params, BattleClient invokerClient)
|
||||||
{
|
{
|
||||||
invokerClient.InGameClient.Game.QuestManager.SideAdvance();
|
if (@params == null)
|
||||||
return String.Format("Advancing side quest line");
|
return Fallback();
|
||||||
|
|
||||||
|
var matches = new List<Asset>();
|
||||||
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
||||||
|
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
|
||||||
|
foreach (var groupPair in MPQStorage.Data.Assets)
|
||||||
|
{
|
||||||
|
foreach (var pair in groupPair.Value)
|
||||||
|
{
|
||||||
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Matches:\n" : "No matches found.",
|
||||||
|
(current, match) => current +
|
||||||
|
$"[{match.SNOId.ToString("D6")}] [{match.Group}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
|
[Command("actor", "Allows you to search for an actor.\nUsage: lookup actor <pattern>")]
|
||||||
|
public string Actor(string[] @params, BattleClient invokerClient)
|
||||||
{
|
{
|
||||||
return e.Message;
|
var matches = new List<Asset>();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("event", "Launches chosen side-quest by snoID\n Usage: event snoId")]
|
if (@params.Count() < 1)
|
||||||
public string Event(string[] @params, BattleClient invokerClient)
|
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
||||||
{
|
|
||||||
if (@params == null)
|
|
||||||
return Fallback();
|
|
||||||
|
|
||||||
if (@params.Count() != 1)
|
var pattern = @params[0].ToLower();
|
||||||
return "Invalid arguments. Type 'help text public' to get help.";
|
|
||||||
|
|
||||||
int questId = Int32.Parse(@params[0]);
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Actor])
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
invokerClient.InGameClient.Game.QuestManager.LaunchSideQuest(questId, true);
|
|
||||||
return String.Format("Advancing side quest line");
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return e.Message;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("timer", "Send broadcasted text message.\n Usage: public 'message'")]
|
|
||||||
public string Timer(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
if (@params == null)
|
|
||||||
return Fallback();
|
|
||||||
|
|
||||||
if (@params.Count() != 2)
|
|
||||||
return "Invalid arguments. Type 'help text public' to get help.";
|
|
||||||
|
|
||||||
int eventId = Int32.Parse(@params[0]);
|
|
||||||
int duration = Int32.Parse(@params[1]);
|
|
||||||
|
|
||||||
invokerClient.InGameClient.Game.QuestManager.LaunchQuestTimer(eventId, (float)duration, new Action<int>((q) => { }));
|
|
||||||
|
|
||||||
return String.Format("Message sended.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[CommandGroup("lookup", "Searches in sno databases.\nUsage: lookup [actor|conv|power|scene|la|sp|weather] <pattern>")]
|
|
||||||
public class LookupCommand : CommandGroup
|
|
||||||
{
|
|
||||||
[DefaultCommand]
|
|
||||||
public string Search(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
if (@params == null)
|
|
||||||
return Fallback();
|
|
||||||
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var groupPair in MPQStorage.Data.Assets)
|
|
||||||
{
|
|
||||||
foreach (var pair in groupPair.Value)
|
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
matches.Add(pair.Value);
|
matches.Add(pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Actor Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current +
|
||||||
|
$"[{match.SNOId.ToString("D6")}] {match.Name} ({(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type} {(((match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type == ActorType.Gizmo) ? ((int)(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[ActorKeys.GizmoGroup]).ToString() : "")})\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Matches:\n" : "No matches found.",
|
[Command("rope", "Allows you to search for an rope.\nUsage: lookup rope <pattern>")]
|
||||||
(current, match) => current +
|
public string Rope(string[] @params, BattleClient invokerClient)
|
||||||
$"[{match.SNOId.ToString("D6")}] [{match.Group}] {match.Name}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("actor", "Allows you to search for an actor.\nUsage: lookup actor <pattern>")]
|
|
||||||
public string Actor(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Actor])
|
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
var matches = new List<Asset>();
|
||||||
matches.Add(pair.Value);
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
||||||
|
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Rope])
|
||||||
|
{
|
||||||
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Rope Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Actor Matches:\n" : "No match found.",
|
[Command("conv", "Allows you to search for an conversation.\nUsage: lookup conv <pattern>")]
|
||||||
(current, match) => current +
|
public string Conversation(string[] @params, BattleClient invokerClient)
|
||||||
$"[{match.SNOId.ToString("D6")}] {match.Name} ({(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type} {(((match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).Type == ActorType.Gizmo) ? ((int)(match.Data as DiIiS_NA.Core.MPQ.FileFormats.Actor).TagMap[ActorKeys.GizmoGroup]).ToString() : "")})\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("rope", "Allows you to search for an rope.\nUsage: lookup rope <pattern>")]
|
|
||||||
public string Rope(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Rope])
|
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
var matches = new List<Asset>();
|
||||||
matches.Add(pair.Value);
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
||||||
|
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Conversation])
|
||||||
|
{
|
||||||
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Conversation Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Rope Matches:\n" : "No match found.",
|
[Command("power", "Allows you to search for a power.\nUsage: lookup power <pattern>")]
|
||||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
public string Power(string[] @params, BattleClient invokerClient)
|
||||||
}
|
|
||||||
|
|
||||||
[Command("conv", "Allows you to search for an conversation.\nUsage: lookup conv <pattern>")]
|
|
||||||
public string Conversation(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup actor' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Conversation])
|
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
var matches = new List<Asset>();
|
||||||
matches.Add(pair.Value);
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup power' to get help.";
|
||||||
|
|
||||||
|
if (@params[0].ToLower() == "id")
|
||||||
|
{
|
||||||
|
var num = Int32.Parse(@params[1]);
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Power])
|
||||||
|
{
|
||||||
|
if (pair.Value.SNOId == num)
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Power])
|
||||||
|
{
|
||||||
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Power Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Conversation Matches:\n" : "No match found.",
|
[Command("world",
|
||||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
"Allows you to search for a world.\nUsage: lookup world <pattern> OR lookup world id <snoId>")]
|
||||||
}
|
public string World(string[] @params, BattleClient invokerClient)
|
||||||
|
|
||||||
[Command("power", "Allows you to search for a power.\nUsage: lookup power <pattern>")]
|
|
||||||
public string Power(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup power' to get help.";
|
|
||||||
|
|
||||||
if (@params[0].ToLower() == "id")
|
|
||||||
{
|
{
|
||||||
var num = Int32.Parse(@params[1]);
|
var matches = new List<Asset>();
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Power])
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup world' to get help.";
|
||||||
|
|
||||||
|
if (@params[0].ToLower() == "id")
|
||||||
|
{
|
||||||
|
var num = Int32.Parse(@params[1]);
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Worlds])
|
||||||
|
{
|
||||||
|
if (pair.Value.SNOId == num)
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Worlds])
|
||||||
|
{
|
||||||
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
|
matches.Add(pair.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "World Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current +
|
||||||
|
$"[{match.SNOId.ToString("D6")}] {match.Name} - {(match.Data as World).DynamicWorld}\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("qr", "Show QuestRange of an actor.\nUsage: lookup qr <id>")]
|
||||||
|
public string QuestRange(string[] @params, BattleClient invokerClient)
|
||||||
|
{
|
||||||
|
var matches = new List<Asset>();
|
||||||
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup world' to get help.";
|
||||||
|
|
||||||
|
var num = Int32.Parse(@params[0]);
|
||||||
|
string qr_id = "-1";
|
||||||
|
string qr_name = "None";
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.QuestRange])
|
||||||
{
|
{
|
||||||
if (pair.Value.SNOId == num)
|
if (pair.Value.SNOId == num)
|
||||||
matches.Add(pair.Value);
|
{
|
||||||
|
qr_id = pair.Value.SNOId.ToString("D6");
|
||||||
|
qr_name = pair.Value.Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $"[{qr_id}] {qr_name}";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
public static int GetExitBits(Asset scene)
|
||||||
{
|
{
|
||||||
|
if (scene.Name.Contains("_N_")) return 1;
|
||||||
|
else if (scene.Name.Contains("_S_")) return 2;
|
||||||
|
else if (scene.Name.Contains("_NS_")) return 3;
|
||||||
|
else if (scene.Name.Contains("_E_")) return 4;
|
||||||
|
else if (scene.Name.Contains("_NE_")) return 5;
|
||||||
|
else if (scene.Name.Contains("_SE_")) return 6;
|
||||||
|
else if (scene.Name.Contains("_NSE_")) return 7;
|
||||||
|
else if (scene.Name.Contains("_W_")) return 8;
|
||||||
|
else if (scene.Name.Contains("_NW_")) return 9;
|
||||||
|
else if (scene.Name.Contains("_SW_")) return 10;
|
||||||
|
else if (scene.Name.Contains("_NSW_")) return 11;
|
||||||
|
else if (scene.Name.Contains("_EW_")) return 12;
|
||||||
|
else if (scene.Name.Contains("_NEW_")) return 13;
|
||||||
|
else if (scene.Name.Contains("_SEW_")) return 14;
|
||||||
|
else if (scene.Name.Contains("_NSEW_")) return 15;
|
||||||
|
else return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("la", "Allows you to search for a LevelArea.\nUsage: lookup la <pattern>")]
|
||||||
|
public string LevelArea(string[] @params, BattleClient invokerClient)
|
||||||
|
{
|
||||||
|
var matches = new List<Asset>();
|
||||||
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup la' to get help.";
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
var pattern = @params[0].ToLower();
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Power])
|
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.LevelArea])
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
matches.Add(pair.Value);
|
matches.Add(pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "LevelArea Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Power Matches:\n" : "No match found.",
|
[Command("sp", "List all Starting Points in world.\nUsage: lookup sp")]
|
||||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
public string StartingPoint(string[] @params, BattleClient invokerClient)
|
||||||
}
|
|
||||||
|
|
||||||
[Command("world", "Allows you to search for a world.\nUsage: lookup world <pattern> OR lookup world id <snoId>")]
|
|
||||||
public string World(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup world' to get help.";
|
|
||||||
|
|
||||||
if (@params[0].ToLower() == "id")
|
|
||||||
{
|
{
|
||||||
var num = Int32.Parse(@params[1]);
|
var matches = invokerClient.InGameClient.Player.World.StartingPoints;
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Worlds])
|
|
||||||
{
|
return matches.Aggregate(matches.Count >= 1 ? "Starting Points:\n" : "No match found.",
|
||||||
if (pair.Value.SNOId == num)
|
(current, match) => current +
|
||||||
matches.Add(pair.Value);
|
$"[{match.GlobalID.ToString("D6")}] {match.Name} - {match.TargetId}\n");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
[Command("weather", "Allows you to search for a Weather.\nUsage: lookup weather <pattern>")]
|
||||||
|
public string Weather(string[] @params, BattleClient invokerClient)
|
||||||
{
|
{
|
||||||
|
var matches = new List<Asset>();
|
||||||
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup weather' to get help.";
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
var pattern = @params[0].ToLower();
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Worlds])
|
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Weather])
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
matches.Add(pair.Value);
|
matches.Add(pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Weather Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "World Matches:\n" : "No match found.",
|
[Command("scene", "Allows you to search for a scene.\nUsage: lookup scene <pattern>")]
|
||||||
(current, match) => current +
|
public string Scene(string[] @params, BattleClient invokerClient)
|
||||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {(match.Data as World).DynamicWorld}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("qr", "Show QuestRange of an actor.\nUsage: lookup qr <id>")]
|
|
||||||
public string QuestRange(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup world' to get help.";
|
|
||||||
|
|
||||||
var num = Int32.Parse(@params[0]);
|
|
||||||
string qr_id = "-1";
|
|
||||||
string qr_name = "None";
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.QuestRange])
|
|
||||||
{
|
{
|
||||||
if (pair.Value.SNOId == num)
|
var matches = new List<Asset>();
|
||||||
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup scene' to get help.";
|
||||||
|
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
|
||||||
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Scene])
|
||||||
{
|
{
|
||||||
qr_id = pair.Value.SNOId.ToString("D6");
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
qr_name = pair.Value.Name;
|
matches.Add(pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Scene Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current +
|
||||||
|
$"[{match.SNOId.ToString("D6")}] {match.Name} - {GetExitBits(match)}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"[{qr_id}] {qr_name}";
|
[Command("eg", "Allows you to search for an EffectGroup.\nUsage: lookup eg <pattern>")]
|
||||||
}
|
public string EffectGroup(string[] @params, BattleClient invokerClient)
|
||||||
|
|
||||||
public static int GetExitBits(Asset scene)
|
|
||||||
{
|
|
||||||
if (scene.Name.Contains("_N_")) return 1;
|
|
||||||
else if (scene.Name.Contains("_S_")) return 2;
|
|
||||||
else if (scene.Name.Contains("_NS_")) return 3;
|
|
||||||
else if (scene.Name.Contains("_E_")) return 4;
|
|
||||||
else if (scene.Name.Contains("_NE_")) return 5;
|
|
||||||
else if (scene.Name.Contains("_SE_")) return 6;
|
|
||||||
else if (scene.Name.Contains("_NSE_")) return 7;
|
|
||||||
else if (scene.Name.Contains("_W_")) return 8;
|
|
||||||
else if (scene.Name.Contains("_NW_")) return 9;
|
|
||||||
else if (scene.Name.Contains("_SW_")) return 10;
|
|
||||||
else if (scene.Name.Contains("_NSW_")) return 11;
|
|
||||||
else if (scene.Name.Contains("_EW_")) return 12;
|
|
||||||
else if (scene.Name.Contains("_NEW_")) return 13;
|
|
||||||
else if (scene.Name.Contains("_SEW_")) return 14;
|
|
||||||
else if (scene.Name.Contains("_NSEW_")) return 15;
|
|
||||||
else return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("la", "Allows you to search for a LevelArea.\nUsage: lookup la <pattern>")]
|
|
||||||
public string LevelArea(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup la' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.LevelArea])
|
|
||||||
{
|
{
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
var matches = new List<Asset>();
|
||||||
matches.Add(pair.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "LevelArea Matches:\n" : "No match found.",
|
if (@params.Count() < 1)
|
||||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
return "Invalid arguments. Type 'help lookup eg' to get help.";
|
||||||
}
|
|
||||||
|
|
||||||
[Command("sp", "List all Starting Points in world.\nUsage: lookup sp")]
|
var pattern = @params[0].ToLower();
|
||||||
public string StartingPoint(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = invokerClient.InGameClient.Player.World.StartingPoints;
|
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Starting Points:\n" : "No match found.",
|
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.EffectGroup])
|
||||||
(current, match) => current +
|
|
||||||
$"[{match.GlobalID.ToString("D6")}] {match.Name} - {match.TargetId}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("weather", "Allows you to search for a Weather.\nUsage: lookup weather <pattern>")]
|
|
||||||
public string Weather(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup weather' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Weather])
|
|
||||||
{
|
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
|
||||||
matches.Add(pair.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Weather Matches:\n" : "No match found.",
|
|
||||||
(current, match) => current + $"[{match.SNOId.ToString("D6")}] {match.Name}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("scene", "Allows you to search for a scene.\nUsage: lookup scene <pattern>")]
|
|
||||||
public string Scene(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup scene' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.Scene])
|
|
||||||
{
|
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
|
||||||
matches.Add(pair.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Scene Matches:\n" : "No match found.",
|
|
||||||
(current, match) => current +
|
|
||||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {GetExitBits(match)}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("eg", "Allows you to search for an EffectGroup.\nUsage: lookup eg <pattern>")]
|
|
||||||
public string EffectGroup(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<Asset>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup eg' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var pair in MPQStorage.Data.Assets[SNOGroup.EffectGroup])
|
|
||||||
{
|
|
||||||
if (pair.Value.Name.ToLower().Contains(pattern))
|
|
||||||
matches.Add(pair.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "EffectGroup Matches:\n" : "No match found.",
|
|
||||||
(current, match) => current +
|
|
||||||
$"[{match.SNOId.ToString("D6")}] {match.Name} - {GetExitBits(match)}\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
[Command("item", "Allows you to search for an item.\nUsage: lookup item <pattern>")]
|
|
||||||
public string Item(string[] @params, BattleClient invokerClient)
|
|
||||||
{
|
|
||||||
var matches = new List<ItemTable>();
|
|
||||||
|
|
||||||
if (@params.Count() < 1)
|
|
||||||
return "Invalid arguments. Type 'help lookup item' to get help.";
|
|
||||||
|
|
||||||
var pattern = @params[0].ToLower();
|
|
||||||
|
|
||||||
foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values)
|
|
||||||
{
|
|
||||||
var data = asset.Data as GameBalance;
|
|
||||||
if (data == null || data.Type != BalanceType.Items) continue;
|
|
||||||
|
|
||||||
foreach (var itemDefinition in data.Item)
|
|
||||||
{
|
{
|
||||||
if (itemDefinition.Name.ToLower().Contains(pattern))
|
if (pair.Value.Name.ToLower().Contains(pattern))
|
||||||
matches.Add(itemDefinition);
|
matches.Add(pair.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "EffectGroup Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current +
|
||||||
|
$"[{match.SNOId.ToString("D6")}] {match.Name} - {GetExitBits(match)}\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Command("item", "Allows you to search for an item.\nUsage: lookup item <pattern>")]
|
||||||
|
public string Item(string[] @params, BattleClient invokerClient)
|
||||||
|
{
|
||||||
|
var matches = new List<ItemTable>();
|
||||||
|
|
||||||
|
if (@params.Count() < 1)
|
||||||
|
return "Invalid arguments. Type 'help lookup item' to get help.";
|
||||||
|
|
||||||
|
var pattern = @params[0].ToLower();
|
||||||
|
|
||||||
|
foreach (var asset in MPQStorage.Data.Assets[SNOGroup.GameBalance].Values)
|
||||||
|
{
|
||||||
|
var data = asset.Data as GameBalance;
|
||||||
|
if (data == null || data.Type != BalanceType.Items) continue;
|
||||||
|
|
||||||
|
foreach (var itemDefinition in data.Item)
|
||||||
|
{
|
||||||
|
if (itemDefinition.Name.ToLower().Contains(pattern))
|
||||||
|
matches.Add(itemDefinition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return matches.Aggregate(matches.Count >= 1 ? "Item Matches:\n" : "No match found.",
|
||||||
|
(current, match) => current + $"[{match.SNOActor.ToString("D6")}] {match.Name}\n");
|
||||||
}
|
}
|
||||||
return matches.Aggregate(matches.Count >= 1 ? "Item Matches:\n" : "No match found.",
|
|
||||||
(current, match) => current + $"[{match.SNOActor.ToString("D6")}] {match.Name}\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
user.block.title