Register for your free account! | Forgot your password?

You last visited: Today at 09:53

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

Advertisement



NPC Script Engine

Discussion on NPC Script Engine within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
NPC Script Engine

It's all made by me and it's just using delegates and reading files. I know it's not the best way etc. I just thought I would share it anyway, if anybody was interested in using it.

There is 2 downloads, one for the source code, if anybody is interesting in customizing it or whatever and then one for the library, which you just add to your project.

How can you use this?

Make a new class in your project, which is where you will handle it.
Use this as a reference or convert it to your own. (Not all functions and handlers are included and only examples are given.)
PHP Code:
public class ConquerScripting
    
{
        public static 
ScriptEngine NPCEngine = new ScriptEngine(Environment.CurrentDirectory + @"\NPCs");
        public static 
void Create()
        {
            
NPCEngine.TalkEvent = new ScriptEventDialog(Talk);
            
NPCEngine.OptionEvent = new ScriptEventDialog(Option);
            
NPCEngine.EndAndAvatarEvent = new ScriptEventDialog(End);
            
NPCEngine.NotRequirementsEvent = new ScriptEventDialog(NotRequirements);
        }
        static 
void Talk(object senderobject value)
        {
            
GameClient Client sender as GameClient;
            
Client.SendNPCDialog(value.ToString());
        }
        static 
void Option(object senderobject value)
        {
            
GameClient Client sender as GameClient;
            
string[] arg value.ToString().Split(':');
            
NPCEngine.HandleNPC(ClientNPCIDbyte.Parse(arg[0]), Client.ScriptClient);
        }
        static 
void End(object senderobject value)
        {
            
GameClient Client sender as GameClient;
            
Client.SendNPCEnd((byte)value);
        }
        static 
void NotRequirements(object senderobject value)
        {
            
GameClient Client sender as GameClient;
            
Client.SendNPCDialog(value.ToString());
        }
        public static 
void ProcessScript(GameClient Clientint NPCIDbyte OptionID)
        {
            
NPCEngine.HandleNPC(ClientNPCIDOptionIDClient.ScriptClient);
        }
    } 
How does the scripting works?
Well I would suggest you take a look at the source or the example given in the download.

When you make a NPC, then it need a folder, where the options are in.

That means if you want a dialog for ex. a NPC with the ID 10000, then you make a folder with the name 10000. Every text file in there is the options and the name must match the option id. Ex. for option 1 it must be 1.txt.

Then I will explain the syntax a bit.

Every dialog must start with arguments, which is where the requirements are put.
If you don't want any requirements, then you write [ARG /].

If you then want to put arguments, then it needs to look like this:
Code:
[ARG]
requirements should be here.
[/ARG]
Example:
Code:
[ARG]
ReqMoney 100
[/ARG]
A dialog is split by :, that means every argument is between the :'s in the script.

Example:
Code:
Option:255:I See.
It will first check the first argument, which is Option in this case. That way the engine knows it's an option and it will then seek and option ID for the next handler.

Comments in the NPCScripts can also be used, it's just // like in C#. But it has to be after the requirements.

Example on 2 dialogs:
Option 0:

Option 1:


I don't think there is much more to explain as I don't want to explain all the functions etc. and how it works.

Oh and a last thing, you must make a new variable for your client, with the script engine client. Make sure you use get/set, so it always updates the script engine client.

Download (Source):


Download (DLL):


Good luck.

PS: About options, you could parse it in the engine instead. One thing I just thought about.
BaussHacker is offline  
Thanks
2 Users
Old 07/17/2011, 22:10   #2
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Sexy bro.

The syntax isnt my fav but... Nice work <3
_DreadNought_ is offline  
Old 07/18/2011, 01:08   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by Y u k i View Post
Ur so much better wif c# now IM SO ******* PROUD OF YOU! I HAZ TEARS IN MY EYES RIGHT NOW!
@the haters: YES IM SERIOUS!
Thank you master.

<3
BaussHacker is offline  
Old 07/18/2011, 01:38   #4
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
;P nice work bro ^^
12tails is offline  
Old 07/18/2011, 02:27   #5
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
_tao4229_ is offline  
Reply


Similar Threads Similar Threads
[NEW]Cheat engine script
08/24/2012 - Dekaron PServer Hacks, Bots, Cheats & Exploits - 17 Replies
Hello i created CE Script by draegon71 tutorial. dreagon71 putted codes for many types of hack for Dekaron Private servers. For private server you dont need have bypass because they havent anti-cheat. But if you want to hack in Europe dekaron or some that you need.(Bypass is at the moment outdatet). Ok so one last,will be realy good if you guys go to draegon71 post and click on "Thank you" button. :) 1,Download draegon71's dekaron.exe. http://www.mediafire.com/?mmvmzytzynj
wts cheat engine script
12/18/2009 - Dekaron Trading - 3 Replies
have all hacks in it everything vack non aggro skill hacks 1 and 2 elusive and more pm for more info sell for cheap dils or usd paypal



All times are GMT +1. The time now is 09:54.


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.