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
  #16  
Old 04-17-2015, 05:35 PM
Asylum
Sarnak
 
Join Date: Jun 2013
Posts: 81
Default

Congratulation on solving your puzzle. Now to tackle simplifying the code. As many have advised over the years, using an array or hash to handle multiple inputs and outputs is the best method to simplify code.

Basically you have a player /say "location" as input to the npc's EVENT_SAY subroutine, which triggers the wonderful spell animations and invis prior to porting to the various destinations as output. The inputs can be stored as a variable $playersaidthis and the outputs as a variable $portplayerhere in an associated array.

Your code will have a single if statement instead of an if/elsif for every destination and be about 90% shorter. Let us know how it works and once again, congratulations on solving your perl puzzle and learning more about scripting.

EDIT: haha, I forgot to hit send this morning and after I realized it this afternoon, ghanja had already posted the script I described.
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 04:22 AM.


 

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