Search the Commands

Home  All  a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  y  z 

Details for command donpcevent:
 
* donpcevent "NpcName::OnEventlabel";
 
This command is kinda confusing cause it performs in two completely different
ways.

If the event label is phrased like "::<label name>", all NPC objects that have a
specified label in them will be invoked as if by a 'doevent', but no RID
whatsoever will be attached while they execute.

Otherwise, if the label is given as "<NPC name>::<label name>", a label within
the NPC object that runs this command will be called, but as if it was running
inside another, specified NPC object. No RID will be attached to it in this case
either.

This can be used for making another NPC react to an action that you have done
with the NPC that has this command in it, i.e. show an emotion, or say
something.

place,100,100,1%TAB%script%TAB%NPC%TAB%53,{
mes "Hey NPC2 copy what I do";
close2;
set @emo, rand(1,30);
donpcevent "NPC2::OnEmo";
OnEmo:
emotion @emo;
end;
}

place,102,100,1%TAB%script%TAB%NPC2%TAB%53,{
mes "Hey NPC copy what I do";
close2;
set @emo, rand(1,30);
donpcevent "NPC::OnEmo";
OnEmo:
emotion @emo;
end;
}

This will make both NPC perform the same random emotion from 1 to 30, and the
emotion will appear above each of their heads.

Valid XHTML 1.0 Strict Valid CSS!