public static JObject Spoiler(int number, string carName, bool cf)
        {
            Templates temp = new Templates();

            JObject o = (JObject)temp.mainTemplate.DeepClone();

            string strNumber = "";

            if (number < 10)
            {
                strNumber = "0" + number.ToString();
            }
            else
            {
                strNumber = number.ToString();
            }

            string name = carName + "_STYLE" + strNumber + "_SPOILER";

            if (cf)
            {
                name += "_CF";
            }
            o["Name"] = name;

            JObject stckFalse = (JObject)temp.stockFalse.DeepClone();

            JObject lodCharOffset = (JObject)temp.lodCharacterOffset.DeepClone();

            JObject lanHash = (JObject)temp.template1.DeepClone();

            lanHash.Add("Value", 36323522 + (1 * number));
            lanHash["Name"] = "LANGUAGEHASH";

            JObject lodNamePref = (JObject)temp.lodPrefixSelector.DeepClone();

            JObject nameOffset = (JObject)temp.template1.DeepClone();
            JArray  strings    = (JArray)nameOffset["Strings"];

            if (cf)
            {
                strings.Add(strNumber + " CF");
            }
            else
            {
                strings.Add(strNumber);
            }
            nameOffset["Name"] = "NAME_OFFSET";

            JObject idUpdateGroup = (JObject)temp.template1.DeepClone();

            idUpdateGroup.Add("Value", 15363 + (1 * number));
            idUpdateGroup["Name"] = "PARTID_UPGRADE_GROUP";

            JObject mxLod = (JObject)temp.maxLod.DeepClone();

            JObject lodBaseName = (JObject)temp.template1.DeepClone();

            strings = (JArray)lodBaseName["Strings"];
            strings.Add("STYLE" + strNumber);
            if (cf)
            {
                strings.Add("SPOILER_CF");
            }
            else
            {
                strings.Add("SPOILER");
            }
            lodBaseName["Name"] = "LOD_BASE_NAME";


            strings = (JArray)o["Attributes"];

            strings.Add(stckFalse);
            strings.Add(lodCharOffset);
            strings.Add(lanHash);
            strings.Add(lodNamePref);
            strings.Add(nameOffset);
            strings.Add(idUpdateGroup);
            strings.Add(mxLod);
            strings.Add(lodBaseName);

            return(o);
        }
        public static JObject GlobalSpoiler(int number, string type, bool cf)
        {
            Templates temp = new Templates();

            JObject o = (JObject)temp.mainTemplate.DeepClone();

            string strNumber = "";

            if (number < 10)
            {
                strNumber = "0" + number.ToString();
            }
            else
            {
                strNumber = number.ToString();
            }

            string name = "SPOILER_STYLE" + strNumber + "_" + type;

            if (cf)
            {
                name += "_CF";
            }
            o["Name"] = name;

            JObject useMark = (JObject)temp.useMarker.DeepClone();

            JObject lodCharOffset = (JObject)temp.lodCharacterOffset.DeepClone();

            JObject lanHash = (JObject)temp.template1.DeepClone();

            if (cf)
            {
                lanHash.Add("Value", 3983425162 + (35937 * number));
            }
            else
            {
                lanHash.Add("Value", 36323522 + (1 * number));
            }
            lanHash["Name"] = "LANGUAGEHASH";

            JObject lodNamePref = (JObject)temp.lodPrefixSelector.DeepClone();

            lodNamePref["Value"] = 2;

            JObject nameOffset = (JObject)temp.template1.DeepClone();
            JArray  strings    = (JArray)nameOffset["Strings"];

            if (cf)
            {
                strings.Add("SPOILER " + strNumber + " CF");
            }
            else
            {
                strings.Add("SPOILER " + strNumber);
            }
            nameOffset["Name"] = "NAME_OFFSET";

            JObject idUpdateGroup = (JObject)temp.template1.DeepClone();

            idUpdateGroup.Add("Value", 15393);
            idUpdateGroup["Name"] = "PARTID_UPGRADE_GROUP";


            JObject lodNamehash = (JObject)temp.template1.DeepClone();

            lodNamehash.Add("Value", 3376116733);
            lodNamehash["Name"] = "LOD_NAME_PREFIX_NAMEHASH";

            JObject mxLod = (JObject)temp.maxLod.DeepClone();

            JObject lodBaseName = (JObject)temp.template1.DeepClone();

            strings = (JArray)lodBaseName["Strings"];
            strings.Add("STYLE" + strNumber);
            if (cf)
            {
                strings.Add(type + "_CF");
            }
            else
            {
                strings.Add(type);
            }
            lodBaseName["Name"] = "LOD_BASE_NAME";


            strings = (JArray)o["Attributes"];

            strings.Add(useMark);
            strings.Add(lodCharOffset);
            strings.Add(lanHash);
            strings.Add(lodNamePref);
            strings.Add(nameOffset);
            strings.Add(idUpdateGroup);
            strings.Add(lodNamehash);
            strings.Add(mxLod);
            strings.Add(lodBaseName);

            return(o);
        }
Beispiel #3
0
        public static JObject Door(int number, string carName, string side)
        {
            Templates temp = new Templates();

            JObject o = (JObject)temp.mainTemplate.DeepClone();

            string strNumber = "";

            if (number < 10)
            {
                strNumber = "0" + number.ToString();
            }
            else
            {
                strNumber = number.ToString();
            }

            string name = carName + "_KITW" + strNumber + "_DOOR_" + side;

            o["Name"] = name;

            JObject lodCharOffset = (JObject)temp.lodCharacterOffset.DeepClone();

            JObject lanHash  = (JObject)temp.template1.DeepClone();
            uint    doorHash = 0;

            if (side == "LEFT")
            {
                doorHash = 1774456068;
            }
            else
            {
                doorHash = 2729735447;
            }
            lanHash.Add("Value", doorHash);
            lanHash["Name"] = "LANGUAGEHASH";

            JObject lodNamePref = (JObject)temp.lodPrefixSelector.DeepClone();

            JObject kitNumber = (JObject)temp.template1.DeepClone();

            kitNumber.Add("Value", number);
            kitNumber["Name"] = "KITNUMBER";

            JObject nameOffset = (JObject)temp.template1.DeepClone();
            JArray  strings    = (JArray)nameOffset["Strings"];

            strings.Add(strNumber);
            nameOffset["Name"] = "NAME_OFFSET";

            JObject idUpdateGroup  = (JObject)temp.template1.DeepClone();
            int     updateGroupVal = 0;

            if (side == "LEFT")
            {
                updateGroupVal = 24320;
            }
            else
            {
                updateGroupVal = 24576;
            }
            idUpdateGroup.Add("Value", updateGroupVal);
            idUpdateGroup["Name"] = "PARTID_UPGRADE_GROUP";

            JObject mxLod = (JObject)temp.maxLod.DeepClone();

            JObject lodBaseName = (JObject)temp.template1.DeepClone();

            strings = (JArray)lodBaseName["Strings"];
            strings.Add("KITW" + strNumber);
            strings.Add("DOOR_" + side);
            lodBaseName["Name"] = "LOD_BASE_NAME";

            strings = (JArray)o["Attributes"];
            strings.Add(lodCharOffset);
            strings.Add(lanHash);
            strings.Add(lodNamePref);
            strings.Add(kitNumber);
            strings.Add(nameOffset);
            strings.Add(idUpdateGroup);
            strings.Add(mxLod);
            strings.Add(lodBaseName);

            return(o);
        }
Beispiel #4
0
        public static JObject Body(int number, string carName)
        {
            Templates temp = new Templates();
            JObject   o    = (JObject)temp.mainTemplate.DeepClone();

            string strNumber = "";

            if (number < 10)
            {
                strNumber = "0" + number.ToString();
            }
            else
            {
                strNumber = number.ToString();
            }

            string name = carName + "_BODY_KITW" + strNumber;

            o["Name"] = name;

            JObject cv = (JObject)temp.template1.DeepClone();

            cv.Add("Value", 2750249672 + (35937 * number));
            cv["Name"] = "CV";

            JObject lodCharOffset = (JObject)temp.lodCharacterOffset.DeepClone();

            JObject lanHash = (JObject)temp.template1.DeepClone();

            lanHash.Add("Value", 2678708386 + (1 * number));
            lanHash["Name"] = "LANGUAGEHASH";

            JObject lodNamePref = (JObject)temp.lodPrefixSelector.DeepClone();

            JObject kitNumber = (JObject)temp.template1.DeepClone();

            kitNumber.Add("Value", number);
            kitNumber["Name"] = "KITNUMBER";

            JObject nameOffset = (JObject)temp.template1.DeepClone();
            JArray  strings    = (JArray)nameOffset["Strings"];

            strings.Add(strNumber);
            nameOffset["Name"] = "NAME_OFFSET";

            JObject idUpdateGroup = (JObject)temp.template1.DeepClone();

            idUpdateGroup.Add("Value", 5984 + (1 * number));
            idUpdateGroup["Name"] = "PARTID_UPGRADE_GROUP";

            JObject mxLod = (JObject)temp.maxLod.DeepClone();

            JObject lodBaseName = (JObject)temp.template1.DeepClone();

            strings = (JArray)lodBaseName["Strings"];
            strings.Add("KITW" + strNumber);
            strings.Add("BODY");
            lodBaseName["Name"] = "LOD_BASE_NAME";

            strings = (JArray)o["Attributes"];
            strings.Add(cv);
            strings.Add(lodCharOffset);
            strings.Add(lanHash);
            strings.Add(lodNamePref);
            strings.Add(kitNumber);
            strings.Add(nameOffset);
            strings.Add(idUpdateGroup);
            strings.Add(mxLod);
            strings.Add(lodBaseName);

            return(o);
        }
Beispiel #5
0
        public static JObject Hood(int number, string carName, bool cf)
        {
            Templates temp = new Templates();

            JObject o = (JObject)temp.mainTemplate.DeepClone();

            string strNumber = "";

            if (number < 10)
            {
                strNumber = "0" + number.ToString();
            }
            else
            {
                strNumber = number.ToString();
            }

            string name = carName + "_STYLE" + strNumber + "_HOOD";

            if (cf)
            {
                name += "_CF";
            }
            o["Name"] = name;


            JObject lodCharOffset = (JObject)temp.lodCharacterOffset2.DeepClone();

            JObject lanHash = (JObject)temp.template1.DeepClone();

            if (cf)
            {
                lanHash.Add("Value", 171723638 + (1 * number));
            }
            else
            {
                lanHash.Add("Value", 2528916686 + (1 * number));
            }
            lanHash["Name"] = "LANGUAGEHASH";

            JObject lodNamePref = (JObject)temp.lodPrefixSelector.DeepClone();

            JObject nameOffset = (JObject)temp.template1.DeepClone();
            JArray  strings    = (JArray)nameOffset["Strings"];

            if (cf)
            {
                strings.Add(strNumber + " CF");
            }
            else
            {
                strings.Add(strNumber);
            }
            nameOffset["Name"] = "NAME_OFFSET";

            JObject idUpdateGroup = (JObject)temp.template1.DeepClone();

            idUpdateGroup.Add("Value", 23328 + (1 * number));
            idUpdateGroup["Name"] = "PARTID_UPGRADE_GROUP";

            JObject mxLod = (JObject)temp.maxLod.DeepClone();

            mxLod["Value"] = 3;

            JObject idk = (JObject)temp.template1.DeepClone();

            idk.Add("Value", 199781921);
            idk["Name"] = "0xE80A3B62";

            JObject lodBaseName = (JObject)temp.template1.DeepClone();

            strings = (JArray)lodBaseName["Strings"];
            strings.Add("STYLE" + strNumber);
            if (cf)
            {
                strings.Add("HOOD_CF");
            }
            else
            {
                strings.Add("HOOD");
            }
            lodBaseName["Name"] = "LOD_BASE_NAME";


            strings = (JArray)o["Attributes"];

            strings.Add(lodCharOffset);
            strings.Add(lanHash);
            strings.Add(lodNamePref);
            strings.Add(nameOffset);
            strings.Add(idUpdateGroup);
            strings.Add(mxLod);
            strings.Add(idk);
            strings.Add(lodBaseName);

            return(o);
        }