Added @Item.Use(ItemID) command

@Item.Use(ItemID)
Uses the specified item if the player has it.
This commit is contained in:
JappaWakka 2023-12-27 17:10:54 +01:00
parent 168255e1a0
commit 845464f03c
2 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,11 @@
steps = 250
End Select
Core.Player.RepelSteps += steps
Case "use"
Dim itemID As String = argument
If Core.Player.Inventory.GetItemAmount(itemID) > 0 Then
Item.GetItemByID(itemID).Use()
End If
Case "select"
Dim allowedPages As Integer()
Dim allowedItems As New List(Of String)

View File

@ -290,6 +290,7 @@ Namespace ScriptVersion2
r(New ScriptCommand("item", "messagegive", {New ScriptArgument("ItemID", ScriptArgument.ArgumentTypes.Int),
New ScriptArgument("Amount", ScriptArgument.ArgumentTypes.Int, True, "1")}.ToList(), "Displays a message for getting the specified amount of items."))
r(New ScriptCommand("item", "repel", {New ScriptArgument("RepelItemID", ScriptArgument.ArgumentTypes.Int, {"20", "42", "43"})}.ToList(), "Adds the steps of the Repel to the Repel steps of the player."))
r(New ScriptCommand("item", "use", {New ScriptArgument("ItemID", ScriptArgument.ArgumentTypes.Str)}.ToList(), "Uses the specified item if the player has it."))
r(New ScriptCommand("item", "select", {New ScriptArgument("AllowedPages", ScriptArgument.ArgumentTypes.Str, True, "-1"),
New ScriptArgument("AllowedItems", ScriptArgument.ArgumentTypes.Str, True, "-1")}.ToList(), "Opens an item select screen with only the specified item type pages (separated with "";"", e.g. ""0;1;2"" or ""standard;medicine;plants"") and possible item IDs (single items separated with "";"", or with a ""-"" if you want a range, e.g. ""2000-2066"")."))