Quote:
Originally Posted by trevius
A better way to write this might be the following:
Code:
if($text=~/Hail/i)
{
if($qglobals{rin_quest} == 1)
{
$client->Message(5, ("Rin Distlmore whispers - I am so sorry! I should never have sent you to that place! Can you ever [forgive me]?");
}
else
{
quest::emote("jumps at your voice, and begins breathing heavily...");
$client->Message(5, "Oh, it's just you. I bet [you think I'm crazy] too, huh? Everyone thinks I'm crazy!");
}
}
|
Just to caveat, you should also check if the global is defined before making a == check.
Code:
if(defined($qglobals{rin_quest}) && $qglobals{rin_quest} == 1)