PDA

View Full Version : Fabled spawn code


bodi
10-17-2011, 05:46 PM
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!



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");
}

LordAdakos
10-17-2011, 06:00 PM
Did you use a SQL query or edit the mobs out by hand?

looks like you are missing a close bracket

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...

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 :)

Derision
10-17-2011, 06:03 PM
Syntax-wise, you have an extra opening parenthesis and a missing closing curly bracket. This is a syntactically correct version:


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:

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.

bodi
10-17-2011, 06:10 PM
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.


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)

joligario
10-17-2011, 07:17 PM
http://www.eqemulator.net/wiki/wikka.php?wakka=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.

bodi
10-17-2011, 07:36 PM
Where would you find what "grid" to use?

Can you give me an example of the quest global?

joligario
10-17-2011, 07:38 PM
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.

bodi
10-17-2011, 07:52 PM
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.

joligario
10-17-2011, 08:15 PM
All kinds of examples if you have the peq quests library. Take a look at any elemental zone and PoK

bodi
10-17-2011, 09:40 PM
If you mean the PEQ editor, yeah , ill try to install that later. Looks pretty complex itself.

sorvani
10-17-2011, 10:59 PM
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.

bodi
10-18-2011, 02:09 AM
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.

lerxst2112
10-18-2011, 05:17 AM
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

bodi
10-18-2011, 03:23 PM
Ok, ill dig through there and try to find something similar to what i'm looking for. Thanks

revloc02c
10-18-2011, 07:58 PM
Hey bodi, hang in there, you'll get it.

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

http://projecteqquests.googlecode.com/svn/trunk/quests/bazaar/Aediles_Thrall.pl

You'd have to have complied your server with bots to play around and see it working in game though.