|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Quests::Q&A This is the quest support section |

06-25-2008, 04:00 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
That did the trick  Thanks!
I had actually (briefly) considered that possibility, but I had seen
examples from others using the curly brackets and thought it must be a valid usage.
|

06-25-2008, 04:19 PM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
np
the bracket prabobly work in some cases, but parentesis work always
|
 |
|
 |

06-25-2008, 07:05 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Okay, here's another one, then:
Quote:
sub EVENT_ITEM
{
if(plugin::check_handin(\%itemcount,13732 == 1))
{
quest::givecash("0","0","0","5000");
quest::exp(3500000);
quest::faction(19927,4000);
quest::ding();
quest::say("Well done, $name! We now have the item. Yet it is certain the enemy knows of our plans; even now he is planning his attack. We must muster our defenses and set reinforcements on our [cities].");
$client->Message(15, "You receive 5000 platinum pieces");
$client->Message(15, "You receive 3500000 exp points");
$client->Message(15, "Your faction standing with the Realm could not get any better!");
}
if($text=~/cities/i)
{
quest::say("Who knows where he may strike first? Go now, $name, and make preparations for war. Take the Interior Road to the Palace, and take word to the Captain of our good fortune--and of the threat that follows. He will know what to do. I will keep watch here the time being, but will make way there if it [comes to that].");
}
if($text=~/comes to that/i)
{
quest::say("$name, listen to me carefully. You must take word to the Captain of the Guard. He knows nothing of this find, and very soon it may be too late. The Palace lies defenseless, and is vulnerable to the enemy's attack. The fate of the Palace is in your hands, $name. If you do not go quickly, who can tell what [fate] awaits them?");
}
if($text=~/fate/i)
{
quest::say("There is little time to explain it all now, Go! I have made you a full citizen of the Realm and a knight of the Palace. On this journey you bear the authority of the king himself! Go; and may the blessing of the Realm go with you! My trusted advisor will take care of matters here.");
}
else
{
quest::say("I have no use for this, $name. Do not trouble me again--unless you bring the item!");
plugin::return_items(\%itemcount);
}
}
|
Each time I give the item to the npc, he gives it back and defaults to the return_item text. I have triple-checked the item #, and it is correct. I have tried a different operator (< 2 instead of == 1) with the same result. I have tried placing the initial quest::say before all the reward lines, with the same result. I have run the code through a Perl cmd line and it reported no syntax problems.
Thoughts?
|
 |
|
 |
 |
|
 |

06-25-2008, 07:45 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Try the following. You forgot to put in an EVENT_SAY section:
Code:
sub EVENT_ITEM {
if(plugin::check_handin(\%itemcount,13732 == 1)) {
quest::givecash("0","0","0","5000");
quest::exp(3500000);
quest::faction(19927,4000);
quest::ding();
quest::say("Well done, $name! We now have the item. Yet it is certain the enemy knows of our plans; even now he is planning his attack. We must muster our defenses and set reinforcements on our [cities].");
$client->Message(15, "You receive 5000 platinum pieces");
$client->Message(15, "You receive 3500000 exp points");
$client->Message(15, "Your faction standing with the Realm could not get any better!"); }
else {
quest::say("I have no use for this, $name. Do not trouble me again--unless you bring the item!");
plugin::return_items(\%itemcount); }
}
Sub EVENT_SAY {
if($text=~/cities/i) {
quest::say("Who knows where he may strike first? Go now, $name, and make preparations for war. Take the Interior Road to the Palace, and take word to the Captain of our good fortune--and of the threat that follows. He will know what to do. I will keep watch here the time being, but will make way there if it [comes to that]."); }
if($text=~/comes to that/i) {
quest::say("$name, listen to me carefully. You must take word to the Captain of the Guard. He knows nothing of this find, and very soon it may be too late. The Palace lies defenseless, and is vulnerable to the enemy's attack. The fate of the Palace is in your hands, $name. If you do not go quickly, who can tell what [fate] awaits them?"); }
if($text=~/fate/i) {
quest::say("There is little time to explain it all now, Go! I have made you a full citizen of the Realm and a knight of the Palace. On this journey you bear the authority of the king himself! Go; and may the blessing of the Realm go with you! My trusted advisor will take care of matters here."); }
}
|
 |
