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.
|
This is what Ive got so far, however the $counts do not show in the emote...
Code:
sub EVENT_DEATH_COMPLETE{ Code:
sub EVENT_DEATH_COMPLETE{ |
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?
|
Why not just add a small script to the orc/gnoll death that increments the counter?
|
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
|
Code:
sub EVENT_KILLED_MERIT Code:
$killed |
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) { Not sure which event would work best, though, that would provide the $npc and $client that killed 'em. Maybe someone else can chime in. |
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. |
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. |
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.
|
Code:
sub EVENT_DEATH_COMPLETE{ |
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. |
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 |
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?
|
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 |
Thanks Shen I did not realize that was there, now its book marked lol. And Kay are you talking about using
Code:
quest::setglobal Code:
sub EVENT_DEATH_COMPLETE{ |
So, you have multiple NPC ID's for both Gnolls and Orcs. You would like to keep track of the deaths of them in only two zones (currently).
That's my understanding. Do you wish to give credit for the kills if no experience is yielded? What if groups go out killing them? You only wish for the one with the final blow to get the credit? |
Its a controlled event, blackburrow and crushbone, every orc/gnoll, level 10 PC max(is not a concern as there is a zone autoboot script already in place), personal credit is not a priority. Its living vs undead and when you are undead you play as undead gnolls raiding crushbone. as the living you play as orcs raiding blackburrow.
My simplistic version is to just keep track of orc and gnoll deaths, and broadcast them to their own zone. What I really wanted was, every gnoll death whether it be PC or NPC acted as a gnoll kill etc etc. The dwarves were all changed to orcs to make it easier on the default script. |
Anyone care to tell me why this default.pl does not work, yet when I assign it to an NPC it works fine?
Code:
sub EVENT_DEATH_COMPLETE{ |
Do ALL the NPCs you're trying to use that on have their 'qglobal' column set to '1' in 'npc_types'?
|
yea I used navicat and had them all set
|
Hmm, pretty weird, didn't look at the code, but I'll get back to you on something, message me on Skype (Kingly.krab).
|
Ok so I got it to work as a default script... only issue is it does not work with all the npcs in the zone. There is no other scripts other than mine in the zone file. Orcs and gnolls globally, all share the same script when dying, the only issue is I cant find it. I looked in the global file and nothing. Are there hard coded scripts when they die they automatically say those things that will superceed my default file?
Code:
sub EVENT_DEATH_COMPLETE{ |
All times are GMT -4. The time now is 10:44 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.