rakuzas Posted September 13, 2013 Posted September 13, 2013 Hello, Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks.. Quote
1 xienne15 Posted September 14, 2013 Posted September 14, 2013 (edited) Hello, Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks.. Hmm try this~ Item_db: 644,Gift_Box,Gift Box,2,1000,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc "randombox"; },{},{} Script: function script randombox { setarray .BoxItems[0],983,982,978,976,980,975,981; set .Random, rand( getarraysize( .BoxItems ) ); getitem .BoxItems[ .Random ], 1; end; } Please hit the reputation button if this works. -> Edited September 14, 2013 by xienne15 Quote
0 Dolphin86 Posted April 20, 2020 Posted April 20, 2020 question, where should i add the script? inside npc/custom ? Quote
Sanasol Posted September 13, 2013 Posted September 13, 2013 so add second getitem for this or try this { getrandgroupitem(IG_GiftBox),2; } *getrandgroupitem <group id>,<quantity>; Quote
vivianlimfb Posted October 12, 2013 Posted October 12, 2013 Hello, Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks.. Hmm try this~ Item_db: 644,Gift_Box,Gift Box,2,1000,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc "randombox"; },{},{} Script: function script randombox { setarray .BoxItems[0],983,982,978,976,980,975,981; set .Random, rand( getarraysize( .BoxItems ) ); getitem .BoxItems[ .Random ], 1; end; } Please hit the reputation button if this works. -> i hv try and its work! thnx xinnie! Quote
Question
rakuzas
Hello,
Im going to give item as reward for my server event.. But i want to give random item.. But i notice getitem rand only give 1 of the 2 items.. Have any way to add more item like got 1 from 10 item ? Thanks..
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.