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 12-07-2011, 01:46 AM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default Best practice to initialize qglobals?

Here's one way to initialize a qglobal:
Code:
sub EVENT_SPAWN {
	quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50);
}

sub EVENT_ENTER {
	if(!defined $qglobals{some_nice_qglobal}) {
		quest::setglobal("some_nice_qglobal", 0, 5, "F");
	}
}
Does setting a proximity utilize more resources? than say just checking for the qglobal whether the PC initiates with the NPC by saying something or giving an item, like so:
Code:
sub EVENT_SAY {
	if(!defined $qglobals{some_nice_qglobal}) {
		quest::setglobal("some_nice_qglobal", 0, 5, "F");
	}

	# ...other EVENT_SAY code...
}

sub EVENT_ITEM {
	if(!defined $qglobals{some_nice_qglobal}) {
		quest::setglobal("some_nice_qglobal", 0, 5, "F");
	}

	# ...other EVENT_ITEM code...
}

...or is there another better way altogether?

Or does it even matter?
Reply With Quote
  #2  
Old 12-07-2011, 01:09 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

IMO, the latter is probably better for one small reason: proximity updates only happen at certain intervals and only if the client doesn't already occupy space inside the area. If those don't matter to you then there isn't much of a difference.
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:20 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