Thread: create a npc
View Single Post
  #3  
Old 05-06-2014, 09:03 AM
Trubles
Sarnak
 
Join Date: May 2014
Posts: 80
Default

Quote:
Originally Posted by warkid View Post
im wanting to know if its possible to create a NPC that gives rewards upon hails BUT its limited to on hail/reward per charater
Here is an example of qglobals being used to limit people from setting skills and wiping out any skill over 100.

Code:
sub EVENT_SAY
{
my $skill = quest::saylink("skills");
if($text=~/hail/i)
{
plugin::Whisper("Welcome to the tombs $name. You have access to a few commands to help you through your journey type #help to see them. Read the MOTD I can also give you [$skill] and spells (say links are broken, will fix in AM)");

}
if($text=~/skills/i && $qglobals{skills} == 0)
{
quest::setallskill(100);
quest::scribespells(65);
quest::traindisc(65);
quest::setglobal("skills",1,7,'f');
}
elsif($text=~/skills/i && $qglobals{skills}>= 1)
{
plugin::Whisper("You're trained");
}
}
Reply With Quote