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 10-17-2011, 05:46 PM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default Fabled spawn code

On my server, I am getting rid of the old /camp out to repop zone. I deleted all PH so named are the only one in their spawn table. Now, instead of fabled sharing a spawn, I want to make it so that once you kill the named, you have a 5% chance of making its death spawn the fabled version. (right now it is set to 70% for testing below) Here is my script. Please tell me why its not working. Also, is there a way I can code it so that it /Emotes something to the server the first time it has been killed? Thanks!

Code:
sub EVENT_DEATH{
 my $random_result = int(rand(100));
 my $a=63096; #npc - Fabled Garanel Rucksif
 if(($random_result<70){
   quest::say("Spawning Fabled");
quest::shout ("I will be Avenged Scoundrel!");
   quest::spawn2($a, 485, 147, -33);
  }else{
    quest::say("No spawn");
  }
Reply With Quote
  #2  
Old 10-17-2011, 06:00 PM
LordAdakos
Sarnak
 
Join Date: Dec 2007
Posts: 60
Default

Did you use a SQL query or edit the mobs out by hand?

looks like you are missing a close bracket
Code:
sub EVENT_DEATH{
 my $random_result = int(rand(100));
 my $a=63096; #npc - Fabled Garanel Rucksif
 if(($random_result<70){
   quest::say("Spawning Fabled");
quest::shout ("I will be Avenged Scoundrel!");
   quest::spawn2($a, 485, 147, -33);
  }else{
    quest::say("No spawn");
  }
  }
To troubleshoot, why not add in...
Code:
sub EVENT_DEATH{
 my $random_result = int(rand(100));
 my $a=63096; #npc - Fabled Garanel Rucksif
 if(($random_result<70){
quest::shout ("$random_result");
   quest::say("Spawning Fabled");
quest::shout ("I will be Avenged Scoundrel!");
   quest::spawn2($a, 485, 147, -33);
  }else{
    quest::say("No spawn");
quest::shout ("$random_result");
  }
  }

sorry I'm not much help
Reply With Quote
  #3  
Old 10-17-2011, 06:03 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Syntax-wise, you have an extra opening parenthesis and a missing closing curly bracket. This is a syntactically correct version:
Code:
sub EVENT_DEATH
{
	my $random_result = int(rand(100));
	my $a=63096; #npc - Fabled Garanel Rucksif
	if($random_result<70)
	{
		quest::say("Spawning Fabled");
		quest::shout ("I will be Avenged Scoundrel!");
		quest::spawn2($a, 485, 147, -33);
	}
	else
	{
		quest::say("No spawn");
	}
}
To find those issues, all I did was copy your code into a file called, e.g. D:\temp\test.pl, launched a command window and ran it through Perl like so:
Code:
D:\temp>perl test.pl
syntax error at test.pl line 4, near "){"
syntax error at test.pl line 8, near "}else"
Missing right curly or square bracket at test.pl line 10, at end of line
Execution of test.pl aborted due to compilation errors.
That won't tell you if it will work in-game, but it will catch any syntax errors for you.

If it terminates with no messages, you know your syntax is good.

Last edited by Derision; 10-17-2011 at 06:09 PM..
Reply With Quote
  #4  
Old 10-17-2011, 06:10 PM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default

ok, derision's works, I think I need 6 numbers in the spawn loc instead of 3 to spawn the fabled, if I add in 0, 0, 0 to the back of the spawn loc it adds him under the world.

Code:
sub EVENT_DEATH
{
	my $random_result = int(rand(100));
	my $a=63096; #npc - Fabled Garanel Rucksif
	if($random_result<70)
	{
		quest::say("Spawning Fabled");
		quest::shout ("I will be Avenged Scoundrel!");
		quest::spawn2($a, 485, 147, -33);
	}
	else
	{
		quest::say("No spawn");
	}
}
And if you know how I can make him emote ONLY the first time he is killed, that would be sick too. (for "SERVER FIRST" script)
Reply With Quote
  #5  
Old 10-17-2011, 07:17 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

http://www.eqemulator.net/wiki/wikka...=QuestTutorial

quest::spawn2(npc_type,grid,guildwarset,x,y,z,head ing) - Spawn "npc_type" on "grid" with "guildwarset" (use 0) at "x","y","z" facing "heading".

As for the "first", use a quest global.
Reply With Quote
  #6  
Old 10-17-2011, 07:36 PM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default

Where would you find what "grid" to use?

Can you give me an example of the quest global?
Reply With Quote
  #7  
Old 10-17-2011, 07:38 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

The grid is set up by you. If you don't want him to walk, use 0.

Quest globals are on the bottom of that page I just linked.
Reply With Quote
  #8  
Old 10-17-2011, 07:52 PM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default

k thanks.

the global section is sort of gibberish, its easier to deconstruct or manipulate existing, but ill look elsewhere. Thanks for the grid tip, though. Works.
Reply With Quote
  #9  
Old 10-17-2011, 08:15 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

All kinds of examples if you have the peq quests library. Take a look at any elemental zone and PoK
Reply With Quote
  #10  
Old 10-17-2011, 09:40 PM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default

If you mean the PEQ editor, yeah , ill try to install that later. Looks pretty complex itself.
Reply With Quote
  #11  
Old 10-17-2011, 10:59 PM
sorvani
Dragon
 
Join Date: May 2010
Posts: 965
Default

you can increase the zone autoshutdown delay to something greater than 5000ms or you could simply statically load the zones.

I assume you are only doing this on fabled as there are a ton of named with PH spawns otherwise.

And giving the named a 100% spawn? so instead of repopping the zone, i go from zone to zone killing everything and coming back at the scheduled respawn time.

Finally, no he is not talking about the peq editor.
Reply With Quote
  #12  
Old 10-18-2011, 02:09 AM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default

Quote:
Originally Posted by sorvani View Post
you can increase the zone autoshutdown delay to something greater than 5000ms or you could simply statically load the zones.

I assume you are only doing this on fabled as there are a ton of named with PH spawns otherwise.

And giving the named a 100% spawn? so instead of repopping the zone, i go from zone to zone killing everything and coming back at the scheduled respawn time.

Finally, no he is not talking about the peq editor.

No, im doing it on all named spawns in dungeons at least. Its way more fun to run through a zone in an hour and slay everything. There is nothing fun about /camping to repop a zone. If you really want to camp the fabled, yeah, i guess come back later, but its more of a bonus encounter.

Can you tell me what he IS talking about? I googled it and no results. dumb it down with a download link for us newbs.
Reply With Quote
  #13  
Old 10-18-2011, 05:17 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

You know the quests folder in your server directory full of a bunch of perl files? Where did it come from? peq...

http://projecteqquests.googlecode.com/svn/trunk/quests
Reply With Quote
  #14  
Old 10-18-2011, 03:23 PM
bodi
Hill Giant
 
Join Date: May 2010
Posts: 105
Default

Ok, ill dig through there and try to find something similar to what i'm looking for. Thanks
Reply With Quote
  #15  
Old 10-18-2011, 07:58 PM
revloc02c's Avatar
revloc02c
Hill Giant
 
Join Date: Aug 2010
Location: UT
Posts: 215
Default

Hey bodi, hang in there, you'll get it.

Here's where I first learned how to use quest globals:

http://projecteqquests.googlecode.co...iles_Thrall.pl

You'd have to have complied your server with bots to play around and see it working in game though.
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 11:23 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