View Single Post
  #3  
Old 01-06-2007, 06:21 PM
JrFaust
Sarnak
 
Join Date: Aug 2005
Location: Overthere
Posts: 82
Default

This is what I came up with.
The subroutine HEALING is the only way I got a pause.
For what ever reason nesting quest::selfcast(spellid); and castspell($userid,spellid); in the sub EVENT_TIMER or even in a sub EVENT_SIGNAL it doesn't cast the spell.

Code:
#Test for pausing a selfcast script.
#This can be added to any spawn in any zone.
#This script shows several way we should be able to pause the quest::selfcast();

sub EVENT_SAY {
  if ($text=~ /Hail/i) {
   quest::say("Why hello there, $name!  I can heal you.");
   quest::settimer("healme",5);   #This is a five second pause then the event timer call.
  }
  if ($text=~ /Hurt/i) {
   quest::say("Why hello there, $name!  Stand still for a few seconds this won't hurt much.");
   quest::pause(30);              #This should be a 30 second pause (but there isn't) then a heal.
   quest::say("There sould be a pause then a heal.");      #This is just a statement to see if the script is running.
   quest::selfcast(6110);
  }
  if ($text =~ /Heal/i) {
  	$h = 0;
  	HEALING();
  }
}

sub HEALING {                     #This works to get about a 10 second pause and it appears not to lag the server.
  while ($h <= 30000000) {
    #quest::say("$h");
	  $h ++;
  }
quest::say("Direct sub call to heal.");                     #This is just a statement to see if the script is running.
quest::selfcast(6110);
}

sub EVENT_TIMER {                 #This is the event timer call but the selfcast won't work nested here for what ever reason.
	if ($timername == "healme") {
		quest::say("Timer call to heal.");                       #This is just a statement to see if the script is running.
		quest::stoptimer("healme");
		quest::selfcast(6110);
  }
}
Reply With Quote