View Single Post
  #10  
Old 09-02-2007, 07:58 AM
sonicintuition
Hill Giant
 
Join Date: Jan 2005
Posts: 124
Default

Quote:
you need to group the two class comparisons because if you dont, the logic says:

if the text contains "hail" and class eq 'Rogue'

OR

class eq 'Warrior'

whereas you want:

if the text contains 'hail'

AND

the class is either Rogue or Warrior
It makes sense, yet doesn't work... the npc STILL spews out both lines regardless of class. This is what I wrote as an update to what you guys have been telling me...

Quote:
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!");
}
}
So ....I'll hail the NPC with a rogue, and get "You are not a caster! You are a caster!" ....


Sonic
Reply With Quote