Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 01:13

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

Advertisement



[Release]Change NPC System To C# - Hybrids

Discussion on [Release]Change NPC System To C# - Hybrids within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
[Release]Change NPC System To C# - Hybrids

First open your projectfile.
Create a new folder and call it NPC.
Make a class inside the folder called NPCDialog, it should look like this once you have done it.
Code:
    public class NPCDialog
    {
        public static void ProcessNpc(GameClient Client, byte OptionID, string Input)
        {
            switch (Client.ActiveNpcID)
            {
                default: break;
            }
        }
    }
Now open ConquerScriptEngine.cs and find:
Code:
public static void ProcessNpc(GameClient Client, byte OptionID, string Input)
Replace it with this.
Code:
        public static void ProcessNpc(GameClient Client, byte OptionID, string Input)
        {
            try
            {
                NPC.NPCDialog.ProcessNpc(Client, OptionID, Input);
            }
            catch (Exception e)
            {
                Kernel.NotifyDebugMsg(string.Format("[Npc Processor Error - {0}, {1}, {2}]", Client.ActiveNpcID, OptionID, Input),
                    e.ToString(), true);
            }
        }
Now find:
Code:
public static int Dialog(INpcPlayer Player, string[] Dlg)
Change it to:
Code:
public static int Dialog(GameClient Player, string[] Dlg)
Now code your npc's in NPCDialog.cs
Example on Conductress:
Code:
                #region Conductress
                case 10050:
                    {
                        switch (OptionID)
                        {
                            case 0:
                                {
                                    ConquerScriptEngine.Dialog(Client, new string[] {
                                "AVATAR 120",
                                "TEXT Where are you heading for?",
                                "OPTION1 Phoenix Castle",
                                "OPTION2 Ape City",
                                "OPTION3 Desert City",
                                "OPTION4 Bird Island",
                                "OPTION5 Mine Cave",
                                "OPTION6 Market",
                                "OPTION-1 I will stay"
                            });
                                    break;
                                }
                            case 1: Client.Teleport(1002, 958, 555); break;
                            case 2: Client.Teleport(1002, 555, 957); break;
                            case 3: Client.Teleport(1002, 69, 473); break;
                            case 4: Client.Teleport(1002, 232, 190); break;
                            case 5: Client.Teleport(1002, 53, 399); break;
                            case 6: Client.Teleport(1036, 211, 196); break;
                        }
                        break;
                    }
                #endregion
To send clientcommands use this: (Example on level)
Code:
                                   PacketProcessor.ProcessServerCommand(Client, "@level 130", false);//Makes u level 130.
Goodluck
Syst3m_W1z4rd is offline  
Thanks
2 Users
Old 01/14/2011, 09:58   #2


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Why would you give up scripting such small things for hardcoding them thus hardening testing?
KraHen is offline  
Old 01/14/2011, 11:26   #3
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
What do you mean exactly?
Syst3m_W1z4rd is offline  
Old 01/14/2011, 14:41   #4


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
I mean that with external scripts you can change the behaviour of the NPCs without recompiling the source, also it is more flexible. There is no point in hard-coding them, especially when a scripting engine is already implemented. The only reason I could imagine someone would argue with is performance, well if you don`t load the scripts every time someone talks to an NPC, you`re fine.
KraHen is offline  
Thanks
2 Users
Old 01/14/2011, 14:50   #5
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
I know, but some peoples can't VB and don't know how to change the npc scripting system. Also is a ***** doing it for tournaments :P
Syst3m_W1z4rd is offline  
Old 01/14/2011, 17:16   #6
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
thats why Hybrid never did it for toury's..

He hard coded the Tournament npc and the rest are realtime-editable
_DreadNought_ is offline  
Old 01/14/2011, 18:13   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Yah there is no reason you can't hard code more 'difficult' npcs but real time editable npcs are sexy as hell and personally I feel that there's no reason you couldn't expand your scripting engine to allow for complex npcs aswell.

Personally my server uses python scripts and they have full access to all C# elements I pass into the script so basically anything you can do in C# you can do from python... so there's really nothing stopping you from doing complex scripts still.
pro4never is offline  
Old 01/14/2011, 20:26   #8
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
You can code parts in the actual source if you like, its not that hard to combine the two, in fact hybrid already does .
Basser is offline  
Thanks
1 User
Old 01/15/2011, 02:12   #9
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
good release. for some that has c# and stuff it don't help me but i still thank its is a really good release.
and thank you for the release.
taylor2846 is offline  
Old 01/15/2011, 18:11   #10
 
ImFlamedCOD's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
Lua <3
ImFlamedCOD is offline  
Old 01/15/2011, 18:28   #11
 
anime157's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 1
Received Thanks: 0
ham??
anime157 is offline  
Old 01/15/2011, 21:12   #12
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Quote:
Originally Posted by anime157 View Post
ham??
Cheese?
Syst3m_W1z4rd is offline  
Old 01/15/2011, 21:54   #13
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
tomato¿¿

lmao.
lets keep up the work and keep Releasing stuff for this source.
taylor2846 is offline  
Reply


Similar Threads Similar Threads
[Release]Hybrids Source v5(my way)
08/22/2010 - CO2 PServer Guides & Releases - 19 Replies
Ok guys this was my very first project i ever worked on. Its 5017 server built up. Since I coded my source from scratch i stopped working on this project and started a new 5017. This project was in the middle of converting over to Structured packets using the method that saint used but different if you ever looked at his source. Its far from bugles and far from clean was my test project. The main one that was not being used to test new things out on i'm not going to release because...
[Release] Socket System for Hybrids Source!
05/12/2010 - CO2 PServer Guides & Releases - 22 Replies
Apple Pie is amazing!!!!
Change the BlackMarket-System?
10/19/2008 - Trading - 0 Replies
Dear Users, In the past we had several complaints about incorrect appreciate from users about users in the BlackMarket-Area. We thought a lot about the whole situation and want to offer you a solution. We know that the forum-style of an auction-/sellsystem is not the best solution of the whole topic. In the past we bought the license of the following system:



All times are GMT +1. The time now is 01:14.


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.