Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 07-01-2010, 03:31 PM
kaos00723
Sarnak
 
Join Date: Apr 2010
Posts: 38
Default Need help with chest spawn quest

Hi, I can't figure out what I'm doing wrong here. I'm trying to get this chest spawn script installed so that all NPC's up to lvl 50 have a chance of spawning a treasure chest.

Code:
sub EVENT_DEATH
{
$rand = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10);
if ($npc->GetLevel() >= $ulevel)
{
	if ($rand > 9)
	{

		if ($ulevel < 11)
		{
			quest::emote(" was holding extraordinary treasure!");
			quest::spawn(1250,0,0,$x,$y,$z);
		} else {
			if ($ulevel < 21)
			{
				quest::emote(" was holding extraordinary treasure!");
				quest::spawn(1251,0,0,$x,$y,$z);
			} else {
				if ($ulevel < 31)
				{
					quest::emote(" was holding extraordinary treasure!");
					quest::spawn(1252,0,0,$x,$y,$z);
				} else {
					if ($ulevel < 41)
					{
						quest::emote(" was holding extraordinary treasure!");
						quest::spawn(1253,0,0,$x,$y,$z);
					} else {
						if ($ulevel < 51)
						{
							quest::emote(" was holding extraordinary treasure!");
							quest::spawn(1254,0,0,$x,$y,$z);
						} else {
					// We don't support level 51+ characters
				}
			}
		}
	} else {
		quest::emote(" was worth no treasure this time.");
	}
} else {
	quest::emote(" is worth no treasure as it is weaker than you.");
}
}
I've tried adding this to the default.pl in the quests directory, the plugins directory, the templates directory, and even individual zones with absolutely no luck. I've tried adding it to the stock default.pl and tried renaming it to default.pl by itself, nothing seems to work.

Can someone please explain to me how to get this to work?

Thanks!
Reply With Quote
  #2  
Old 07-02-2010, 05:15 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

There's an issue with the script. The closing brackets( } ) don't all match the opening brackets( { ). Go through and make sure they match up and try it again.

Code:
sub EVENT_DEATH
{
	$rand = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10);
	if ($npc->GetLevel() >= $ulevel)
	{
		if ($rand > 9)
		{
			if ($ulevel < 11)
			{
				quest::emote(" was holding extraordinary treasure!");
				quest::spawn(1250,0,0,$x,$y,$z);
			} 
			else {
				if ($ulevel < 21)
				{
					quest::emote(" was holding extraordinary treasure!");
					quest::spawn(1251,0,0,$x,$y,$z);
				} 
				else 
				{
					if ($ulevel < 31)
					{
						quest::emote(" was holding extraordinary treasure!");
						quest::spawn(1252,0,0,$x,$y,$z);
					} 
					else 
					{
						if ($ulevel < 41)
						{
							quest::emote(" was holding extraordinary treasure!");
							quest::spawn(1253,0,0,$x,$y,$z);
						} 
						else 
						{
							if ($ulevel < 51)
							{
								quest::emote(" was holding extraordinary treasure!");
								quest::spawn(1254,0,0,$x,$y,$z);
							}
						}
					}
				}
			}
		} 
		else 
		{
			quest::emote(" was worth no treasure this time.");
		}
	} 
	else 
	{
		quest::emote(" is worth no treasure as it is weaker than you.");
	}
}
There might be other problems I didn't check but that was the most obvious. I try to tell people to have consistent clean style when they code for the project to avoid things like this, if everything lines up it's a lot easier to catch and fix mistakes.
Reply With Quote
  #3  
Old 07-02-2010, 01:58 PM
kaos00723
Sarnak
 
Join Date: Apr 2010
Posts: 38
Default

Thanks KLS, adding a couple closing brackets did the trick.
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 04:55 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3