Jump to content
  • 0

Help..


Critica

Question


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

Sorry this is a repost, i couldnt find my old topic..

how can i make this more than 1 item again, and more than 1 (% chance)

for ex.

item 1,2,3,4,5 (1% chance)

item 6,7,8,9 (3% chance)

- script OnNPCKillEvent -1,{ 
end;

OnNPCKillEvent:

switch(rand(3)){
case 1:
getitem 7227, 1;
end;
default:
end;
}
end;
}

thanks you

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

- script OnNPCKillEvent -1,{
end;

OnNPCKillEvent:

switch(rand(100)){
case 1:
getitem 7227, 1;
getitem ID, 1;
getitem ID, 1;
getitem ID, 1;
getitem ID, 1;
end;
default:
end;
}
end;
}

Edited by frenzmu06
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

it is better to do it in this way

http://upaste.me/c3c4494a804a6b2

@frenzmu06

ur script give all items with the rate of 1% only. because you are using the switch-case...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  326
  • Reputation:   47
  • Joined:  04/01/12
  • Last Seen:  

@Emistry yes all with 1%, i thought he just say 3% as example and he want 1% for all

Edited by frenzmu06
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  130
  • Reputation:   43
  • Joined:  12/11/11
  • Last Seen:  

@Emistry: The chances are actually 1%, 2% and 7% for your code. The else if makes sure that lower numbers are already counted for.

For 1%, 3% and 10%, you should set them to "< 1", "< 4" and "< 14".

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  82
  • Topics Per Day:  0.02
  • Content Count:  223
  • Reputation:   4
  • Joined:  02/23/12
  • Last Seen:  

thank you guys!

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