Thread: qglobal
View Single Post
  #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