|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Custom Custom Quests here |

09-12-2008, 05:40 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
First, in order for you to earn credits, you first have to be flagged by the quest NPC for earning credits. The actual kills themselves don't flag you for that, because I didn't want it to do more work for every kill and I also didn't want to risk any possible reset of credits.
So, you need to use one of the other quests I posted here first.
Also, for this to work on a global level, you have to edit the option in the globals to 5 instead of 1. So, note the following and see where I marked it in RED:
Code:
quest::setglobal("exp_credits", $qglobals{exp_credits}+1, 1, "F");
If you want this global to be seen by all NPCs in all Zones, you need to change every flag to use option 5 like this:
Code:
quest::setglobal("exp_credits", $qglobals{exp_credits}+1, 5, "F");
That should resolve both of your issues. Lemme know if you have any more questions.
|
 |
|
 |

09-12-2008, 08:19 PM
|
Sarnak
|
|
Join Date: May 2006
Location: Cincinnati
Posts: 73
|
|
Awesome Trev. I was trying to work out something like this about 2 weeks ago on my server but couldn't figure out how to make a variable a counter. I kind of gave up on the idea but I might go back and plug this in in my own way. I appreciate the work.
|

09-13-2008, 12:49 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Still doesn't work for me. I changed what you posted. Hailed the NPC for the flags. It says I got them. Zoned to gukbottom and killed something. All I get is normal xp. Do you have to have aaxp on for the quest to work at all or will it work anyways? On my server all I have is old school eq enabled. No kunark or anything, even if I #lvl myself to 51 it doesn't let me turn aa on. Thats the only thing I can come up with that may be breaking it.
|

09-13-2008, 03:55 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I haven't really messed with default or player.pl files much yet. Maybe try putting the quest directly on a certain NPC and try it that way first.
|

09-13-2008, 11:27 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
I still can't get it to work. I copy and pasted your quest to one zone and made no mods to it at all. I get the flag when I hail an NPC. Then kill the NPC that I have the kill script set too...I get normal xp...so now I'm totally at a loss. All other quests on the server work...it just seems to hate this one haha :(
|
 |
|
 |

09-14-2008, 02:55 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Man this is about to drive me frikken crazy, I copied your quest directly from this page into a file called a_gnoll.pl in the blackburrow folder. I also have the quest that gives the flags on an NPC. I hail, it says I have the flag. I kill a gnoll...I get normal xp....why does my server hate me :( Can anyone see anything wrong with this script?
Code:
sub EVENT_KILLED_MERIT {
#Checking if the anti-AE global is defined to stop credits from being earned if it is
if (!defined($qglobals{anti_ae})) {
#Optional code to randomly spawn a named NPC when the target dies.
my $x = $npc->GetX();
my $y = $npc->GetY();
my $z = $npc->GetZ();
my $named = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50);
if ($named == 50) {
quest::unique_spawn(quest::ChooseRandom(2700667,2700670,2700673,2700676,2700683,2700685),0,0,$x,$y,$z);
$named = undef;}
#Checking if the exp_credit global is defined for this character
if (defined($qglobals{exp_credits})) {
#Making sure the character is not already level 70+
if ($ulevel <= 69) {
#Adding 1 point/credit to the exp_credits global
quest::setglobal("exp_credits", $qglobals{exp_credits}+1, 5, "F");
#Checking the character's level range
if ($ulevel >= 1 && $ulevel <= 55) {
#Variable to define how many exp_credits are needed to level in this level range.
my $exp_req = 24;
if ($qglobals{exp_credits} >= $exp_req) {
quest::level($ulevel+1);
#subtract the actual exp_credits global points. Note that this has to be 1 more than the exp_req global is set to.
quest::setglobal("exp_credits", $qglobals{exp_credits}-25, 5, "F");
}
my $exp_needed = ($exp_req - $qglobals{exp_credits});
$client->Message(5, "You currently need $exp_needed experience credits for your next level.");
}
#same thing as above, but for the next higher level range
if ($ulevel >= 56 && $ulevel <= 60) {
my $exp_req = 29;
if ($qglobals{exp_credits} >= $exp_req) {
quest::level($ulevel+1);
quest::setglobal("exp_credits", $qglobals{exp_credits}-30, 5, "F");
}
my $exp_needed = ($exp_req - $qglobals{exp_credits});
$client->Message(5, "You currently need $exp_needed experience credits for your next level.");
}
if ($ulevel >= 61 && $ulevel <= 65) {
my $exp_req = 34;
if ($qglobals{exp_credits} >= $exp_req) {
quest::level($ulevel+1);
quest::setglobal("exp_credits", $qglobals{exp_credits}-35, 5, "F");
}
my $exp_needed = ($exp_req - $qglobals{exp_credits});
$client->Message(5, "You currently need $exp_needed experience credits for your next level.");
}
if ($ulevel >= 66 && $ulevel <= 69) {
my $exp_req = 39;
if ($qglobals{exp_credits} >= $exp_req) {
quest::level($ulevel+1);
quest::setglobal("exp_credits", $qglobals{exp_credits}-40, 5, "F");
}
my $exp_needed = ($exp_req - $qglobals{exp_credits});
$client->Message(5, "You currently need $exp_needed experience credits for your next level.");
}
}
#If the character is level 70+, delete the exp_credit global for them since it is no longer needed.
if ($ulevel >= 70) {
quest::delglobal("exp_credits");
}
}
#Checking if the new_credits global is defined for this character
if (defined($qglobals{new_credits})) {
#Adding 1 point/credit to the new_credits global
quest::setglobal("new_credits", $qglobals{new_credits}+1, 5, "F");
#Setting the anti_ae global after all credits are applied.
quest::setglobal("anti_ae", 1, 7, "S5");
my $total_credits = ($qglobals{new_credits} + 1);
$client->Message(5, "You currently have $total_credits Credits.");
}
}
}
|
 |
|
 |

09-14-2008, 05:17 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Every NPC that uses qglobals in a script HAS to have the qglobal setting in the NPC_Types table set to 1 (default is 0 which ignores globals completely).
You can set these easily for an entire zone by using GeorgeS NPC Loot Editor and changing 1 of the NPCs to have qglobal set to 1 and then use the field tool menu to "propagate the field" or whatever it is called. That will set all NPCs in the zone to the same setting.
That should resolve your issue.
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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 10:09 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |