From 790e15f2e64badf62d9ba62421776c4ba0e771ed Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Fri, 28 Jul 2017 12:00:20 -0500 Subject: Added anvil enchantment handling. (#3857) + Added anvil enchantment handling. --- Server/Plugins/APIDump/APIDesc.lua | 64 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) (limited to 'Server/Plugins/APIDump/APIDesc.lua') diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index 134a36d7b..9e920d429 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -2696,6 +2696,23 @@ local Hash = cCryptoHash.sha1HexString("DataToHash") }, Notes = "Returns the level of the specified enchantment stored in this object; 0 if not stored", }, + CanAddEnchantment = + { + Params = + { + { + Name = "EnchantmentNumID", + Type = "number", + }, + }, + Returns = + { + { + Type = "boolean" + }, + }, + Notes = "Returns true if the specified enchantment is not mutually exclusive with any of the enchantments stored by the object.", + }, IsEmpty = { Returns = @@ -6599,6 +6616,49 @@ These ItemGrids are available in the API and can be manipulated by the plugins, }, Notes = "Adds the specified amount to the item count. Returns self (useful for chaining).", }, + AddEnchantment = + { + Params = + { + { + Name = "Enchantment ID", + Type = "number", + }, + { + Name = "Level", + Type = "number", + }, + { + Name = "FromBook", + Type = "boolean", + }, + }, + Returns = + { + { + Type = "number", + }, + }, + Notes = "Adds the given enchantment at the given level to this item, following anvil enchantment combining rules. Returns the XP level cost of the addition. FromBook specifies whether to use the XP multiplier for books or the multiplier used for other items, if true it uses the multiplier for books.", + }, + AddEnchantmentsFromItem = + { + Params = + { + { + Name = "Additive", + Type = "cItem", + }, + }, + Returns = + { + { + Name = "LevelCost", + Type = "number", + }, + }, + Notes = "Adds the enchantments from the specified item to this item, returning the cost as if this were an anvil.", + }, Clear = { Notes = "Resets the instance to an empty item", @@ -6803,7 +6863,7 @@ These ItemGrids are available in the API and can be manipulated by the plugins, Type = "number", }, { - Name = "WithBook", + Name = "FromBook", Type = "boolean", }, }, @@ -6813,7 +6873,7 @@ These ItemGrids are available in the API and can be manipulated by the plugins, Type = "boolean", }, }, - Notes = "Returns true if the specified item type is enchantable. If WithBook is true, the function is used in the anvil inventory with book enchantments. So it checks the \"only book enchantments\" too. Example: You can only enchant a hoe with a book.", + Notes = "Returns true if the specified item type is enchantable. If FromBook is true, the function is used in the anvil inventory with book enchantments. So it checks the \"only book enchantments\" too. Example: You can only enchant a hoe with a book.", }, IsEqual = { -- cgit v1.2.3