Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2014, 04:34 PM
knight-mare
Sarnak
 
Join Date: Jun 2014
Posts: 69
Default Quest help

ok so here i have a quest it works without any issues however i want to make it so it will cast on players below level 10 if anyone above level 10 hails it wont work for them.... can someone please help.... thanks in advance

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) { quest::selfcast(13); }
}
sub EVENT_ITEM
{
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);
}
}

Last edited by Uleat; 08-22-2014 at 06:56 PM.. Reason: Uleat: added code blocks
Reply With Quote
  #2  
Old 08-22-2014, 04:36 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

You should post code in a code block so it is readable and doesn't have a bunch of smilies in it.
Reply With Quote
  #3  
Old 08-22-2014, 06:58 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

I added code blocks..but, he'll have to add indentions... I don't want to change to change the context of what he's trying to do.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote
  #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
  #5  
Old 08-23-2014, 12:18 PM
knight-mare
Sarnak
 
Join Date: Jun 2014
Posts: 69
Default

tried that and didnt work ..... but what i wanna do is give free spells to people under say level 10.... so in all honesty that script would not work anyways

so i changed it to

sub EVENT_SAY
{
my $buffs = quest::saylink("buffs");
if($text=~/Hail/i)
{
quest::say("Greetings $name. Would you like some [$buffs]?");
}

if($text=~/buffs/i)
{
quest::selfcast(174);
quest::selfcast(3692);
quest::selfcast(2525);
quest::selfcast(144);
quest::selfcast(970);
quest::selfcast(356);
quest::selfcast(99;
quest::selfcast(27;
}
}

but if i add u level it becomes unusable
Reply With Quote
  #6  
Old 08-23-2014, 12:44 PM
nilbog
Hill Giant
 
Join Date: Nov 2007
Posts: 197
Default

Quest worked fine for me. I tried it, but maybe something is different. The perl wiki still references:

Quote:
$ulevel # Returns the level of the user that triggered the Event.
So I'm not sure about that.
Quote:
but what i wanna do is give free spells to people under say level 10
In your previous example, it seemed you explicitly wanted to charge for them.

I just tried this, and it worked fine, with a level check, as well as an else telling them why it wouldn't work.

Code:
sub EVENT_SAY {
	if ($text=~/buffs/i) 
	{
		if ($ulevel <= 10)
		{
			quest::selfcast(174);
			quest::selfcast(3692);
			quest::selfcast(2525);
			quest::selfcast(144);
			quest::selfcast(970);
			quest::selfcast(356);
		}
		else
		{
			quest::say("I was going to give you buffs, but you're above level 10!");
		}
	}
}
__________________
https://www.project1999.com
Reply With Quote
  #7  
Old 08-23-2014, 01:25 PM
knight-mare
Sarnak
 
Join Date: Jun 2014
Posts: 69
Default

Thanks you a ton
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:04 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3