Hercules
                                
                                
                                
                                    Hercules copied to clipboard
                            
                            
                            
                        Allow OnNPCKillEvent to run on monsters with event label
Pull Request Prelude
- [x] I have followed proper Hercules code styling.
 - [x] I have read and understood the contribution guidelines before making this PR.
 - [x] I am aware that this PR will be closed if the above-mentioned criteria are not fulfilled.
 
2 Issues addressed
- https://github.com/rathena/rathena/issues/1949
 - https://github.com/rathena/rathena/issues/1278 http://herc.ws/board/topic/15799-killedrid-variable-dont-work-with-script-command-monster/#comment-87230
 
2 Changes Proposed
1st. yes aleos has a point that OnNPCKillEvent shouldn't trigger with monster has event labels however there are also cases that we want OnNPCKillEvent to trigger both of them together
let's say for example my mission board script or tr0n's quest board members keep on complaining that when they setup a board nearby an instanced npc the board doesn't trigger the kill for them, because those instanced npc already has event label attached
and the reason why I make this configurable so when members change the false into true
they should also change how their script going to work
... just like changing the check_gotocount means you don't have to use *freeloop as often
2nd. currently monster with event labels doesn't save the killedrid variable
suddenly remember this bug, and just add 2 lines in the process
Tested with
prontera,155,185,5	script	ksjdfsdk	1_F_MARIA,{
	monster "this", -1,-1, "OnNPCKillEvent", PORING, 1;
	monster "this", -1,-1, "Event Label", PORING, 1, strnpcinfo(0)+"::Onaaa";
	end;
OnNPCKillEvent:
	dispbottom "OnNPCKillEvent";
	end;
Onaaa:
	dispbottom "Event Label";
	end;
}
Affected Branches
- Master
 
Known Issues and TODO List
none
I too believe this was much needed feature.
since I have some time now, just write something here to explain whats happen this post will be announce on the forum
Removed just read on the forum http://herc.ws/board/topic/15991-onnpckillevent-changes/
conclusion, yeah this is a big change, that's why rathena ... or aleos didn't implement this system back then, at the time I thought he made the right decision he also probably understood if make such change without telling the community can break many scripts
screw the previous post, github markdown just feels entirely different than using IPB forum so I post a full description of this PR on the forum http://herc.ws/board/topic/15991-onnpckillevent-changes/
I want @MishimaHaruna to fully understand what is this change and discuss maybe this patch is better ? before merging this ...
The only thing I'm worried about is that, to my understanding, there isn't an easy way for a script to implement the previous behavior once the configuration flag for this is enabled.
We should perhaps add a new type to getunitdata() to retrieve whether it's a naturally spawning monster, before merging this
Indeed. I think this should be done together with fixing #2692.
ok let me take some time to read that issue from kenpachi 1st
I feel since https://github.com/HerculesWS/Hercules/pull/2821 got merged, can this PR now can be merged too.