Jump to content
  • 0

Monster drop


leertaste

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Is it possible to let every monster drop the same item (for example: with the chance of 0,5%) without entering this in the mob_db.txt for every single mob?

EDIT: Oh my gaaawd!

I posted in wrong section.. please move it!

Edited by leertaste
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


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

OnNPCKillEvent:
if( rand(10000) < 50 )
   getitem 512,1;
end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Can you post a full function and explain what is doing what please? :)

Link to comment
Share on other sites


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

Is it possible to let every monster drop the same item (for example: with the chance of 0,5%) without entering this in the mob_db.txt for every single mob?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

OnNPCKillEvent:
if( rand(10000) < 50 )
getitem 512,1;
end;

So what is the 10000 for?

and how is the dropchance defined? 50 = 0,5%?

why do i never get the entered item?

function    script    Samedrop    {
OnNPCKillEvent:
if( rand(10000) < 50 )
   getitem 512,1;
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

OnNPCKillEvent:

every time a player killing a monster without event label

if ( rand(1000) < 5 )

in every 5/1000 *100% chance

getitem 512,1;

get an apple

the full script should be

-    script    test    -1,{
OnNPCKillEvent:
   if ( rand(1000) < 5 )
       getitem 512, 1;
   end;
}

OnNPCKillEvent shouldn't be put inside the function

read wiki more

http://rathena.org/wiki/Scripting

https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/doc/script_commands.txt

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  137
  • Reputation:   1
  • Joined:  02/02/13
  • Last Seen:  

Oh.. i felt so stupid xD
it was kinda late!
ty to this point.. :)

 

next question i have.. 20003 is dropped with the chance of 1% now:

OnNPCKillEvent:
	if ( rand(100) < 1 )
		getitem 20003, 1;

do this stack with this itemscript:

bonus2 bAddMonsterDropItem,20003,1;

it should be the chance from onnpckillevent = 1% + baddmonsterdropitem = 1%, correct?

Edited by leertaste
Link to comment
Share on other sites


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

it dont stack....both are "different"....both run separately....

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