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

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.
|

09-15-2008, 12:31 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
I have never messed with global quests so didn't catch that at all. Many thanks Trev, you're the man. Works perfectly after this change.
|

09-15-2008, 12:33 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
One more question, and I'm sorry to keep bugging you, but I really do appreciate you helping out. Is there any way to make mobs only within 7 levels give points? Since this is global, it would be way too easy to lvl on my server at like 40 killing in qeynos hills haha.
|

09-15-2008, 04:13 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
You would just need to compare the mob level to the userlevel. So, something like this at the top of the script right below the EVENT_MERIT line should work:
Code:
if($mlevel + 7 >= $ulevel) {
or if you wanted to restrict it to 7 levels higher and lower, you could use this:
Code:
if(($mlevel + 7 >= $ulevel)&&($mlevel - 7 >= $ulevel)) {
Then, of course, you would need to add an extra bracket "}" at the end of the script to encompass the whole EVENT_MERIT section.
|

09-15-2008, 11:59 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Thanks again Trev, I'll try to leave ya alone for a while now ;p
|

09-19-2008, 07:03 AM
|
Fire Beetle
|
|
Join Date: Jul 2006
Posts: 11
|
|
Is there a way to make this work for player kills? I mean, killing players in PVP and having a script that gives them the points as a reward?
|
 |
|
 |

10-21-2008, 01:15 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Since people have been testing my server I have had a few reports of this quest taking points and not giving the item. Every time I test it I get the item though. Anyone see something wrong with this? :(
Code:
sub EVENT_SAY {
if($text =~ /Hail/i) {
if (!defined($qglobals{new_credits})) {
#This tells the player to hail the NPC that sets the credit globals on their character if they haven't already
quest::say ("Nice to meet you, $name. You should speak with the God of War"); }
if (defined($qglobals{new_credits})) {
quest::say ("I can enhance your Starter [armor] if you have enough [credits] for it."); }
}
if($text =~ /credits/i && defined($qglobals{new_credits})) {
quest::say ("To enhance your armor, you must turn in the Starter piece that you wish to enhance, and you must also have enough credits to afford the labor [costs]."); }
if($text =~ /costs/i && defined($qglobals{new_credits})) {
quest::say ("Enhancing Chest and Leg armor pieces costs 35 credits each. Other armor costs 25 credits each. Weapons are 50 each and I can currently do Pierceing, a shield, 1hb, 2hb, 1hs, and Bows"); }
if($text =~ /armor/i && defined($qglobals{new_credits})) {
quest::say ("I can Enhance your starter armor for you. Just hand me the old piece if you have enough credits."); }
}
sub EVENT_ITEM {
#This is the hash of item turn ins and upgrade rewards with comments as to what each is.
my %armor = (
2683 => 3482, #Chain_Boots
2672 => 3479, #Chain_Bracer
2668 => 3397, #Chain_Coif
2673 => 3480, #Chain_Gauntlets
2670 => 3442, #Chain_Vambraces
2826 => 3537, #Cloth_Boots
2810 => 3540, #Cloth_Bracer
2807 => 3582, #Cloth_Cap
2812 => 3539, #Cloth_Gloves
2809 => 3541, #Cloth_Sleeves
2730 => 3625, #Leather_Boots
2687 => 3486, #Leather_Bracer
4212 => 25439, #Starter_Boots
4210 => 25437, #Starter_Gauntlets
4209 => 25436, #Starter_Braces
4208 => 25435, #Starter_Vambraces
4207 => 71234, #Starter_Belt
4206 => 89803, #Starter_Cloak
4201 => 25433, #Starter_Helm
4202 => 89900, #Starter_Mask
4203 => 34132, #Starter_Neck
4205 => 83353, #Starter_Shoulder
);
#Separate hash item turn ins and rewards to allow for separate credit prices
my %chestlegs = (
4204 => 25434, #Starter_Breastplate
4211 => 25438, #Starter_Greaves
68232 => 34142, #Starter_Robe
2820 => 3538, #Cloth_Leggings
2685 => 3484, #Leather_Breastplate
2718 => 3491, #Leather_Leggings
42040 => 3616, #Plate_Breastplate
2666 => 3232, #Plate_Greaves
);
my %weapons = (
70646 => 62258, #Starter_1hb
6652 => 27054, #Starter_2hb
11940 => 11938, #Starter_1hs
2820 => 3538, #Starter_2hs
2595 => 2689, #Starter_Piercing
5758 => 45137, #Starter_Bow
6730 => 6806, #Starter_Shield
2666 => 3232, #Starter_caster
);
#Verify that the character has enough credits for the turn in.
if ($qglobals{new_credits} >= 25) {
#Sort the hash
for my $armor (sort keys %armor) {
if(defined($armor)) {
#Check the item turn in is correct and in the hash
if (plugin::check_handin(\%itemcount, $armor => 1)) {
#Check to make sure that there is a reward defined for the turn in
if(defined($armor{$armor})) {
quest::emote("recognizes your efforts and fashions an upgrade for your armor piece" );
quest::say("Thank you, $name, here is your enhanced armor piece!");
quest::exp(45000);
#Subtract the amount of credits for the upgrade purchase
quest::setglobal("new_credits", $qglobals{new_credits} - 25, 1, "F");
#Reward the player with the upgrade reward.
quest::summonitem($armor{$armor});
#Send a message with the character's new credit total after the purchase
my $total_credits = ($qglobals{new_credits} - 25);
$client->Message(5, "You have spent 25 Credits and now have $total_credits remaining credits.");
}
}
#This is supposed to return items if the wrong one is turned in, but it just eats incorrect items.
#This is the only part of all credit quests that doesn't work properly yet as it should.
# else {
# plugin::return_items(\%itemcount);
# quest::say ("I have no use for this item, $name.");
# }
}
}
}
#This repeats the process above accept for the items of a higher credit cost
if ($qglobals{new_credits} >= 35) {
for my $chestlegs (sort keys %chestlegs) {
if(defined($chestlegs)) {
if (plugin::check_handin(\%itemcount, $chestlegs => 1)) {
if(defined($chestlegs{$chestlegs})) {
quest::emote("recognizes your efforts and enhances your armor piece" );
quest::say("Thank you, $name, here is your upgraded armor piece!");
quest::setglobal("new_credits", $qglobals{new_credits} - 35, 1, "F");
quest::summonitem($chestlegs{$chestlegs});
my $total_credits = ($qglobals{new_credits} - 30);
$client->Message(5, "You have spent 35 Credits and now have $total_credits remaining credits.");
}
}
# else {
# plugin::return_items(\%itemcount);
# quest::say ("I have no use for this item, $name.");
# }
}
}
}
#This repeats the process above accept for the items of a higher credit cost
if ($qglobals{new_credits} >= 50) {
for my $weapons (sort keys %weapons) {
if(defined($weapons)) {
if (plugin::check_handin(\%itemcount, $weapons => 1)) {
if(defined($weapons{$weapons})) {
quest::emote("recognizes your efforts and enhances your weapon" );
quest::say("Thank you, $name, here is your enhanced weapon!");
quest::setglobal("new_credits", $qglobals{new_credits} - 50, 1, "F");
quest::summonitem($weapons{$weapons});
my $total_credits = ($qglobals{new_credits} - 50);
$client->Message(5, "You have spent 50 Credits and now have $total_credits remaining credits.");
}
}
# else {
# plugin::return_items(\%itemcount);
# quest::say ("I have no use for this item, $name.");
# }
}
}
}
#This returns the items if the character does not have enough credits to make the purchase
else {
plugin::return_items(\%itemcount);
# quest::say ("You don't have enough credits for that, sorry.");
}
}
|
 |
|
 |
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 03:43 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |