Jump to content
  • 0

Random Dropping


NexusXVI

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

I don't know if this script already exist.., if it does can someone link it to me..


The idea is to make a monster drop random list of items with only 1 quantity..

Ex. Killing poring will make it drop either topaz,gold or diamond.. with only 1 quantity and on a % chance too on each and every item :D

Edited by NexusXVI
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  


- script RandomDrop -1,{

OnNPCKillEvent:

if(killedrid == 1002) { // Remove so it would apply to all monsters

if(rand(10) < 5) { // 50% chance to Drop

getmapxy(.@DMap$,.@Dx,.@Dy,0);

makeitem .DropList[rand(getarraysize(.DropList))],1,.@DMap$,.@Dx,.@Dy;

}

}

end;

OnInit:

setarray .DropList[0],607,608,609; // Edit to desired Item ID to be dropped

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


- script Sample -1,{

OnNPCKillEvent:

.@i = rand( getarraysize( .i ) );

getmapxy( .@map$, .@x, .@y, 0 );

if ( rand( 100 ) < .@i )

makeitem .i[ .@i ], 1, .@map$, .@x, .@y;

end;

OnInit:

setarray .i[0],607,608,609; // item to drop

setarray .c[0],5,3,2; // chance

}

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