Thread: $race related
View Single Post
  #9  
Old 09-21-2004, 07:20 AM
Magoth78
Discordant
 
Join Date: Jun 2003
Posts: 345
Default

Ok, now for Dark Elf (example).

Here is the code:
Code:
sub EVENT_SAY
{
if($text=~/hail/i)
  {
  if($race eq Human)
    {
    quest::say("You are a Human.");
    }
  if($race eq Dark Elf)
    {
    quest::say("You are a Dark Elf.");
    }
   else
    {
    quest::say("FOOL! You are a $race not a human or a dark elf!");
    }
  }
}
Nothing happens when I hail the npc.
The error in the zone.exe is:
Message: Hail, evil side representant
[Status] Script error: qst76::EVENT_SAY - Perl runtime error: Can't locate object method "Dark" via package "Elf" (perhaps you forgot to load "Elf"?) at (eval 29) line 9.

Now, let's try
Code:
 if ($race eq Dark_Elf)
I hail the npc (I'm a dark elf), he answers me: "FOOL! You are a Dark Elf not a human or a dark elf!"

Sigh... now, let's try
Code:
 if ($race eq "Dark Elf")
And yeh, it works..

Thanks for the help guys,
Mag
Reply With Quote