From c4c43421f3e5b6cdecb16a5713ef76347bd3fbea Mon Sep 17 00:00:00 2001 From: Filip Maj Date: Fri, 5 Aug 2016 18:24:17 -0400 Subject: [PATCH] Forgot ObjectItemStorage script. --- .../chara/npc/object/ObjectItemStorage.lua | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/data/scripts/base/chara/npc/object/ObjectItemStorage.lua b/data/scripts/base/chara/npc/object/ObjectItemStorage.lua index 908d7b6e..f84d0399 100644 --- a/data/scripts/base/chara/npc/object/ObjectItemStorage.lua +++ b/data/scripts/base/chara/npc/object/ObjectItemStorage.lua @@ -1,3 +1,15 @@ +--[[ + +ObjectItemStorage Script + +Functions: + +storageMenu() - Shows store/retrieve/help menu. +selectCategory() - Shows the category menu +selectStoreItem(nil, categoryId) - Shows store item menu +selectReceiveItem(nil, categoryId) - Shows retrieve item menu +--]] + require ("global") function init(npc) @@ -6,6 +18,29 @@ end function onEventStarted(player, npc, triggerName) + ::TOP_MENU:: + storageChoice = callClientFunction(player, "storageMenu"); + + if (storageChoice == 1) then + categoryChoice = callClientFunction(player, "selectCategory"); + + if (categoryChoice == 5) then + goto TOP_MENU; + end + + callClientFunction(player, "selectStoreItem", nil, categoryChoice); + + elseif (storageChoice == 2) then + categoryChoice = callClientFunction(player, "selectCategory"); + + if (categoryChoice == 5) then + goto TOP_MENU; + end + + callClientFunction(player, "selectReceiveItem", nil, categoryChoice); + + end + player:EndEvent(); -end \ No newline at end of file +end \ No newline at end of file