Thread: $race related
View Single Post
  #2  
Old 09-21-2004, 06:55 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default Re: $race related

Quote:
Originally Posted by Magoth78
Hello,

I'm pretty new at quest scripting and i've looked for $race in the search forum but I did not find the solution at my problem.
I'm just trying to get a npc to say the race of the player that hails him... pretty simple you say me... probably not for me...

Code:
sub EVENT_SAY
{
	if ($text=~ /Hail/i)
		{
  		if($race == Erudite)
    			{
    			quest::say("Erudit");
			}

		if($race == Darkelf)
			{
    			quest::say("Dark elf");
			}

		}
}
I've tested whit a human character, hailed the npc and he says me Erudit then Dark elf, even if I'm a human. I think it's due to the $race == xx.

Can someone help me please?
thx by advance
Try this code. I think all you need are quotes around the race and correct spelling (Dark Elf not Darkelf).
Code:
sub EVENT_SAY
{
if($text~/hail/i)
  {
  if($race == "Human")
    {
    quest::say("You are a human.");
    }
   else
    {
    quest::say("FOOL! You are a $race not a human!");
    }
  }
}
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote