-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a890e9
commit d3b8802
Showing
3 changed files
with
152 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using API; | ||
using API.Commands; | ||
|
||
namespace Client.Commands | ||
{ | ||
public class Equip : CommandBase | ||
{ | ||
public override string CmdName => "Equip"; | ||
|
||
public override string CmdUsage => "<bagPath> <invPath>"; | ||
|
||
public override string CmdDesc => "Equip an item from the bag."; | ||
|
||
public override string Run(IClient handler, string command, Dictionary<string, object> localVars) | ||
{ | ||
if (!(handler is RyzomClient ryzomClient)) | ||
throw new Exception("Command handler is not a Ryzom client."); | ||
|
||
var args = GetArgs(command); | ||
|
||
if (args.Length != 2) | ||
return "Please specify a bag path (INVENTORY:BAG:165) and an inventory path (INVENTORY:HAND:0 OR INVENTORY:EQUIP:5)."; | ||
|
||
var bagPath = args[0].ToUpper().Trim(); | ||
var invPath = args[1].ToUpper().Trim(); | ||
|
||
var inventoryManager = ryzomClient.GetInventoryManager(); | ||
|
||
inventoryManager.Equip(bagPath, invPath); | ||
|
||
return ""; | ||
} | ||
|
||
public override IEnumerable<string> GetCmdAliases() | ||
{ | ||
return new[] { "" }; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters