Thread: Quest help
View Single Post
  #4  
Old 08-23-2014, 10:20 AM
nilbog
Hill Giant
 
Join Date: Nov 2007
Posts: 197
Default

You can do this rather simply by requesting a $ulevel check with an if. Like:

if ($text=~/heal/i)
{
if ($ulevel <= 10)
{
quest::selfcast(13);
}
}

and at the beginning of sub EVENT_ITEM:

sub EVENT_ITEM
{
if ($ulevel <= 10)
{

Note that will make the npc not accept any item unless the user is <= level 10. If you wanted them to take other items, you can add that if check in each platinum/item check.

For example, here is your script with the additions.

Code:
sub EVENT_SAY {
	if ($text =~/Hail/i)
	{
		quest::say("Greetings $name. If you want me to cast a spell on you, please say so and I will give you my [pricelist]. If you want me to [heal] you, please say so and I will do it for free."); 
	}
	if($text=~/pricelist/i)
	{
		quest::say("I can cast the following spells : Spirit of Wolf = 1 pp // Dead Man Floating = 3 pp // Clarity = 4 pp // Clarity II = 5 pp // Spiritual Light = 8 pp // Spiritual Radiance = 15 pp // Temperance = 1 peridot // Virtue = 4 peridots // KEI = 50 pp");
	}
	if ($text=~/heal/i) 
	{ 
		if ($ulevel <= 10)
		{
			quest::selfcast(13); 
		}
	}
}

sub EVENT_ITEM
{
	if ($ulevel <= 10)
	{
		if($platinum == 1)
		{
			quest::selfcast(278);
		}
		if($platinum == 3)
		{
			quest::selfcast(457);
		}
		if($platinum == 4)
		{
			quest::selfcast(174);
		}
		if($platinum == 5)
		{
			quest::selfcast(1693);
		}
		if($platinum == 8)
		{
			quest::selfcast(2176);
		}
		if($platinum == 15)
		{
			quest::selfcast(2177);
		}
		if($item1== 10028)
		{
			quest::selfcast(3692);
		}
		if($itemcount{10028} == 4)
		{
			quest::selfcast(3467);
		}
		if($platinum == 50)
		{
			quest::selfcast(2570);
		}
	}
}
Hope that helps. Good luck.
__________________
https://www.project1999.com
Reply With Quote