Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-28-2002, 10:40 AM
Xarslik
Hill Giant
 
Join Date: Oct 2002
Location: System.Web
Posts: 107
Default WesQuests.cpp - NPCTYPESPAWN

I wrote this after I noticed that SPAWN_GROUP and SPAWN_NPC were both broken. The following code will allow you to spawn an npc_type at the specified x, y, z coord and heading.

Insert the following block under the else if block of SPAWN_GROUP in WesQuests.cpp.
Quote:
else if (strstr(strupr(command),"NPCTYPESPAWN") != NULL) {
if (tt2 || ti2 || td) {
if (sep.IsNumber(1)) {
const NPCType* tmp = 0;
if ((tmp = database.GetNPCType(atoi(sep.arg[1]))))
{
// tmp->fixedZ = 1;
NPC* npc = new NPC(tmp, 0, atoi(sep.arg[2]), atoi(sep.arg[3]), atoi(sep.arg[4])/10, atoi(sep.arg[5]));
entity_list.AddNPC(npc);
}
else
{
Message(0, "ERROR: NPC Type %i not found. Please petition a GM.", atoi(sep.arg[1]));
}
}
else {
Message(0, "ERROR: NPCTYPESPAWN Used incorrectly. Please petition a GM.");
}
}
}
Here's an example quest script using this function:
Code:
TRIGGER_TEXT:Bring on the first Challenge:{ 
SHOUT:Come forth, wolf of the night!
NPCTYPESPAWN 3 1056.52 -45.71 5.00 65.00 
}
That will spawn npc_type 3 (Savage Wolf in my case) at the specified location.
__________________
~ Xarslik
[ Xarslik's Arena Challenge Server ]
Reply With Quote
 


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:34 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3