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
  #15  
Old 09-02-2007, 12:44 PM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

Quote:
Originally Posted by sonicintuition View Post

So ....I'll hail the NPC with a rogue, and get "You are not a caster! You are a caster!" ....

Code:
sub EVENT_SAY
{
if($text=~/hail/i && ($class eq 'Warrior' || $class eq 'Rogue'))
{
quest::say("You are not a caster!");
}
if($text=~/hail/i && ($class ne 'Warrior' || $class ne 'Rogue'))
{
quest::say("You are a caster!");
}
}
Sonic
broken logic. on the "second" if, if i'im a rogue, it will fire because, you're asking a different question:

if $text contains "hail"

and

the $class is either ( not warrior ) or (not rogue)

which is true if you're a rogue ( rogue != warrior ).

converse statements (ones containing "negations" ) are usually tricky and require some care. you're easiest bet would be to construct it like follows:

if( contains "hail" )
{
if( class1 ) { do something }
elsif (class2 ) { do something else }
elsif( class3 ) { do something else }
...
else { do the other thing }
}


hope this helps.

== sfisque
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 03:44 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