View Single Post
  #4  
Old 11-08-2011, 08:28 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by lerxst2112 View Post
I can't answer your gold question, but your script has the same problem that many others do. If you're checking for a series of items with the intent to return anything not used at the end you must use if/elsif/else, otherwise the last else only applies to the last if.
I think most people misunderstand how to us the return_items plugin properly. Of course, it works in most cases as an else to the last if for most scenarios. The way I use it is out in the open at the end of the EVENT_ITEM sub (as shown in the example in my last post). Based on how the check_handin and return_items plugins work, you will only be returned items that weren't used by the check_handin plugin. So, leaving it out in the open at the end of the sub just makes sure any left over items will get returned.

One case where adding it as an else to the last if won't work is if someone turns in the needed item(s) for the last turn in, but also turns in an extra item. They will get the reward, but will not get their extra item back.

The main case in which you might need an if/elsif/else, is if you also want to give a return items say message if the turn in was incorrect.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 11-09-2011 at 12:35 AM..
Reply With Quote