[Plugin] onMonsterKill

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
Henrybk
Developers
Developers
Posts: 11
Joined: 15 Mar 2011, 22:50
Noob?: No

[Plugin] onMonsterKill

#1 Post by Henrybk »

Hi guys, i made a plugin that adds a now block to the config called onMonsterKill, it activates and uses the set command when the conditions are met, it is verified everytime a monster is killed, and its stats are used for verification. It also accepts any Self condition like lvl, zeny etc.

The monsters condition are:

Code: Select all

moblv
numAtkFromYou
dmgFromYou
nameID
name_given
name
quant_Killed
exemple of config:

Code: Select all

onMonsterKill c I killed a Marin and I'm rich {
moblv
numAtkFromYou
dmgFromYou
nameID 1242
name_given
name
quant_Killed
zeny > 5000
}

onMonsterKill c I killed a Marin and I'm poor {
moblv
numAtkFromYou
dmgFromYou
nameID 1242
name_given
name zeny < 5000
}
code: PasteBin


A source configuration also is needed for this to work:

On AI::Attack::finishAttacking:

Change this:

Code: Select all

Plugins::callHook("target_died");
For this:

Code: Select all

Plugins::callHook("target_died", {monster => $monsters_old{$ID}});
Note: The quant_Killed condition is not actually how many times the monster must be killed for the command to trigger, it is how many times the whole block must be true for it to activate.