|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
01-15-2010, 09:19 AM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
qglobal's
ok this is trevius's quest i used it to check my qglobal's but i cant seem to get them to keep it this quest just keeps giving the person level 71 any idea's of why my qglobal's wont work?
Code:
sub EVENT_SAY {
if($text=~/hail/i)
{
quest::say("Hello, $name. I am a card collector and am willing to trade my personal experience for cards.
If you have [minor], [godly] or the normal [card] of experience, I may be able to make a trade with you.
I can also [return] your level if you have the correct status with me.");
}
if (($text =~/minor/i)&&($ulevel <= 44))
{
quest::say ("You must gain more experience before you can turn in this type of card to me.
I hear they are attained in the Plane of Earth B.");
}
if (($text =~/minor/i)&&($ulevel >= 45))
{
quest::say ("If you happen to come across any Cards of Minor Experience, please bring them to me and I will kindly reward you.
I am creating a collection and can always use more. Make sure to hand them to me unstacked.
I hear they are attained in the Plane of Earth B.");
}
if (($text =~/card/i)&&($ulevel <= 64))
{
quest::say ("You must gain more experience before you can turn in this type of card to me. I hear they are attained in the Plane of Valor.");
}
if (($text =~/card/i)&&($ulevel >= 65))
{
quest::say ("If you happen to come across any Cards of Experience, please bring them to me and I will kindly reward you.
I am creating a collection and can always use more. Make sure to hand them to me unstacked.
You must be 65+ for me to reward you for these cards.");
}
if (($text =~/godly/i)&&($ulevel <= 69))
{
quest::say ("You must gain more experience before you can turn in this type of card to me. I hear they are attained in the Tower of Solusek Ro.");
}
if (($text =~/godly/i)&&($ulevel >= 70))
{
quest::say ("If you happen to come across any Cards of Godly Experience, please give 4 of them to me at once and I will kindly reward you.
I hear they are attained in the Tower of Solusek Ro. Make sure to hand them to me unstacked.");
}
if (($text =~/return/i)&&($ulevel <= 69))
{
quest::say ("You must be at least level 70 for me to provide this service to you! Return when you have gained more experience.");
}
if (($text =~/return/i)&&($ulevel >= 70)) {
if ($max_level == undef){
quest::say("You are already at your current maximum level."); }
elsif ($max_level == 71) {
quest::say("You are now set back to your previous maximum level.");
quest::level(71);
$max_level=undef; }
elsif ($max_level == 72) {
quest::say("You are now set back to your previous maximum level.");
quest::level(72);
$max_level=undef; }
elsif ($max_level == 73) {
quest::say("You are now set back to your previous maximum level.");
quest::level(73);
$max_level=undef; }
elsif ($max_level == 74) {
quest::say("You are now set back to your previous maximum level.");
quest::level(74);
$max_level=undef; }
elsif ($max_level == 75) {
quest::say("You are now set back to your previous maximum level.");
quest::level(75);
$max_level=undef; }
}
}
sub EVENT_ITEM {
if ((plugin::check_handin(\%itemcount, 2275=>1))&&($ulevel >= 65)){
quest::say("I am always looking for more for my collection.");
$client->Message(6, "Maximus Serilious rewards you with experience." );
quest::exp(9999999); }
if ((plugin::check_handin(\%itemcount, 2834=>1))&&($ulevel >= 45)){
quest::say("I am always looking for more for my collection.");
$client->Message(6, "Maximus Serilious rewards you with experience." );
quest::exp(2000000); }
if (plugin::check_handin(\%itemcount, 93665=>4)) {
if ($max_level == undef) {
quest::say("These are in excellent shape! They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
quest::exp(9999999);
quest::setglobal("max_level", 71, 5, "F");
quest::level(71);
$max_level=undef; }
elsif ($max_level == 71) {
quest::say("These are in excellent shape! They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
quest::exp(9999999);
quest::setglobal("max_level", 72, 5, "F");
quest::level(72);
$max_level=undef; }
elsif ($max_level == 72) {
quest::say("These are in excellent shape! They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
quest::exp(9999999);
quest::setglobal("max_level", 73, 5, "F");
quest::level(73);
$max_level=undef; }
elsif ($max_level == 73) {
quest::say("These are in excellent shape! They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
quest::exp(9999999);
quest::setglobal("max_level", 74, 5, "F");
quest::level(74);
$max_level=undef; }
elsif ($max_level == 74) {
quest::say("These are in excellent shape! They will be trophies in my collection!");
$client->Message(6, "Maximus Serilious rewards you with a new level!" );
$client->Message(15, "You have reached the max level! Repeating this quest will give no further rewards!" );
quest::exp(9999999);
quest::setglobal("max_level", 75, 5, "F");
quest::level(75);
$max_level=undef; }
elsif ($max_level == 75) {
quest::say("You have already reached the max level. I can no longer reward you for the Cards of Godly Experience.
But if you want to give them to me anyway, I will take them for free. Ha ha ha!");
quest::level(75);
$max_level=undef; }
{
$max_level=undef;
}
}
Last edited by trevius; 01-16-2010 at 08:47 AM..
Reason: formatted so it doesn't stretch the thread extremely wide
|
|
|
|
|
|
|
01-15-2010, 10:11 AM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
ok i got
Code:
sub EVENT_SAY {
if ($text=~/hail/i && $flyer == 1) {
quest::say("May you travel with the Fives' blessing, $name.");
}
if ($flyer == 0) {
if ($text=~/Hail/i) {
quest::say("Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?");
}
if ($text=~/flyer/i) {
quest::say("Ah good, good. Just give the flyer back to me and we shall begin.");
}
if ($text=~/ready/i) {
quest::say("Here. This item will return you to our fair city. It holds enchantments that will make you more powerful as well. Ill start you off on something simple.
The councils scouts have recently discovered a strange new race of humanoids dwelling in a place they call Crushbone. The council wishes to gain further information on the humanoids in Crushbone.
An Ambassador was sent a few days ago. He returned with a few missing body parts.
The scouts report seeing small books on a few of the more intelligent looking humanoids there.
Bring back at least four of these books for the council to study. The council does not care how you obtain them. Feel free to get them by any means necessary.
Upon your return, find my apprentice. He will handle the books accordingly.");
quest::summonitem(1002);
quest::setglobal("flyer",1,0,"M2");
}
}
}
To work but i was wondering now where the global is saved to check if someone did the quest or not
Last edited by trevius; 01-16-2010 at 08:46 AM..
Reason: formatted so it doesn't stretch the thread extremely wide
|
|
|
|
01-15-2010, 11:18 AM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
Ok i figured out how to check them just wondering why this quest right here will set the epic1.5 value 1 and not do the rest of the quest
Code:
sub EVENT_SAY { if ($text=~/hail/i) {
quest::say("How Are you today, $name Bring me One Peice of Epic Weapon From Karnor for your epic1.5 quest?");
quest::setglobal("Epic1.5",1,0,"f");
} }
sub EVENT_ITEM {
if (($itemcount {1387} == 1)) && ($Epic1.5 == 1) {
quest::say("Now i need your third peice of your Epic1.5 From Netherbian");
quest::setglobal("Epic1.5",2,0,"f"); }
if (($itemcount {1001} == 1)) && ($Epic1.5 == 2) {
quest::say("Now i need your third peice of your Epic1.5 From Netherbian");
quest::setglobal("Epic1.5",3,0,"f"); }
if (($itemcount {1002} == 1)) && ($Epic1.5 == 3) {
quest::say("Now i need your fourth peice of your Epic1.5 From Dulak");
quest::setglobal("Epic1.5",4,0,"f"); } }
|
|
|
|
01-16-2010, 08:39 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Yeah, sorry, but that is a pretty old quest I submitted. I have since learned how to use qglobals and such properly, and that way is not the proper way to do it. It should actually work most of the time, but can cause some nasty bugs that you don't want to have to deal with :P Your script would actually seem to work fine most of the time, accept you have some parenthesis in the wrong places in your EVENT_ITEM that is breaking that section of the script.
Anyway, the proper way to check a qglobal value is to write it like this:
Code:
if ($itemcount {1387} == 1 && $qglobals{Epic1.5} == 1) {
(also note that I removed the extra parenthesis that you had in the wrong places too)
Instead of the way you have it like this:
Code:
if (($itemcount {1387} == 1)) && ($Epic1.5 == 1) {
Also, you should use plugins for your item turn ins, so you can use the return item plugin to return a player's items if they turn in the wrong item or don't meet other requirements you might have set. Here is the same example as above, accept with the plugin:
Code:
if (plugin::check_handin(\%itemcount, 1387 => 1) && $qglobals{Epic1.5} == 1) {
You can find quite a bit on qglobals here from the wiki at the bottom of the page:
http://www.eqemulator.net/wiki/wikka...=QuestTutorial
There are 2 more things I think are worth mentioning in regards to qglobals:
1. Always make sure you enable the NPC to see qglobals by setting the qglobal field in the npc_types table to 1.
2. Check the wiki page above to understand the options field for qglobals. By setting it to 0 like you are, it means that only that particular NPC in that particular zone will see that qglobal for that particular player. If you wanted another NPC to check it, they would not see it.
Last edited by trevius; 01-16-2010 at 08:45 AM..
|
|
|
|
01-16-2010, 09:16 AM
|
Hill Giant
|
|
Join Date: Sep 2008
Posts: 204
|
|
one more thing. In my experience, if the qglobal check happens after the item check, if the player doing the turn in has the proper item, but not the qglobal flag, the NPC will eat the proper item. Doing the qglobal check before the item check resolve this issue.
__________________
|
01-16-2010, 12:51 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
ahh thank you both so much ill try that later when i get a chance'
|
01-16-2010, 09:59 PM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Yeah, I didn't want to get that far into explaining it just yet hehe. The reason that is, is because the ifs check from left to right and if it hits one that is false, it doesn't bother checking any of the others. So, that will let it return the items that were handed in, because the plugin will think that the items were not successfully turned in, I believe. By having them in the order I put them from left to right, it checks that the hand in is correct first, and so no matter what, the return items plugin won't return those items once the check_handin has been verified correct. So, in that case, if they fail to meet the qglobal, it won't reward them, but it also won't return their items.
I am basically just saying what Lillu had already said, but explaining the why of how it works so you can better understand how to write that type of check.
|
|
|
|
01-16-2010, 10:27 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
you all helped me alot and im grateful for it
|
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 01:13 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|