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 sender, object value)
{
GameClient Client = sender as GameClient;
Client.SendNPCDialog(value.ToString());
}
static void Option(object sender, object value)
{
GameClient Client = sender as GameClient;
string[] arg = value.ToString().Split(':');
NPCEngine.HandleNPC(Client, NPCID, byte.Parse(arg[0]), Client.ScriptClient);
}
static void End(object sender, object value)
{
GameClient Client = sender as GameClient;
Client.SendNPCEnd((byte)value);
}
static void NotRequirements(object sender, object value)
{
GameClient Client = sender as GameClient;
Client.SendNPCDialog(value.ToString());
}
public static void ProcessScript(GameClient Client, int NPCID, byte OptionID)
{
NPCEngine.HandleNPC(Client, NPCID, OptionID, Client.ScriptClient);
}
}
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]
Code:
[ARG] ReqMoney 100 [/ARG]
Example:
Code:
Option:255:I See.
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.






