Jump to content
  • 0

item drop.. is this possible...


Question

Posted

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?

3 answers to this question

Recommended Posts

Posted (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 by shadowseph
Posted (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 by MojoMojo
Posted

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;

}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...