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 10-05-2015, 01:10 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default 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.
Reply With Quote
  #2  
Old 10-07-2015, 10:16 AM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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...
Reply With Quote
  #3  
Old 10-07-2015, 10:37 AM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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?
Reply With Quote
  #4  
Old 10-07-2015, 11:04 AM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 905
Default

Why not just add a small script to the orc/gnoll death that increments the counter?
__________________
Clumsy's World: Resurgence
Clumsy's World [2006-2012]
Reply With Quote
  #5  
Old 10-07-2015, 11:29 AM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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
Reply With Quote
  #6  
Old 10-07-2015, 11:42 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
sub EVENT_KILLED_MERIT
Code:
$killed
Reply With Quote
  #7  
Old 10-07-2015, 11:44 AM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

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.
Reply With Quote
  #8  
Old 10-07-2015, 11:56 AM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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.
Reply With Quote
  #9  
Old 10-07-2015, 12:09 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

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.
Reply With Quote
  #10  
Old 10-07-2015, 12:14 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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.
Reply With Quote
  #11  
Old 10-07-2015, 12:28 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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.
Reply With Quote
  #12  
Old 10-07-2015, 12:29 PM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

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.
Reply With Quote
  #13  
Old 10-07-2015, 12:33 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

And if you change the qglobal's type to 3 instead of 7, it'll track the tallies separately for each zone the script runs in.

http://wiki.eqemulator.org/p?How_To_Use_Quest_Globals
Reply With Quote
  #14  
Old 10-07-2015, 12:37 PM
Maceblade
Hill Giant
 
Join Date: Jun 2010
Posts: 231
Default

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?
Reply With Quote
  #15  
Old 10-07-2015, 12:39 PM
Shendare
Dragon
 
Join Date: Apr 2009
Location: California
Posts: 814
Default

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
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 07:19 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3