Thread: coming soon
View Single Post
  #21  
Old 07-22-2004, 07:41 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Quote:
Originally Posted by KhaN
Quote:
people in #support have said my quest is correct
I would like to know what they smoke ?!~

Try something like this, your syntax is wrong.
Code:
*#281099.pl 
sub EVENT_SAY 
{ 
 if ($text=~/hail/i) 
 { 
  if($npcvari1 == 0) 
  {
   quest::say("Hello! Would you be interested in helping me?"); 
   $npcvari1="0";    } 
  }
 if($text=~/helping/i)
 {
  if($npcvari1 == 1 &&  
  { 
   quest::targlobal("npcvari1","1","Y5",281099,$charid,26);
   quest::say("Thanks!"); 
   quest::me("You have recieved a character flag!");
   $npcvari1="0"; 
  } 
 }
}
You check action done to NPC, then if there is a variable and its value, then you give the action to do.

One important things is to ALWAYS add "quest::targlobal" as the first actions, or you can have bugs.
Also be sure to always perl cache by using command "$npcvari1="0"; ".
*
Hope that will help and GL in dev quests.
No i dont think you understood the quest, after you complete the quest the NPC should just respond with "Thanks for helping!".

and will

$npcvari1="0";

reset the global back to 0? Becuase thats not what I want.

Thanks in advance.
__________________
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