Jones 36 Report post Posted March 23, 2016 (edited) Hi, Jones here from BPO. In this post I will show you how to write a simple script and explain how it works. There are 2 things in the script that I'm not sure of, so maybe someone can also confirm it to me. function ItemUse_KylinChest ( role , Item ) local cha = TurnToCha ( role ) --// define [cha] as the character (?) local cha_type = GetChaTypeID ( cha ) --// get the character's type (1 = Lance, 2 = Carsise, 3 = Phyllis, 4 = Ami) and put into definition as [cha_type] local Item_CanGet = GetChaFreeBagGridNum ( role ) -- Define [Item_CanGet] as Free Grid space in Character's Inventory. (Free Slots) if Item_CanGet <= 3 then -- If Free Slots in inventory EQUALS or LESS THAN 3, then SystemNotice(role ,"Requires 4 slots in inventory to open the Kylin Chest!") -- Initiate a System Message UseItemFailed ( role ) -- Fail to use the item. return end -- Close [if] GiveItem ( cha , 0 , 825 , 1 , 0 ) -- Give Item to character, 0, 825 (Item ID), 1, 0 GiveItem ( cha , 0 , 826 , 1 , 0 ) -- Give Item to character, 0, 826 (Item ID), 1, 0 GiveItem ( cha , 0 , 827 , 1 , 0 ) -- Give Item to character, 0, 827 (Item ID), 1, 0 local cha_name = GetChaDefaultName ( role ) -- Define [cha_name] as Character's name, VALUE: [GetChaDefaultName ( role )] local message = cha_name.." opens the the Kylin Chest and gets a Kylin Set!" -- Define [message] as the following message. Notice ( message ) -- Do a world-announcement (Notice) for the message. end -- Close the Function You can put this script into ItemEffect.lua in scripts>calculate>itemeffect.lua and make an item with XXXX id, then define the ItemUse_Function as ItemUse_KylinChest. eg. 7694 Kylin Chest n1755 10130016 0 0 0 0 0 0 31 0 0 0 0 0 1 1 0 1 1 0 200 -1,-2,-2,-2 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 -1,-2,-2,-2,-2,-2,-2,-2,-2,-2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 ItemUse_KylinChest 0 0 0 0,0 0 0 Click to obtain the Kylin Set! 0 7694 is the Item ID Kylin Chest is the Name n1755 is the Icon After that, you can double click on the item and the function will play itself! Edited April 1, 2016 by Jones 2 Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted March 23, 2016 GetChaTypeID gives the characterinfo line, so 1 for lance, 2 for carsise, 3 for phyliss, 4 for ami, so you can give the correct set if it is different per character. 1 Quote Share this post Link to post Share on other sites
Jones 36 Report post Posted April 1, 2016 (edited) thanks @7n6, updated. Edited April 1, 2016 by Jones Quote Share this post Link to post Share on other sites