Ejemplo n.º 1
0
        private static string FWProcedureExpression(Procedure p)
        {
            var str = "";

            int param1;
            int param2;
            int param3;
            switch (p.Type)
            {
                case 0:
                    str = "Attack(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 1:
                    str = "Cast_Skill(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 2:
                    str = "Broadcast_Message(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    str += "\"" + Encoding.Unicode.GetString((byte[])p.Parameter[1]).Replace("\0", "") + "\"";
                    str += ")";
                    break;
                case 3:
                    str = "Reset_Aggro()";
                    break;
                case 4:
                    str = "Execute_ActionSet(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 5:
                    str = "Disable_ActionSet(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 6:
                    str = "Enable_ActionSet(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 7:
                    str = "Create_Timer(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + ", ";
                    param3 = (int)p.Parameter[2];
                    str += param3.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 8:
                    str = "Remove_Timer(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 9:
                    str = "Flee()";
                    break;
                case 10:
                    str = "Be_Taunted()";
                    break;
                case 11:
                    str = "Fade_Target()";
                    break;
                case 13:
                    str = "Unknown13()";
                    break;
                case 14:
                    var paramStr = (int)p.Parameter[1] % 2 < 1 ? "start" : "stop";
                    str = "NPC_Generator(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + "[" + paramStr + "]";
                    str += ")";
                    break;
                case 15:
                    str = "Summon_Mob(";
                    str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[3]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + "\"" + Encoding.Unicode.GetString((byte[])p.Parameter[4]).Replace("\0", "") + "\",";
                    str = str + ((int)p.Parameter[5]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str += ((int)p.Parameter[6]).ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 16:
                    str = "Unknown16()";
                    break;
                case 17:
                    str = "Unknown17(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 18:
                    str = "Disappear()";
                    break;
                case 19:
                    str = "Unknown19(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 21:
                    str = "Set_Mob_Attribute(";
                    str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[3]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str += ((int)p.Parameter[4]).ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 22:
                    str = "Set_Value(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 23:
                    str = "Add_Value(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 24:
                    str = "Unknown24(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 25:
                    str = "Unknown25(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + ", ";
                    param3 = (int)p.Parameter[2];
                    str += param3.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 26:
                    str = "Unknown26()";
                    break;
                case 27:
                    str = "Unknown27()";
                    break;
            }
            return str + (" " + FWProcedureTarget(p.Target));
        }
Ejemplo n.º 2
0
        private static string JDProcedureExpression(Procedure p, int ver)
        {
            var str = "";

            if (p.Type == 0)
            {
                str = "Attack(";
                str += ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 1)
            {
                str = "Cast_Skill(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 2)
            {
                str = "Broadcast_Message(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + "\"" + Encoding.Unicode.GetString((byte[])p.Parameter[1]).Replace("\0", "") + "\"";
                str += ")";
            }
            if (p.Type == 3)
            {
                str = "Fade_Aggro()";
            }
            if (p.Type == 4)
            {
                str = "Exec_ActionSet(";
                str += ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 5)
            {
                str = "Disable_ActionSet(";
                str += ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 6)
            {
                str = "Enable_ActionSet(";
                str += ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 7)
            {
                str = "Create_Timer(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 8)
            {
                str = "Delete_Timer(";
                str += ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 9)
            {
                str = "Flee()";
            }
            if (p.Type == 10)
            {
                str = "Be_Taunted()";
            }
            if (p.Type == 11)
            {
                str = "Unknown11()";
            }
            if (p.Type == 12)
            {
                str = "Fade_Aggro()";
            }
            if (p.Type == 13)
            {
                str = "Unknown13()";
            }
            if (p.Type == 14)
            {
                str = "Trigger(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 15)
            {
                str = "Summon_Mob(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[3]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + "\"" + Encoding.Unicode.GetString((byte[])p.Parameter[4]).Replace("\0", "") + "\",";
                str = str + ((int)p.Parameter[5]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[6]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 16)
            {
                str = "Unknown16(";
                str = str + ((int) p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 17)
            {
                str = "Set_Path(";
                str += ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture);
                if (ver == 11)
                {
                    str = str + ", " + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture);
                }
                str += ")";
            }
            if (p.Type == 18)
            {
                str = "Disappear()";
            }
            if (p.Type == 21)
            {
                str = "Respawn()";
            }
            if (p.Type == 22)
            {
                str = "Set_Value(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 23)
            {
                str = "Add_Value(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 25)
            {
                str = "Set_Mob_Attribute(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[3]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[4]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }
            if (p.Type == 26)
            {
                str = "Drop_WarSoul(";
                str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                str += ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture);
                str += ")";
            }

            str = str + " Target(" + JDProcedureTarget(p.Target);
            if (p.Target == 6)
            {
                var extra = p.TargetParams;
                str = str + ", " + extra;
            }
            return str + ")";
        }
Ejemplo n.º 3
0
        private static string PWProcedureExpression(Procedure p)
        {
            var str = "";

            int param1;
            int param2;
            int param3;
            int param4;
            switch(p.Type)
            {
                case 0:
                    str = "Attack(";
                    param1 = (int) p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 1:
                    str = "Cast_Skill(";
                    param1 = (int) p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int) p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 2:
                    str = "Broadcast_Message(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    str += "\"" + Encoding.Unicode.GetString((byte[])p.Parameter[1]).Replace("\0", "") + "\"";
                    str += ")";
                    break;
                case 3:
                    str = "Reset_Aggro()";
                    break;
                case 4:
                    str = "Execute_ActionSet(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 5:
                    str = "Disable_ActionSet(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 6:
                    str = "Enable_ActionSet(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 7:
                    str = "Create_Timer(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + ", ";
                    param3 = (int)p.Parameter[2];
                    str += param3.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 8:
                    str = "Remove_Timer(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 9:
                    str = "Flee()";
                    break;
                case 10:
                    str = "Be_Taunted()";
                    break;
                case 11:
                    str = "Fade_Target()";
                    break;
                case 12:
                    str = "Fade_Aggro()";
                    break;
                case 13:
                    str = "Break()";
                    break;
                case 14:
                    var paramStr = (int)p.Parameter[1] % 2 < 1 ? "start" : "stop";
                    str = "NPC_Generator(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + "[" + paramStr + "]";
                    str += ")";
                    break;
                case 15:
                    str = "Initialize_Public_Counter(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + ", ";
                    param3 = (int)p.Parameter[2];
                    str += param3.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 16:
                    str = "Increment_Public_Counter(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 17:
                    str = "Player_Aimed_NPC_Spawn(";
                    str = str + ((int)p.Parameter[0]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[1]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[2]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[3]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str = str + ((int)p.Parameter[4]).ToString(CultureInfo.InvariantCulture) + ", ";
                    str += ((int)p.Parameter[5]).ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 18:
                    str = "Change_Path(";
                    param1 = (int)p.Parameter[0];
                    str += param1.ToString(CultureInfo.InvariantCulture) + ", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + ", ";
                    param3 = (int)p.Parameter[2];
                    str += param3.ToString(CultureInfo.InvariantCulture) + ", ";
                    param4 = (int)p.Parameter[3];
                    str += param4.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
                case 19:
                    str = "Play_Action(";
                    str += "\"" + Encoding.GetEncoding("GBK").GetString((byte[])p.Parameter[0]).Replace("\0", "") + "\", ";
                    param2 = (int)p.Parameter[1];
                    str += param2.ToString(CultureInfo.InvariantCulture) + ", ";
                    param3 = (int)p.Parameter[2];
                    str += param3.ToString(CultureInfo.InvariantCulture) + ", ";
                    param4 = (int)p.Parameter[3];
                    str += param4.ToString(CultureInfo.InvariantCulture);
                    str += ")";
                    break;
            }
            return str + (" " + PWProcedureTarget(p.Target, p.TargetParams));
        }