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 04-16-2015, 10:50 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 70
Default

LOL I know, I ran into that as well. However - success at last!! Apparently, there's not a built in delay so you have to write your own. I stumbled across this thread and it's working like a champ.

Code:
sub EVENT_SAY{
	if ($text=~/Hail/i) {
		plugin::Whisper("Hail! Where would you like to go? [Butcherblock] Mountains, The [Feerrott], North [Karana], [Lavastorm] Mountains, [Misty] Thicket, [South Ro], [Steamfont] Mountains, West [Commonlands] or [Toxxulia] Forest?");
	}
	
	elsif ($text=~/Commonlands/i) {
	quest::say("Off to West Commonlands!");
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(21, 1427, 479, -51, 0);
	}
}
sub castdelay{
	$delayOver = (time + @_[0]);
	while (time < $delayOver){}
	1;
}
Order of events is now:
1. /say commonlands to NPC
2. Spell Effect appears on player
3. Player self-invises
4. 5 seconds later player is moved to WC druid ring

Whew. Thanks for the help. I at least learned a lot
Reply With Quote
  #2  
Old 04-17-2015, 12:19 AM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 70
Default

Ok, working, quasi-finished product:

Code:
sub castdelay{
	$delayOver = (time + @_[0]);
	while (time < $delayOver){}
	1;
}

sub EVENT_SPAWN {
	quest::settimer("portershout",90);
}

sub EVENT_TIMER {
	if($timer eq "portershout") {
	quest::shout("Porting to all druid locations! Hail me near tunnel to Qeynos Hills!");
	$random_number = int(rand(100))+30; ## Randomizes porter shout after initial 90 second delay but no less than 30 seconds between shouts
	quest::settimer("portershout", $random_number);
	}
}

sub EVENT_SAY{
	if ($text=~/Hail/i) {
		plugin::Whisper("Hail! Where would you like to go? [Surefall] Glade, [Butcherblock] Mountains, The [Feerrott], North [Karana], [Lavastorm] Mountains, [Misty] Thicket, [South Ro], [Steamfont] Mountains, West [Commonlands] or [Toxxulia] Forest?");
	}
	elsif ($text=~/Commonlands/i) {
	quest::say("Off to West Commonlands!");
	$npc->DoAnim(43); #Cast animation
	$client->SpellEffect(43,10); #Cast spell effect
	castdelay(5); #invoke delay subroutine
	quest::selfcast(34); #selfcast superior camo
	quest::movepc(21, 1427, 479, -51, 0); #move PC to (zoneid, x, y, z, heading)
	}
	elsif ($text=~/Surefall/i) {
	quest::say("Off to Surefall Glade!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(3, -391, -209, 4.75, 0);
	}
	elsif ($text=~/butcherblock/i) {
	quest::say("Off to Butcherblock Mountains!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(68, 1984, -2135, 0);
	}
	elsif ($text=~/feerrott/i) {
	quest::say("Off to The Feerrott!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(47, -1885, 367, 13.57, 0);
	}
	elsif ($text=~/karana/i) {
	quest::say("Off to North Karana!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(13, -1494, -2706, -7.5, 0);
	}
	elsif ($text=~/lavastorm/i) {
	quest::say("Off to Lavastorm Mountains!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(27, 460, 460, -84.88, 0);
	}
	elsif ($text=~/misty/i) {
	quest::say("Off to Misty Thicket!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(33, -1896, -490, 120.34, 0);
	}
	elsif ($text=~/south ro/i) {
	quest::say("Off to South Ro!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(35, 317, -2034, -22.64, 0);
	}
	elsif ($text=~/steamfont/i) {
	quest::say("Off to Steamfont Mountains!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(56, 1668, -1779, -108.07, 0);
	}
	elsif ($text=~/toxxulia/i) {
	quest::say("Off to Toxxulia Forest!");
	$npc->DoAnim(43);
	$client->SpellEffect(43,10);
	castdelay(5);
	quest::selfcast(34);
	quest::movepc(56, -357, 1099, -57.93, 0);
	}
}
Any optimization tips are more than welcome. Functionality-wise I think I'm there.
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:51 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3