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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-19-2004, 09:30 AM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

Your problem is that you are using far too many braces. You should use one pair of braces to enclose the entire sub. Then you should use one and only one pair to enclose every line you want to associate with each if statement. Change
Quote:
Code:
sub EVENT_SAY 
{ 
if ($text=~ /Hail/i){quest::say("Who are you and how do you know me?");} 
if ($text=~ /know/i){quest::say("Not just everyone knows me! Only a privileged few.  But you seem trustworthy, perhaps i can use you.");} 
if ($text=~ /use/i){quest::say("I lead the resistance in Norrath.  I'm in need of soldiers.  Are you willing?");} 
if ($text=~ /willing/i){quest::say("Good, see Nyla for equipment.  Then see one of our undercover ops in the house next to us for your assignment.");} 
{guest::givecash(1000,0,0,0);} 
{guest::setallskill(255);} 
{quest::level(8);} 
{quest::pvp(on);} 
}
To
Code:
sub EVENT_SAY 
{ 
if ($text=~ /Hail/i)
  {
  quest::say("Who are you and how do you know me?");
  } 
if ($text=~ /know/i)
  {
  quest::say("Not just everyone knows me! Only a privileged few.  But you seem trustworthy, perhaps i can use you.");
  } 
if ($text=~ /use/i)
  {
  quest::say("I lead the resistance in Norrath.  I'm in need of soldiers.  Are you willing?");
  } 
if ($text=~ /willing/i)
  {
  quest::say("Good, see Nyla for equipment.  Then see one of our undercover ops in the house next to us for your assignment.");
  guest::givecash(1000,0,0,0);
  guest::setallskill(255);
  quest::level(8);
  quest::pvp(on);
  }
}
It may not be your whole problem, but its definitely a big mistake. Lines are seperated by a ; no need to seperate each one by {}s. Block of code such as if statements are seperated by {}s. I'd suggest looking at an introductory programming tutorial website. I don't know if you can find one for perl, but C++ or Java ones would help you out a lot because their syntax is very similar and they would teach you all you need to know to write basic quests.
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 11:23 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