Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 10-16-2011, 03:01 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

FYI, you should ALWAYS make your turn in check last in your if statements:

Code:
if  ((plugin::check_handin(\%itemcount, xxxx => 1)) && ($ulevel>=8) && ($ulevel<16))
The above example from you will result in the NPC eating the turned in item and failing to trigger the desired result for the player if they don't meet the level criteria.

Here is a better way:

Code:
if  ($ulevel >= 8 && $ulevel < 16 && plugin::check_handin(\%itemcount, xxxx => 1))
This way, if they fail the level checks (or any checks that you want to do along with an item turn-in), the item is not lost. You can still use the return items plugin and give back any items that were not taken by the NPC.

Also, since any items that get taken by the NPC will be removed from the list of items to return, you can use the return plugin at the end of the EVENT_ITEMS sub without having it inside an else or any other statement.

Code:
plugin::return_items(\%itemcount);
Just put that before the last bracket of EVENT_ITEM and you will always return any unused items.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:06 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3