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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2009, 02:43 PM
kayen85
Sarnak
 
Join Date: Dec 2007
Posts: 50
Default Method for automaticly generating locs for quest spawned NPC's

Maybe there is a better way that people use. But for the longest time when I was quest spawning NPC via scripts I would always manually enter the locs, using #loc then just writing that down into the file. Obviously this is time consuming and tedious when you need to generate a large number. So here is a small script I wrote that will automatically do it for you.

In short. You spawn the mob. It automatically saves its location to a text file. Then despawn. For added control you can alter the code to let you use say for when you want to store the locs. Then you can directly copy and paste the entire quest spawn from. Its very efficient.

- First create an NPC call it whatever you want. I used the name ####LOC
- Then create a quest file for this NPC in the zone you will be generating the locations
- Then just dbspawn the NPC your using for this (in this case I used ####LOC ). It will spawn store the loc and depop.
- Go to txt file and copy and paste out your spawn2 information


Basically the most important part for customizing the NPCid in this.
quest::write("LocGen.txt","quest::spawn2(888183,0, 0, $LocX, $LocY, $LocZ , $LocH);");

Code:
# Mob name: ####LOC  ID: 888184
#This generates and saves locations for copy and paste.
#Yes = save
#No = Depop
#Break = Line break in .txt

sub EVENT_SAY {
if ($text=~/hail/i) {
quest::say("[Yes] or [No]. [Break]");
}

if ($text=~/Yes/i) {
my $LocX = $npc->GetX();
my $LocY = $npc->GetY();
my $LocZ = $npc->GetZ();
my $LocH = $npc->GetHeading();
quest::say( "quest::spawn2(ReplaceID,0,0, $LocX, $LocY, $LocZ , $LocH);") ;
quest::write("LocGen.txt","quest::spawn2(888183,0,0, $LocX, $LocY, $LocZ , $LocH);");
quest::depop();
}

if ($text=~/No/i) {
quest::depop();
}

if ($text=~/Break/i) {
quest::write("LocGen.txt"," ");
}

}

### Disable this if you want more detailed control ###
sub EVENT_SPAWN {
my $LocX = $npc->GetX();
my $LocY = $npc->GetY();
my $LocZ = $npc->GetZ();
my $LocH = $npc->GetHeading();
quest::say( "quest::spawn2(ReplaceID,0,0, $LocX, $LocY, $LocZ , $LocH);") ;
quest::write("LocGen.txt","quest::spawn2(888183,0,0, $LocX, $LocY, $LocZ , $LocH);");
quest::settimer("depop",1);
}

sub EVENT_TIMER {
if ($timer eq "depop") {
quest::stoptimer("depop");
quest::depop()
  }
}
I wish I thought of this along time ago. Makes my life easier.

Kayen
GM Stormhaven
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 02:11 PM.


 

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