View Single Post
  #1  
Old 06-25-2008, 03:17 PM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default Need help on a turn in

I'm hoping I can get some insight on why this script is not working correctly. I ran in through a perl command line with no syntax problems.

Quote:
# test script for hand in of bone chips for exp, faction, and cash
sub EVENT_ITEM
{
if(plugin::check_handin{\%itemcount,13073 => 4})
{
quest::givecash("0","5","0","0");
quest::exp(1000);
quest::faction(19927,1);
quest::ding();
quest::say("You have done well, $name! These indeed are a token of friendship with our realm. But will your heart remain true through days of darkness? I urge you, continue these deeds. And may you continue to become a trusted friend of our realm!");
}
else
{
quest::say("I have no use for these, $name. I require four remains of our enemies");
plugin::return_items(\%itemcount);
}
}
At this point the turn-in works as far as it goes. That is, when I give 4 bone chips to the npc, they are accepted, and I receive the right amount of exp, cash, and faction. However, when I test it with other items--or with fewer than 4 of the right items--those items are accepted as well, and I still receive exp, cash and faction. Because all items are accepted the script never gets to the return_items line, so I cannot tell yet whether that part is working. I've looked at several examples on these forums of the check_handin line, and mine seems to be right. But the variables are being ignored. Any clue why? Thanks!
Reply With Quote