Hercules icon indicating copy to clipboard operation
Hercules copied to clipboard

Allow OnNPCKillEvent to run on monsters with event label

Open AnnieRuru opened this issue 7 years ago • 8 comments

Pull Request Prelude

2 Issues addressed

  1. https://github.com/rathena/rathena/issues/1949
  2. 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

AnnieRuru avatar Jun 04 '18 21:06 AnnieRuru

This change is Reviewable

HerculesWSAPI avatar Jun 04 '18 21:06 HerculesWSAPI

I too believe this was much needed feature.

dastgirp avatar Jun 06 '18 08:06 dastgirp

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

AnnieRuru avatar Jun 07 '18 16:06 AnnieRuru

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 ...

AnnieRuru avatar Jun 08 '18 07:06 AnnieRuru

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

MishimaHaruna avatar Jun 27 '20 22:06 MishimaHaruna

Indeed. I think this should be done together with fixing #2692.

Kenpachi2k13 avatar Jun 27 '20 22:06 Kenpachi2k13

ok let me take some time to read that issue from kenpachi 1st

AnnieRuru avatar Sep 19 '20 05:09 AnnieRuru

I feel since https://github.com/HerculesWS/Hercules/pull/2821 got merged, can this PR now can be merged too.

MrKeiKun avatar Jan 28 '21 14:01 MrKeiKun