[Source] Edit hook: 'target_died'

This section is created for developers and non-developers who think that he/she has a good (and realistic) idea that might contribute to the OpenKore community.

Moderator: Moderators

Message
Author
Spherical
Human
Human
Posts: 29
Joined: 03 Jan 2013, 00:05
Noob?: No

[Source] Edit hook: 'target_died'

#1 Post by Spherical »

I suggest that we edit the following hook call:

Code: Select all

#src\AI\attack.pm line 167
		Plugins::callHook("target_died");
To the following:

Code: Select all

Plugins::callHook("target_died", {ID => $ID});
I understand that the hook Plugins::callHook('attack_end', {ID => $ID}) is also at the end of this function but it is called even if the target isn't dead. So I suggest either editing the attack_end to contain information regarding if the player killed it or not, or editing the target_died hook. (I guess you could call both $monsters_old{$ID}{dead} and $monsters_old{$ID} like it does just before the target_died hook call, but why on earth are there two hooks then?)

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: [Source] Edit hook: 'target_died'

#2 Post by EternalHarvest »

Good idea.

Post Reply