EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Quests (https://www.eqemulator.org/forums/forumdisplay.php?f=624)
-   -   Function - Checking faction name ? (https://www.eqemulator.org/forums/showthread.php?t=13091)

KhaN 04-13-2004 10:51 PM

Function - Checking faction name ?
 
Im starting to write quests (Thx smogo for all your tutorials btw), I was wondering if a function exist or a way to do PERL quest that will check value of player faction.
Example : "Faction is ally, NPC will speak with him" ?

Monrezz 04-13-2004 11:24 PM

There's the $faction variable, it returns a number corresponding to the current faction level. See the sticky on Perl Quest guide at the top.

KhaN 04-13-2004 11:42 PM

Ah yes, thanks Monrezz like always.
Look like i have skipped the identifier part.

Monrezz 04-13-2004 11:47 PM

It is mainly used for if statements, so you can check the player has a high enough faction before the quest continues:

Code:

sub EVENT_SAY
{
  if(($text =~ /Hail/i) && ($faction >= 3))
    {
      quest::say("Do you think I ave time to talk to people like you?.");
    }

  elsif(($text =~ /Hail/i) && ($faction < 3))
    {
      quest::say("Greetings, $name.");
    }
}



All times are GMT -4. The time now is 02:27 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.