View Single Post
  #12  
Old 09-14-2008, 09:42 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Ok, I see. You could add a variable that doesn't allow him to continuously react to signals. And with your stoptimers, you should stop them as soon as the trigger hits. Take a look at this example:

Code:
my $started;

sub EVENT_SPAWN {
  $started = 0;
}

sub EVENT_SIGNAL {
  if ($started == 0) {
    $started = 1;
    quest::setsky(0);
    quest::selfcast(3430);
    quest::settimer("kneel",3);
  }
}

sub EVENT_TIMER	{
  if($timer eq "kneel") {
    quest::stoptimer("kneel");
    $npc->SetAppearance(4);
    quest::shout("Ah, there you are!");
    quest::settimer("shout",3);
  }
  if($timer eq "shout") {
    quest::stoptimer("shout");
    $npc->SetAppearance(0);
    quest::shout2("My servants, hear me and rejoice! For my power and cruelty have returned to me. I now reign supreme. Join me, my minions, and together we shall destroy our enemies!");
    quest::settimer("depop",3);
  }
  if($timer eq "depop") {
    quest::stoptimer("depop");
    quest::setsky(1);
    quest::delglobal("king");
    quest::emote("fades into shadow");
    quest::depop();
  }
}
Reply With Quote