|
 |

06-25-2008, 08:18 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Thanks Trevius. I made the change, but he's still returning the item. I'm just learning Perl, so I appreciate your patience with this. Fyi, I already have one EVENT_SAY section that comes before the EVENT_ITEM section (yours would be a second one that comes after). I didn't include it in the first post because it was working fine on it's own. The only section I'm having trouble with is the turn in. Any other suggestions?
|

06-25-2008, 08:31 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
You only want to have 1 EVENT_SAY in your quest. Put all of the ones in the script I posted into your pre-existing one and remove the one I put in.
You have to keep certain things like that completely separated for a reason, otherwise they will get messed up as you are now seeing.
Anytime you have an "if" statement, whatever it is if'ing on is what section it should go in. So, if's on text should go in EVENT_SAY, and if's on turn ins should go in EVENT_ITEM, and if's on timers should go in EVENT_TIMER, etc.
|
 |
|
 |

06-25-2008, 08:51 PM
|
Hill Giant
|
|
Join Date: May 2008
Location: Colorado
Posts: 238
|
|
Okay, here's the entire script, annotated by me. Maybe this will help.
Quote:
# player hails npc. If player is carrying item #13732, npc offers to take item.
# Otherwise, npc wants nothing to do with player.
sub EVENT_SAY
{
if($text=~/hail/i)
{
if(plugin::check_hasitem($client, 13732))
{
quest::say("What is this? You bring good tidings indeed, $name! Give me the item.");
}
else
{
quest::say("Do you not see I have enough [trouble] already? Your welcome here is doubtful");
}
if($text=~/trouble/i)
{
quest::say("I sense my will is being bent by some [evil].");
}
if($text=~/evil/i)
{
quest::emote("mumbles inaudibly; his eyes stare blankly");
}
}
}
# above script works well independently. If the player has the item, the npc responds favorably.
sub EVENT_ITEM
{
if(plugin::check_handin(\%itemcount,13732 == 1))
{
quest::givecash("0","0","0","5000");
quest::exp(3500000);
quest::faction(19927,4000);
quest::ding();
quest::say("Well done, $name! We now have the item. Yet it is certain the enemy knows of our plans; even now he is planning his attack. We must muster our defenses and set reinforcements on our [cities].");
$client->Message(15, "You receive 5000 platinum pieces");
$client->Message(15, "You receive 3500000 exp points");
$client->Message(15, "Your faction standing with the Realm could not get any better!");
}
else
{
quest::say("I have no use for this, $name. Do not trouble me again--unless you bring the item!");
plugin::return_items(\%itemcount);
}
}
# in the above script, the player hands in item. If wrong item, it's handed back. If correct item, npc doles out cash, exp, and faction. This is the part that is failing. Below is the section you added (or rather modified from my original):
Sub EVENT_SAY
{
if($text=~/cities/i)
{
quest::say("Who knows where he may strike first? Go now, $name, and make preparations for war. Take the Interior Road to the Palace, and take word to the Captain of our good fortune--and of the threat that follows. He will know what to do. I will keep watch here the time being, but will make way there if it [comes to that].");
}
if($text=~/comes to that/i)
{
quest::say("$name, listen to me carefully. You must take word to the Captain of the Guard. He knows nothing of this find, and very soon it may be too late. The Palace lies defenseless, and is vulnerable to the enemy's attack. The fate of the Palace is in your hands, $name. If you do not go quickly, who can tell what [fate] awaits them?");
}
if($text=~/fate/i)
{
quest::say("There is little time to explain it all now, Go! I have made you a full citizen of the Realm and a knight of the Palace. On this journey you bear the authority of the king himself! Go; and may the blessing of the Realm go with you! My trusted advisor will take care of matters here.");
}
}
|
I removed the final EVENT_SAY section and tested the script without it, and the npc still returns the item. It makes no sense to me. He recognizes the item in the hail during the first section ((hasitem), but doesn't seem to recognize it when I actually give it to him.
|
 |
|
 |
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 09:23 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |