Exemple #1
0
        private static void Main(string[] args)
        {
            const string stbRoot = "./3DDATA/stb/";
            const string zoneStb = "list_zone.stb";

            var itemDataFiles = new ItemInfo[14];

            itemDataFiles[00].set("list_faceitem.stb", "list_faceitem_s.stl");
            itemDataFiles[01].set("list_cap.stb", "list_cap_s.stl");
            itemDataFiles[02].set("list_body.stb", "list_body_s.stl");
            itemDataFiles[03].set("list_arms.stb", "list_arms_s.stl");
            itemDataFiles[04].set("list_foot.stb", "list_foot_s.stl");
            itemDataFiles[05].set("list_back.stb", "list_back_s.stl");
            itemDataFiles[06].set("list_jewel.stb", "list_jewel_s.stl");
            itemDataFiles[07].set("list_weapon.stb", "list_weapon_s.stl");
            itemDataFiles[08].set("list_subwpn.stb", "list_subwpn_s.stl");
            itemDataFiles[09].set("list_useitem.stb", "list_useitem_s.stl");
            itemDataFiles[10].set("list_jemitem.stb", "list_jemitem_s.stl");
            itemDataFiles[11].set("list_natural.stb", "list_natural_s.stl");
            itemDataFiles[12].set("list_questitem.stb", "list_questitem_s.stl");
            itemDataFiles[13].set("list_pat.stb", "list_pat_s.stl");

            (new FileInfo("srv_data\\scripts\\root.lua")).Directory.Create();
            var luaFile = new System.IO.StreamWriter("srv_data\\scripts\\root.lua", false);

            luaFile.Write("include(\"npc_scripts.lua\");\n");
            luaFile.Write("include(\"npc_spawns.lua\");\n");
            luaFile.Close();

            (new FileInfo("srv_data\\scripts\\npc_spawns.lua")).Directory.Create();
            luaFile = new System.IO.StreamWriter("srv_data\\scripts\\npc_spawns.lua", false);
            luaFile.Close();

            (new FileInfo("srv_data\\scripts\\npc_scripts.lua")).Directory.Create();
            luaFile = new System.IO.StreamWriter("srv_data\\scripts\\npc_scripts.lua", false);
            luaFile.Close();

            int typeIdx = 0;
            var sqlFile = new System.IO.StreamWriter("srv_data\\item_db.sql", false);

            sqlFile.Close();

            sqlFile = new System.IO.StreamWriter("srv_data\\mob_db.sql", false);
            sqlFile.Close();
            foreach (var itemDataFile in itemDataFiles)
            {
                var itemData = new ItemData();
                itemData.Load((ItemData.ItemType)(++typeIdx), stbRoot + itemDataFile.DataFile, stbRoot + itemDataFile.StringFile);
            }

            //"list_skill.stb";
            //"list_skill_s.stl";

            var dataFile = new DataFile();

            dataFile.Load(stbRoot + zoneStb);

            Console.Write("npc(<npc_lua_file>, <map_id>, <npc_id>, <x_pos>, <y_pos>, <angle>);\n");
            Console.Write(
                "mob(<mob_spawner_alias>, <map_id>, <mob_id>, <mob_count>, <spawner_limit>, <spawner_interval>, <spawner_range>, <x_pos>, <y_pos>, <angle>);\n");
            Console.Write(
                "warp_gate(<warp_alias>, <gate_to>, <this_gate_id>, <map_id>, <min_x_pos>, <min_y_pos>, <min_z_pos>, <max_x_pos>, <max_y_pos>, <max_z_pos>);\n\n");

            for (var i = 1; i < dataFile.RowCount; i++)
            {
                if (!dataFile[i][2].Contains(".zon"))
                {
                    continue;
                }

                Console.Write("Attempting to load \"" + dataFile[i][1] + "\" - ");
                var zone = new ZoneData();
                zone.Load(dataFile[i][2], i);
            }


            const string npcStb  = "list_npc.stb";
            const string npcStl  = "list_npc_s.stl";
            var          mobFile = new MobData();

            mobFile.Load(stbRoot + npcStb, stbRoot + npcStl);

            Console.Write("Done extracting. Press any key to exit...\n");
            Console.ReadLine();
        }
