Jump to content
  • 0

Gift Box Give Random Item?


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

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..

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

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 by xienne15
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  258
  • Topics Per Day:  0.06
  • Content Count:  710
  • Reputation:   16
  • Joined:  01/07/12
  • Last Seen:  

question, where should i add the script? inside npc/custom ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

so add second getitem for this

 

or try this

 

{ getrandgroupitem(IG_GiftBox),2; }
*getrandgroupitem <group id>,<quantity>;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  09/28/13
  • Last Seen:  

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...