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-07-2004, 05:21 AM
sgaske24
Sarnak
 
Join Date: Sep 2004
Posts: 30
Default Help with NPC script

Greetings all,

I have searched the threads for quite a while and haven't found any help with what I'm trying to do. Basically my goal is to have an NPC set up so that if you are below level 65 he tells you to go fly a kite when you hail him, but if you are level 65 or higher he'll give you the quest. It seems simple enough but it doesn't work. If anyone could toss me a few pointers I would appreciate it, thanks. Here is the code for the part where he tells you go fly a kite if you're under 65:

sub EVENT_SAY

{
if($ulevel < 65) && ($text=~/hail/i){quest::say("You appear to be a hearty adventurer, $name, but I'm afraid you aren't of use to me just yet. Come back when you've reached your 65th level of training and we'll talk.");}
}
Reply With Quote
  #2  
Old 09-07-2004, 05:25 AM
sgaske24
Sarnak
 
Join Date: Sep 2004
Posts: 30
Default

Nevermind I figured it out. Too many parenthesis.
Reply With Quote
  #3  
Old 09-07-2004, 05:27 AM
RangerDown
Demi-God
 
Join Date: Mar 2004
Posts: 1,066
Default

You need a full set of parentheses enclosing the entire conditional.

Like so:

Code:
if(($ulevel < 65) && ($text=~/hail/i))
__________________
<idleRPG> Rogean ate a plate of discounted, day-old sushi. This terrible calamity has slowed them 0 days, 15:13:51 from level 48.
Reply With Quote
  #4  
Old 09-07-2004, 06:17 AM
sgaske24
Sarnak
 
Join Date: Sep 2004
Posts: 30
Default

Actually what I did was this:

{
if($text=~/hail/i &amp;&amp; $ulevel&lt;65){quest::say("turned away");}
if($text=~/hail/i &amp;&amp; $ulevel>=65){quest::say("quest text");}
}

It worked out, I tested it under 65 and over 65. I tried it your way and it didn't work. Maybe I missed a parenthesis somewhere Anyways thanks for the quick reply I appreciate any help I can get.

Thrax the Tormentor
Guts and Glory
Reply With Quote
  #5  
Old 09-07-2004, 12:14 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Try this:
Code:
if($text=~/hail/i){
   if($ulevel >= 65){
      quest::say("quest text");
   }
   else{
      quest::say("turned away");
   }
}
Should be much cleaner and there's really no reason to check if the text is hail multiple times since you can nest the other conditions within that if().

Or if you want to use quite a few responses with hail, you can use an array.
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
Reply


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 09:51 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3