View Single Post
  #5  
Old 06-25-2004, 04:37 PM
x-scythe
Discordant
 
Join Date: Jun 2003
Posts: 449
Default

aight i thought i should clarify this seeing as some people may (and have) been getting confused by it.
in the example quests: Hail script
Multiple responses
NPC Shouting and Emoting
Bone Chips
there is an error

this is how they should look:

Hail Script:
Code:
sub EVENT_SAY 
{ 
 if ($text=~/Hail/i){quest::say("Why hello there mister!");} 
}
Multiple Responses:
Code:
sub EVENT_SAY 
{ 
 if ($text=~/Hail/i){quest::say("Hey, have you seen a [rock] around here?");} 
 if ($text=~/rock/i){quest::say("Ya it was big and shiny");} 
}
NPC Shouting and Emoting:
Code:
sub EVENT_SAY 
{ 
 if ($text=~/Hail/i) { quest::me("Theres a sound of [wind] blowing as you come close to bob-the-npc");} 
 if ($text=~/wind/i) { quest::shout("This guy is bugging me");} 
}
Bone Chips:
Code:
sub EVENT_SAY 
{ 
 if ($text=~/Hail/i){quest::say("Hail $name. We of Tunare are charged with protecting the Great Mother from the forces of Innoruk. Even now the evil minions of this foul deity are despoiling our great forest. Will you help us [protect the mother]?");} 
 if ($text=~/perform a task/i){quest::say("Just outside the gates of Felwithe the forces of Innoruk gather in the guise of decaying skeletons. Bring me four sets of bone chips as proof of your vigilance. I assure you that your faith shall not go unrewarded.");} 
} 
sub EVENT_ITEM 
{ 
 if ($itemcount{13331} == 4){quest::say("Praise Tunare - I knew that you would be victorious. I reward you with this spell, and pray that it will help you in your fight against the unholy forces of Innoruk."); 
 quest::exp(125); 
 quest::faction(32,5); 
 quest::faction(57,-1); 
 quest::spawnitem(15374);} 
}
notice the change was the ~= have been switched around to =~

it should be written like this
Code:
if($text=~/Blah/i)
NOT
Code:
if($text~=/Blah/i)

just thought i should point this out to the people who wish to learn PERL quest writing...
Reply With Quote