Realize, mine is runtime-editable (in sense of editing the script file, in this case, all are *.vb, will be taken in to consideration at run-time, and changes will be visible in game without a server restart) where I doubt the first one is.
The second one is, but it seems like it'd be a lot of pain to implement things that require more logic such as, how would one
script the marriage NPC in this format (due to the packet logic, and the need for variables). In scenarios such as where keep-alive scope variables are required (i.e. the tinter/armor dye) how does one store variables with this system (or even perform arithmetic).
I think the second system has a good idea to it, but isn't thoroughly thought out, and would require the end-programmer to do a more work than required to implement for support for these sorts of things (i.e. variables) while accommodating for speed.
Also,
Code:
Engine = new ScriptEngine("VB/C#");
Code:
// By: Wolf
// Npc: 10021
// Name: ArenaGuard
using System;
using ConquerScriptLinker;
public partial class NpcEngine
{
public static void ArenaGuard()
{
string[] dlg = null;
switch (OptionID)
{
case 0:
dlg = new string[3];
dlg[0] = "TEXT Hello would you like to enter the PK Arena for 50 silvers?";
dlg[1] = "OPTION1 Yes, here you go.";
dlg[2] = "OPTION-1 No thanks.";
break;
case 1:
if (Player.Money >= 50)
{
Player.Money -= 50;
Command("@mm 1005 50 50");
}
else
{
dlg = new string[2];
dlg[0] = "TEXT I'm sorry you dont have 50 silvers.";
dlg[1] = "OPTION-1 Oh, I will go work my corner more.";
}
break;
}
if (dlg != null)
Dialog(dlg);
}
}
Good to go.
Edit -- Scripted Marriage:
Code:
'#include ...\define_data.vb
'#include ...\define_string.vb
' By: Hybrid
' Npc: 390
' Name: Love Stone
Imports System
Imports ConquerScriptLinker
Partial Public Class NpcEngine
Public Shared Sub LoveStone()
Dim dlg As String() = Nothing
Select Case OptionID
Case 0
ReDim dlg(3)
dlg(0) = "TEXT I am the all mighty digital-pimp, what is it you wish?"
dlg(1) = "OPTION1 Get married."
dlg(2) = "OPTION2 Get divorced."
dlg(3) = "OPTION-1 Nothing."
Case 1
Player.SendData(DataID.Switch, DataSwitchArg.MarriageMouse, 0, 0)
Case 2
Dim spouse As INpcPlayer = FindPlayerByName(Player.Spouse)
If Not spouse Is Nothing Then
Player.SpouseAccount = ""
Player.Spouse = "None"
spouse.SpouseAccount = ""
spouse.Spouse = "None"
Player.SendString(StringID.Spouse, "None")
spouse.SendString(StringID.Spouse, "None")
Else
Dim SpouseFile As String = DatabasePath & "\Accounts\" & Player.SpouseAccount & ".ini"
If String.Compare(QueryDatabase("Character", "Spouse", "", SpouseFile), Player.Account, True) Then
Player.SpouseAccount = ""
Player.Spouse = "None"
Player.SendString(StringID.Spouse, "None")
WriteDatabase("Character", "Spouse", "", SpouseFile)
End If
End If
End Select
If Not dlg Is Nothing Then
Dialog(dlg)
End If
End Sub
End Class