PDA

View Full Version : Any idea why this wont work?


Sakrateri
09-29-2004, 08:58 PM
sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Greetings. $name. nice day for some orc slaying eh?.");
}
sub EVENT_SLAY {
quest::say("For the defense of Kelethin."); }
}
#END of FILE Zone:gfaydark ID:54093 -- Guard_Fayfear


My EVENT_SAY works but the EVENT_SLAY wont , any ideas?

Thanks , Sak

Oh one more thing , I am wanting this to work when a guard kills an NPC , mabey EVENT_SLAY only works when they kill PCs ?

Muuss
09-29-2004, 09:26 PM
The } are misplaced.

the EVENT_SLAY is included in the EVENT_SAY

corrected :

sub EVENT_SAY {
if($text=~/Hail/i){
quest::say("Greetings. $name. nice day for some orc slaying oh?.");
}
}

sub EVENT_SLAY {
quest::say("For the defense of Kelethin.");
}
#END of FILE Zone:gfaydark ID:54093 -- Guard_Fayfear


You should indent your code, it's easier to read and avoid those lil errors :)

Sakrateri
09-29-2004, 09:50 PM
Thanks , i tried that but same thing, just the hail works, then I tried it with just

sub EVENT_SLAY {
quest::say("For the defense of Kelethin.");}
}


And still nothing, Im thinking that SLAY is not working on here, I am using a 5.7 DR6 server , i dunno

Sakrateri
09-29-2004, 09:58 PM
Ok , I just went on with a level 1 character and attacked the guard , he said what he was suppose to so it seems sub EVENT_SLAY only works when they slay PCs , so does anyone know how to get them to say stuff when they slay an NPC??

Muuss
09-29-2004, 11:14 PM
sub EVENT_SLAY {
quest::say("For the defense of Kelethin.");}
}

has a syntax error, should be
sub EVENT_SLAY {
quest::say("For the defense of Kelethin.");
}

Sakrateri
09-29-2004, 11:20 PM
Yes thats how you had it in your last post and thats how i tried it, It only worked when the guard killed me , this is copy right from my .pl

sub EVENT_SLAY {
quest::say("For the defense of Kelethin.");
}

Its not working still when killing NPCs , only PCs

Liscadipesce
09-29-2004, 11:41 PM
Hmm, I checked out the tutorial and I don't think their is a clear sub event for an NPC killing an NPC. Since Slay is only when an NPC kills a PC and Death is when he is killed, no other options.

You could probably make a quest file for each mob, and when it is killed, if mobid == the NPC ID of the guards, it would emote the guard saying something, it might be a bit tedious to apply all of them though.

The best next thing though, without getting too technical, you could make the NPC say "For the Defense of Kelethin!" when being attacked. :/

Muuss
09-30-2004, 12:06 AM
This confirms what Liscadipesce wrote, row 1029 of attack.cpp, 5.6dr6, the only part of the code where EVENT_SPLAY is spawned, IE when a PC dies.


if (other->IsNPC())
parse->Event(6, other->GetNPCTypeID(), 0, other,this->CastToMob());



edit : Forget the modification i proposed

Sakrateri
09-30-2004, 01:02 AM
Ahhh, Ok thanks alot guys , clears that up .