Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 04:07

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

Advertisement



[REQUEST] ADD NPC to SOURCE CoEmu

Discussion on [REQUEST] ADD NPC to SOURCE CoEmu within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
ktamer's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 99
Received Thanks: 35
[REQUEST] ADD NPC to SOURCE CoEmu

I've looked all over and searched my **** off. How the **** do you add a non-existent NPC to the server? Example; I have no Blacksmith Lee existing in server so i added him via Navicat and then in NPCtalk.cs. Navicat - NPCID = 55122 NPc type = 45199 SubType = 146 Map = 1036 x = 207 y = 213 direction = 0 flag = 2. and case in source is 45199. he shows up but clicking does nothing. i even tried same npc setup with different ID and wouldnt click still? Any and all related info is appreciated.
ktamer is offline  
Old 01/04/2010, 07:11   #2
 
elite*gold: 80
Join Date: Sep 2007
Posts: 642
Received Thanks: 168
Quote:
Originally Posted by ktamer View Post
I've looked all over and searched my **** off. How the **** do you add a non-existent NPC to the server? Example; I have no Blacksmith Lee existing in server so i added him via Navicat and then in NPCtalk.cs. Navicat - NPCID = 55122 NPc type = 45199 SubType = 146 Map = 1036 x = 207 y = 213 direction = 0 flag = 2. and case in source is 45199. he shows up but clicking does nothing. i even tried same npc setup with different ID and wouldnt click still? Any and all related info is appreciated.
the case is 55122 not 45199.

EDIT:

If you adding a shop you need to edit the shop.dat...If i am correct, it has nothing to do with the source coding.
Santa is offline  
Thanks
1 User
Old 01/06/2010, 07:45   #3
 
ktamer's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 99
Received Thanks: 35
Unfortunately tried your suggestion...was a no go. I took an already placed "useless" npc and made it a blacksmith, which worked when I clicked him. Is there any guide specific rules for making non-shop based NPC's?
ktamer is offline  
Old 01/07/2010, 00:40   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Yes, there are TONS of guides posted which you can find easily by searching the forum.

Also if you are interested the link in my siggy has some general scripting guides in it (they are formatted for cofuture but it's identical to coemu except you will need to change around some stuff like you use CSocket instead of Client and some other little things like that. The basis behind the guides apply to any source though)

Another example you could use is ANY npc script released for CoEmu (I suggest a simple/small one as it is easier to understand) and then go from there.


Case number in Handlers>npctalk.cs is the script for the npc (as controlled in the database). What you could do to avoid trouble is talk to a non-implemented npc ingame and it will tell you its case number. Then make a new case in npctalk for it and that will be your test npc for it. When done just add a new npc in the database and change the case number over.


For simplicity I took the time to open up the base coEmu source to give you a super simple sample npc incase you don't feel like searching (you really should, there is tons of info on here)

Code:
case 1152: // Simon the lab teleporter//case number is the script id for the npc in database
					{
						if(LinkBack == 0)//link back 0 is the STARTING option for any npc
							{
							Text("Hello My name is Simon, And I can help you train after you reach Level 70.\n Although I am willing to help you out I have one requirement:\n you pay me 100,000 gold for my services.", CSocket);//this is how text is handled in npcs, \n creates new line of text or you can do multiple Text("", CSocket);'s
							Link("I am prepared to pay you for your\n wonderful service!", 1, CSocket);//links change to a different LinkBack in the SAME case number
							Link("Not interested", 255, CSocket);//Link 255 closes the npc
							End(CSocket);//End CSocket ENDS the linkback. MUST BE USED IN EVERY LINK BACK OR YOU WILL GET SOME FUNKY BUGS!
						}
						else if(LinkBack == 1)//link back 1 comes from npc option 1 in last section
						{
							
							if(CSocket.Client.Level >= 70)//checks if player level is 70+
							{
								if(CSocket.Client.Money >= 100000)//checks if player money is 100000 +
								{//if money check passes these brackets happen
									Money(-100000, CSocket);//money is removed
									Teleport(1351, 20, 130, 0, CSocket);//player is teleported to map 1351 x20 y 130 instance 0
								}//end of money check
								else//if player money isn't 100k+
								{
									Text("Dare you try to rip me off?! Be gone, fool!", CSocket);//text for if player doesn't have money
									Link("Sorry sir.", 255, CSocket);//closes dialogue
									End(CSocket);//REMEMBER TO END IT!
								}
							}
							else//if player isn't 70+
							{
								Text("You are not yet level 70. Train harder.", CSocket);//text
								Link("Oh, sorry. Thanks!", 255 ,CSocket);//closes dialogue
								End(CSocket);//REMEMBER TO END IT ANY TIME YOU HAVE A NPC TEXT SCREEN!
							}
						}
						break;//ends the npc script! Use break; at the end or you will get errors
                    }//closes the last bracket

That should put you alot further along in understanding but a full guide may be better for you.
pro4never is offline  
Reply


Similar Threads Similar Threads
[REQUEST] CoEmu 5165 Source
11/28/2009 - CO2 Private Server - 9 Replies
Hello, please can someone hand over a 5165 source please, im currently learning c# and would like to add things to different source.. Kindest Regards Phenom
[Request]For CoEmu v2 Source
09/27/2009 - CO2 Private Server - 6 Replies
CAn someone poste on this topic or create another topic and post the code for nobility for the CoEmu V2 Source it doesn't matter if it's by npc or with the little icon on the left top screen just plsssss postee it a lot of people whant it PLSS:handsdown::handsdown:
[Request]Help with CoEmu source
06/02/2009 - Conquer Online 2 - 0 Replies
I'm having some trouble with the coemu source... i did everything that the guides told me to do and i tried and tried... i just have a problem when i try to start the server and an error report pops up and closes the program. i just want some help so if anyone knows what my problem is just let me know and i would appreciate it. =)
[REQUEST]CoEmu Coded Source
05/30/2009 - CO2 Private Server - 5 Replies
can someone post a CoEmu source coded..:confused:
[Request]Need help with CoEmu source
05/28/2009 - CO2 Private Server - 2 Replies
Can anyone tell me or gimme any guides how to get server.dat working with hamachi on 5095 patch? Everytime i change to hamachi ip it just says that server.dat broken or smth. my hamachi ip is 5.133.104.45 if anyone knows how to make working one and willing to make Thanks in advance - Laury



All times are GMT +1. The time now is 04:08.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.