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