Jump to content
  • 0

Random item drop from item list


Question

Posted

Lets say there is itemId array itemId[4]=[324,23,4234,51,54];

How to make rb drop only one item from item array?

Maybe in doDie() function add "this.drop(...,get random id,...)"?

Or there is other way?

 

 

 

 

2 answers to this question

Recommended Posts

  • 0
Posted

You ask 2 questions in one, but both questions can be answered by following :

 

You got 2 choices : make a script or make a droplist infos for that mob.

 

Via script (and guessing you use Frozen, it's old L2JIL python engine) you must do as you said :

- registering the npcId via addKillId

- create the array

- choose a random index of that array using Rnd => itemId[Rnd.get(itemId.size())]

 

Via droplist, well all is made by SQL.

  • 0
Posted

You ask 2 questions in one, but both questions can be answered by following :

 

You got 2 choices : make a script or make a droplist infos for that mob.

 

Via script (and guessing you use Frozen, it's old L2JIL python engine) you must do as you said :

- registering the npcId via addKillId

- create the array

- choose a random index of that array using Rnd => itemId[Rnd.get(itemId.size())]

 

Via droplist, well all is made by SQL.

 

ok thanks dude

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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