Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (1)No (0)
Photo

@loadnpc doesn't trigger OnInit of duplicate npcs

Posted by Samuel on 24 April 2014 - 10:50 AM

@loadnpc works well with the main npc having the oninit label, but those duplicates OnInit doesn't trigger..

So for example, I made an npc like this:

prontera,150,150,4 script Kriemhild#20::InsideFlagsPR2 GUILD_FLAG,{
L_Warp:
message strcharinfo(0),"WoE is not Active";
end;

OnRecvCastlePt01:
flagemblem getcastledata("prtg_cas01",1);
end;


OnInit:
defpattern 2,"warp","L_Warp";
activatepset 2;
end;
}

prontera,155,133,4 duplicate(InsideFlagsPR2) Kriemhild#22 GUILD_FLAG

So when I use @unloadnpcfile path of that npc and use @loadnpc after (without errors in console), When I go to the main NPC and say warp, it triggers the Event.. :)

But when I go to the duplicate npc and says warp, nothing happen.

But when I do @reloadscript, both main and duplicate will work triggering the OnInit Label..

Confirmed..
When we do @reloadscript ,
npc->event_doall("OnInit")
is Executed.

While on loadnpc,  npc->parsesrcfile is Executed.
npc->parsesrcfile executes npc->parse_script (Which has function to call OnInit) While duplicate is parsed form npc->parse_duplicate, which does not have an function to call OnInit..

Well, hopefully, it would be fixed.. :) Duplicates should run the OnInit label as well.. :)

I could reproduce this issue but I'm not going to flag it yet because I'm not sure of the expected behavior of OnInit as our documentation isn't clear, so I'll consult the rest of the staff to determine which way it should work.

Thank you for reporting.

pan 
changed severity to: 3 - Medium
changed status to: Fixed