|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
10-05-2015, 01:10 PM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
Tally count w 2 zone pop-up?
I'm looking to create a script that keeps tally of 2 races. Gnolls and orcs. I want it to pop-up a count of gnoll/orc deaths every time one is killed and broadcast either globally or in 2 specified zones. I'm not gonna be picky, so if it is a combined script that works to. Also was hoping their was a way to keep track of player records as far as who killed the most gnolls/orcs. Any help or direction would be appreciated.
|
10-07-2015, 10:16 AM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
This is what Ive got so far, however the $counts do not show in the emote...
Code:
sub EVENT_DEATH_COMPLETE{
if(!defined($qglobals{"orcslay1"})){ $client->SetGlobal("orcslay1", "0", 7, 'F'); }
my $CountOrcs = $qglobals{"orcslay1"};
quest::ze(15, "Dead orcs = " . $CountOrcs . "Dead Gnolls =" . $CountGnolls . "...");
$client->SetGlobal("orcslay1", ($qglobals{"orcslay1"} + 1) , 7, 'F');}
Changed it bc it kept setting the orcslay1 global to 0...
Code:
sub EVENT_DEATH_COMPLETE{
my $CountOrcs = $qglobals{"orcslay1"};
$client->SetGlobal("orcslay1", ($qglobals{"orcslay1"} + 1) , 7, 'F');
quest::ze(15, "Dead orcs = " . $CountOrcs . "Dead Gnolls =" . $CountGnolls . "...");}
However, the count will not exceed 1, and the ze will not give the quantity...
|
10-07-2015, 10:37 AM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
Nevermind I just realized I never turned on the mobs Qglobals so of course the count would not exceed 1. Also the counter started working after I did that. Im curious as to if I put this in the player.pl and set a range of npc ID's if this would work for every orc death, and does anyone know of an easy way to do that rather than add 200 id's individually?
|
10-07-2015, 11:04 AM
|
|
Dragon
|
|
Join Date: Nov 2008
Location: GA
Posts: 906
|
|
Why not just add a small script to the orc/gnoll death that increments the counter?
|
10-07-2015, 11:29 AM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
It does increment the counter with every death. I was hoping there was an easy way within the player.pl to do a sub EVENT_DEATH_COMPLETE if death is between npc id 58000 and 58100 then add 1 global. This would be the zones player pl and not the global one. Would be kinda neat to add a "-" hit to any death that is NOT an NPC death, just to keep it more competitive
|
10-07-2015, 11:42 AM
|
|
Dragon
|
|
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
|
|
Code:
sub EVENT_KILLED_MERIT
|
10-07-2015, 11:44 AM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
Yeah, there's probably a global event you could use that provides the npc that was killed. Then you could just: (pseudo-code, not actual Perl)
Code:
if ($npc->GetRace() == 458) {
orc_global++;
}
elif ($npc->GetRace() == 524) {
gnoll_global++;
}
Those are the race numbers for the new DoD+ orcs and gnolls. Could put in checks for the old ones if you use 'em instead, or for any other race, I would think.
Not sure which event would work best, though, that would provide the $npc and $client that killed 'em. Maybe someone else can chime in.
|
10-07-2015, 11:56 AM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
right now I have it tied to an orc centurion (58000.pl) and the script is functional and working as intended, but rather than have 100 different PL's for all the npc id's id like to know if there was a way to make it easier... one script that accounts for all the orcs in thus said zone, crushbone.
I do like the one you posted Shen that would work awesomely in a mixed race zone or in the global PL to account for all orcs not just specified zones..
Ghanja I wouldn't know how to incorporate what you posted into a script and have it be functional... im still a newb when it comes to this stuff.
|
10-07-2015, 12:09 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
If you want to separate out tallies by zone, you just use a different setting in the qglobal. You could still have the tally logic in one single global place.
Could even tally separately by other things, like whether the npc's name starts with # to indicate a named or something.
|
10-07-2015, 12:14 PM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
Yea that tally system is currently working in both zones, im just trying to figure out how to simplify this down to one script per zone. For instance, I don't want to have a 58001.pl, 58002.pl 58003.pl etc etc for every single mob in the zone... im wondering if there is a better place or better way to handle this... I tried adding it in the player.pl I created for the zone, all I need now is the proper coding. so that when a orc dies the counter goes up, when a player dies counter goes against it.... ill post what I have in a second.
|
10-07-2015, 12:28 PM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
Code:
sub EVENT_DEATH_COMPLETE{
my $CountOrcs = $qglobals{"orcslay1"};
my $CountGnolls = $qglobals{"gnollslay1"};
if ($npc->GetRace() == 54) {
$client->SetGlobal("orcslay1", ($qglobals{"orcslay1"}+1) , 7, 'F');
quest::ze(14, "Dead orcs = " . $CountOrcs . " Dead Gnolls =" . $CountGnolls . " ...");}
elsif ($npc->GetRace() == 17) {
$client->SetGlobal("gnollslay1", ($qglobals{"gnollslay1"}+1) , 7, 'F');
quest::ze(14, "Dead orcs = " . $CountOrcs . " Dead Gnolls =" . $CountGnolls . " ...");}
}
This is in my player.pl, and it does not work lol. im not sure what im doing wrong.
|
10-07-2015, 12:29 PM
|
Developer
|
|
Join Date: Mar 2009
Location: -
Posts: 228
|
|
If you want it triggering off NPC's in the zone.
Run it off the default.pl
That runs the code on every NPC in zone that doesn't have a specific .pl file
You don't need to set the global to a client, just use a type 7 global on the NPC that will save it across all zones and can be accessed by anything.
|
10-07-2015, 12:37 PM
|
Hill Giant
|
|
Join Date: Jun 2010
Posts: 231
|
|
I saved it to "default.pl" and threw all the other scripts for the zone into a folder. It will not work now. Do you have an example of how to set a global w.o assigning it to a client by any chance?
|
10-07-2015, 12:39 PM
|
Dragon
|
|
Join Date: Apr 2009
Location: California
Posts: 814
|
|
default.pl has to be in EQEmuServer\quests. Setting the qglobal type to 7 (as you have it) and to 3 both set it for all clients and not just the one that triggered the event.
Check out that wiki page on qglobals and this one on quests in general:
http://wiki.eqemulator.org/p?Ultimate_Perl_Reference
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:08 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|