Register for your free account! | Forgot your password?

You last visited: Today at 11:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



NPC Spawn

Discussion on NPC Spawn within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
NPC Spawn

Code:
union NPC {
			uint16_t val;
			struct {
				uint16_t type, Dir;
			}coords;
		};
		       case 0x7EE:{
			NpcSpawnPacket npc;
			npc.setNPC_ID(1002);
			npc.setNPC_CordX(444);
			npc.setNPC_CordY(444);
			NPC s;
			s.coords.type=0;
			s.coords.Dir=1002;
			npc.setNPC_Type_Direction(s.val);
			npc.setNPC_Interaction(1);
			SendPacket(&npc);
		}
actully idk what is NPC_Type_Direction and NPC_Interaction!!
Mr_PoP is offline  
Old 03/07/2011, 03:56   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Seriously... just learn to log your own packets. This is like the 3rd thread you have made about trying to upgrade your packets.

Simply use my proxy to log some packets and then structure them. You already know it's type 1022 so just fill in the blanks yourself.

There is no actual offset in the packet for direction (it's simply the last digit in the mesh offset) and interaction is most likely the script number.. that being said I don't know how the actual packet is structured cause you only posted yourself USING it.
pro4never is offline  
Old 03/07/2011, 04:02   #3
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by pro4never View Post
Seriously... just learn to log your own packets. This is like the 3rd thread you have made about trying to upgrade your packets.
am not trying to upgrade am making a server from scratch(C++)

Quote:
Originally Posted by pro4never View Post
Simply use my proxy to log some packets and then structure them. You already know it's type 1022 so just fill in the blanks yourself.
i will

Quote:
Originally Posted by pro4never View Post
There is no actual offset in the packet for direction (it's simply the last digit in the mesh offset) and interaction is most likely the script number.. that being said I don't know how the actual packet is structured cause you only posted yourself USING it.
what am trying to say is:
NPC_ID(means what or what should i pass as it?)= MAPID?
and u already told me about NPC_Type_Direction and NPC_Interaction
Mr_PoP is offline  
Old 03/07/2011, 04:24   #4
 
Arco.'s Avatar
 
elite*gold: 0
Join Date: Feb 2011
Posts: 335
Received Thanks: 170
@pro, he has the structure already, what he's trying to find out is what exactly do the values mean.
Arco. is offline  
Old 03/07/2011, 05:31   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
My bad. But without knowing which offset he's writing each value to we have no idea what they mean. For all I know he's writing the NPC ID to the MapX offset. That's what I meant by structuring the packet :P
pro4never is offline  
Old 03/07/2011, 05:34   #6
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by pro4never View Post
My bad. But without knowing which offset he's writing each value to we have no idea what they mean. For all I know he's writing the NPC ID to the MapX offset. That's what I meant by structuring the packet :P
here is how i DO it:

Code:
	void setNPC_ID(uint32_t value){this->writeInt<uint32_t>(4,value);}
	void setNPC_CordX(uint16_t value){this->writeInt<uint16_t>(8,value);}
	void setNPC_CordY(uint16_t value){this->writeInt<uint16_t>(10,value);}
	void setNPC_Type_Direction(uint16_t value){this->writeInt<uint16_t>(12,value);}
	void setNPC_Interaction(uint16_t value){this->writeInt<uint16_t>(14,value);}
Edit: where should i add the Map_ID?
Mr_PoP is offline  
Old 03/07/2011, 05:58   #7
 
elite*gold: 0
Join Date: Dec 2009
Posts: 81
Received Thanks: 6
thxxxxxxx
romey007 is offline  
Old 03/07/2011, 06:02   #8
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by Mr_PoP View Post
here is how i DO it:

Code:
	void setNPC_ID(uint32_t value){this->writeInt<uint32_t>(4,value);}
	void setNPC_CordX(uint16_t value){this->writeInt<uint16_t>(8,value);}
	void setNPC_CordY(uint16_t value){this->writeInt<uint16_t>(10,value);}
	void setNPC_Type_Direction(uint16_t value){this->writeInt<uint16_t>(12,value);}
	void setNPC_Interaction(uint16_t value){this->writeInt<uint16_t>(14,value);}

NpcID should be the ID of the npc (this means the npc script the client will try to use when clicking it)

X should be offset 12
Y should be offset 14

Direction is part of the mesh (offset 16) as the last digit so mesh 1 would be 10-18


Interaction is what many call flag which is simply type of npc which goes at offset 18. 2 is normal npcs which you use. Other interaction types for things like shops and avatar change npcs.
pro4never is offline  
Old 03/07/2011, 06:10   #9
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by pro4never View Post
NpcID should be the ID of the npc (this means the npc script the client will try to use when clicking it)

X should be offset 12
Y should be offset 14

Direction is part of the mesh (offset 16) as the last digit so mesh 1 would be 10-18


Interaction is what many call flag which is simply type of npc which goes at offset 18. 2 is normal npcs which you use. Other interaction types for things like shops and avatar change npcs.
yeah got it now but u didnt tell me about :
where should i add the Map_ID?
Mr_PoP is offline  
Old 03/07/2011, 06:12   #10
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by Mr_PoP View Post
yeah got it now but u didnt tell me about :
where should i add the Map_ID?
Not needed. You don't need map id for any of the spawn packets.
pro4never is offline  
Old 03/07/2011, 06:21   #11
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by pro4never View Post
Not needed. You don't need map id for any of the spawn packets.
then how would the npc knw which map to spawn at ?
Mr_PoP is offline  
Old 03/07/2011, 07:42   #12
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
The npc doesn't 'know' anything...

You have to control all your maps, x and y from the server. What is sent in the packet simply controls how the entity is displayed in the client. The client removes entities if they go above a distance of 18 from you meaning that you cannot possibly have something visible on a different map.

Obviously you will need a map id in your monster structure to control where and when it is being spawned but it has NOTHING to do with packets.

When you move your character you essentially want to query nearby objects pulling everything within a 18x18 grid and if the entity is not already spawned to the user, you need to spawn it using your spawn packets (spawn sob, npc, player/monster, item)
pro4never is offline  
Reply


Similar Threads Similar Threads
x5 Spawn Req?
12/27/2009 - Grand Chase - 2 Replies
i nid x5 spawn for spearman quest. can any1 make me please. im trying to learn the editing atm. and cant seem to get it :<
lab 2 spawn
07/19/2006 - Conquer Online 2 - 2 Replies
i was just wandering where is the best spawn to lvl archer in lab 2 or the best spawn of agile rat
MZ Spawn Map?
04/27/2006 - Conquer Online 2 - 23 Replies
i just wanna no does any1 have a map of where the MetDove spawns in MZ. Thx In Advance



All times are GMT +2. The time now is 11:29.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.