Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2004, 03:36 AM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

Glancing at the script, just a couple of insights. Take it for what you will:

For your level range checking, you do not need as many checks. Consider the following:
Code:
if ($x >= 10 && $x <= 20)
{
   print "x is between 10 and 20 inclusive\n";
}
elsif ($x >= 21 && $x <= 30)
{
   print "x is between 21 and 30 inclusive\n";
}
Instead, try:
Code:
if ($x > 30)
{
   print "x is larger than 30!\n";
}
elsif ($x >= 20)
{
   print "x is between 30 and 20 inclusive\n";
}
As for all of these "if ($text =~ ...)" lines, after the first if statement, you may as well use elsif from then on.
Code:
if($text=~/hail/i)
...
elsif($text=~/categorys/i)
...
Also, the whole structure of the NPC telling what buffs he casts, etc., could probably be done with an array/hash more elegantly, and would take less code. I'm not going to draw that up, though .

Good effort on your script. I would suggest practicing with perl a bit more, and then attempt to redesign it. People have a habit of not wanting to redo or throw out their code, but in the end it will give you a better result, and likely increase your skills.
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:27 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