Register for your free account! | Forgot your password?

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

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

Advertisement



[Question]Adding an NPC?

Discussion on [Question]Adding an NPC? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2011
Posts: 82
Received Thanks: 12
[Question]Adding an NPC?

Hello guys,

first of all, I'm just a very noob coder and I learn everyday how to code in C#, and now I have a little problem with adding an NPC. Also, my English isn't perfect so don't pay attention to my mistakes.

Because the sources are made by different people and different ways, adding a NPC isn't the same on every sources. I can't even remember where I get mine si I uploaded the source again. I think that you don't need a guide for making the server so, here's the . It is a 5375 source so you need a client, I think that you've got one already .

My problem is, I correctly added the NPC but I can't even change his name. Let me show you how my code added is and the modified tables are right now.

Quote:
Originally Posted by Dialog.cs
Code:
                #region MyNewNPC
                case 7685:
                    {
                        switch (npcRequest.OptionID)
                        {
                            case 0:
                                {
                                    dialog.Text("Yop mec, j'peux que te parler pour le moment, mais on va faire des choses plus intéressantes ŕ l'avenir !");
                                    dialog.Link("Ouais ouais...", 255);
                                    dialog.Avatar(55);
                                    dialog.Send();
                                    break;
                                }
                        } break;
                    }
                #endregion
Quote:
Originally Posted by cq_npc
id | ownerid | name | type | lookface |mapid | cellx | celly | direction | action
7685 | 0 | MyNewNPC | 2 | 4450 | 1002 | 436 | 384 | 0 | 0
I tried also with "npc" table but gives the same result. The two tables modifed also. I really don't know how to add my NPC because when I try "CTRL+F" on "cq_npc", "npc" or in the entire solution and I search "Wolfe", I don't have any results...

I have seen a gui, "Manager.cs" and it looks like we can add NPC by that GUI, but she doesn't appear when I generate the executable file. I really don't have any idea on my problem, I hope that someone will get interesting in my problem.

Photo :

Uploaded with
itachi26 is offline  
Old 03/18/2012, 10:29   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Names are client sided. They're in "npc.ini" in the INI folder of the client.
Spirited is offline  
Thanks
1 User
Old 03/18/2012, 10:37   #3
 
elite*gold: 0
Join Date: Jul 2011
Posts: 82
Received Thanks: 12
Oh my gosh, you're right... I didn't know that. Thanks a lot for you're fast answer!
itachi26 is offline  
Old 07/20/2012, 23:32   #4
 
elite*gold: 0
Join Date: Jul 2011
Posts: 82
Received Thanks: 12
#UP

Back to annoy you again.

Well, I choiced an easier source because of my coding level, and I still have some problems to add my own NPC without editing an existant one.

Of course, you were right, there is "npc.ini" in the client, with the name but for exemple, for Alex :

INI :
Quote:
[NpcType216]
Name=Alex
SimpleObjID=265
StandByMotion=999265100
BlazeMotion=999265102
RestMotion=999265101
Effect=none
ASB=5
ADB=6
FixDir=0
Here is his code :

CODE :
Code:
                            #region Alex

                            case 3600:
                                {
                                    if (option == 0)
                                    {

                                        GC.AddSend(Packets.NPCSay("So you feel like getting 2nd reborn? Well then you came to the right place. In order to get 2nd reborn you need to be level 120 and have a Exemption Token"));
                                        GC.AddSend(Packets.NPCLink("I want 2nd reborn", 1));
                                        GC.AddSend(Packets.NPCLink("Nope, you're mistaken.", 255));
                                        GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                        GC.AddSend(Packets.NPCFinish());
This is not the entire code but anyway, I can't see a link between the "npc.ini" in the client and the "Case n°" in the code.

Can someone tell me where do I have to take a look?

EDIT : Moreoever, no "npc" tables in the database.

Thanks!
itachi26 is offline  
Old 07/21/2012, 00:58   #5
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Okay.

PHP Code:
[NpcType216]
Name=Alex
SimpleObjID
=265
StandByMotion
=999265100
BlazeMotion
=999265102
RestMotion
=999265101
Effect
=none
ASB
=5
ADB
=6
FixDir
=
216 is the TYPE of the npc, not its ID.

Look into OldCODB/ and there will be an npcs file, which will have a line like this
PHP Code:
//ID TYPE MAPID X Y
2600 216 1002 400 400 
or something of the sort, the case number is the ID in the database.
_DreadNought_ is offline  
Old 07/21/2012, 01:07   #6
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Please note that you CAN send the npc names from the server's end for on the fly changes but it's (slightly) more efficient to use client side editing only.

Just append the name string into the npc spawn packet and it should work fine.
pro4never is offline  
Old 07/21/2012, 02:02   #7
 
elite*gold: 0
Join Date: Jul 2011
Posts: 82
Received Thanks: 12
_DreadNought_ : I checked it out immediately but it lookds like it doesn't have the same look :
Quote:
3600(1) 2160(2) 2(3) 67(4) 1020(5) 436(6) 311(7)
(1) I guess this is the case number
(2) I really don't what is that thing
(3) I think that it is the flag*
(4) Well... haha
(5) It should be the map ID
(6) & (7) x & y

*flag : I can see that in a part of the source code :
Code:
 public enum NPCActionType
    {
        Shop = 1,
        Dialog = 2,//3, 4, 10, 15, 27
I will test to add mine and keep both of you informed.

pro4never : I won't lie and say that I didn't understand. At the moment I'm swimming into that large code but for sure, I note what you said.

Thanks!

EDIT : Oh no, can't build the solution, it looks like there is an error in the source. It was written in VS 2008 and I translated into 2010, now I've got an error... I think I am gonna take 5375's source which works fine.
itachi26 is offline  
Reply


Similar Threads Similar Threads
Adding new horses[Question]
09/28/2019 - SRO Coding Corner - 8 Replies
XXXXXXXXXXXXX
several question and maybe adding later
08/08/2010 - Private Server - 0 Replies
1) is athens luna and celestia luna both dead? 2) which private server of perfect world have latest mermaid character? thats all for now.......
[Question]Adding Pets
07/15/2010 - EO PServer Hosting - 2 Replies
when always i add new pets i get same proplem which is dissapearing the pet + dissapering the egg :confused: what i want to know for examble this in thread" New 2 Pets i 've make the sql with nothing wrong but what i want to know is if i must change any of the cilent side files ? or puts any thing new ??
{QUESTION} Adding sit to F1-F10
12/28/2009 - Conquer Online 2 - 3 Replies
is there anyway to do this
[Question]Adding Skills
08/22/2009 - CO2 Private Server - 1 Replies
How do you add skills? For example I want a skill for GMs only that uses magic and 1 hits everyone.



All times are GMT +1. The time now is 16:48.


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.