PDA

View Full Version : Is EVENT_NPC_SLAY working correctly ?


Theeper
02-08-2008, 09:23 PM
It fires for the NPC that dies, not the NPC that does the killing, but it uses the killer NPC in the message.

By changing line 1761 of attack.cpp from

parse->Event(EVENT_NPC_SLAY, this->GetNPCTypeID(), 0, oos->CastToNPC(), this);
to ..
parse->Event(EVENT_NPC_SLAY, other->GetNPCTypeID(), 0, other->CastToNPC(), this);

.. it will make the event happen on the slayer, not the slayee. I'm just not sure of what the original intent was, maybe I am misunderstanding it.

So_1337
02-09-2008, 06:19 AM
Hrm. I've never seen it occur between two NPCs, so I don't know if it works correctly there. I stuck some of the flavor text onto XTC and Vyzh`Dra the Cursed, though.

sub EVENT_SLAY {
quest::say("Odd, we normally have to drag sacrifices kicking and screaming, but this one all but throws himself at us.");
}

sub EVENT_SLAY {
quest::shout("Tell your gods that I will be coming for them next!");
}

I can confirm that both of those fire off correctly.

So_1337
02-09-2008, 06:31 AM
Er, shoot, you said NPC_SLAY.

Disregard :)

Theeper
02-09-2008, 07:04 AM
What currently happens (1090 build) is that NPC_SLAY runs on the NPC that is killed.

So if you have two NPC's, npc_killer and npc_killed .. and you have a npc_killed.pl script that looks like this ..


sub EVENT_NPC_SLAY {
quest::say("I was killed.");
}


You will see ..

npc_killer says "I was killed".

It should be npc_killed saying that if it were meant to function that way.