Critica Posted May 10, 2012 Group: Members Topic Count: 82 Topics Per Day: 0.02 Content Count: 223 Reputation: 4 Joined: 02/23/12 Last Seen: March 28, 2018 Share Posted May 10, 2012 hey guys, is there a way that i can make an item be dropped by all monsters without editing it on mob db?? is it possible on a script? making an item be dropped by any monsters killed by a % chance? Quote Link to comment Share on other sites More sharing options...
Ryuuzaki Posted May 10, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 87 Reputation: 13 Joined: 02/15/12 Last Seen: September 11, 2024 Share Posted May 10, 2012 (edited) Quote from the pccommand_list.txt inside the rathena doc folder: + PCCommand: OnOnNPCKillEvent + Code by: lordalfa + How it works: When a player kills a monster, the NPC will run as if he just clicked it. Which means if the script is like this: + Sample: - script OnNPCKillEvent -1,{ mes "Holy shit"; close; } + Explaination: whenever a player kills a monster on the map, the words "Holy Shit" will appear on the guy's face. + Note: 1) This script runs everytime a player kills a monster It is adviced if you want to repeatedly use this script, to use a sort of filter. 2) The var "KilledRid" is set on the killer, this can be used in strmobinfo to find out info about the Monster that was killed Create a switch argument which will define a random number between 1 and 10 switch(rand(10)){ case 1: getitem xx, amount; end; default: end; } This will cause the script to check if number is 1, if yes it will give you an item, if no it will cancel the script. Here the two possibilities: 1. -%tab%script%tab%OnNPCKillEvent%tab%-1,{ switch(rand(10)){ case 1: getitem xx, amount; end; default: end; } end; } 2. -%tab%script%tab%INSERTNPCNAMEHERE%tab%-1,{ end; OnNPCKillEvent: switch(rand(10)){ case 1: getitem xx, amount; end; default: end; } end; } For the second function you need to do this (change the value to 1) ---> PC Command List ------> Here's a list of scripts that can be triggered by PC actions and what they do. ------> Configuration is found at conf/script_athena.conf ------> There are two methods to define the script to be use (event_script_type) ------> 0 - By NPC. There has to be an NPC named in the same manner as the event ------> 1 - By Label. Every label from every NPC with the event name will be executed (note that in this case the event HAS to start with the word 'On', eg: 'OnPCBaseLvUpEvent:') Hope this gives you an idea : ) Additional informations: 1 out of 10 is a 10% chance, 1 out of 100 is a 1% chance and so on. Edited May 10, 2012 by shadowseph Quote Link to comment Share on other sites More sharing options...
MojoMojo Posted May 10, 2012 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 114 Reputation: 1 Joined: 03/07/12 Last Seen: January 17, 2015 Share Posted May 10, 2012 (edited) Yeah its possible. I will search for this script and will post here. @EDIT I found it, OnNPCKillEvent: set .@lucky,rand(100); if (.@lucky <= 10 ){ getitem <item id>,<amount>{,<character id>}; } In this script, the chance to obtain the item is 10% ( (if (.@lucky <= 10 ) ). To modificate the chance, just change the number inner the IF condition. (In this case, the number 10) OBS¹: The character id is optional, i just write it to give you an option. OBS²: Don't put the '<' and '>'. Edited May 10, 2012 by MojoMojo Quote Link to comment Share on other sites More sharing options...
Critica Posted May 10, 2012 Group: Members Topic Count: 82 Topics Per Day: 0.02 Content Count: 223 Reputation: 4 Joined: 02/23/12 Last Seen: March 28, 2018 Author Share Posted May 10, 2012 thank you so much for the help im gona test it now! Sirs.. i already tried this two.. but it doesnt seem to work.. im summoning 60 porings and non of it drops tcg.. im i doing something wrong?? OnNPCKillEvent: set .@lucky,rand(100); if (.@lucky <= 10 ){ getitem 7227,1; } //---------------------------- - script OnNPCKillEvent -1,{ switch(rand(10)){ case 1: getitem 7227, 1; end; default: end; } end; } Quote Link to comment Share on other sites More sharing options...
Question
Critica
hey guys, is there a way that i can make an item be dropped by all monsters without editing it on mob db??
is it possible on a script? making an item be dropped by any monsters killed by a % chance?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.