View Single Post
  #1  
Old 02-18-2018, 02:14 PM
lctucker2999
Sarnak
 
Join Date: Jan 2018
Posts: 51
Default simple perl help, please!

Hello everyone. I am trying to teach myself some basic script by copying code from existing quests and the perl lexicon, and tweaking it a little at a time, trying to add more and make things more complex as I go. I'm having trouble with the below code where the NPC just eats any items. Before I tried adding the armor code, it was working fine with turning in a water flask and getting a gem back. I'm guessing it's just some basic syntax errors that I don't understand. Thanks for the help!

Code:
sub EVENT_SAY
{
	if($text=~/hail/i)
		{
			quest::say("Hail, mortal.");
		}
}#END OF SAY

sub EVENT_ITEM
{
	if($itemcount{13006} == 1) #Water flask
		{
			quest::say("Thank you, $name.");#Text made up
			quest::summonitem(quest::ChooseRandom(10028, 10037, 22503, 15981));#Random gem: Peridot, Diamond, Blue Diamond, Raw Diamond
		}
	
	if($itemcount{13006} == 1) #Water flask
	if($itemcount{68223} == 1) #Muramite glove armor
		{
			quest::say("Thank you, $name.");#Text made up
			quest::summonitem(68862);#Trimdet gloves
		}
		
	if($itemcount{13006} == 1) #Water flask
	if($itemcount{68221} == 1) #Muramite sleeve armor
		{
			quest::say("Thank you, $name.");#Text made up
			quest::summonitem(68861);#Trimded Arms
		}
	else
		{
			quest::say("I do not need this, fool. $name, bah!");#Text made up
			quest::summonitem($item1) if($item1);
			quest::summonitem($item2) if($item2);
			quest::summonitem($item3) if($item3);
			quest::summonitem($item4) if($item4);
		}	
}#END of FILE Zone:poknowledge  ID:______ -- Defender of Frost
Reply With Quote