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 05-21-2014, 09:17 PM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default qglobal

Hi,

Trying to set a qglobal to characters on a signal.

This is what I'm using so far, but the global is setting for the mob it's on, not for the character. i.e. in the charid it's showing up the "-npcid" instead of a character id.

I'm thinking I need to draw on clients in the zone, and then set that global onto those characters currently in the zone.

Someone able to point me in the direction of an example or help me out?

Thinking something like $clientlist or something like that. I want to draw on all the players currently in the zone and assign the qglobal to all of them though, not just one.

Thanks in advance for any help!

Code:
sub EVENT_SIGNAL {
	if ($signal == 1) { ###Egg Death
		$eggdeath += 1;
		if ($eggdeath == 16) {
			quest::setglobal("EmpoweredAseisa",1,1,"H12");
			}
		}
	}
Reply With Quote
  #2  
Old 05-21-2014, 10:04 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Try here, this should help you out.
Reply With Quote
  #3  
Old 05-22-2014, 04:01 AM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Read that, still can't seem to get what I'm trying to do to work.

Trying to use qglobals to determine whether or not someone has killed a boss. If they have and they enter that instance I want there to be a warning that they entered and a 2 minute window before they either leave or the bosses they have killed are despawned.

I've got the bosses setting the qglobal perfectly using this:

Code:
sub EVENT_DEATH_COMPLETE {
	$entity_list->SignalAllClients(2)
	}
Then, in my player.pl(to get the qglobal set for all the players currently in the zone):

Code:
sub EVENT_SIGNAL {
	if ($signal == 2) {
		quest::setglobal("AncientGlaucoideIsDead",1,1,"H12");
		}
	}
Then, in my player.pl I'm using this to identify that qglobal upon zone in of any client:

Code:
sub EVENT_ENTERZONE {
if (defined $qglobals{"AncientGlaucoideIsDead"}){
		quest::ze(15, "$name has recently defeated the Ancient Glaucoide. If $name does not leave the zone within 2 minutes the event will despawn.");
		quest::signalwith(4770000,3,0);
		quest::signalwith(4770001,3,0);
		}
	}
Lastly, those two npcs(the two mobs who start the event that has been killed), defined by "AncientGlaucoideIsDead". These two npcs have an almost identical .pl, the only difference being the quest::ze messages in the one below aren't in the other(don't want double the message):

Code:
sub EVENT_SIGNAL {
if ($signal == 3) {
		quest::settimer(1,60);
		}
	}

sub EVENT_TIMER {
	if ($timer == 1) {
		if(!defined $qglobals{"AncientGlaucoideIsDead"}){
			quest::stoptimer(1);
			quest::depop_withtimer();
			quest::ze(15, "The player(s) did not leave and the Ancient Glaucoide event has despawned.");
			}
			else {
			quest::stoptimer(1);
			quest::ze(15, "The player(s) have left within two minutes. The event has not despawned.");
			}
		}
	}
My issue is on the timer. I have the two NPCs qglobal set to 1 in the database. I'm assuming that the string:

Code:
if(!defined $qglobals{"AncientGlaucoideIsDead"}){
Is simply checking to see if that qglobal is defined anywhere in the database. How would I call upon seeing if a client within that zone has that qglobal defined? I'm 90% sure this is where I'm currently hung up. If I didn't want there to be a timer for the person with the 'lockout' to leave I could simply have the signal despawn the 2 mobs upon someone zoning in with the defined qglobal and it would work right now.
Reply With Quote
  #4  
Old 05-22-2014, 05:56 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Why not just boot the player from the zone if they zone in with the global? :p

Signaling the boss to despawn seems really easy to grief other players...

Kill boss.. then keep zoning in so no one else can kill it
Reply With Quote
  #5  
Old 05-22-2014, 07:17 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Writing quest::setglobal(quest global name, value, type of quest global, how long the quest global lasts);
Try quest::setglobal("Blah", 1, 5, "H12"); It sets it on the current player in all zones and in all NPCs for 12 hours., so that all NPCs can read it and it can be read in all zones, as you can see, 1 only does ALL NPCs, current player, current zone for 12 hours.
Reply With Quote
  #6  
Old 05-22-2014, 03:30 PM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

I tried 5, didn't work.

Will try again.

Natedog,

It will be an instance. So,i idea of giving people 2 minutes is so that if the people leave they don't have to reget the instance to get the boss up again.

Edit: Sort of misread your question Natedog:

Also, gives people who may of only killed one boss in their instance the ability to pair up with others from another instance, or if their group falls apart etc.
Reply With Quote
  #7  
Old 05-22-2014, 03:55 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

I didn't say that setting the global to 5 would fix your issue, you'd need to re-write what you wrote as Natedog said.
Reply With Quote
  #8  
Old 05-22-2014, 03:59 PM
Esildor
Hill Giant
 
Join Date: Feb 2010
Posts: 207
Default

Don't see him saying that, but, okay.

Question I was asking was does anyone have an example of *how* to call on that qglobal for clients within the zone. Since I assume my issue is on this line checking to see if it's defined AT ALL vs. for an npc within the zone at that time.

Code:
if(!defined $qglobals{"AncientGlaucoideIsDead"}){
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 08:20 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3