PDA

View Full Version : qglobal


Esildor
05-21-2014, 09:17 PM
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!


sub EVENT_SIGNAL {
if ($signal == 1) { ###Egg Death
$eggdeath += 1;
if ($eggdeath == 16) {
quest::setglobal("EmpoweredAseisa",1,1,"H12");
}
}
}

Kingly_Krab
05-21-2014, 10:04 PM
Try here (http://wiki.eqemulator.org/p?How_To_Use_Quest_Globals), this should help you out.

Esildor
05-22-2014, 04:01 AM
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:


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):


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:


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):


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:


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.

NatedogEZ
05-22-2014, 05:56 AM
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 :)

Kingly_Krab
05-22-2014, 07:17 AM
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.
http://i.imgur.com/Nsqmq84.png

Esildor
05-22-2014, 03:30 PM
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.

Kingly_Krab
05-22-2014, 03:55 PM
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.

Esildor
05-22-2014, 03:59 PM
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.


if(!defined $qglobals{"AncientGlaucoideIsDead"}){