View Single Post
  #1  
Old 09-11-2009, 08:02 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Quote:
Originally Posted by trevius View Post
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)
Reply With Quote