Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2007, 11:36 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default Caster delay, I need help!

Can someone post an example of how to make a delay before quest::selfcast with quest::settimer or something else?
I've been stuck with this all day and nothing works for me :(
Reply With Quote
  #2  
Old 01-06-2007, 04:11 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

I did a search through the PLs for settimer, which I am sure you looked through as well. Below is the Dark Elf Corruptor script, showing his spawning as setting a 600 second countdown to despawn. Once the 600 seconds expires, EVENT_TIMER pops and removes the timer and the NPC.

Code:
# dark elf corruptor shouts before attacking
#

sub EVENT_SPAWN {
  quest::shout("We come for you, fools. Your reign of weakness over the powers of the land comes to an end now!");
  quest::settimer("despawn",600);
}

sub EVENT_TIMER {
  quest::stoptimer("despawn");
  quest::depop();
}

sub EVENT_DEATH {
  quest::stoptimer("despawn");
}

# EOF zone: eastkarana ID: 15153 NPC: Dark_Elf_Corruptor
Can you set the settimer("castdelay",10) and then use the EVENT_TIMER to kill the timer, then cast the spell?

stoptimer("castdelay")
castspell($userid,spellid)
Reply With Quote
  #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
  #4  
Old 01-07-2007, 05:24 AM
Cripp's Avatar
Cripp
Discordant
 
Join Date: Oct 2003
Location: The Shire
Posts: 474
Default

try theeees
Code:
sub EVENT_SAY
{
	if ($text=~/Hail/i)
	{
		quest::say("Hail, $name");
	}
	if ($text=~/timeheal/i)
	{
		quest::settimer("theal1",15);
		quest::say("poop init heal");
	}
}

sub EVENT_TIMER
{
	if ($timer eq "theal1")
	{
		quest::stoptimer("theal1");
		$npc->CastSpell(6110,$client->CharacterID());
		quest::say("healing you weee");
	}
}
untested.. should work if not than just change the $client-> part probably....
__________________
Nug Blazers - ServerOP / founder
^^comming... later!

www.nugblazers.com
Reply With Quote
  #5  
Old 01-07-2007, 05:39 AM
JrFaust
Sarnak
 
Join Date: Aug 2005
Location: Overthere
Posts: 82
Default

I got that to work with a change. Thanks Cripp!

What does -> do or what is it?

Code:
sub EVENT_SAY
{
	if ($text=~/Hail/i)
	{
		quest::say("Hail, $name");
	}
	if ($text=~/timeheal/i)
	{
		quest::settimer("theal1",15);
		quest::say("poop init heal");
	}
}

sub EVENT_TIMER
{
	if ($timer eq "theal1")
	{
		quest::stoptimer("theal1");
		$npc->CastSpell(6110,$userid);
		quest::say("healing you weee");
	}
}

Last edited by JrFaust; 01-07-2007 at 02:32 PM..
Reply With Quote
  #6  
Old 01-07-2007, 09:08 AM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

Thanks for the help you all, it's working fine for me now
Reply With Quote
  #7  
Old 04-16-2015, 09:28 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

Please remove this post. I was replying to another and didn't realize which tab I was in.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:21 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3