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
  #10  
Old 10-31-2013, 10:44 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by Maceblade View Post
H you were correct, only issue im having is that 1 person can bang out all 10 hails.
Mace, I came up with a quick example for you - the count part was a simple mistake because I was thinking of something different before I got to the below section (quickly) but simply illustrating what you can do.

To limit 1 per person, you have to add additional checking. In this case I would create a character scoped (Type 5) qglobal to keep folks from being able to hail more than once from their character:

Code:
sub EVENT_SAY{
	if(!defined($qglobals{"TenTimeEvent"})){ $client->SetGlobal("TenTimeEvent", "10", 7, 'F'); }
	my $CountToZero = ($qglobals{"TenTimeEvent"} - 1);
	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{"TenTimeEventChar"} == 1){
			quest::say("You already got your reward!");
		}
		elsif($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');
			$client->SetGlobal("TenTimeEventChar", 1 , 5, 'F');
		}else{
			quest::say("Sorry man, I told you I wouldn't make you a sammich anymore...");
		}
	}
}
I really suggest you read up on qglobals - they can be used often.
Reply With Quote
 

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:01 PM.


 

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