Quote:
Originally Posted by sonicintuition
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