Like this?
prontera,150,150,5 script Monster Spawner 100,{
monster "prontera",151,151,"Poringz0rd",2341,1,"Monster Spawner::OnDeath";
monster "prontera",151,150,"Drops",1113,1;
monster "prontera",151,149,"Poporing",1031,1;
sleep 1000;
npctalk "I will now kill the Poringz0rd!";
sleep 1000;
killmonster "prontera","Monster Spawner::OnDeath",1;
end;
OnDeath:
npctalk "Fear not! The Poringz0rd has been slain!";
}
This is the only way I know of currently... So you have to spawn the monster with a specific event label and target it through that method.
Until the mobsearch and new getmapxy commands are implemented.
Edit--
I thought of a few more that I used previously.
Using bg_monster and .@gid with unitkill I'm not sure if it triggers the death event still though.
prontera,150,150,5 script Monster Spawner 100,{
set .@gid, bg_monster(.@foo,"prontera",151,151,"Poringz0rd",1002,"Monster Spawner::OnDeath");
monster "prontera",151,150,"Drops",1113,1;
monster "prontera",151,149,"Poporing",1031,1;
sleep 1000;
npctalk "I will now kill the Poringz0rd!";
sleep 1000;
unitkill .@gid;
end;
OnDeath:
npctalk "Fear not! The Poringz0rd has been slain!";
}
Another way with bg_monster.
prontera,150,150,5 script Monster Spawner 100,{
set .@gid, bg_monster(.@foo,"prontera",0,0,"bar",1002,"Monster Spawner::OnDeath");
mercenary_create 6017,999; .@gid++;
killmonster "prontera","Monster Spawner::OnDeath";
sleep 1000;
npctalk "I will now kill you helping hand!";
sleep 1000;
unitkill .@gid;
npctalk "The Mercenary has been slain!";
end;
}
In this example I summoned a fake monster with bg_monster off screen to get the gameid for our next summoned creature... This can be used to return the gameid of anything we cannot normally. If using in the right way even players.