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 01-08-2003, 09:08 PM
mByte
Hill Giant
 
Join Date: Feb 2002
Posts: 206
Default Updated Quest.CPP [SPAWN_NPC] w/ X, Y, Z, H

Spawn a npc and put it where you want it. (make sure your location is correct!)

SPAWN_NPC NPCID GRIDID X Y Z H

this example spawns a npc from the npc_types and places it at the location given with no grid assigned.

SPAWN_NPC 41419 0 -74 -130 -10

Code:
		/* New Spawn NPC Code */
		/*
		mByte
		SPAWN_NPC NPCID GRIDID X, Y, Z, H
		*/
		else if (strstr(command,"SPAWN_NPC") != NULL) {
				const NPCType* tmp = 0;
				int16 grid = atoi(sep.arg[2]);
				float xPos = atoi(sep.arg[4]); // no idea but need to swap X with Y
				float yPos = atoi(sep.arg[3]); // no idea but need to swap Y with X
				float zPos = atoi(sep.arg[5]);
				float hPos = atoi(sep.arg[6]);
				if (tmp = database.GetNPCType(atoi(sep.arg[1])))
				{
					if(xPos == NULL)
						xPos = 0;

					if(yPos == NULL)
						yPos = 0;

					if(zPos == NULL)
						zPos = 0;

					if(hPos == NULL)
						hPos = 0;


					NPC* npc = new NPC(tmp, 0, xPos, yPos, zPos, hPos);
					npc->AddLootTable();
					entity_list.AddNPC(npc,true,true);
					Sleep(200);
					if(npc != 0)
					{
						if(grid > 0)
							npc->AssignWaypoints(grid);
			
						npc->SendPosUpdate();
					}
			}
			ps = true;
		}
		/* end of New Spawn NPC Code */
I needed this function, so now its yours just replace over the old elseif statment. around line 281 of WesQuest.cpp

another example i use in my server for the that ride the school bus
[Do not use this in the .cpp file]

Code:
NPC_SCRIPT 41419{

	TRIGGER_TEXT:Hail:{
	EMOTE:Glance's over to %CHARNAME%, then returns to his overview of the yard.
	}

	TRIGGER_ITEM:9131:{
	EMOTE:Staggers in disbelief
	DO_ANIMATION 6
	EMOTE:Shakes his head then looks to %CHARNAME%. Will you help [defend Freeport]?
	}
	
	TRIGGER_TEXT:defend Freeport:{
	SAY:Great!, The orcs have dispatched an army, You have the praise of Marr with you! 
	Say:Get to the west gates now you havnt a moment to lose. 
	SHOUT:Bring me the head of the commanding Orc! 
 
	RAIN 1 
	SPAWN_NPC 55222 0 -117 -74 -10 0
	}
}
__________________
mByte
Reply With Quote
 

Thread Tools
Display Modes

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 12:28 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