// Token: 0x06001C53 RID: 7251 RVA: 0x0009AAE8 File Offset: 0x00098EE8 public ObjectNPCAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { this.npcName = localization.format("Character"); this.npcName = ItemTool.filterRarityRichText(this.npcName); this.shirt = data.readUInt16("Shirt"); this.pants = data.readUInt16("Pants"); this.hat = data.readUInt16("Hat"); this.backpack = data.readUInt16("Backpack"); this.vest = data.readUInt16("Vest"); this.mask = data.readUInt16("Mask"); this.glasses = data.readUInt16("Glasses"); this.face = data.readByte("Face"); this.hair = data.readByte("Hair"); this.beard = data.readByte("Beard"); this.skin = Palette.hex(data.readString("Color_Skin")); this.color = Palette.hex(data.readString("Color_Hair")); this.isBackward = data.has("Backward"); this.primary = data.readUInt16("Primary"); this.secondary = data.readUInt16("Secondary"); this.tertiary = data.readUInt16("Tertiary"); if (data.has("Equipped")) { this.equipped = (ESlotType)Enum.Parse(typeof(ESlotType), data.readString("Equipped"), true); } else { this.equipped = ESlotType.NONE; } this.dialogue = data.readUInt16("Dialogue"); if (data.has("Pose")) { this.pose = (ENPCPose)Enum.Parse(typeof(ENPCPose), data.readString("Pose"), true); } else { this.pose = ENPCPose.STAND; } if (data.has("Pose_Lean")) { this.poseLean = data.readSingle("Pose_Lean"); } if (data.has("Pose_Pitch")) { this.posePitch = data.readSingle("Pose_Pitch"); } else { this.posePitch = 90f; } if (data.has("Pose_Head_Offset")) { this.poseHeadOffset = data.readSingle("Pose_Head_Offset"); } else if (this.pose == ENPCPose.CROUCH) { this.poseHeadOffset = 0.1f; } }
public ItemBarricadeAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (!Dedicator.isDedicated) { this._barricade = (GameObject)bundle.load("Barricade"); } this._clip = (GameObject)bundle.load("Clip"); this._nav = (GameObject)bundle.load("Nav"); this._use = (AudioClip)bundle.load("Use"); this._build = (EBuild)Enum.Parse(typeof(EBuild), data.readString("Build"), true); this._health = data.readUInt16("Health"); this._range = data.readSingle("Range"); this._radius = data.readSingle("Radius"); this._offset = data.readSingle("Offset"); this._explosion = data.readUInt16("Explosion"); this._isLocked = data.has("Locked"); this._isVulnerable = data.has("Vulnerable"); this._bypassClaim = data.has("Bypass_Claim"); this._isRepairable = !data.has("Unrepairable"); this._proofExplosion = data.has("Proof_Explosion"); this._isUnpickupable = data.has("Unpickupable"); this._isSalvageable = !data.has("Unsalvageable"); this._isSaveable = !data.has("Unsaveable"); bundle.unload(); }
public ItemSentryAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (data.has("Mode")) { this._sentryMode = (ESentryMode)Enum.Parse(typeof(ESentryMode), data.readString("Mode"), true); } else { this._sentryMode = ESentryMode.NEUTRAL; } }
// Token: 0x06001AA8 RID: 6824 RVA: 0x00094F80 File Offset: 0x00093380 public ItemGlassesAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (!Dedicator.isDedicated) { this._glasses = (GameObject)bundle.load("Glasses"); } if (data.has("Vision")) { this._vision = (ELightingVision)Enum.Parse(typeof(ELightingVision), data.readString("Vision"), true); } else { this._vision = ELightingVision.NONE; } this.isBlindfold = data.has("Blindfold"); bundle.unload(); }
public ItemStructureAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (!Dedicator.isDedicated) { this._structure = (GameObject)bundle.load("Structure"); } this._clip = (GameObject)bundle.load("Clip"); this._nav = (GameObject)bundle.load("Nav"); this._use = (AudioClip)bundle.load("Use"); this._construct = (EConstruct)Enum.Parse(typeof(EConstruct), data.readString("Construct"), true); this._health = data.readUInt16("Health"); this._range = data.readSingle("Range"); this._explosion = data.readUInt16("Explosion"); this._isVulnerable = data.has("Vulnerable"); this._isRepairable = !data.has("Unrepairable"); this._proofExplosion = data.has("Proof_Explosion"); this._isUnpickupable = data.has("Unpickupable"); this._isSalvageable = !data.has("Unsalvageable"); this._isSaveable = !data.has("Unsaveable"); bundle.unload(); }
public ItemSightAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { this._sight = (GameObject)bundle.load("Sight"); if (data.has("Vision")) { this._vision = (ELightingVision)Enum.Parse(typeof(ELightingVision), data.readString("Vision"), true); } else { this._vision = ELightingVision.NONE; } if (data.has("Zoom")) { this._zoom = 90f / (float)data.readByte("Zoom"); } else { this._zoom = 90f; } this._isHolographic = data.has("Holographic"); bundle.unload(); }
// Token: 0x06001915 RID: 6421 RVA: 0x0005BBA0 File Offset: 0x00059FA0 public Asset(Bundle bundle, Data data, Local localization, ushort id) { if (bundle != null) { this.name = bundle.name; } else { this.name = "Asset_" + id; } this.id = id; this.canUse = true; if (data != null) { this.hash = data.hash; if (data.has("Asset_Origin_Override")) { this.assetOrigin = (EAssetOrigin)Enum.Parse(typeof(EAssetOrigin), data.readString("Asset_Origin_Override"), true); } } else { this.hash = new byte[20]; } }
// Token: 0x06001B3D RID: 6973 RVA: 0x0009736C File Offset: 0x0009576C public ItemTireAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { this._mode = (EUseableTireMode)Enum.Parse(typeof(EUseableTireMode), data.readString("Mode"), true); bundle.unload(); }
// Token: 0x060018FE RID: 6398 RVA: 0x0008CD50 File Offset: 0x0008B150 public AnimalAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (id < 50 && !bundle.hasResource && !data.has("Bypass_ID_Limit")) { throw new NotSupportedException("ID < 50"); } this._animalName = localization.format("Name"); this._client = (GameObject)bundle.load("Animal_Client"); this._server = (GameObject)bundle.load("Animal_Server"); this._dedicated = (GameObject)bundle.load("Animal_Dedicated"); this._ragdoll = (GameObject)bundle.load("Ragdoll"); if (this.client == null) { Assets.errors.Add(this.animalName + " is missing client data. Highly recommended to fix."); } if (this.server == null) { Assets.errors.Add(this.animalName + " is missing server data. Highly recommended to fix."); } if (this.dedicated == null) { Assets.errors.Add(this.animalName + " is missing dedicated data. Highly recommended to fix."); } if (this.ragdoll == null) { Assets.errors.Add(this.animalName + " is missing ragdoll data. Highly recommended to fix."); } this._speedRun = data.readSingle("Speed_Run"); this._speedWalk = data.readSingle("Speed_Walk"); this._behaviour = (EAnimalBehaviour)Enum.Parse(typeof(EAnimalBehaviour), data.readString("Behaviour"), true); this._health = data.readUInt16("Health"); this._regen = data.readSingle("Regen"); if (!data.has("Regen")) { this._regen = 10f; } this._damage = data.readByte("Damage"); this._meat = data.readUInt16("Meat"); this._pelt = data.readUInt16("Pelt"); this._rewardID = data.readUInt16("Reward_ID"); if (data.has("Reward_Min")) { this._rewardMin = data.readByte("Reward_Min"); } else { this._rewardMin = 3; } if (data.has("Reward_Max")) { this._rewardMax = data.readByte("Reward_Max"); } else { this._rewardMax = 4; } this._roars = new AudioClip[(int)data.readByte("Roars")]; byte b = 0; while ((int)b < this.roars.Length) { this.roars[(int)b] = (AudioClip)bundle.load("Roar_" + b); b += 1; } this._panics = new AudioClip[(int)data.readByte("Panics")]; byte b2 = 0; while ((int)b2 < this.panics.Length) { this.panics[(int)b2] = (AudioClip)bundle.load("Panic_" + b2); b2 += 1; } this._rewardXP = data.readUInt32("Reward_XP"); bundle.unload(); }
public ItemGunAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { this._shoot = (AudioClip)bundle.load("Shoot"); this._reload = (AudioClip)bundle.load("Reload"); this._hammer = (AudioClip)bundle.load("Hammer"); this._aim = (AudioClip)bundle.load("Aim"); this._minigun = (AudioClip)bundle.load("Minigun"); this._projectile = (GameObject)bundle.load("Projectile"); this.ammoMin = data.readByte("Ammo_Min"); this.ammoMax = data.readByte("Ammo_Max"); this.sightID = data.readUInt16("Sight"); this.tacticalID = data.readUInt16("Tactical"); this.gripID = data.readUInt16("Grip"); this.barrelID = data.readUInt16("Barrel"); this.magazineID = data.readUInt16("Magazine"); int num = data.readInt32("Magazine_Replacements"); this.magazineReplacements = new MagazineReplacement[num]; for (int i = 0; i < num; i++) { ushort id2 = data.readUInt16("Magazine_Replacement_" + i + "_ID"); string map = data.readString("Magazine_Replacement_" + i + "_Map"); MagazineReplacement magazineReplacement = default(MagazineReplacement); magazineReplacement.id = id2; magazineReplacement.map = map; this.magazineReplacements[i] = magazineReplacement; } this.unplace = data.readSingle("Unplace"); this.replace = data.readSingle("Replace"); if ((double)this.replace < 0.01) { this.replace = 1f; } this.hasSight = data.has("Hook_Sight"); this.hasTactical = data.has("Hook_Tactical"); this.hasGrip = data.has("Hook_Grip"); this.hasBarrel = data.has("Hook_Barrel"); int num2 = data.readInt32("Magazine_Calibers"); if (num2 > 0) { this.magazineCalibers = new ushort[num2]; for (int j = 0; j < num2; j++) { this.magazineCalibers[j] = data.readUInt16("Magazine_Caliber_" + j); } int num3 = data.readInt32("Attachment_Calibers"); if (num3 > 0) { this.attachmentCalibers = new ushort[num3]; for (int k = 0; k < num3; k++) { this.attachmentCalibers[k] = data.readUInt16("Attachment_Caliber_" + k); } } else { this.attachmentCalibers = this.magazineCalibers; } } else { this.magazineCalibers = new ushort[1]; this.magazineCalibers[0] = data.readUInt16("Caliber"); this.attachmentCalibers = this.magazineCalibers; } this.firerate = data.readByte("Firerate"); this.action = (EAction)Enum.Parse(typeof(EAction), data.readString("Action"), true); this.deleteEmptyMagazines = data.has("Delete_Empty_Magazines"); this.bursts = data.readInt32("Bursts"); this.hasSafety = data.has("Safety"); this.hasSemi = data.has("Semi"); this.hasAuto = data.has("Auto"); this.hasBurst = (this.bursts > 0); this.isTurret = data.has("Turret"); if (this.hasAuto) { this.firemode = EFiremode.AUTO; } else if (this.hasSemi) { this.firemode = EFiremode.SEMI; } else if (this.hasBurst) { this.firemode = EFiremode.BURST; } else if (this.hasSafety) { this.firemode = EFiremode.SAFETY; } this.spreadAim = data.readSingle("Spread_Aim"); this.spreadHip = data.readSingle("Spread_Hip"); if (data.has("Recoil_Aim")) { this.recoilAim = data.readSingle("Recoil_Aim"); this.useRecoilAim = true; } else { this.recoilAim = 1f; this.useRecoilAim = false; } this.recoilMin_x = data.readSingle("Recoil_Min_X"); this.recoilMin_y = data.readSingle("Recoil_Min_Y"); this.recoilMax_x = data.readSingle("Recoil_Max_X"); this.recoilMax_y = data.readSingle("Recoil_Max_Y"); this.recover_x = data.readSingle("Recover_X"); this.recover_y = data.readSingle("Recover_Y"); this.shakeMin_x = data.readSingle("Shake_Min_X"); this.shakeMin_y = data.readSingle("Shake_Min_Y"); this.shakeMin_z = data.readSingle("Shake_Min_Z"); this.shakeMax_x = data.readSingle("Shake_Max_X"); this.shakeMax_y = data.readSingle("Shake_Max_Y"); this.shakeMax_z = data.readSingle("Shake_Max_Z"); this.ballisticSteps = data.readByte("Ballistic_Steps"); this.ballisticTravel = data.readSingle("Ballistic_Travel"); if (data.has("Ballistic_Steps")) { this.ballisticSteps = data.readByte("Ballistic_Steps"); this.ballisticTravel = data.readSingle("Ballistic_Travel"); } else { this.ballisticTravel = 10f; this.ballisticSteps = (byte)Mathf.CeilToInt(this.range / this.ballisticTravel); } if (data.has("Ballistic_Drop")) { this.ballisticDrop = data.readSingle("Ballistic_Drop"); } else { this.ballisticDrop = 0.002f; } if (data.has("Ballistic_Force")) { this.ballisticForce = data.readSingle("Ballistic_Force"); } else { this.ballisticForce = 0.002f; } this.reloadTime = data.readSingle("Reload_Time"); this.hammerTime = data.readSingle("Hammer_Time"); this.muzzle = data.readUInt16("Muzzle"); this.explosion = data.readUInt16("Explosion"); if (data.has("Shell")) { this.shell = data.readUInt16("Shell"); } else if (this.action == EAction.Pump || this.action == EAction.Break) { this.shell = 33; } else if (this.action != EAction.Rail) { this.shell = 1; } else { this.shell = 0; } if (data.has("Alert_Radius")) { this.alertRadius = data.readSingle("Alert_Radius"); } else { this.alertRadius = 48f; } bundle.unload(); }
public static void readRewards(Data data, Local localization, string prefix, INPCReward[] rewards) { for (int i = 0; i < rewards.Length; i++) { if (!data.has(prefix + i + "_Type")) { throw new NotSupportedException("Missing reward type"); } ENPCRewardType enpcrewardType = (ENPCRewardType)Enum.Parse(typeof(ENPCRewardType), data.readString(prefix + i + "_Type"), true); string text = localization.read(prefix + i); text = ItemTool.filterRarityRichText(text); switch (enpcrewardType) { case ENPCRewardType.EXPERIENCE: rewards[i] = new NPCExperienceReward(data.readUInt32(prefix + i + "_Value"), text); break; case ENPCRewardType.REPUTATION: rewards[i] = new NPCReputationReward(data.readInt32(prefix + i + "_Value"), text); break; case ENPCRewardType.FLAG_BOOL: rewards[i] = new NPCBoolFlagReward(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), text); break; case ENPCRewardType.FLAG_SHORT: rewards[i] = new NPCShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text); break; case ENPCRewardType.FLAG_SHORT_RANDOM: rewards[i] = new NPCRandomShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Min_Value"), data.readInt16(prefix + i + "_Max_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text); break; case ENPCRewardType.QUEST: rewards[i] = new NPCQuestReward(data.readUInt16(prefix + i + "_ID"), text); break; case ENPCRewardType.ITEM: rewards[i] = new NPCItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), data.readUInt16(prefix + i + "_Sight"), data.readUInt16(prefix + i + "_Tactical"), data.readUInt16(prefix + i + "_Grip"), data.readUInt16(prefix + i + "_Barrel"), data.readUInt16(prefix + i + "_Magazine"), data.readByte(prefix + i + "_Ammo"), text); break; case ENPCRewardType.ITEM_RANDOM: rewards[i] = new NPCRandomItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), text); break; case ENPCRewardType.ACHIEVEMENT: rewards[i] = new NPCAchievementReward(data.readString(prefix + i + "_ID"), text); break; case ENPCRewardType.VEHICLE: rewards[i] = new NPCVehicleReward(data.readUInt16(prefix + i + "_ID"), data.readString(prefix + i + "_Spawnpoint"), text); break; case ENPCRewardType.TELEPORT: rewards[i] = new NPCTeleportReward(data.readString(prefix + i + "_Spawnpoint"), text); break; case ENPCRewardType.EVENT: rewards[i] = new NPCEventReward(data.readString(prefix + i + "_ID"), text); break; } } }
public ObjectAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (id < 2000 && !bundle.hasResource && !data.has("Bypass_ID_Limit")) { throw new NotSupportedException("ID < 2000"); } this._objectName = localization.format("Name"); this.type = (EObjectType)Enum.Parse(typeof(EObjectType), data.readString("Type"), true); if (this.type == EObjectType.NPC) { if (Dedicator.isDedicated) { this._modelGameObject = (GameObject)Resources.Load("Characters/NPC_Server"); } else { this._modelGameObject = (GameObject)Resources.Load("Characters/NPC_Client"); } this.useScale = true; this.interactability = EObjectInteractability.NPC; } else if (this.type == EObjectType.DECAL) { float num = data.readSingle("Decal_X"); float num2 = data.readSingle("Decal_Y"); float num3 = 1f; if (data.has("Decal_LOD_Bias")) { num3 = data.readSingle("Decal_LOD_Bias"); } Texture2D texture2D = (Texture2D)bundle.load("Decal"); this._modelGameObject = Object.Instantiate <GameObject>(Resources.Load <GameObject>("Materials/Decal_Template")); this._modelGameObject.hideFlags = 61; Object.DontDestroyOnLoad(this._modelGameObject); BoxCollider component = this.modelGameObject.GetComponent <BoxCollider>(); component.size = new Vector3(num2, num, 1f); Decal component2 = this.modelGameObject.transform.FindChild("Decal").GetComponent <Decal>(); Material material = Object.Instantiate <Material>(component2.material); material.name = "Decal_Deferred"; material.hideFlags = 52; material.SetTexture("_MainTex", texture2D); component2.material = material; component2.lodBias = num3; component2.transform.localScale = new Vector3(num, num2, 1f); MeshRenderer component3 = this.modelGameObject.transform.FindChild("Mesh").GetComponent <MeshRenderer>(); Material material2 = Object.Instantiate <Material>(component3.sharedMaterial); material2.name = "Decal_Forward"; material2.hideFlags = 52; material2.SetTexture("_MainTex", texture2D); component3.sharedMaterial = material2; component3.transform.localScale = new Vector3(num2, num, 1f); this.useScale = true; } else { if (Dedicator.isDedicated) { this._modelGameObject = (GameObject)bundle.load("Clip"); if (this.modelGameObject == null && this.type != EObjectType.SMALL) { Debug.LogError(this.objectName + " is missing collision data. Highly recommended to fix."); } } else { this._modelGameObject = (GameObject)bundle.load("Object"); if (this.modelGameObject == null) { throw new NotSupportedException("Missing object gameobject"); } this._skyboxGameObject = (GameObject)bundle.load("Skybox"); } if (this.modelGameObject != null) { if (Mathf.Abs(this.modelGameObject.transform.localScale.x - 1f) > 0.01f || Mathf.Abs(this.modelGameObject.transform.localScale.y - 1f) > 0.01f || Mathf.Abs(this.modelGameObject.transform.localScale.z - 1f) > 0.01f) { this.useScale = false; Assets.errors.Add(this.objectName + " should have a scale of one."); } else { this.useScale = true; } Transform transform = this.modelGameObject.transform.FindChild("Block"); if (transform != null && transform.GetComponent <Collider>() != null && transform.GetComponent <Collider>().sharedMaterial == null) { Assets.errors.Add(this.objectName + " has a clip object but no physics material."); } Transform transform2 = this.modelGameObject.transform.FindChild("Model_0"); if (this.type == EObjectType.SMALL) { if (!this.modelGameObject.CompareTag("Small")) { Assets.errors.Add(this.objectName + " is set up as small, but is not tagged as small."); } if (this.modelGameObject.layer != LayerMasks.SMALL) { Assets.errors.Add(this.objectName + " is set up as small, but is not layered as small."); } if (transform2 != null) { if (!transform2.CompareTag("Small")) { Assets.errors.Add(this.objectName + " is set up as small, but is not tagged as small."); } if (transform2.gameObject.layer != LayerMasks.SMALL) { Assets.errors.Add(this.objectName + " is set up as small, but is not layered as small."); } } } else if (this.type == EObjectType.MEDIUM) { if (!this.modelGameObject.CompareTag("Medium")) { Assets.errors.Add(this.objectName + " is set up as medium, but is not tagged as medium."); } if (this.modelGameObject.layer != LayerMasks.MEDIUM) { Assets.errors.Add(this.objectName + " is set up as medium, but is not layered as medium."); } if (transform2 != null) { if (!transform2.CompareTag("Medium")) { Assets.errors.Add(this.objectName + " is set up as medium, but is not tagged as medium."); } if (transform2.gameObject.layer != LayerMasks.MEDIUM) { Assets.errors.Add(this.objectName + " is set up as medium, but is not layered as medium."); } } } else if (this.type == EObjectType.LARGE) { if (!this.modelGameObject.CompareTag("Large")) { Assets.errors.Add(this.objectName + " is set up as large, but is not tagged as large."); } if (this.modelGameObject.layer != LayerMasks.LARGE) { Assets.errors.Add(this.objectName + " is set up as large, but is not layered as large."); } if (transform2 != null) { if (!transform2.CompareTag("Large")) { Assets.errors.Add(this.objectName + " is set up as large, but is not tagged as large."); } if (transform2.gameObject.layer != LayerMasks.LARGE) { Assets.errors.Add(this.objectName + " is set up as large, but is not layered as large."); } } } } this._navGameObject = (GameObject)bundle.load("Nav"); if (this.navGameObject == null && this.type == EObjectType.LARGE) { Assets.errors.Add(this.objectName + " is missing navigation data. Highly recommended to fix."); } if (this.navGameObject != null) { if (!this.navGameObject.CompareTag("Navmesh")) { Assets.errors.Add(this.objectName + " is set up as navmesh, but is not tagged as navmesh."); } if (this.navGameObject.layer != LayerMasks.NAVMESH) { Assets.errors.Add(this.objectName + " is set up as navmesh, but is not layered as navmesh."); } } this._slotsGameObject = (GameObject)bundle.load("Slots"); this._triggersGameObject = (GameObject)bundle.load("Triggers"); this.isSnowshoe = data.has("Snowshoe"); if (data.has("Chart")) { this.chart = (EObjectChart)Enum.Parse(typeof(EObjectChart), data.readString("Chart"), true); } else { this.chart = EObjectChart.NONE; } this.isFuel = data.has("Fuel"); this.isRefill = data.has("Refill"); this.isSoft = data.has("Soft"); this.isCollisionImportant = data.has("Collision_Important"); if (this.isFuel || this.isRefill) { Assets.errors.Add(this.objectName + " is using the legacy fuel/water system."); } if (data.has("LOD")) { this.lod = (EObjectLOD)Enum.Parse(typeof(EObjectLOD), data.readString("LOD"), true); this.lodBias = data.readSingle("LOD_Bias"); if (this.lodBias < 0.01f) { this.lodBias = 1f; } this.lodCenter = data.readVector3("LOD_Center"); this.lodSize = data.readVector3("LOD_Size"); } if (data.has("Interactability")) { this.interactability = (EObjectInteractability)Enum.Parse(typeof(EObjectInteractability), data.readString("Interactability"), true); this.interactabilityRemote = data.has("Interactability_Remote"); this.interactabilityDelay = data.readSingle("Interactability_Delay"); this.interactabilityReset = data.readSingle("Interactability_Reset"); if (data.has("Interactability_Hint")) { this.interactabilityHint = (EObjectInteractabilityHint)Enum.Parse(typeof(EObjectInteractabilityHint), data.readString("Interactability_Hint"), true); } this.interactabilityEmission = data.has("Interactability_Emission"); if (this.interactability == EObjectInteractability.NOTE) { ushort num4 = data.readUInt16("Interactability_Text_Lines"); StringBuilder stringBuilder = new StringBuilder(); for (ushort num5 = 0; num5 < num4; num5 += 1) { string value = localization.format("Interactability_Text_Line_" + num5); stringBuilder.AppendLine(value); } this.interactabilityText = stringBuilder.ToString(); } else { this.interactabilityText = localization.read("Interact"); } if (data.has("Interactability_Power")) { this.interactabilityPower = (EObjectInteractabilityPower)Enum.Parse(typeof(EObjectInteractabilityPower), data.readString("Interactability_Power"), true); } else { this.interactabilityPower = EObjectInteractabilityPower.NONE; } if (data.has("Interactability_Editor")) { this.interactabilityEditor = (EObjectInteractabilityEditor)Enum.Parse(typeof(EObjectInteractabilityEditor), data.readString("Interactability_Editor"), true); } else { this.interactabilityEditor = EObjectInteractabilityEditor.NONE; } if (data.has("Interactability_Nav")) { this.interactabilityNav = (EObjectInteractabilityNav)Enum.Parse(typeof(EObjectInteractabilityNav), data.readString("Interactability_Nav"), true); } else { this.interactabilityNav = EObjectInteractabilityNav.NONE; } this.interactabilityDrops = new ushort[(int)data.readByte("Interactability_Drops")]; byte b = 0; while ((int)b < this.interactabilityDrops.Length) { this.interactabilityDrops[(int)b] = data.readUInt16("Interactability_Drop_" + b); b += 1; } this.interactabilityRewardID = data.readUInt16("Interactability_Reward_ID"); this.interactabilityEffect = data.readUInt16("Interactability_Effect"); this.interactabilityConditions = new INPCCondition[(int)data.readByte("Interactability_Conditions")]; NPCTool.readConditions(data, localization, "Interactability_Condition_", this.interactabilityConditions); this.interactabilityRewards = new INPCReward[(int)data.readByte("Interactability_Rewards")]; NPCTool.readRewards(data, localization, "Interactability_Reward_", this.interactabilityRewards); this.interactabilityResource = data.readUInt16("Interactability_Resource"); this.interactabilityResourceState = BitConverter.GetBytes(this.interactabilityResource); } else { this.interactability = EObjectInteractability.NONE; this.interactabilityPower = EObjectInteractabilityPower.NONE; this.interactabilityEditor = EObjectInteractabilityEditor.NONE; } if (this.interactability == EObjectInteractability.RUBBLE) { this.rubble = EObjectRubble.DESTROY; this.rubbleReset = data.readSingle("Interactability_Reset"); this.rubbleHealth = data.readUInt16("Interactability_Health"); this.rubbleEffect = data.readUInt16("Interactability_Effect"); this.rubbleFinale = data.readUInt16("Interactability_Finale"); this.rubbleRewardID = data.readUInt16("Interactability_Reward_ID"); this.rubbleRewardXP = data.readUInt32("Interactability_Reward_XP"); this.rubbleIsVulnerable = !data.has("Interactability_Invulnerable"); this.rubbleProofExplosion = data.has("Interactability_Proof_Explosion"); } else if (data.has("Rubble")) { this.rubble = (EObjectRubble)Enum.Parse(typeof(EObjectRubble), data.readString("Rubble"), true); this.rubbleReset = data.readSingle("Rubble_Reset"); this.rubbleHealth = data.readUInt16("Rubble_Health"); this.rubbleEffect = data.readUInt16("Rubble_Effect"); this.rubbleFinale = data.readUInt16("Rubble_Finale"); this.rubbleRewardID = data.readUInt16("Rubble_Reward_ID"); this.rubbleRewardXP = data.readUInt32("Rubble_Reward_XP"); this.rubbleIsVulnerable = !data.has("Rubble_Invulnerable"); this.rubbleProofExplosion = data.has("Rubble_Proof_Explosion"); if (data.has("Rubble_Editor")) { this.rubbleEditor = (EObjectRubbleEditor)Enum.Parse(typeof(EObjectRubbleEditor), data.readString("Rubble_Editor"), true); } else { this.rubbleEditor = EObjectRubbleEditor.ALIVE; } } if (data.has("Foliage")) { this.foliage = new AssetReference <FoliageInfoCollectionAsset>(new Guid(data.readString("Foliage"))); } this.useWaterHeightTransparentSort = data.has("Use_Water_Height_Transparent_Sort"); if (data.has("Material_Palette")) { this.materialPalette = new AssetReference <MaterialPaletteAsset>(data.readGUID("Material_Palette")); } if (data.has("Landmark_Quality")) { this.landmarkQuality = (EGraphicQuality)Enum.Parse(typeof(EGraphicQuality), data.readString("Landmark_Quality"), true); } else { this.landmarkQuality = EGraphicQuality.LOW; } } this.conditions = new INPCCondition[(int)data.readByte("Conditions")]; NPCTool.readConditions(data, localization, "Condition_", this.conditions); bundle.unload(); }
// Token: 0x06001A26 RID: 6694 RVA: 0x00092038 File Offset: 0x00090438 public ItemAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { this.isPro = data.has("Pro"); if (id < 2000 && !bundle.hasResource && !this.isPro && !data.has("Bypass_ID_Limit")) { throw new NotSupportedException("ID < 2000"); } if (!this.isPro) { this._itemName = localization.format("Name"); this._itemDescription = localization.format("Description"); this._itemDescription = ItemTool.filterRarityRichText(this.itemDescription); } this.type = (EItemType)Enum.Parse(typeof(EItemType), data.readString("Type"), true); if (data.has("Rarity")) { this.rarity = (EItemRarity)Enum.Parse(typeof(EItemRarity), data.readString("Rarity"), true); } else { this.rarity = EItemRarity.COMMON; } if (this.isPro) { if (this.type == EItemType.SHIRT) { this._proPath = "/Shirts"; } else if (this.type == EItemType.PANTS) { this._proPath = "/Pants"; } else if (this.type == EItemType.HAT) { this._proPath = "/Hats"; } else if (this.type == EItemType.BACKPACK) { this._proPath = "/Backpacks"; } else if (this.type == EItemType.VEST) { this._proPath = "/Vests"; } else if (this.type == EItemType.MASK) { this._proPath = "/Masks"; } else if (this.type == EItemType.GLASSES) { this._proPath = "/Glasses"; } else if (this.type == EItemType.KEY) { this._proPath = "/Keys"; } else if (this.type == EItemType.BOX) { this._proPath = "/Boxes"; } this._proPath = this._proPath + "/" + this.name; } this.size_x = data.readByte("Size_X"); if (this.size_x < 1) { this.size_x = 1; } this.size_y = data.readByte("Size_Y"); if (this.size_y < 1) { this.size_y = 1; } this.size_z = data.readSingle("Size_Z"); this.size2_z = data.readSingle("Size2_Z"); this.amount = data.readByte("Amount"); if (this.amount < 1) { this.amount = 1; } this.countMin = data.readByte("Count_Min"); if (this.countMin < 1) { this.countMin = 1; } this.countMax = data.readByte("Count_Max"); if (this.countMax < 1) { this.countMax = 1; } if (data.has("Quality_Min")) { this.qualityMin = data.readByte("Quality_Min"); } else { this.qualityMin = 10; } if (data.has("Quality_Max")) { this.qualityMax = data.readByte("Quality_Max"); } else { this.qualityMax = 90; } this.isBackward = data.has("Backward"); this.useable = data.readString("Useable"); this.isUseable = !string.IsNullOrEmpty(this.useable); if (this.isUseable) { this._equip = (AudioClip)bundle.load("Equip"); if (!this.isPro) { GameObject gameObject = (GameObject)bundle.load("Animations"); if (gameObject != null) { Animation component = gameObject.GetComponent <Animation>(); this._animations = new AnimationClip[component.GetClipCount()]; int num = 0; IEnumerator enumerator = component.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; AnimationState animationState = (AnimationState)obj; this.animations[num] = animationState.clip; num++; } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } } else { this._animations = new AnimationClip[0]; } } } string text = data.readString("Slot"); if (text == null) { this.slot = ESlotType.NONE; } else { this.slot = (ESlotType)Enum.Parse(typeof(ESlotType), text, true); } if (!Dedicator.isDedicated || this.type == EItemType.GUN || this.type == EItemType.MELEE) { this._item = (GameObject)bundle.load("Item"); if (this.item == null) { throw new NotSupportedException("Missing item gameobject"); } if (this.item.transform.FindChild("Icon") != null && this.item.transform.FindChild("Icon").GetComponent <Camera>() != null) { Assets.errors.Add(this.itemName + " icon has a camera attached!"); } if (id < 2000 && (this.type == EItemType.GUN || this.type == EItemType.MELEE) && this.item.transform.FindChild("Stat_Tracker") == null) { Assets.errors.Add(this.itemName + " missing stat tracker hook!"); } } byte b = data.readByte("Blueprints"); byte b2 = data.readByte("Actions"); this._blueprints = new List <Blueprint>((int)b); this._actions = new List <Action>((int)b2); for (byte b3 = 0; b3 < b; b3 += 1) { if (!data.has("Blueprint_" + b3 + "_Type")) { throw new NotSupportedException("Missing blueprint type"); } EBlueprintType newType = (EBlueprintType)Enum.Parse(typeof(EBlueprintType), data.readString("Blueprint_" + b3 + "_Type"), true); byte b4 = data.readByte("Blueprint_" + b3 + "_Supplies"); if (b4 < 1) { b4 = 1; } BlueprintSupply[] array = new BlueprintSupply[(int)b4]; byte b5 = 0; while ((int)b5 < array.Length) { ushort newID = data.readUInt16(string.Concat(new object[] { "Blueprint_", b3, "_Supply_", b5, "_ID" })); bool newCritical = data.has(string.Concat(new object[] { "Blueprint_", b3, "_Supply_", b5, "_Critical" })); byte b6 = data.readByte(string.Concat(new object[] { "Blueprint_", b3, "_Supply_", b5, "_Amount" })); if (b6 < 1) { b6 = 1; } array[(int)b5] = new BlueprintSupply(newID, newCritical, b6); b5 += 1; } byte b7 = data.readByte("Blueprint_" + b3 + "_Outputs"); BlueprintOutput[] array2; if (b7 > 0) { array2 = new BlueprintOutput[(int)b7]; byte b8 = 0; while ((int)b8 < array2.Length) { ushort newID2 = data.readUInt16(string.Concat(new object[] { "Blueprint_", b3, "_Output_", b8, "_ID" })); byte b9 = data.readByte(string.Concat(new object[] { "Blueprint_", b3, "_Output_", b8, "_Amount" })); if (b9 < 1) { b9 = 1; } array2[(int)b8] = new BlueprintOutput(newID2, b9); b8 += 1; } } else { array2 = new BlueprintOutput[1]; ushort num2 = data.readUInt16("Blueprint_" + b3 + "_Product"); if (num2 == 0) { num2 = id; } byte b10 = data.readByte("Blueprint_" + b3 + "_Products"); if (b10 < 1) { b10 = 1; } array2[0] = new BlueprintOutput(num2, b10); } ushort newTool = data.readUInt16("Blueprint_" + b3 + "_Tool"); bool newToolCritical = data.has("Blueprint_" + b3 + "_Tool_Critical"); ushort newBuild = data.readUInt16("Blueprint_" + b3 + "_Build"); byte b11 = data.readByte("Blueprint_" + b3 + "_Level"); EBlueprintSkill newSkill = EBlueprintSkill.NONE; if (b11 > 0) { newSkill = (EBlueprintSkill)Enum.Parse(typeof(EBlueprintSkill), data.readString("Blueprint_" + b3 + "_Skill"), true); } bool newTransferState = data.has("Blueprint_" + b3 + "_State_Transfer"); string newMap = data.readString("Blueprint_" + b3 + "_Map"); INPCCondition[] array3 = new INPCCondition[(int)data.readByte("Blueprint_" + b3 + "_Conditions")]; NPCTool.readConditions(data, localization, "Blueprint_" + b3 + "_Condition_", array3, string.Concat(new object[] { "item ", id, " blueprint ", b3 })); INPCReward[] array4 = new INPCReward[(int)data.readByte("Blueprint_" + b3 + "_Rewards")]; NPCTool.readRewards(data, localization, "Blueprint_" + b3 + "_Reward_", array4, string.Concat(new object[] { "item ", id, " blueprint ", b3 })); this.blueprints.Add(new Blueprint(id, b3, newType, array, array2, newTool, newToolCritical, newBuild, b11, newSkill, newTransferState, newMap, array3, array4)); } for (byte b12 = 0; b12 < b2; b12 += 1) { if (!data.has("Action_" + b12 + "_Type")) { throw new NotSupportedException("Missing action type"); } EActionType newType2 = (EActionType)Enum.Parse(typeof(EActionType), data.readString("Action_" + b12 + "_Type"), true); byte b13 = data.readByte("Action_" + b12 + "_Blueprints"); if (b13 < 1) { b13 = 1; } ActionBlueprint[] array5 = new ActionBlueprint[(int)b13]; byte b14 = 0; while ((int)b14 < array5.Length) { byte newID3 = data.readByte(string.Concat(new object[] { "Action_", b12, "_Blueprint_", b14, "_Index" })); bool newLink = data.has(string.Concat(new object[] { "Action_", b12, "_Blueprint_", b14, "_Link" })); array5[(int)b14] = new ActionBlueprint(newID3, newLink); b14 += 1; } string newText = data.readString("Action_" + b12 + "_Text"); string newTooltip = data.readString("Action_" + b12 + "_Tooltip"); string newKey = data.readString("Action_" + b12 + "_Key"); ushort num3 = data.readUInt16("Action_" + b12 + "_Source"); if (num3 == 0) { num3 = id; } this.actions.Add(new Action(num3, newType2, array5, newText, newTooltip, newKey)); } if (b2 == 0) { bool flag = false; byte b15 = 0; while ((int)b15 < this.blueprints.Count) { Blueprint blueprint = this.blueprints[(int)b15]; if (blueprint.type == EBlueprintType.REPAIR) { Action item = new Action(id, EActionType.BLUEPRINT, new ActionBlueprint[] { new ActionBlueprint(b15, true) }, null, null, "Repair"); this.actions.Insert(0, item); } else if (blueprint.type == EBlueprintType.AMMO) { flag = true; } else if (blueprint.supplies.Length == 1 && blueprint.supplies[0].id == id) { Action item2 = new Action(id, EActionType.BLUEPRINT, new ActionBlueprint[] { new ActionBlueprint(b15, this.type == EItemType.GUN || this.type == EItemType.MELEE) }, null, null, "Salvage"); this.actions.Add(item2); } b15 += 1; } if (flag) { List <ActionBlueprint> list = new List <ActionBlueprint>(); byte b16 = 0; while ((int)b16 < this.blueprints.Count) { Blueprint blueprint2 = this.blueprints[(int)b16]; if (blueprint2.type == EBlueprintType.AMMO) { ActionBlueprint item3 = new ActionBlueprint(b16, true); list.Add(item3); } b16 += 1; } Action item4 = new Action(id, EActionType.BLUEPRINT, list.ToArray(), null, null, "Refill"); this.actions.Add(item4); } } this._shouldVerifyHash = !data.has("Bypass_Hash_Verification"); this.overrideShowQuality = data.has("Override_Show_Quality"); if (!Dedicator.isDedicated) { this._albedoBase = (Texture2D)bundle.load("Albedo_Base"); this._metallicBase = (Texture2D)bundle.load("Metallic_Base"); this._emissionBase = (Texture2D)bundle.load("Emission_Base"); } }
// Token: 0x06001CDC RID: 7388 RVA: 0x0009C460 File Offset: 0x0009A860 public VehicleAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (id < 200 && !bundle.hasResource && !data.has("Bypass_ID_Limit")) { throw new NotSupportedException("ID < 200"); } this._vehicleName = localization.format("Name"); this._vehicle = (GameObject)bundle.load("Vehicle"); if (this.vehicle == null) { throw new NotSupportedException("Missing vehicle gameobject"); } this._clip = (GameObject)bundle.load("Clip"); this._size2_z = data.readSingle("Size2_Z"); this._sharedSkinName = data.readString("Shared_Skin_Name"); if (data.has("Shared_Skin_Lookup_ID")) { this._sharedSkinLookupID = data.readUInt16("Shared_Skin_Lookup_ID"); } else { this._sharedSkinLookupID = id; } if (data.has("Engine")) { this._engine = (EEngine)Enum.Parse(typeof(EEngine), data.readString("Engine"), true); if (this.engine == EEngine.BOAT || this.engine == EEngine.BLIMP) { if (this.vehicle.transform.FindChild("Buoyancy") == null) { this._engine = EEngine.CAR; } } else if (this.engine != EEngine.CAR && this.engine != EEngine.TRAIN && this.vehicle.transform.FindChild("Rotors") == null) { this._engine = EEngine.CAR; } } else { this._engine = EEngine.CAR; } if (data.has("Rarity")) { this._rarity = (EItemRarity)Enum.Parse(typeof(EItemRarity), data.readString("Rarity"), true); } else { this._rarity = EItemRarity.COMMON; } this._hasHeadlights = (this.vehicle.transform.FindChild("Headlights") != null); this._hasSirens = (this.vehicle.transform.FindChild("Sirens") != null); this._hasHook = (this.vehicle.transform.FindChild("Hook") != null); this._hasZip = data.has("Zip"); this._hasBicycle = data.has("Bicycle"); this.isReclined = data.has("Reclined"); this._hasCrawler = data.has("Crawler"); this._hasLockMouse = data.has("LockMouse"); this._hasTraction = data.has("Traction"); this._hasSleds = data.has("Sleds"); this._ignition = (AudioClip)bundle.load("Ignition"); this._horn = (AudioClip)bundle.load("Horn"); if (this.clip == null) { Assets.errors.Add(this.vehicleName + " is missing collision data. Highly recommended to fix."); } if (this.vehicle != null && this.vehicle.transform.FindChild("Seats") == null) { Assets.errors.Add(this.vehicleName + " vehicle is missing seats."); } if (this.clip != null && this.clip.transform.FindChild("Seats") == null) { Assets.errors.Add(this.vehicleName + " clip is missing seats."); } if (data.has("Pitch_Idle")) { this._pitchIdle = data.readSingle("Pitch_Idle"); } else { this._pitchIdle = 0.5f; AudioSource component = this.vehicle.GetComponent <AudioSource>(); if (component != null) { AudioClip clip = component.clip; if (clip != null) { if (clip.name == "Engine_Large") { this._pitchIdle = 0.625f; } else if (clip.name == "Engine_Small") { this._pitchIdle = 0.75f; } } else { Assets.errors.Add(this.vehicleName + " missing engine audio!"); } } } if (data.has("Pitch_Drive")) { this._pitchDrive = data.readSingle("Pitch_Drive"); } else { this._pitchDrive = 0.05f; AudioSource component2 = this.vehicle.GetComponent <AudioSource>(); if (component2 != null) { AudioClip clip2 = component2.clip; if (clip2 != null) { if (clip2.name == "Engine_Large") { this._pitchDrive = 0.025f; } else if (clip2.name == "Engine_Small") { this._pitchDrive = 0.075f; } } else { Assets.errors.Add(this.vehicleName + " missing engine audio!"); } } } this._speedMin = data.readSingle("Speed_Min"); this._speedMax = data.readSingle("Speed_Max"); if (this.engine != EEngine.TRAIN) { this._speedMax *= 1.25f; } this._steerMin = data.readSingle("Steer_Min"); this._steerMax = data.readSingle("Steer_Max") * 0.75f; this._brake = data.readSingle("Brake"); this._lift = data.readSingle("Lift"); this._fuelMin = data.readUInt16("Fuel_Min"); this._fuelMax = data.readUInt16("Fuel_Max"); this._fuel = data.readUInt16("Fuel"); this._healthMin = data.readUInt16("Health_Min"); this._healthMax = data.readUInt16("Health_Max"); this._health = data.readUInt16("Health"); this._explosion = data.readUInt16("Explosion"); if (data.has("Explosion_Min_Force_Y")) { this.minExplosionForce = data.readVector3("Explosion_Min_Force"); } else { this.minExplosionForce = new Vector3(0f, 1024f, 0f); } if (data.has("Explosion_Max_Force_Y")) { this.maxExplosionForce = data.readVector3("Explosion_Max_Force"); } else { this.maxExplosionForce = new Vector3(0f, 1024f, 0f); } if (data.has("Exit")) { this._exit = data.readSingle("Exit"); } else { this._exit = 2f; } if (data.has("Cam_Follow_Distance")) { this._camFollowDistance = data.readSingle("Cam_Follow_Distance"); } else { this._camFollowDistance = 5.5f; } this._camDriverOffset = data.readSingle("Cam_Driver_Offset"); if (data.has("Bumper_Multiplier")) { this._bumperMultiplier = data.readSingle("Bumper_Multiplier"); } else { this._bumperMultiplier = 1f; } if (data.has("Passenger_Explosion_Armor")) { this._passengerExplosionArmor = data.readSingle("Passenger_Explosion_Armor"); } else { this._passengerExplosionArmor = 1f; } if (this.engine == EEngine.HELICOPTER || this.engine == EEngine.BLIMP) { this._sqrDelta = Mathf.Pow(this.speedMax * 0.125f, 2f); } else { this._sqrDelta = Mathf.Pow(this.speedMax * 0.1f, 2f); } this._turrets = new TurretInfo[(int)data.readByte("Turrets")]; byte b = 0; while ((int)b < this.turrets.Length) { TurretInfo turretInfo = new TurretInfo(); turretInfo.seatIndex = data.readByte("Turret_" + b + "_Seat_Index"); turretInfo.itemID = data.readUInt16("Turret_" + b + "_Item_ID"); turretInfo.yawMin = data.readSingle("Turret_" + b + "_Yaw_Min"); turretInfo.yawMax = data.readSingle("Turret_" + b + "_Yaw_Max"); turretInfo.pitchMin = data.readSingle("Turret_" + b + "_Pitch_Min"); turretInfo.pitchMax = data.readSingle("Turret_" + b + "_Pitch_Max"); turretInfo.useAimCamera = !data.has("Turret_" + b + "_Ignore_Aim_Camera"); turretInfo.aimOffset = data.readSingle("Turret_" + b + "_Aim_Offset"); this._turrets[(int)b] = turretInfo; b += 1; } this.isVulnerable = !data.has("Invulnerable"); this.isVulnerableToExplosions = !data.has("Explosions_Invulnerable"); this.isVulnerableToEnvironment = !data.has("Environment_Invulnerable"); this.isVulnerableToBumper = !data.has("Bumper_Invulnerable"); this.canTiresBeDamaged = !data.has("Tires_Invulnerable"); if (data.has("Air_Turn_Responsiveness")) { this.airTurnResponsiveness = data.readSingle("Air_Turn_Responsiveness"); } else { this.airTurnResponsiveness = 2f; } if (data.has("Air_Steer_Min")) { this.airSteerMin = data.readSingle("Air_Steer_Min"); } else { this.airSteerMin = this.steerMin; } if (data.has("Air_Steer_Max")) { this.airSteerMax = data.readSingle("Air_Steer_Max"); } else { this.airSteerMax = this.steerMax; } this.bicycleAnimSpeed = data.readSingle("Bicycle_Anim_Speed"); this.staminaBoost = data.readSingle("Stamina_Boost"); this.useStaminaBoost = data.has("Stamina_Boost"); this.isStaminaPowered = data.has("Stamina_Powered"); this.supportsMobileBuildables = data.has("Supports_Mobile_Buildables"); this.trunkStorage_X = data.readByte("Trunk_Storage_X"); this.trunkStorage_Y = data.readByte("Trunk_Storage_Y"); this.trainTrackOffset = data.readSingle("Train_Track_Offset"); this.trainWheelOffset = data.readSingle("Train_Wheel_Offset"); this.trainCarLength = data.readSingle("Train_Car_Length"); this._shouldVerifyHash = !data.has("Bypass_Hash_Verification"); if (!Dedicator.isDedicated) { this._albedoBase = (Texture2D)bundle.load("Albedo_Base"); this._metallicBase = (Texture2D)bundle.load("Metallic_Base"); this._emissionBase = (Texture2D)bundle.load("Emission_Base"); } bundle.unload(); }
// Token: 0x06003448 RID: 13384 RVA: 0x00155AC4 File Offset: 0x00153EC4 public static void readRewards(Data data, Local localization, string prefix, INPCReward[] rewards, string errorMessageSource) { for (int i = 0; i < rewards.Length; i++) { if (!data.has(prefix + i + "_Type")) { Assets.errors.Add(string.Concat(new object[] { "Missing ", prefix, i, " reward type" })); throw new NotSupportedException(string.Concat(new object[] { "Missing ", prefix, i, " reward type" })); } ENPCRewardType enpcrewardType = (ENPCRewardType)Enum.Parse(typeof(ENPCRewardType), data.readString(prefix + i + "_Type"), true); string text = localization.read(prefix + i); text = ItemTool.filterRarityRichText(text); switch (enpcrewardType) { case ENPCRewardType.EXPERIENCE: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Experience reward ", prefix, i, " missing _Value in: ", errorMessageSource })); } rewards[i] = new NPCExperienceReward(data.readUInt32(prefix + i + "_Value"), text); break; case ENPCRewardType.REPUTATION: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Reputation reward ", prefix, i, " missing _Value in: ", errorMessageSource })); } rewards[i] = new NPCReputationReward(data.readInt32(prefix + i + "_Value"), text); break; case ENPCRewardType.FLAG_BOOL: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Bool flag reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Bool flag reward ", prefix, i, " missing _Value in: ", errorMessageSource })); } rewards[i] = new NPCBoolFlagReward(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), text); break; case ENPCRewardType.FLAG_SHORT: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Short flag reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Short flag reward ", prefix, i, " missing _Value in: ", errorMessageSource })); } rewards[i] = new NPCShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text); break; case ENPCRewardType.FLAG_SHORT_RANDOM: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Random short flag reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Min_Value")) { Assets.errors.Add(string.Concat(new object[] { "Random short flag reward ", prefix, i, " missing _Min_Value in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Max_Value")) { Assets.errors.Add(string.Concat(new object[] { "Random short flag reward ", prefix, i, " missing _Max_Value in: ", errorMessageSource })); } rewards[i] = new NPCRandomShortFlagReward(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Min_Value"), data.readInt16(prefix + i + "_Max_Value"), (ENPCModificationType)Enum.Parse(typeof(ENPCModificationType), data.readString(prefix + i + "_Modification"), true), text); break; case ENPCRewardType.QUEST: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Quest reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } rewards[i] = new NPCQuestReward(data.readUInt16(prefix + i + "_ID"), text); break; case ENPCRewardType.ITEM: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Item reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Amount")) { Assets.errors.Add(string.Concat(new object[] { "Item reward ", prefix, i, " missing _Amount in: ", errorMessageSource })); } rewards[i] = new NPCItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), data.readUInt16(prefix + i + "_Sight"), data.readUInt16(prefix + i + "_Tactical"), data.readUInt16(prefix + i + "_Grip"), data.readUInt16(prefix + i + "_Barrel"), data.readUInt16(prefix + i + "_Magazine"), data.readByte(prefix + i + "_Ammo"), text); break; case ENPCRewardType.ITEM_RANDOM: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Random item reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Amount")) { Assets.errors.Add(string.Concat(new object[] { "Random item reward ", prefix, i, " missing _Amount in: ", errorMessageSource })); } rewards[i] = new NPCRandomItemReward(data.readUInt16(prefix + i + "_ID"), data.readByte(prefix + i + "_Amount"), text); break; case ENPCRewardType.ACHIEVEMENT: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Achievement reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } rewards[i] = new NPCAchievementReward(data.readString(prefix + i + "_ID"), text); break; case ENPCRewardType.VEHICLE: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Vehicle reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Spawnpoint")) { Assets.errors.Add(string.Concat(new object[] { "Vehicle reward ", prefix, i, " missing _Spawnpoint in: ", errorMessageSource })); } rewards[i] = new NPCVehicleReward(data.readUInt16(prefix + i + "_ID"), data.readString(prefix + i + "_Spawnpoint"), text); break; case ENPCRewardType.TELEPORT: if (!data.has(prefix + i + "_Spawnpoint")) { Assets.errors.Add(string.Concat(new object[] { "Teleport reward ", prefix, i, " missing _Spawnpoint in: ", errorMessageSource })); } rewards[i] = new NPCTeleportReward(data.readString(prefix + i + "_Spawnpoint"), text); break; case ENPCRewardType.EVENT: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Event reward ", prefix, i, " missing _ID in: ", errorMessageSource })); } rewards[i] = new NPCEventReward(data.readString(prefix + i + "_ID"), text); break; case ENPCRewardType.FLAG_MATH: if (!data.has(prefix + i + "_A_ID")) { Assets.errors.Add(string.Concat(new object[] { "Math reward ", prefix, i, " missing _A_ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_B_ID")) { Assets.errors.Add(string.Concat(new object[] { "Math reward ", prefix, i, " missing _B_ID in: ", errorMessageSource })); } rewards[i] = new NPCFlagMathReward(data.readUInt16(prefix + i + "_A_ID"), data.readUInt16(prefix + i + "_B_ID"), (ENPCOperationType)Enum.Parse(typeof(ENPCOperationType), data.readString(prefix + i + "_Operation"), true), text); break; } } }
// Token: 0x06003447 RID: 13383 RVA: 0x00154C10 File Offset: 0x00153010 public static void readConditions(Data data, Local localization, string prefix, INPCCondition[] conditions, string errorMessageSource) { for (int i = 0; i < conditions.Length; i++) { if (!data.has(prefix + i + "_Type")) { Assets.errors.Add(string.Concat(new object[] { "Missing condition ", prefix, i, " type" })); throw new NotSupportedException(string.Concat(new object[] { "Missing condition ", prefix, i, " type" })); } ENPCConditionType enpcconditionType = (ENPCConditionType)Enum.Parse(typeof(ENPCConditionType), data.readString(prefix + i + "_Type"), true); string text = localization.read(prefix + i); text = ItemTool.filterRarityRichText(text); bool newShouldReset = data.has(prefix + i + "_Reset"); ENPCLogicType newLogicType = ENPCLogicType.NONE; if (data.has(prefix + i + "_Logic")) { newLogicType = (ENPCLogicType)Enum.Parse(typeof(ENPCLogicType), data.readString(prefix + i + "_Logic"), true); } switch (enpcconditionType) { case ENPCConditionType.EXPERIENCE: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Experience condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCExperienceCondition(data.readUInt32(prefix + i + "_Value"), newLogicType, text, newShouldReset); break; case ENPCConditionType.REPUTATION: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Reputation condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCReputationCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.FLAG_BOOL: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Bool flag condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Bool flag condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCBoolFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.FLAG_SHORT: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Short flag condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Short flag condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCShortFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.QUEST: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Quest condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Status")) { Assets.errors.Add(string.Concat(new object[] { "Quest condition ", prefix, i, " missing _Status in: ", errorMessageSource })); } conditions[i] = new NPCQuestCondition(data.readUInt16(prefix + i + "_ID"), (ENPCQuestStatus)Enum.Parse(typeof(ENPCQuestStatus), data.readString(prefix + i + "_Status"), true), data.has(prefix + i + "_Ignore_NPC"), newLogicType, text, newShouldReset); break; case ENPCConditionType.SKILLSET: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Skillset condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCSkillsetCondition((EPlayerSkillset)Enum.Parse(typeof(EPlayerSkillset), data.readString(prefix + i + "_Value"), true), newLogicType, text); break; case ENPCConditionType.ITEM: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Item condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Amount")) { Assets.errors.Add(string.Concat(new object[] { "Item condition ", prefix, i, " missing _Amount in: ", errorMessageSource })); } conditions[i] = new NPCItemCondition(data.readUInt16(prefix + i + "_ID"), data.readUInt16(prefix + i + "_Amount"), text, newShouldReset); break; case ENPCConditionType.KILLS_ZOMBIE: { if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Zombie kills condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Zombie kills condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } EZombieSpeciality newZombie = EZombieSpeciality.NONE; if (data.has(prefix + i + "_Zombie")) { newZombie = (EZombieSpeciality)Enum.Parse(typeof(EZombieSpeciality), data.readString(prefix + i + "_Zombie"), true); } else { Assets.errors.Add(string.Concat(new object[] { "Zombie kills condition ", prefix, i, " missing _Zombie in: ", errorMessageSource })); } conditions[i] = new NPCZombieKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), newZombie, data.has(prefix + i + "_Spawn"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; } case ENPCConditionType.KILLS_HORDE: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Horde kills condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Horde kills condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Nav")) { Assets.errors.Add(string.Concat(new object[] { "Horde kills condition ", prefix, i, " missing _Nav in: ", errorMessageSource })); } conditions[i] = new NPCHordeKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; case ENPCConditionType.KILLS_ANIMAL: if (!data.has(prefix + i + "_ID")) { Assets.errors.Add(string.Concat(new object[] { "Animal kills condition ", prefix, i, " missing _ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Animal kills condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } if (!data.has(prefix + i + "_Animal")) { Assets.errors.Add(string.Concat(new object[] { "Animal kills condition ", prefix, i, " missing _Animal in: ", errorMessageSource })); } conditions[i] = new NPCAnimalKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readUInt16(prefix + i + "_Animal"), text, newShouldReset); break; case ENPCConditionType.COMPARE_FLAGS: if (!data.has(prefix + i + "_A_ID")) { Assets.errors.Add(string.Concat(new object[] { "Compare flags condition ", prefix, i, " missing _A_ID in: ", errorMessageSource })); } if (!data.has(prefix + i + "_B_ID")) { Assets.errors.Add(string.Concat(new object[] { "Compare flags condition ", prefix, i, " missing _B_ID in: ", errorMessageSource })); } conditions[i] = new NPCCompareFlagsCondition(data.readUInt16(prefix + i + "_A_ID"), data.readUInt16(prefix + i + "_B_ID"), data.has(prefix + i + "_Allow_A_Unset"), data.has(prefix + i + "_Allow_B_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.TIME_OF_DAY: if (!data.has(prefix + i + "_Second")) { Assets.errors.Add(string.Concat(new object[] { "Time of day condition ", prefix, i, " missing _Second in: ", errorMessageSource })); } conditions[i] = new NPCTimeOfDayCondition(data.readInt32(prefix + i + "_Second"), newLogicType, text, newShouldReset); break; case ENPCConditionType.PLAYER_LIFE_HEALTH: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life health condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeHealthCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.PLAYER_LIFE_FOOD: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life food condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeFoodCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.PLAYER_LIFE_WATER: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life water condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeWaterCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.PLAYER_LIFE_VIRUS: if (!data.has(prefix + i + "_Value")) { Assets.errors.Add(string.Concat(new object[] { "Player life virus condition ", prefix, i, " missing _Value in: ", errorMessageSource })); } conditions[i] = new NPCPlayerLifeVirusCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; } } }
public EffectAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { if (id < 200 && !bundle.hasResource && !data.has("Bypass_ID_Limit")) { throw new NotSupportedException("ID < 200"); } this._effect = (GameObject)bundle.load("Effect"); if (this.effect == null) { throw new NotSupportedException("Missing effect gameobject"); } this._gore = data.has("Gore"); this._splatters = new GameObject[(int)data.readByte("Splatter")]; for (int i = 0; i < this.splatters.Length; i++) { this.splatters[i] = (GameObject)bundle.load("Splatter_" + i); } this._splatter = data.readByte("Splatters"); this._splatterLiquid = data.has("Splatter_Liquid"); if (data.has("Splatter_Temperature")) { this._splatterTemperature = (EPlayerTemperature)Enum.Parse(typeof(EPlayerTemperature), data.readString("Splatter_Temperature"), true); } else { this._splatterTemperature = EPlayerTemperature.NONE; } this._splatterLifetime = data.readSingle("Splatter_Lifetime"); if (data.has("Splatter_Lifetime_Spread")) { this._splatterLifetimeSpread = data.readSingle("Splatter_Lifetime_Spread"); } else { this._splatterLifetimeSpread = 1f; } this._lifetime = data.readSingle("Lifetime"); if (data.has("Lifetime_Spread")) { this._lifetimeSpread = data.readSingle("Lifetime_Spread"); } else { this._lifetimeSpread = 4f; } this._isStatic = data.has("Static"); if (data.has("Preload")) { this._preload = data.readByte("Preload"); } else { this._preload = 1; } if (data.has("Splatter_Preload")) { this._splatterPreload = data.readByte("Splatter_Preload"); } else { this._splatterPreload = (byte)(Mathf.CeilToInt((float)this.splatter / (float)this.splatters.Length) * (int)this.preload); } this._blast = data.readUInt16("Blast"); bundle.unload(); }
public ItemTankAsset(Bundle bundle, Data data, Local localization, ushort id) : base(bundle, data, localization, id) { this._source = (ETankSource)Enum.Parse(typeof(ETankSource), data.readString("Source"), true); this._resource = data.readUInt16("Resource"); this.resourceState = BitConverter.GetBytes(this.resource); }
public static void readConditions(Data data, Local localization, string prefix, INPCCondition[] conditions) { for (int i = 0; i < conditions.Length; i++) { if (!data.has(prefix + i + "_Type")) { throw new NotSupportedException("Missing condition type"); } ENPCConditionType enpcconditionType = (ENPCConditionType)Enum.Parse(typeof(ENPCConditionType), data.readString(prefix + i + "_Type"), true); string text = localization.read(prefix + i); text = ItemTool.filterRarityRichText(text); bool newShouldReset = data.has(prefix + i + "_Reset"); ENPCLogicType newLogicType = ENPCLogicType.NONE; if (data.has(prefix + i + "_Logic")) { newLogicType = (ENPCLogicType)Enum.Parse(typeof(ENPCLogicType), data.readString(prefix + i + "_Logic"), true); } switch (enpcconditionType) { case ENPCConditionType.EXPERIENCE: conditions[i] = new NPCExperienceCondition(data.readUInt32(prefix + i + "_Value"), newLogicType, text, newShouldReset); break; case ENPCConditionType.REPUTATION: conditions[i] = new NPCReputationCondition(data.readInt32(prefix + i + "_Value"), newLogicType, text); break; case ENPCConditionType.FLAG_BOOL: conditions[i] = new NPCBoolFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readBoolean(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.FLAG_SHORT: conditions[i] = new NPCShortFlagCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.has(prefix + i + "_Allow_Unset"), newLogicType, text, newShouldReset); break; case ENPCConditionType.QUEST: conditions[i] = new NPCQuestCondition(data.readUInt16(prefix + i + "_ID"), (ENPCQuestStatus)Enum.Parse(typeof(ENPCQuestStatus), data.readString(prefix + i + "_Status"), true), data.has(prefix + i + "_Ignore_NPC"), newLogicType, text, newShouldReset); break; case ENPCConditionType.SKILLSET: conditions[i] = new NPCSkillsetCondition((EPlayerSkillset)Enum.Parse(typeof(EPlayerSkillset), data.readString(prefix + i + "_Value"), true), newLogicType, text); break; case ENPCConditionType.ITEM: conditions[i] = new NPCItemCondition(data.readUInt16(prefix + i + "_ID"), data.readUInt16(prefix + i + "_Amount"), text, newShouldReset); break; case ENPCConditionType.KILLS_ZOMBIE: { EZombieSpeciality newZombie = EZombieSpeciality.NONE; if (data.has(prefix + i + "_Zombie")) { newZombie = (EZombieSpeciality)Enum.Parse(typeof(EZombieSpeciality), data.readString(prefix + i + "_Zombie"), true); } conditions[i] = new NPCZombieKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), newZombie, data.has(prefix + i + "_Spawn"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; } case ENPCConditionType.KILLS_HORDE: conditions[i] = new NPCHordeKillsCondition(data.readUInt16(prefix + i + "_ID"), data.readInt16(prefix + i + "_Value"), data.readByte(prefix + i + "_Nav"), text, newShouldReset); break; } } }