Exemple #2
0
        private static void Main(string[] args)
        {
            const string zoneStb = "list_zone.stb";

            var itemDataFiles = new ItemInfo[14];

            itemDataFiles[00].set("list_faceitem.stb", "list_faceitem_s.stl");
            itemDataFiles[01].set("list_cap.stb", "list_cap_s.stl");
            itemDataFiles[02].set("list_body.stb", "list_body_s.stl");
            itemDataFiles[03].set("list_arms.stb", "list_arms_s.stl");
            itemDataFiles[04].set("list_foot.stb", "list_foot_s.stl");
            itemDataFiles[05].set("list_back.stb", "list_back_s.stl");
            itemDataFiles[06].set("list_jewel.stb", "list_jewel_s.stl");
            itemDataFiles[07].set("list_weapon.stb", "list_weapon_s.stl");
            itemDataFiles[08].set("list_subwpn.stb", "list_subwpn_s.stl");
            itemDataFiles[09].set("list_useitem.stb", "list_useitem_s.stl");
            itemDataFiles[10].set("list_jemitem.stb", "list_jemitem_s.stl");
            itemDataFiles[11].set("list_natural.stb", "list_natural_s.stl");
            itemDataFiles[12].set("list_questitem.stb", "list_questitem_s.stl");
            itemDataFiles[13].set("list_pat.stb", "list_pat_s.stl");

            (new FileInfo("srv_data\\scripts\\root.lua")).Directory.Create();
            var luaFile = new System.IO.StreamWriter("srv_data\\scripts\\root.lua", false);

            luaFile.Write("include(\"npc_scripts.lua\");\n");
            luaFile.Write("include(\"npc_spawns.lua\");\n");
            luaFile.Close();

            (new FileInfo("srv_data\\scripts\\npc_spawns.lua")).Directory.Create();
            luaFile = new System.IO.StreamWriter("srv_data\\scripts\\npc_spawns.lua", false);
            luaFile.Close();

            (new FileInfo("srv_data\\scripts\\npc_scripts.lua")).Directory.Create();
            luaFile = new System.IO.StreamWriter("srv_data\\scripts\\npc_scripts.lua", false);
            luaFile.Close();

            int typeIdx = 0;
            var sqlFile = new System.IO.StreamWriter("srv_data\\item_db.sql", false);

            sqlFile.Close();

            sqlFile = new System.IO.StreamWriter("srv_data\\skill_db.sql", false);
            sqlFile.Close();
            foreach (var itemDataFile in itemDataFiles)
            {
                var itemData = new ItemData();
                itemData.Load((ItemData.ItemType)(++typeIdx), Globals.stbroot + itemDataFile.DataFile, Globals.stbroot + itemDataFile.StringFile);
            }

            const string skillStb  = "list_skill.stb";
            const string skillStl  = "list_skill_s.stl";
            var          skillFile = new SkillData();

            skillFile.Load(Globals.stbroot + skillStb, Globals.stbroot + skillStl);

            const string npcStb  = "list_npc.stb";
            const string npcStl  = "list_npc_s.stl";
            var          mobFile = new MobData();

            mobFile.Load(Globals.stbroot + npcStb, Globals.stbroot + npcStl);

            var dataFile = new DataFile();

            dataFile.Load(Globals.stbroot + zoneStb);
            for (var i = 1; i < dataFile.RowCount; i++)
            {
                if (!("../" + dataFile[i][2]).Contains(".zon"))
                {
                    continue;
                }

                Console.Write("Attempting to load \"" + dataFile[i][1] + "\" - ");
                var zone = new ZoneData();
                zone.Load("../" + dataFile[i][2], i);
            }

            Console.Write("Done extracting. Press any key to exit...\n");
            Console.ReadLine();
        }