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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 10-31-2013, 09:58 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by Maceblade View Post
This may be an odd request, but I was looking at creating an NPC that hands out a reward to the first 10 hails and then depops forever, however I have no idea how to write it.

The only way I know how to do it is to create 10 seperate npc id's all controlled by triggers, when #1 is hailed it depops and spawns #2 etc and once #10 is hailed he depops forever. The only issue is I have no way to keep one person from doing multiple hails unless I can have it check for the item in inventory first.

I guess I was just looking to see if someone had an easier way to do this.
Something like this should work:

Code:
sub EVENT_SAY{
	if(!defined($qglobals{"TenTimeEvent"})){ $client->SetGlobal("TenTimeEvent", "10", 7, 'F'); }
	my $CountToZero = (10 - $qglobals{"TenTimeEvent"});
	if($text=~/hail/i){ quest::say("The fuck you want?"); $client->Message(15, quest::saylink("Make me a sammich", 1)); }
	if($text=~/sammich/i){ 
		if($qglobals{"TenTimeEvent"} > 0){
			quest::say("WHAT?! Fine... But I will only do it " . $CountToZero . " more time(s)..."); 
			$npc->SetGlobal("TenTimeEvent", ($qglobals{"TenTimeEvent"} - 1) , 7, 'F');
		}else{
			quest::say("Sorry man, I told you I wouldn't make you a sammich anymore...");
		}
	}
}
You need to have qglobals enabled on the npc (Set to 1) and it is set at a global scope, meaning any NPC can grab this qglobal variable if you tried to fetch it.

He sets it once and when the value of the qglobal has been subtracted to 0, he no longer will make a sammich
Reply With Quote
 


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