diff --git a/.gitignore b/.gitignore index e2bb03bc7e..3c57070a34 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ /[Uu]ser[Ss]ettings/ *.log +.DS_Store + # By default unity supports Blender asset imports, *.blend1 blender files do not need to be commited to version control. *.blend1 *.blend1.meta diff --git a/Assets/PerfectWorld/Scene/TaskTest.unity b/Assets/PerfectWorld/Scene/TaskTest.unity new file mode 100644 index 0000000000..0327c382c8 --- /dev/null +++ b/Assets/PerfectWorld/Scene/TaskTest.unity @@ -0,0 +1,170 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1956623781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1956623783} + - component: {fileID: 1956623782} + m_Layer: 0 + m_Name: TaskTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1956623782 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1956623781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 561ff33122f704147a67d91c42fde5a4, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!4 &1956623783 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1956623781} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1956623783} diff --git a/Assets/PerfectWorld/Scene/TaskTest.unity.meta b/Assets/PerfectWorld/Scene/TaskTest.unity.meta new file mode 100644 index 0000000000..e21e053ce8 --- /dev/null +++ b/Assets/PerfectWorld/Scene/TaskTest.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 768ce4fda26964eca987fc64bf5bab70 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Task/ATaskTemplFixedData.cs b/Assets/Scripts/Task/ATaskTemplFixedData.cs new file mode 100644 index 0000000000..5804dd5be4 --- /dev/null +++ b/Assets/Scripts/Task/ATaskTemplFixedData.cs @@ -0,0 +1,550 @@ +using System; +using System.Runtime.InteropServices; + +namespace PerfectWorld.Scripts.Task +{ + [StructLayout(LayoutKind.Sequential, Pack = 1)] + public struct ATaskTemplFixedData + { + // 任务id // Task ID + public uint m_ID; + + // 任务名称 // Task name + [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASK_NAME_LEN)] + public ushort[] m_szName; + + // 任务署名 // Task signature + public bool m_bHasSign; + + // 署名字符串 // Signature string + // skip 4 bytes + public ushort[] m_pszSignature; + + // 任务类型 // Task type + public uint m_ulType; + + // 时间限制 // Time limit + public uint m_ulTimeLimit; + + // 下线任务失败 // Task fails when offline + public bool m_bOfflineFail; + + // 任务失败时间 // Task failure time + public bool m_bAbsFail; + public task_tm m_tmAbsFailTime; + + // 任务开启物品检验不收取 // Don't take items when validating task start + public bool m_bItemNotTakeOff; + + // 是否绝对时间 // Whether absolute time + public bool m_bAbsTime; + + // 时间段个数 // Number of time periods + public uint m_ulTimetable; + + // 时间方式 // Time method + [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TIMETABLE_SIZE)] + public byte[] m_tmType; + + // 发放起始时间 // Distribution start time + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public task_tm[] m_tmStart; + + // 发放终止时间 // Distribution end time + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public task_tm[] m_tmEnd; + + // 发放频率 // Distribution frequency + public int m_lAvailFrequency; + public int m_lPeriodLimit; + + // 选择单个子任务执行 // Execute single subtask + public bool m_bChooseOne; + + // 随机旋转单个子任务执行 // Randomly rotate single subtask execution + public bool m_bRandOne; + + // 子任务是否有顺序 // Whether subtasks have order + public bool m_bExeChildInOrder; + + // 失败后是否认为父任务也失败 // Whether parent task fails when subtask fails + public bool m_bParentAlsoFail; + + // 子任务成功后父任务成功 // Parent task succeeds when subtask succeeds + public bool m_bParentAlsoSucc; + + // 能否放弃此任务 // Whether task can be abandoned + public bool m_bCanGiveUp; + + // 是否可重复完成 // Whether task can be repeated + public bool m_bCanRedo; + + // 失败后是否可重新完成 // Whether task can be redone after failure + public bool m_bCanRedoAfterFailure; + + // 放弃清空任务 // Clear task when abandoned + public bool m_bClearAsGiveUp; + + // 是否需要记录 // Whether recording is needed + public bool m_bNeedRecord; + + // 玩家被杀死是否认为失败 // Whether task fails when player dies + public bool m_bFailAsPlayerDie; + + // 接受者上限 // Maximum number of receivers + public uint m_ulMaxReceiver; + + // 发放区域 // Distribution area + public bool m_bDelvInZone; + public uint m_ulDelvWorld; + public uint m_ulDelvRegionCnt; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASKREGION)] + [NonSerialized] + public Task_Region[] m_pDelvRegion; + + // 进入区域任务失败 // Task fails when entering region + public bool m_bEnterRegionFail; + public uint m_ulEnterRegionWorld; + public uint m_ulEnterRegionCnt; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASKREGION)] + [NonSerialized] + public Task_Region[] m_pEnterRegion; + + // 离开区域任务失败 // Task fails when leaving region + public bool m_bLeaveRegionFail; + public uint m_ulLeaveRegionWorld; + public uint m_ulLeaveRegionCnt; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASKREGION)] + [NonSerialized] + public Task_Region[] m_pLeaveRegion; + + // 离开阵营失败 // Fails when leaving force + public bool m_bLeaveForceFail; + + // 传送到特定点 // Teleport to specific point + public bool m_bTransTo; + public uint m_ulTransWldId; + public ZONE_VERT m_TransPt; + + // Monster controller + public long m_lMonsCtrl; + public bool m_bTrigCtrl; + + // Auto trigger when conditions are met + public bool m_bAutoDeliver; + + // Whether to display in exclusive UI + public bool m_bDisplayInExclusiveUI; + public bool m_bReadyToNotifyServer; + + // Whether used in token shop + public bool m_bUsedInTokenShop; + + // Death trigger + public bool m_bDeathTrig; + + // Whether clear all acquired items + public bool m_bClearAcquired; + + // Recommended level + public uint m_ulSuitableLevel; + + // Whether to show prompt + public bool m_bShowPrompt; + + // Whether it is a key task + public bool m_bKeyTask; + + // Delivery NPC + public uint m_ulDelvNPC; + + // Award NPC + public uint m_ulAwardNPC; + + // Whether it is a skill task + public bool m_bSkillTask; + + // Whether can be searched + public bool m_bCanSeekOut; + + // Whether show direction + public bool m_bShowDirection; + + // Marriage + public bool m_bMarriage; + + // Change global key/value + public uint m_ulChangeKeyCnt; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public int[] m_plChangeKey; // [TASK_AWARD_MAX_CHANGE_VALUE] + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public int[] m_plChangeKeyValue; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public bool[] m_pbChangeType; + + // Fail on scene switch + public bool m_bSwitchSceneFail; + + // Hidden task + public bool m_bHidden; + + // Whether deliver skill + public bool m_bDeliverySkill; + public int m_iDeliveredSkillID; + public int m_iDeliveredSkillLevel; + + // Whether show task completion effect + public bool m_bShowGfxFinished; + + // Whether change player ranking in PQ + public bool m_bChangePQRanking; + + // Compare delivery items with player inventory slots + public bool m_bCompareItemAndInventory; + public uint m_ulInventorySlotNum; + + // PQ Task related // PQ任务相关 + public bool m_bPQTask; // Whether it is a PQ task // 是否是PQ任务 + public uint m_ulPQExpCnt; // PQ task global variable display // PQ任务全局变量显示 + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public byte[,] m_pszPQExp; // PQ expressions + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public TASK_EXPRESSION[,] m_pPQExpArr; // PQ expression arrays + + public bool m_bPQSubTask; // Whether it is a PQ subtask // 是否PQ子任务 + public bool m_bClearContrib; // Clear contribution when task starts // 任务开始时清空贡献度 + public uint m_ulMonsterContribCnt; // Number of monster types // 怪物种类数量 + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public MONSTERS_CONTRIB[] m_MonstersContrib; // Monster contribution settings // 怪物贡献度设定 + + // Account Task related // 账号任务相关 + public int m_iPremNeedRecordTasksNum; // Number of completed record tasks // 记录完成结果任务完成个数 + public bool m_bShowByNeedRecordTasksNum; // Show by number of needed record tasks + public int m_iPremiseFactionContrib; // Faction contribution // 帮派贡献度 + public bool m_bShowByFactionContrib; // Show by faction contribution + public bool m_bAccountTaskLimit; // Whether account limits completion times // 是否账号限制完成次数 + public bool m_bRoleTaskLimit; // Whether role limits completion times // 是否角色限制完成次数 + public uint m_ulAccountTaskLimitCnt; // Account task limit count (deprecated) // 账号限制完成次数,废弃使用了 + public bool m_bLeaveFactionFail; // Fail when leaving faction + public bool m_bNotIncCntWhenFailed; // Don't increase count when failed // 是否失败时不增加完成次数 + public bool m_bNotClearItemWhenFailed; // Don't clear items when failed // 任务失败时不收取任务要求的物品 + public bool m_bDisplayInTitleTaskUI; // Show in title task UI // 是否显示在称号任务界面里 + + /* 开启条件 */ /* Opening conditions */ + + // 变身状态 // Transformation state + public byte m_ucPremiseTransformedForm; + public bool m_bShowByTransformed; + // 等级条件 // Level conditions + public uint m_ulPremise_Lev_Min; + public uint m_ulPremise_Lev_Max; + public uint m_bPremCheckMaxHistoryLevel; + public bool m_bShowByLev; + // 转生次数 // Reincarnation times + public bool m_bPremCheckReincarnation; + public uint m_ulPremReincarnationMin; + public uint m_ulPremReincarnationMax; + public bool m_bShowByReincarnation; + // 境界 // Realm level + public bool m_bPremCheckRealmLevel; + public uint m_ulPremRealmLevelMin; + public uint m_ulPremRealmLevelMax; + public bool m_bPremCheckRealmExpFull; + public bool m_bShowByRealmLevel; + // 所需道具 // Required items + public uint m_ulPremItems; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public ITEM_WANTED[] m_PremItems; //[MAX_ITEM_WANTED]; + public bool m_bShowByItems; + public bool m_bPremItemsAnyOne; + // 发放道具 // Given items + public uint m_ulGivenItems; + public uint m_ulGivenCmnCount; + public uint m_ulGivenTskCount; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public ITEM_WANTED[] m_GivenItems; //[MAX_ITEM_WANTED]; + // 押金 // Deposit + public uint m_ulPremise_Deposit; + public bool m_bShowByDeposit; + // 声望 // Reputation + public long m_lPremise_Reputation; + public long m_lPremise_RepuMax; + public bool m_bShowByRepu; + // 完成特定任务(成功?失败?),Task ID最高位1表示条件为失败,0为成功 // Complete specific tasks (success? failure?), Task ID highest bit 1 means failure condition, 0 means success condition + public uint m_ulPremise_Task_Count; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_PREM_TASK_COUNT)] + public uint[] m_ulPremise_Tasks; + public bool m_bShowByPreTask; + public uint m_ulPremise_Task_Least_Num; // 多个前提任务需要完成若干个 // Multiple prerequisite tasks need to complete a certain number + // 达到特定时期 // Reach specific period + public uint m_ulPremise_Period; + public bool m_bShowByPeriod; + // 帮派 // Faction + public uint m_ulPremise_Faction; + public int m_iPremise_FactionRole; + public bool m_bShowByFaction; + + // 性别 // Gender + public uint m_ulGender; + public bool m_bShowByGender; + // 职业限制 // Occupation restrictions + public uint m_ulOccupations; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_OCCUPATIONS)] + public uint[] m_Occupations; + public bool m_bShowByOccup; + // 夫妻 // Spouse + public bool m_bPremise_Spouse; + public bool m_bShowBySpouse; + public bool m_bPremiseWeddingOwner; + public bool m_bShowByWeddingOwner; + // GM + public bool m_bGM; + // 完美神盾用户 // Perfect Shield user + public bool m_bShieldUser; + + // 账号累计充值金额(下限&上限) // Account accumulated recharge amount (lower & upper limit) + public bool m_bShowByRMB; + public uint m_ulPremRMBMin; + public uint m_ulPremRMBMax; + + // 角色相关时间 // Character-related time + public bool m_bCharTime; + public bool m_bShowByCharTime; + public int m_iCharStartTime; + public int m_iCharEndTime; // 为0则为当前时间;为1则为m_tmCharEndTime指定时间; // 0 means current time; 1 means the time specified by m_tmCharEndTime; + public task_tm m_tmCharEndTime; + public uint m_ulCharTimeGreaterThan; + + // 关联任务 // Related tasks + public uint m_ulPremise_Cotask; + public uint m_ulCoTaskCond; + // 互斥任务 // Mutually exclusive tasks + public uint m_ulMutexTaskCount; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_MUTEX_TASK_COUNT)] + public uint[] m_ulMutexTasks; + // 生活技能级别 // Life skill levels + [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_LIVING_SKILLS)] + public long[] m_lSkillLev; + // 动态任务类型 // Dynamic task type + public byte m_DynTaskType; + // 特殊奖励号,用于运营的活动 // Special award number, used for operational activities + public uint m_ulSpecialAward; + + // 组队信息 // Team information + public bool m_bTeamwork; // 组队任务 // Team task + public bool m_bRcvByTeam; // 必须组队接收 // Must be in team to receive + public bool m_bSharedTask; // 新队员分享任务 // New team members share tasks + public bool m_bSharedAchieved; // 分享杀怪、物品数量 // Share kill counts and item counts + public bool m_bCheckTeammate; // 检查队友位置 // Check teammate positions + public float m_fTeammateDist; // 队友距离平方值 // Square of teammate distance + public bool m_bAllFail; // 任意队员失败则全部失败 // Any member fails, all fail + public bool m_bCapFail; // 队长失败则全部失败 // Leader fails, all fail + public bool m_bCapSucc; // 队长成功则全队成功 // Leader succeeds, all succeed + public float m_fSuccDist; // 成功时队员的距离 // Member distance for success + public bool m_bDismAsSelfFail; // 队员离队自身失败 // Member leaves team fails itself + public bool m_bRcvChckMem; // 接任务时检查队员位置 // Check member positions when receiving task + public float m_fRcvMemDist; // 接任务时队员距离平方值 // Square of member distance when receiving task + public bool m_bCntByMemPos; // 队员在有效范围内杀怪有效 // Members in valid range for kill counts + public float m_fCntMemDist; // 队员有效的范围 // Valid range for members + public bool m_bAllSucc; // 任意队员成功则全部成功 // Any member succeeds, all succeed + public bool m_bCoupleOnly; // 队长队员必须为夫妻 // Leader and member must be spouses + public bool m_bDistinguishedOcc; // 队伍中不允许有相同的职业 // No same occupations allowed in team + + // 队伍成员需求 // Team member requirements + public uint m_ulTeamMemsWanted; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public TEAM_MEM_WANTED[] m_TeamMemsWanted; + public bool m_bShowByTeam; + + // 前提全局key/value // Premise global key/value + public bool m_bPremNeedComp; + public int m_nPremExp1AndOrExp2; + public COMPARE_KEY_VALUE m_Prem1KeyValue; + public COMPARE_KEY_VALUE m_Prem2KeyValue; + + public bool m_bPremCheckForce; + public int m_iPremForce; + public bool m_bShowByForce; + public int m_iPremForceReputation; + public bool m_bShowByForceReputation; + public int m_iPremForceContribution; // 扣除战功 // Deduct military merit + public bool m_bShowByForceContribution; + public int m_iPremForceExp; // 经验兑换 // Experience exchange + public bool m_bShowByForceExp; + public int m_iPremForceSP; // 元神兑换 // Spirit exchange + public bool m_bShowByForceSP; + public int m_iPremForceActivityLevel; + public bool m_bShowByForceActivityLevel; + + public bool m_bPremIsKing; + public bool m_bShowByKing; + public bool m_bPremNotInTeam; + public bool m_bShowByNotInTeam; + public uint m_iPremTitleNumTotal; + public uint m_iPremTitleNumRequired; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public int[] m_PremTitles; + public bool m_bShowByTitle; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] m_iPremHistoryStageIndex; // 历史阶段 // Historical stage + public bool m_bShowByHistoryStage; + + public uint m_ulPremGeneralCardCount; // 收集的卡牌数量 // Number of collected cards + public bool m_bShowByGeneralCard; + + public int m_iPremGeneralCardRank; // 要求某品阶的卡牌数量 // Required number of cards of a certain rank + public uint m_ulPremGeneralCardRankCount; + public bool m_bShowByGeneralCardRank; + + /* 任务完成的方式及条件 */ /* Task completion methods and conditions */ + + public uint m_enumMethod; + public uint m_enumFinishType; + + /* 任务方式 */ /* Task methods */ + + public uint m_ulPlayerWanted; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public PLAYER_WANTED[] m_PlayerWanted; + public uint m_ulMonsterWanted; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public MONSTER_WANTED[] m_MonsterWanted; + + public uint m_ulItemsWanted; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public ITEM_WANTED[] m_ItemsWanted; + public uint m_ulGoldWanted; + + public int m_iFactionContribWanted; + public int m_iFactionExpContribWanted; + + public uint m_ulNPCToProtect; + public uint m_ulProtectTimeLen; + + public uint m_ulNPCMoving; + public uint m_ulNPCDestSite; + + //public ZONE_VERT m_ReachSiteMin; + //public ZONE_VERT m_ReachSiteMax; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public Task_Region[] m_pReachSite; + public uint m_ulReachSiteCnt; + public uint m_ulReachSiteId; + public uint m_ulWaitTime; + + //藏宝图 使用已接任务列表中的m_iUsefulData1存储 // Treasure map Use m_iUsefulData1 in the list of accepted tasks + public enum TREASURE_DISTANCE_LEVEL + { + DISTANCE_FAR_FAR_AWAY, + DISTANCE_FAR, + DISTANCE_MEDIUM, + DISTANCE_NEAR, + DISTANCE_VERY_NEAR, + DISTANCE_NUM, + } + + // TREA section + public ZONE_VERT m_TreasureStartZone; + public byte m_ucZonesNumX; + public byte m_ucZonesNumZ; + public byte m_ucZoneSide; + + //public ZONE_VERT m_LeaveSiteMin; + //public ZONE_VERT m_LeaveSiteMax; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] + [NonSerialized] + public Task_Region[] m_pLeaveSite; + public uint m_ulLeaveSiteCnt; + public uint m_ulLeaveSiteId; + + // 完成全局key/value // Complete global key/value + public bool m_bFinNeedComp; + public int m_nFinExp1AndOrExp2; + public COMPARE_KEY_VALUE m_Fin1KeyValue; + public COMPARE_KEY_VALUE m_Fin2KeyValue; + + // 需显示的全局变量表达式 // Global variable expressions to display + public uint m_ulExpCnt; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] + public byte[,] m_pszExp; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] + [NonSerialized] + public TASK_EXPRESSION[,] m_pExpArr; + + // 需显示的全局变量表达式提示字符串 // Global variable expression prompt strings + public uint m_ulTaskCharCnt; + // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] + [NonSerialized] + public ushort[,] m_pTaskChar; + + // 变身状态 // Transformation state + public byte m_ucTransformedForm; + // 等级 // Level + public uint m_ulReachLevel; + // 转生次数 // Reincarnation count + public uint m_ulReachReincarnationCount; + // 境界等级 // Realm level + public uint m_ulReachRealmLevel; + + public uint m_uiEmotion; // 表情动作 // Emotion action + + /* 任务结束后的奖励 */ /* Rewards after task completion */ + public uint m_ulAwardType_S; + public uint m_ulAwardType_F; + + /* 普通和按每个方式 */ /* Normal and per-method rewards */ + // [NonSerialized] + // public AWARD_DATA m_Award_S; /* 成功 */ /* Success */ + public uint m_Award_S_ptr; + [NonSerialized] + // public AWARD_DATA m_Award_F; /* 失败 */ /* Failure */ + public uint m_Award_F_ptr; + + + /* 时间比例方式 */ /* Time ratio method */ + //TODO: Revert + [NonSerialized] + // public AWARD_RATIO_SCALE m_AwByRatio_S; + public uint m_AwByRatio_S_ptr; + [NonSerialized] + // public AWARD_RATIO_SCALE m_AwByRatio_F; + public uint m_AwByRatio_F_ptr; + + /* 按获得物比例方式 */ /* Item ratio method */ + //TODO: Revert + [NonSerialized] + // public AWARD_ITEMS_SCALE m_AwByItems_S; + public uint m_AwByItems_S_ptr; + [NonSerialized] + // public AWARD_ITEMS_SCALE m_AwByItems_F; + public uint m_AwByItems_F_ptr; + + /* 层次结构 */ /* Hierarchy structure */ + public uint m_ulParent; + public uint m_ulPrevSibling; + public uint m_ulNextSibling; + public uint m_ulFirstChild; + + /* 库任务相关 */ /* Library task related */ + public bool m_bIsLibraryTask; + public float m_fLibraryTasksProbability; + public bool m_bIsUniqueStorageTask; + public int m_iWorldContribution; // 世界贡献度要求 // World contribution requirement + } +} \ No newline at end of file diff --git a/Assets/Scripts/Task/ATaskTemplFixedData.cs.meta b/Assets/Scripts/Task/ATaskTemplFixedData.cs.meta new file mode 100644 index 0000000000..b03042e5bb --- /dev/null +++ b/Assets/Scripts/Task/ATaskTemplFixedData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 98da1f5a890d42488e2ef0b4bce1acef +timeCreated: 1761707323 \ No newline at end of file diff --git a/Assets/Scripts/Task/ATaskTemplMan.cs b/Assets/Scripts/Task/ATaskTemplMan.cs index c57b544d55..34c8bfb9e3 100644 --- a/Assets/Scripts/Task/ATaskTemplMan.cs +++ b/Assets/Scripts/Task/ATaskTemplMan.cs @@ -67,12 +67,15 @@ namespace PerfectWorld.Scripts.Task // fread(pOffs, sizeof(long), tph.item_count, fp); + // read File and prepare offset array before loading tasks pOffs = AAssit.ReadArrayFromBinary(fs, (int)tph.item_count, ref readBytes); - - for (int i = 0; i < 1; i++) //TODO: tph.item_count + //BMLogger.Log($" [MH] Task File Lenght: {fs.Length}"); + for (int i = 1; i < 2; i++) //TODO: tph.item_count { + // mvoe file pointer to task offset fs.Seek(pOffs[i], SeekOrigin.Begin); + BMLogger.Log(" [MH] Loading Task Templ at offset: " + pOffs[i]); ATaskTempl pTempl = new ATaskTempl(); g_ulNewCount++; diff --git a/Assets/Scripts/Task/TaskLog.txt b/Assets/Scripts/Task/TaskLog.txt new file mode 100644 index 0000000000..83590e0757 --- /dev/null +++ b/Assets/Scripts/Task/TaskLog.txt @@ -0,0 +1,290 @@ +if(m_ID == 33519UL){ + // Log all non-pointer properties of ATaskTemplFixedData, one per line + a_LogOutput(1, "[MH] m_ID=%lu", m_ID); + // m_szName skipped as complex char array; name already converted above + a_LogOutput(1, "[MH] m_bHasSign=%d", (int)m_bHasSign); + a_LogOutput(1, "[MH] m_ulType=%lu", m_ulType); + a_LogOutput(1, "[MH] m_ulTimeLimit=%lu", m_ulTimeLimit); + a_LogOutput(1, "[MH] m_bOfflineFail=%d", (int)m_bOfflineFail); + a_LogOutput(1, "[MH] m_bAbsFail=%d", (int)m_bAbsFail); + a_LogOutput(1, "[MH] m_tmAbsFailTime={year=%ld,month=%ld,day=%ld,hour=%ld,min=%ld,wday=%ld}", + (long)m_tmAbsFailTime.year,(long)m_tmAbsFailTime.month,(long)m_tmAbsFailTime.day,(long)m_tmAbsFailTime.hour,(long)m_tmAbsFailTime.min,(long)m_tmAbsFailTime.wday); + a_LogOutput(1, "[MH] m_bItemNotTakeOff=%d", (int)m_bItemNotTakeOff); + a_LogOutput(1, "[MH] m_bAbsTime=%d", (int)m_bAbsTime); + a_LogOutput(1, "[MH] m_ulTimetable=%lu", m_ulTimetable); + { + char buf[1024]; + int off = 0; + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "["); + for (unsigned long i = 0; i < (unsigned long)MAX_TIMETABLE_SIZE; ++i){ + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "%s%d", (i?",":""), (int)m_tmType[i]); + if (off < 0 || off >= (int)sizeof(buf)) break; + } + snprintf(buf + (off<0?0:off), (size_t)((off<0?0:sizeof(buf)-off)), "]"); + a_LogOutput(1, "[MH] m_tmType=%s", buf); + } + a_LogOutput(1, "[MH] m_lAvailFrequency=%ld", m_lAvailFrequency); + a_LogOutput(1, "[MH] m_lPeriodLimit=%ld", m_lPeriodLimit); + a_LogOutput(1, "[MH] m_bChooseOne=%d", (int)m_bChooseOne); + a_LogOutput(1, "[MH] m_bRandOne=%d", (int)m_bRandOne); + a_LogOutput(1, "[MH] m_bExeChildInOrder=%d", (int)m_bExeChildInOrder); + a_LogOutput(1, "[MH] m_bParentAlsoFail=%d", (int)m_bParentAlsoFail); + a_LogOutput(1, "[MH] m_bParentAlsoSucc=%d", (int)m_bParentAlsoSucc); + a_LogOutput(1, "[MH] m_bCanGiveUp=%d", (int)m_bCanGiveUp); + a_LogOutput(1, "[MH] m_bCanRedo=%d", (int)m_bCanRedo); + a_LogOutput(1, "[MH] m_bCanRedoAfterFailure=%d", (int)m_bCanRedoAfterFailure); + a_LogOutput(1, "[MH] m_bClearAsGiveUp=%d", (int)m_bClearAsGiveUp); + a_LogOutput(1, "[MH] m_bNeedRecord=%d", (int)m_bNeedRecord); + a_LogOutput(1, "[MH] m_bFailAsPlayerDie=%d", (int)m_bFailAsPlayerDie); + a_LogOutput(1, "[MH] m_ulMaxReceiver=%lu", m_ulMaxReceiver); + a_LogOutput(1, "[MH] m_bDelvInZone=%d", (int)m_bDelvInZone); + a_LogOutput(1, "[MH] m_ulDelvWorld=%lu", m_ulDelvWorld); + a_LogOutput(1, "[MH] m_ulDelvRegionCnt=%lu", m_ulDelvRegionCnt); + a_LogOutput(1, "[MH] m_bEnterRegionFail=%d", (int)m_bEnterRegionFail); + a_LogOutput(1, "[MH] m_ulEnterRegionWorld=%lu", m_ulEnterRegionWorld); + a_LogOutput(1, "[MH] m_ulEnterRegionCnt=%lu", m_ulEnterRegionCnt); + a_LogOutput(1, "[MH] m_bLeaveRegionFail=%d", (int)m_bLeaveRegionFail); + a_LogOutput(1, "[MH] m_ulLeaveRegionWorld=%lu", m_ulLeaveRegionWorld); + a_LogOutput(1, "[MH] m_ulLeaveRegionCnt=%lu", m_ulLeaveRegionCnt); + a_LogOutput(1, "[MH] m_bLeaveForceFail=%d", (int)m_bLeaveForceFail); + a_LogOutput(1, "[MH] m_bTransTo=%d", (int)m_bTransTo); + a_LogOutput(1, "[MH] m_ulTransWldId=%lu", m_ulTransWldId); + a_LogOutput(1, "[MH] m_TransPt={x=%f,y=%f,z=%f}", m_TransPt.x, m_TransPt.y, m_TransPt.z); + a_LogOutput(1, "[MH] m_lMonsCtrl=%ld", m_lMonsCtrl); + a_LogOutput(1, "[MH] m_bTrigCtrl=%d", (int)m_bTrigCtrl); + a_LogOutput(1, "[MH] m_bAutoDeliver=%d", (int)m_bAutoDeliver); + a_LogOutput(1, "[MH] m_bDisplayInExclusiveUI=%d", (int)m_bDisplayInExclusiveUI); + a_LogOutput(1, "[MH] m_bReadyToNotifyServer=%d", (int)m_bReadyToNotifyServer); + a_LogOutput(1, "[MH] m_bUsedInTokenShop=%d", (int)m_bUsedInTokenShop); + a_LogOutput(1, "[MH] m_bDeathTrig=%d", (int)m_bDeathTrig); + a_LogOutput(1, "[MH] m_bClearAcquired=%d", (int)m_bClearAcquired); + a_LogOutput(1, "[MH] m_ulSuitableLevel=%lu", m_ulSuitableLevel); + a_LogOutput(1, "[MH] m_bShowPrompt=%d", (int)m_bShowPrompt); + a_LogOutput(1, "[MH] m_bKeyTask=%d", (int)m_bKeyTask); + a_LogOutput(1, "[MH] m_ulDelvNPC=%lu", m_ulDelvNPC); + a_LogOutput(1, "[MH] m_ulAwardNPC=%lu", m_ulAwardNPC); + a_LogOutput(1, "[MH] m_bSkillTask=%d", (int)m_bSkillTask); + a_LogOutput(1, "[MH] m_bCanSeekOut=%d", (int)m_bCanSeekOut); + a_LogOutput(1, "[MH] m_bShowDirection=%d", (int)m_bShowDirection); + a_LogOutput(1, "[MH] m_bMarriage=%d", (int)m_bMarriage); + a_LogOutput(1, "[MH] m_ulChangeKeyCnt=%lu", m_ulChangeKeyCnt); + a_LogOutput(1, "[MH] m_bSwitchSceneFail=%d", (int)m_bSwitchSceneFail); + a_LogOutput(1, "[MH] m_bHidden=%d", (int)m_bHidden); + a_LogOutput(1, "[MH] m_bDeliverySkill=%d", (int)m_bDeliverySkill); + a_LogOutput(1, "[MH] m_iDeliveredSkillID=%d", m_iDeliveredSkillID); + a_LogOutput(1, "[MH] m_iDeliveredSkillLevel=%d", m_iDeliveredSkillLevel); + a_LogOutput(1, "[MH] m_bShowGfxFinished=%d", (int)m_bShowGfxFinished); + a_LogOutput(1, "[MH] m_bChangePQRanking=%d", (int)m_bChangePQRanking); + a_LogOutput(1, "[MH] m_bCompareItemAndInventory=%d", (int)m_bCompareItemAndInventory); + a_LogOutput(1, "[MH] m_ulInventorySlotNum=%lu", m_ulInventorySlotNum); + a_LogOutput(1, "[MH] m_bPQTask=%d", (int)m_bPQTask); + a_LogOutput(1, "[MH] m_ulPQExpCnt=%lu", m_ulPQExpCnt); + a_LogOutput(1, "[MH] m_bPQSubTask=%d", (int)m_bPQSubTask); + a_LogOutput(1, "[MH] m_bClearContrib=%d", (int)m_bClearContrib); + a_LogOutput(1, "[MH] m_ulMonsterContribCnt=%lu", m_ulMonsterContribCnt); + a_LogOutput(1, "[MH] m_iPremNeedRecordTasksNum=%d", m_iPremNeedRecordTasksNum); + a_LogOutput(1, "[MH] m_bShowByNeedRecordTasksNum=%d", (int)m_bShowByNeedRecordTasksNum); + a_LogOutput(1, "[MH] m_iPremiseFactionContrib=%d", m_iPremiseFactionContrib); + a_LogOutput(1, "[MH] m_bShowByFactionContrib=%d", (int)m_bShowByFactionContrib); + a_LogOutput(1, "[MH] m_bAccountTaskLimit=%d", (int)m_bAccountTaskLimit); + a_LogOutput(1, "[MH] m_bRoleTaskLimit=%d", (int)m_bRoleTaskLimit); + a_LogOutput(1, "[MH] m_ulAccountTaskLimitCnt=%lu", m_ulAccountTaskLimitCnt); + a_LogOutput(1, "[MH] m_bLeaveFactionFail=%d", (int)m_bLeaveFactionFail); + a_LogOutput(1, "[MH] m_bNotIncCntWhenFailed=%d", (int)m_bNotIncCntWhenFailed); + a_LogOutput(1, "[MH] m_bNotClearItemWhenFailed=%d", (int)m_bNotClearItemWhenFailed); + a_LogOutput(1, "[MH] m_bDisplayInTitleTaskUI=%d", (int)m_bDisplayInTitleTaskUI); + a_LogOutput(1, "[MH] m_ucPremiseTransformedForm=%u", (unsigned int)m_ucPremiseTransformedForm); + a_LogOutput(1, "[MH] m_bShowByTransformed=%d", (int)m_bShowByTransformed); + a_LogOutput(1, "[MH] m_ulPremise_Lev_Min=%lu", m_ulPremise_Lev_Min); + a_LogOutput(1, "[MH] m_ulPremise_Lev_Max=%lu", m_ulPremise_Lev_Max); + a_LogOutput(1, "[MH] m_bPremCheckMaxHistoryLevel=%lu", m_bPremCheckMaxHistoryLevel); + a_LogOutput(1, "[MH] m_bShowByLev=%d", (int)m_bShowByLev); + a_LogOutput(1, "[MH] m_bPremCheckReincarnation=%d", (int)m_bPremCheckReincarnation); + a_LogOutput(1, "[MH] m_ulPremReincarnationMin=%lu", m_ulPremReincarnationMin); + a_LogOutput(1, "[MH] m_ulPremReincarnationMax=%lu", m_ulPremReincarnationMax); + a_LogOutput(1, "[MH] m_bShowByReincarnation=%d", (int)m_bShowByReincarnation); + a_LogOutput(1, "[MH] m_bPremCheckRealmLevel=%d", (int)m_bPremCheckRealmLevel); + a_LogOutput(1, "[MH] m_ulPremRealmLevelMin=%lu", m_ulPremRealmLevelMin); + a_LogOutput(1, "[MH] m_ulPremRealmLevelMax=%lu", m_ulPremRealmLevelMax); + a_LogOutput(1, "[MH] m_bPremCheckRealmExpFull=%d", (int)m_bPremCheckRealmExpFull); + a_LogOutput(1, "[MH] m_bShowByRealmLevel=%d", (int)m_bShowByRealmLevel); + a_LogOutput(1, "[MH] m_ulPremItems=%lu", m_ulPremItems); + a_LogOutput(1, "[MH] m_bShowByItems=%d", (int)m_bShowByItems); + a_LogOutput(1, "[MH] m_bPremItemsAnyOne=%d", (int)m_bPremItemsAnyOne); + a_LogOutput(1, "[MH] m_ulGivenItems=%lu", m_ulGivenItems); + a_LogOutput(1, "[MH] m_ulGivenCmnCount=%lu", m_ulGivenCmnCount); + a_LogOutput(1, "[MH] m_ulGivenTskCount=%lu", m_ulGivenTskCount); + a_LogOutput(1, "[MH] m_ulPremise_Deposit=%lu", m_ulPremise_Deposit); + a_LogOutput(1, "[MH] m_bShowByDeposit=%d", (int)m_bShowByDeposit); + a_LogOutput(1, "[MH] m_lPremise_Reputation=%ld", m_lPremise_Reputation); + a_LogOutput(1, "[MH] m_lPremise_RepuMax=%ld", m_lPremise_RepuMax); + a_LogOutput(1, "[MH] m_bShowByRepu=%d", (int)m_bShowByRepu); + a_LogOutput(1, "[MH] m_ulPremise_Task_Count=%lu", m_ulPremise_Task_Count); + { + char buf[1024]; + int off = 0; + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "["); + for (unsigned long i = 0; i < m_ulPremise_Task_Count && i < (unsigned long)MAX_PREM_TASK_COUNT; ++i){ + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "%s%lu", (i?",":""), m_ulPremise_Tasks[i]); + if (off < 0 || off >= (int)sizeof(buf)) break; + } + snprintf(buf + (off<0?0:off), (size_t)((off<0?0:sizeof(buf)-off)), "]"); + a_LogOutput(1, "[MH] m_ulPremise_Tasks=%s", buf); + } + a_LogOutput(1, "[MH] m_bShowByPreTask=%d", (int)m_bShowByPreTask); + a_LogOutput(1, "[MH] m_ulPremise_Task_Least_Num=%lu", m_ulPremise_Task_Least_Num); + a_LogOutput(1, "[MH] m_ulPremise_Period=%lu", m_ulPremise_Period); + a_LogOutput(1, "[MH] m_bShowByPeriod=%d", (int)m_bShowByPeriod); + a_LogOutput(1, "[MH] m_ulPremise_Faction=%lu", m_ulPremise_Faction); + a_LogOutput(1, "[MH] m_iPremise_FactionRole=%d", m_iPremise_FactionRole); + a_LogOutput(1, "[MH] m_bShowByFaction=%d", (int)m_bShowByFaction); + a_LogOutput(1, "[MH] m_ulGender=%lu", m_ulGender); + a_LogOutput(1, "[MH] m_bShowByGender=%d", (int)m_bShowByGender); + a_LogOutput(1, "[MH] m_ulOccupations=%lu", m_ulOccupations); + { + char buf[1024]; + int off = 0; + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "["); + for (unsigned long i = 0; i < m_ulOccupations && i < (unsigned long)MAX_OCCUPATIONS; ++i){ + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "%s%lu", (i?",":""), m_Occupations[i]); + if (off < 0 || off >= (int)sizeof(buf)) break; + } + snprintf(buf + (off<0?0:off), (size_t)((off<0?0:sizeof(buf)-off)), "]"); + a_LogOutput(1, "[MH] m_Occupations=%s", buf); + } + a_LogOutput(1, "[MH] m_bShowByOccup=%d", (int)m_bShowByOccup); + a_LogOutput(1, "[MH] m_bPremise_Spouse=%d", (int)m_bPremise_Spouse); + a_LogOutput(1, "[MH] m_bShowBySpouse=%d", (int)m_bShowBySpouse); + a_LogOutput(1, "[MH] m_bPremiseWeddingOwner=%d", (int)m_bPremiseWeddingOwner); + a_LogOutput(1, "[MH] m_bShowByWeddingOwner=%d", (int)m_bShowByWeddingOwner); + a_LogOutput(1, "[MH] m_bGM=%d", (int)m_bGM); + a_LogOutput(1, "[MH] m_bShieldUser=%d", (int)m_bShieldUser); + a_LogOutput(1, "[MH] m_bShowByRMB=%d", (int)m_bShowByRMB); + a_LogOutput(1, "[MH] m_ulPremRMBMin=%lu", m_ulPremRMBMin); + a_LogOutput(1, "[MH] m_ulPremRMBMax=%lu", m_ulPremRMBMax); + a_LogOutput(1, "[MH] m_bCharTime=%d", (int)m_bCharTime); + a_LogOutput(1, "[MH] m_bShowByCharTime=%d", (int)m_bShowByCharTime); + a_LogOutput(1, "[MH] m_iCharStartTime=%d", m_iCharStartTime); + a_LogOutput(1, "[MH] m_iCharEndTime=%d", m_iCharEndTime); + a_LogOutput(1, "[MH] m_tmCharEndTime={year=%ld,month=%ld,day=%ld,hour=%ld,min=%ld,wday=%ld}", + (long)m_tmCharEndTime.year,(long)m_tmCharEndTime.month,(long)m_tmCharEndTime.day,(long)m_tmCharEndTime.hour,(long)m_tmCharEndTime.min,(long)m_tmCharEndTime.wday); + a_LogOutput(1, "[MH] m_ulCharTimeGreaterThan=%lu", m_ulCharTimeGreaterThan); + a_LogOutput(1, "[MH] m_ulPremise_Cotask=%lu", m_ulPremise_Cotask); + a_LogOutput(1, "[MH] m_ulCoTaskCond=%lu", m_ulCoTaskCond); + a_LogOutput(1, "[MH] m_ulMutexTaskCount=%lu", m_ulMutexTaskCount); + { + char buf[512]; + int off = 0; + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "["); + for (unsigned long i = 0; i < m_ulMutexTaskCount && i < (unsigned long)MAX_MUTEX_TASK_COUNT; ++i){ + off += snprintf(buf + off, (size_t)(sizeof(buf) - off), "%s%lu", (i?",":""), m_ulMutexTasks[i]); + if (off < 0 || off >= (int)sizeof(buf)) break; + } + snprintf(buf + (off<0?0:off), (size_t)((off<0?0:sizeof(buf)-off)), "]"); + a_LogOutput(1, "[MH] m_ulMutexTasks=%s", buf); + } + { + char buf[256]; + snprintf(buf, sizeof(buf), "[%ld,%ld,%ld,%ld]", (long)m_lSkillLev[0], (long)m_lSkillLev[1], (long)m_lSkillLev[2], (long)m_lSkillLev[3]); + a_LogOutput(1, "[MH] m_lSkillLev=%s", buf); + } + a_LogOutput(1, "[MH] m_DynTaskType=%d", (int)m_DynTaskType); + a_LogOutput(1, "[MH] m_ulSpecialAward=%lu", m_ulSpecialAward); + a_LogOutput(1, "[MH] m_bTeamwork=%d", (int)m_bTeamwork); + a_LogOutput(1, "[MH] m_bRcvByTeam=%d", (int)m_bRcvByTeam); + a_LogOutput(1, "[MH] m_bSharedTask=%d", (int)m_bSharedTask); + a_LogOutput(1, "[MH] m_bSharedAchieved=%d", (int)m_bSharedAchieved); + a_LogOutput(1, "[MH] m_bCheckTeammate=%d", (int)m_bCheckTeammate); + a_LogOutput(1, "[MH] m_fTeammateDist=%f", m_fTeammateDist); + a_LogOutput(1, "[MH] m_bAllFail=%d", (int)m_bAllFail); + a_LogOutput(1, "[MH] m_bCapFail=%d", (int)m_bCapFail); + a_LogOutput(1, "[MH] m_bCapSucc=%d", (int)m_bCapSucc); + a_LogOutput(1, "[MH] m_fSuccDist=%f", m_fSuccDist); + a_LogOutput(1, "[MH] m_bDismAsSelfFail=%d", (int)m_bDismAsSelfFail); + a_LogOutput(1, "[MH] m_bRcvChckMem=%d", (int)m_bRcvChckMem); + a_LogOutput(1, "[MH] m_fRcvMemDist=%f", m_fRcvMemDist); + a_LogOutput(1, "[MH] m_bCntByMemPos=%d", (int)m_bCntByMemPos); + a_LogOutput(1, "[MH] m_fCntMemDist=%f", m_fCntMemDist); + a_LogOutput(1, "[MH] m_bAllSucc=%d", (int)m_bAllSucc); + a_LogOutput(1, "[MH] m_bCoupleOnly=%d", (int)m_bCoupleOnly); + a_LogOutput(1, "[MH] m_bDistinguishedOcc=%d", (int)m_bDistinguishedOcc); + a_LogOutput(1, "[MH] m_ulTeamMemsWanted=%lu", m_ulTeamMemsWanted); + a_LogOutput(1, "[MH] m_bShowByTeam=%d", (int)m_bShowByTeam); + a_LogOutput(1, "[MH] m_bPremNeedComp=%d", (int)m_bPremNeedComp); + a_LogOutput(1, "[MH] m_nPremExp1AndOrExp2=%d", m_nPremExp1AndOrExp2); + a_LogOutput(1, "[MH] m_Prem1KeyValue={lType=%d,lNum=%ld,op=%d,rType=%d,rNum=%ld}", m_Prem1KeyValue.nLeftType, (long)m_Prem1KeyValue.lLeftNum, m_Prem1KeyValue.nCompOper, m_Prem1KeyValue.nRightType, (long)m_Prem1KeyValue.lRightNum); + a_LogOutput(1, "[MH] m_Prem2KeyValue={lType=%d,lNum=%ld,op=%d,rType=%d,rNum=%ld}", m_Prem2KeyValue.nLeftType, (long)m_Prem2KeyValue.lLeftNum, m_Prem2KeyValue.nCompOper, m_Prem2KeyValue.nRightType, (long)m_Prem2KeyValue.lRightNum); + a_LogOutput(1, "[MH] m_bPremCheckForce=%d", (int)m_bPremCheckForce); + a_LogOutput(1, "[MH] m_iPremForce=%d", m_iPremForce); + a_LogOutput(1, "[MH] m_bShowByForce=%d", (int)m_bShowByForce); + a_LogOutput(1, "[MH] m_iPremForceReputation=%d", m_iPremForceReputation); + a_LogOutput(1, "[MH] m_bShowByForceReputation=%d", (int)m_bShowByForceReputation); + a_LogOutput(1, "[MH] m_iPremForceContribution=%d", m_iPremForceContribution); + a_LogOutput(1, "[MH] m_bShowByForceContribution=%d", (int)m_bShowByForceContribution); + a_LogOutput(1, "[MH] m_iPremForceExp=%d", m_iPremForceExp); + a_LogOutput(1, "[MH] m_bShowByForceExp=%d", (int)m_bShowByForceExp); + a_LogOutput(1, "[MH] m_iPremForceSP=%d", m_iPremForceSP); + a_LogOutput(1, "[MH] m_bShowByForceSP=%d", (int)m_bShowByForceSP); + a_LogOutput(1, "[MH] m_iPremForceActivityLevel=%d", m_iPremForceActivityLevel); + a_LogOutput(1, "[MH] m_bShowByForceActivityLevel=%d", (int)m_bShowByForceActivityLevel); + a_LogOutput(1, "[MH] m_bPremIsKing=%d", (int)m_bPremIsKing); + a_LogOutput(1, "[MH] m_bShowByKing=%d", (int)m_bShowByKing); + a_LogOutput(1, "[MH] m_bPremNotInTeam=%d", (int)m_bPremNotInTeam); + a_LogOutput(1, "[MH] m_bShowByNotInTeam=%d", (int)m_bShowByNotInTeam); + a_LogOutput(1, "[MH] m_iPremTitleNumTotal=%lu", m_iPremTitleNumTotal); + a_LogOutput(1, "[MH] m_iPremTitleNumRequired=%lu", m_iPremTitleNumRequired); + a_LogOutput(1, "[MH] m_bShowByTitle=%d", (int)m_bShowByTitle); + { + char buf[128]; + snprintf(buf, sizeof(buf), "[%d,%d]", m_iPremHistoryStageIndex[0], m_iPremHistoryStageIndex[1]); + a_LogOutput(1, "[MH] m_iPremHistoryStageIndex=%s", buf); + } + a_LogOutput(1, "[MH] m_bShowByHistoryStage=%d", (int)m_bShowByHistoryStage); + a_LogOutput(1, "[MH] m_ulPremGeneralCardCount=%lu", m_ulPremGeneralCardCount); + a_LogOutput(1, "[MH] m_bShowByGeneralCard=%d", (int)m_bShowByGeneralCard); + a_LogOutput(1, "[MH] m_iPremGeneralCardRank=%d", m_iPremGeneralCardRank); + a_LogOutput(1, "[MH] m_ulPremGeneralCardRankCount=%lu", m_ulPremGeneralCardRankCount); + a_LogOutput(1, "[MH] m_bShowByGeneralCardRank=%d", (int)m_bShowByGeneralCardRank); + a_LogOutput(1, "[MH] m_enumMethod=%lu", m_enumMethod); + a_LogOutput(1, "[MH] m_enumFinishType=%lu", m_enumFinishType); + a_LogOutput(1, "[MH] m_ulPlayerWanted=%lu", m_ulPlayerWanted); + a_LogOutput(1, "[MH] m_ulMonsterWanted=%lu", m_ulMonsterWanted); + a_LogOutput(1, "[MH] m_ulItemsWanted=%lu", m_ulItemsWanted); + a_LogOutput(1, "[MH] m_ulGoldWanted=%lu", m_ulGoldWanted); + a_LogOutput(1, "[MH] m_iFactionContribWanted=%d", m_iFactionContribWanted); + a_LogOutput(1, "[MH] m_iFactionExpContribWanted=%d", m_iFactionExpContribWanted); + a_LogOutput(1, "[MH] m_ulNPCToProtect=%lu", m_ulNPCToProtect); + a_LogOutput(1, "[MH] m_ulProtectTimeLen=%lu", m_ulProtectTimeLen); + a_LogOutput(1, "[MH] m_ulNPCMoving=%lu", m_ulNPCMoving); + a_LogOutput(1, "[MH] m_ulNPCDestSite=%lu", m_ulNPCDestSite); + a_LogOutput(1, "[MH] m_ulReachSiteCnt=%lu", m_ulReachSiteCnt); + a_LogOutput(1, "[MH] m_ulReachSiteId=%lu", m_ulReachSiteId); + a_LogOutput(1, "[MH] m_ulWaitTime=%lu", m_ulWaitTime); + a_LogOutput(1, "[MH] m_TreasureStartZone={x=%f,y=%f,z=%f}", m_TreasureStartZone.x, m_TreasureStartZone.y, m_TreasureStartZone.z); + a_LogOutput(1, "[MH] m_ucZonesNumX=%u", (unsigned int)m_ucZonesNumX); + a_LogOutput(1, "[MH] m_ucZonesNumZ=%u", (unsigned int)m_ucZonesNumZ); + a_LogOutput(1, "[MH] m_ucZoneSide=%u", (unsigned int)m_ucZoneSide); + a_LogOutput(1, "[MH] m_ulLeaveSiteCnt=%lu", m_ulLeaveSiteCnt); + a_LogOutput(1, "[MH] m_ulLeaveSiteId=%lu", m_ulLeaveSiteId); + a_LogOutput(1, "[MH] m_bFinNeedComp=%d", (int)m_bFinNeedComp); + a_LogOutput(1, "[MH] m_nFinExp1AndOrExp2=%d", m_nFinExp1AndOrExp2); + a_LogOutput(1, "[MH] m_Fin1KeyValue={lType=%d,lNum=%ld,op=%d,rType=%d,rNum=%ld}", m_Fin1KeyValue.nLeftType, (long)m_Fin1KeyValue.lLeftNum, m_Fin1KeyValue.nCompOper, m_Fin1KeyValue.nRightType, (long)m_Fin1KeyValue.lRightNum); + a_LogOutput(1, "[MH] m_Fin2KeyValue={lType=%d,lNum=%ld,op=%d,rType=%d,rNum=%ld}", m_Fin2KeyValue.nLeftType, (long)m_Fin2KeyValue.lLeftNum, m_Fin2KeyValue.nCompOper, m_Fin2KeyValue.nRightType, (long)m_Fin2KeyValue.lRightNum); + a_LogOutput(1, "[MH] m_ulExpCnt=%lu", m_ulExpCnt); + a_LogOutput(1, "[MH] m_ulTaskCharCnt=%lu", m_ulTaskCharCnt); + a_LogOutput(1, "[MH] m_ucTransformedForm=%u", (unsigned int)m_ucTransformedForm); + a_LogOutput(1, "[MH] m_ulReachLevel=%lu", m_ulReachLevel); + a_LogOutput(1, "[MH] m_ulReachReincarnationCount=%lu", m_ulReachReincarnationCount); + a_LogOutput(1, "[MH] m_ulReachRealmLevel=%lu", m_ulReachRealmLevel); + a_LogOutput(1, "[MH] m_uiEmotion=%u", (unsigned int)m_uiEmotion); + a_LogOutput(1, "[MH] m_ulAwardType_S=%lu", m_ulAwardType_S); + a_LogOutput(1, "[MH] m_ulAwardType_F=%lu", m_ulAwardType_F); + a_LogOutput(1, "[MH] m_ulParent=%lu", m_ulParent); + a_LogOutput(1, "[MH] m_ulPrevSibling=%lu", m_ulPrevSibling); + a_LogOutput(1, "[MH] m_ulNextSibling=%lu", m_ulNextSibling); + a_LogOutput(1, "[MH] m_ulFirstChild=%lu", m_ulFirstChild); + a_LogOutput(1, "[MH] m_bIsLibraryTask=%d", (int)m_bIsLibraryTask); + a_LogOutput(1, "[MH] m_fLibraryTasksProbability=%f", m_fLibraryTasksProbability); + a_LogOutput(1, "[MH] m_bIsUniqueStorageTask=%d", (int)m_bIsUniqueStorageTask); + a_LogOutput(1, "[MH] m_iWorldContribution=%d", m_iWorldContribution); + } \ No newline at end of file diff --git a/Assets/Scripts/Task/TaskLog.txt.meta b/Assets/Scripts/Task/TaskLog.txt.meta new file mode 100644 index 0000000000..ad753bdfa7 --- /dev/null +++ b/Assets/Scripts/Task/TaskLog.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b430595362eaf4a248b120d46a7dc5e2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Task/TaskTempl.cs b/Assets/Scripts/Task/TaskTempl.cs index bd81c2cef6..c5cf01b117 100644 --- a/Assets/Scripts/Task/TaskTempl.cs +++ b/Assets/Scripts/Task/TaskTempl.cs @@ -701,6 +701,11 @@ namespace PerfectWorld.Scripts.Task public int hour; public int min; public int wday; + + public string GetLog() + { + return string.Format("{0}-{1}-{2} {3}:{4} (wday:{5})", year, month, day, hour, min, wday); + } } // Define task_team_member_info struct required by TEAM_MEM_WANTED @@ -1839,553 +1844,13 @@ namespace PerfectWorld.Scripts.Task { return zvMin.GetHashCode() ^ zvMax.GetHashCode(); } - } - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - public struct ATaskTemplFixedData - { - // 任务id // Task ID - public uint m_ID; - - // 任务名称 // Task name - [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASK_NAME_LEN)] - public char[] m_szName; - - // 任务署名 // Task signature - public bool m_bHasSign; - - public ushort[] m_pszSignature; - - // 任务类型 // Task type - public uint m_ulType; - - // 时间限制 // Time limit - public uint m_ulTimeLimit; - - // 下线任务失败 // Task fails when offline - public bool m_bOfflineFail; - - // 任务失败时间 // Task failure time - public bool m_bAbsFail; - public task_tm m_tmAbsFailTime; - - // 任务开启物品检验不收取 // Don't take items when validating task start - public bool m_bItemNotTakeOff; - - // 是否绝对时间 // Whether absolute time - public bool m_bAbsTime; - - // 时间段个数 // Number of time periods - public uint m_ulTimetable; - - // 时间方式 // Time method - [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TIMETABLE_SIZE)] - public byte[] m_tmType; - - // 发放起始时间 // Distribution start time - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public task_tm[] m_tmStart; - - // 发放终止时间 // Distribution end time - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public task_tm[] m_tmEnd; - - // 发放频率 // Distribution frequency - public int m_lAvailFrequency; - public int m_lPeriodLimit; - - // 选择单个子任务执行 // Execute single subtask - public bool m_bChooseOne; - - // 随机旋转单个子任务执行 // Randomly rotate single subtask execution - public bool m_bRandOne; - - // 子任务是否有顺序 // Whether subtasks have order - public bool m_bExeChildInOrder; - - // 失败后是否认为父任务也失败 // Whether parent task fails when subtask fails - public bool m_bParentAlsoFail; - - // 子任务成功后父任务成功 // Parent task succeeds when subtask succeeds - public bool m_bParentAlsoSucc; - - // 能否放弃此任务 // Whether task can be abandoned - public bool m_bCanGiveUp; - - // 是否可重复完成 // Whether task can be repeated - public bool m_bCanRedo; - - // 失败后是否可重新完成 // Whether task can be redone after failure - public bool m_bCanRedoAfterFailure; - - // 放弃清空任务 // Clear task when abandoned - public bool m_bClearAsGiveUp; - - // 是否需要记录 // Whether recording is needed - public bool m_bNeedRecord; - - // 玩家被杀死是否认为失败 // Whether task fails when player dies - public bool m_bFailAsPlayerDie; - - // 接受者上限 // Maximum number of receivers - public uint m_ulMaxReceiver; - - // 发放区域 // Distribution area - public bool m_bDelvInZone; - public uint m_ulDelvWorld; - public uint m_ulDelvRegionCnt; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASKREGION)] - // [NonSerialized] - // public Task_Region[] m_pDelvRegion; - public Task_Region[] m_pDelvRegion_ptr; - - // 进入区域任务失败 // Task fails when entering region - public bool m_bEnterRegionFail; - public uint m_ulEnterRegionWorld; - public uint m_ulEnterRegionCnt; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASKREGION)] - // [NonSerialized] - // public Task_Region[] m_pEnterRegion; - public uint m_pEnterRegion_ptr; - - // 离开区域任务失败 // Task fails when leaving region - public bool m_bLeaveRegionFail; - public uint m_ulLeaveRegionWorld; - public uint m_ulLeaveRegionCnt; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_TASKREGION)] - // [NonSerialized] - // public Task_Region[] m_pLeaveRegion; - public uint m_pLeaveRegion_ptr; - - // 离开阵营失败 // Fails when leaving force - public bool m_bLeaveForceFail; - - // 传送到特定点 // Teleport to specific point - public bool m_bTransTo; - public uint m_ulTransWldId; - public ZONE_VERT m_TransPt; - - // Monster controller - public long m_lMonsCtrl; - public bool m_bTrigCtrl; - - // Auto trigger when conditions are met - public bool m_bAutoDeliver; - - // Whether to display in exclusive UI - public bool m_bDisplayInExclusiveUI; - public bool m_bReadyToNotifyServer; - - // Whether used in token shop - public bool m_bUsedInTokenShop; - - // Death trigger - public bool m_bDeathTrig; - - // Whether clear all acquired items - public bool m_bClearAcquired; - - // Recommended level - public uint m_ulSuitableLevel; - - // Whether to show prompt - public bool m_bShowPrompt; - - // Whether it is a key task - public bool m_bKeyTask; - - // Delivery NPC - public uint m_ulDelvNPC; - - // Award NPC - public uint m_ulAwardNPC; - - // Whether it is a skill task - public bool m_bSkillTask; - - // Whether can be searched - public bool m_bCanSeekOut; - - // Whether show direction - public bool m_bShowDirection; - - // Marriage - public bool m_bMarriage; - - // Change global key/value - public uint m_ulChangeKeyCnt; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public int[] m_plChangeKey; // [TASK_AWARD_MAX_CHANGE_VALUE] - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public int[] m_plChangeKeyValue; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public bool[] m_pbChangeType; - - // Fail on scene switch - public bool m_bSwitchSceneFail; - - // Hidden task - public bool m_bHidden; - - // Whether deliver skill - public bool m_bDeliverySkill; - public int m_iDeliveredSkillID; - public int m_iDeliveredSkillLevel; - - // Whether show task completion effect - public bool m_bShowGfxFinished; - - // Whether change player ranking in PQ - public bool m_bChangePQRanking; - - // Compare delivery items with player inventory slots - public bool m_bCompareItemAndInventory; - public uint m_ulInventorySlotNum; - - // PQ Task related // PQ任务相关 - public bool m_bPQTask; // Whether it is a PQ task // 是否是PQ任务 - public uint m_ulPQExpCnt; // PQ task global variable display // PQ任务全局变量显示 - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public byte[,] m_pszPQExp; // PQ expressions - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public TASK_EXPRESSION[,] m_pPQExpArr; // PQ expression arrays - - public bool m_bPQSubTask; // Whether it is a PQ subtask // 是否PQ子任务 - public bool m_bClearContrib; // Clear contribution when task starts // 任务开始时清空贡献度 - public uint m_ulMonsterContribCnt; // Number of monster types // 怪物种类数量 - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public MONSTERS_CONTRIB[] m_MonstersContrib; // Monster contribution settings // 怪物贡献度设定 - - // Account Task related // 账号任务相关 - public int m_iPremNeedRecordTasksNum; // Number of completed record tasks // 记录完成结果任务完成个数 - public bool m_bShowByNeedRecordTasksNum; // Show by number of needed record tasks - public int m_iPremiseFactionContrib; // Faction contribution // 帮派贡献度 - public bool m_bShowByFactionContrib; // Show by faction contribution - public bool m_bAccountTaskLimit; // Whether account limits completion times // 是否账号限制完成次数 - public bool m_bRoleTaskLimit; // Whether role limits completion times // 是否角色限制完成次数 - public uint m_ulAccountTaskLimitCnt; // Account task limit count (deprecated) // 账号限制完成次数,废弃使用了 - public bool m_bLeaveFactionFail; // Fail when leaving faction - public bool m_bNotIncCntWhenFailed; // Don't increase count when failed // 是否失败时不增加完成次数 - public bool m_bNotClearItemWhenFailed; // Don't clear items when failed // 任务失败时不收取任务要求的物品 - public bool m_bDisplayInTitleTaskUI; // Show in title task UI // 是否显示在称号任务界面里 - - /* 开启条件 */ /* Opening conditions */ - - // 变身状态 // Transformation state - public byte m_ucPremiseTransformedForm; - public bool m_bShowByTransformed; - // 等级条件 // Level conditions - public uint m_ulPremise_Lev_Min; - public uint m_ulPremise_Lev_Max; - public uint m_bPremCheckMaxHistoryLevel; - public bool m_bShowByLev; - // 转生次数 // Reincarnation times - public bool m_bPremCheckReincarnation; - public uint m_ulPremReincarnationMin; - public uint m_ulPremReincarnationMax; - public bool m_bShowByReincarnation; - // 境界 // Realm level - public bool m_bPremCheckRealmLevel; - public uint m_ulPremRealmLevelMin; - public uint m_ulPremRealmLevelMax; - public bool m_bPremCheckRealmExpFull; - public bool m_bShowByRealmLevel; - // 所需道具 // Required items - public uint m_ulPremItems; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public ITEM_WANTED[] m_PremItems; //[MAX_ITEM_WANTED]; - public bool m_bShowByItems; - public bool m_bPremItemsAnyOne; - // 发放道具 // Given items - public uint m_ulGivenItems; - public uint m_ulGivenCmnCount; - public uint m_ulGivenTskCount; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public ITEM_WANTED[] m_GivenItems; //[MAX_ITEM_WANTED]; - // 押金 // Deposit - public uint m_ulPremise_Deposit; - public bool m_bShowByDeposit; - // 声望 // Reputation - public long m_lPremise_Reputation; - public long m_lPremise_RepuMax; - public bool m_bShowByRepu; - // 完成特定任务(成功?失败?),Task ID最高位1表示条件为失败,0为成功 // Complete specific tasks (success? failure?), Task ID highest bit 1 means failure condition, 0 means success condition - public uint m_ulPremise_Task_Count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_PREM_TASK_COUNT)] - public uint[] m_ulPremise_Tasks; - public bool m_bShowByPreTask; - public uint m_ulPremise_Task_Least_Num; // 多个前提任务需要完成若干个 // Multiple prerequisite tasks need to complete a certain number - // 达到特定时期 // Reach specific period - public uint m_ulPremise_Period; - public bool m_bShowByPeriod; - // 帮派 // Faction - public uint m_ulPremise_Faction; - public int m_iPremise_FactionRole; - public bool m_bShowByFaction; - - // 性别 // Gender - public uint m_ulGender; - public bool m_bShowByGender; - // 职业限制 // Occupation restrictions - public uint m_ulOccupations; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_OCCUPATIONS)] - public uint[] m_Occupations; - public bool m_bShowByOccup; - // 夫妻 // Spouse - public bool m_bPremise_Spouse; - public bool m_bShowBySpouse; - public bool m_bPremiseWeddingOwner; - public bool m_bShowByWeddingOwner; - // GM - public bool m_bGM; - // 完美神盾用户 // Perfect Shield user - public bool m_bShieldUser; - - // 账号累计充值金额(下限&上限) // Account accumulated recharge amount (lower & upper limit) - public bool m_bShowByRMB; - public uint m_ulPremRMBMin; - public uint m_ulPremRMBMax; - - // 角色相关时间 // Character-related time - public bool m_bCharTime; - public bool m_bShowByCharTime; - public int m_iCharStartTime; - public int m_iCharEndTime; // 为0则为当前时间;为1则为m_tmCharEndTime指定时间; // 0 means current time; 1 means the time specified by m_tmCharEndTime; - public task_tm m_tmCharEndTime; - public uint m_ulCharTimeGreaterThan; - - // 关联任务 // Related tasks - public uint m_ulPremise_Cotask; - public uint m_ulCoTaskCond; - // 互斥任务 // Mutually exclusive tasks - public uint m_ulMutexTaskCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_MUTEX_TASK_COUNT)] - public uint[] m_ulMutexTasks; - // 生活技能级别 // Life skill levels - [MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskTemplConstants.MAX_LIVING_SKILLS)] - public long[] m_lSkillLev; - // 动态任务类型 // Dynamic task type - public byte m_DynTaskType; - // 特殊奖励号,用于运营的活动 // Special award number, used for operational activities - public uint m_ulSpecialAward; - - // 组队信息 // Team information - public bool m_bTeamwork; // 组队任务 // Team task - public bool m_bRcvByTeam; // 必须组队接收 // Must be in team to receive - public bool m_bSharedTask; // 新队员分享任务 // New team members share tasks - public bool m_bSharedAchieved; // 分享杀怪、物品数量 // Share kill counts and item counts - public bool m_bCheckTeammate; // 检查队友位置 // Check teammate positions - public float m_fTeammateDist; // 队友距离平方值 // Square of teammate distance - public bool m_bAllFail; // 任意队员失败则全部失败 // Any member fails, all fail - public bool m_bCapFail; // 队长失败则全部失败 // Leader fails, all fail - public bool m_bCapSucc; // 队长成功则全队成功 // Leader succeeds, all succeed - public float m_fSuccDist; // 成功时队员的距离 // Member distance for success - public bool m_bDismAsSelfFail; // 队员离队自身失败 // Member leaves team fails itself - public bool m_bRcvChckMem; // 接任务时检查队员位置 // Check member positions when receiving task - public float m_fRcvMemDist; // 接任务时队员距离平方值 // Square of member distance when receiving task - public bool m_bCntByMemPos; // 队员在有效范围内杀怪有效 // Members in valid range for kill counts - public float m_fCntMemDist; // 队员有效的范围 // Valid range for members - public bool m_bAllSucc; // 任意队员成功则全部成功 // Any member succeeds, all succeed - public bool m_bCoupleOnly; // 队长队员必须为夫妻 // Leader and member must be spouses - public bool m_bDistinguishedOcc; // 队伍中不允许有相同的职业 // No same occupations allowed in team - - // 队伍成员需求 // Team member requirements - public uint m_ulTeamMemsWanted; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public TEAM_MEM_WANTED[] m_TeamMemsWanted; - public bool m_bShowByTeam; - - // 前提全局key/value // Premise global key/value - public bool m_bPremNeedComp; - public int m_nPremExp1AndOrExp2; - public COMPARE_KEY_VALUE m_Prem1KeyValue; - public COMPARE_KEY_VALUE m_Prem2KeyValue; - - public bool m_bPremCheckForce; - public int m_iPremForce; - public bool m_bShowByForce; - public int m_iPremForceReputation; - public bool m_bShowByForceReputation; - public int m_iPremForceContribution; // 扣除战功 // Deduct military merit - public bool m_bShowByForceContribution; - public int m_iPremForceExp; // 经验兑换 // Experience exchange - public bool m_bShowByForceExp; - public int m_iPremForceSP; // 元神兑换 // Spirit exchange - public bool m_bShowByForceSP; - public int m_iPremForceActivityLevel; - public bool m_bShowByForceActivityLevel; - - public bool m_bPremIsKing; - public bool m_bShowByKing; - public bool m_bPremNotInTeam; - public bool m_bShowByNotInTeam; - public uint m_iPremTitleNumTotal; - public uint m_iPremTitleNumRequired; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public int[] m_PremTitles; - public bool m_bShowByTitle; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public int[] m_iPremHistoryStageIndex; // 历史阶段 // Historical stage - public bool m_bShowByHistoryStage; - - public uint m_ulPremGeneralCardCount; // 收集的卡牌数量 // Number of collected cards - public bool m_bShowByGeneralCard; - - public int m_iPremGeneralCardRank; // 要求某品阶的卡牌数量 // Required number of cards of a certain rank - public uint m_ulPremGeneralCardRankCount; - public bool m_bShowByGeneralCardRank; - - /* 任务完成的方式及条件 */ /* Task completion methods and conditions */ - - public uint m_enumMethod; - public uint m_enumFinishType; - - /* 任务方式 */ /* Task methods */ - - public uint m_ulPlayerWanted; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public PLAYER_WANTED[] m_PlayerWanted; - public uint m_ulMonsterWanted; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public MONSTER_WANTED[] m_MonsterWanted; - - public uint m_ulItemsWanted; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public ITEM_WANTED[] m_ItemsWanted; - public uint m_ulGoldWanted; - - public int m_iFactionContribWanted; - public int m_iFactionExpContribWanted; - - public uint m_ulNPCToProtect; - public uint m_ulProtectTimeLen; - - public uint m_ulNPCMoving; - public uint m_ulNPCDestSite; - - //public ZONE_VERT m_ReachSiteMin; - //public ZONE_VERT m_ReachSiteMax; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public Task_Region[] m_pReachSite; - public uint m_ulReachSiteCnt; - public uint m_ulReachSiteId; - public uint m_ulWaitTime; - - //藏宝图 使用已接任务列表中的m_iUsefulData1存储 // Treasure map Use m_iUsefulData1 in the list of accepted tasks - public enum TREASURE_DISTANCE_LEVEL + + public string GetLog() { - DISTANCE_FAR_FAR_AWAY, - DISTANCE_FAR, - DISTANCE_MEDIUM, - DISTANCE_NEAR, - DISTANCE_VERY_NEAR, - DISTANCE_NUM, + return $"Min({zvMin.x}, {zvMin.y}, {zvMin.z}) - Max({zvMax.x}, {zvMax.y}, {zvMax.z})"; } - - // TREA section - public ZONE_VERT m_TreasureStartZone; - public byte m_ucZonesNumX; - public byte m_ucZonesNumZ; - public byte m_ucZoneSide; - - //public ZONE_VERT m_LeaveSiteMin; - //public ZONE_VERT m_LeaveSiteMax; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0)] - [NonSerialized] - public Task_Region[] m_pLeaveSite; - public uint m_ulLeaveSiteCnt; - public uint m_ulLeaveSiteId; - - // 完成全局key/value // Complete global key/value - public bool m_bFinNeedComp; - public int m_nFinExp1AndOrExp2; - public COMPARE_KEY_VALUE m_Fin1KeyValue; - public COMPARE_KEY_VALUE m_Fin2KeyValue; - - // 需显示的全局变量表达式 // Global variable expressions to display - public uint m_ulExpCnt; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] - public byte[,] m_pszExp; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] - [NonSerialized] - public TASK_EXPRESSION[,] m_pExpArr; - - // 需显示的全局变量表达式提示字符串 // Global variable expression prompt strings - public uint m_ulTaskCharCnt; - // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] - [NonSerialized] - public ushort[,] m_pTaskChar; - - // 变身状态 // Transformation state - public byte m_ucTransformedForm; - // 等级 // Level - public uint m_ulReachLevel; - // 转生次数 // Reincarnation count - public uint m_ulReachReincarnationCount; - // 境界等级 // Realm level - public uint m_ulReachRealmLevel; - - public uint m_uiEmotion; // 表情动作 // Emotion action - - /* 任务结束后的奖励 */ /* Rewards after task completion */ - public uint m_ulAwardType_S; - public uint m_ulAwardType_F; - - /* 普通和按每个方式 */ /* Normal and per-method rewards */ - // [NonSerialized] - // public AWARD_DATA m_Award_S; /* 成功 */ /* Success */ - public uint m_Award_S_ptr; - [NonSerialized] - // public AWARD_DATA m_Award_F; /* 失败 */ /* Failure */ - public uint m_Award_F_ptr; - - - /* 时间比例方式 */ /* Time ratio method */ - //TODO: Revert - [NonSerialized] - // public AWARD_RATIO_SCALE m_AwByRatio_S; - public uint m_AwByRatio_S_ptr; - [NonSerialized] - // public AWARD_RATIO_SCALE m_AwByRatio_F; - public uint m_AwByRatio_F_ptr; - - /* 按获得物比例方式 */ /* Item ratio method */ - //TODO: Revert - [NonSerialized] - // public AWARD_ITEMS_SCALE m_AwByItems_S; - public uint m_AwByItems_S_ptr; - [NonSerialized] - // public AWARD_ITEMS_SCALE m_AwByItems_F; - public uint m_AwByItems_F_ptr; - - /* 层次结构 */ /* Hierarchy structure */ - public uint m_ulParent; - public uint m_ulPrevSibling; - public uint m_ulNextSibling; - public uint m_ulFirstChild; - - /* 库任务相关 */ /* Library task related */ - public bool m_bIsLibraryTask; - public float m_fLibraryTasksProbability; - public bool m_bIsUniqueStorageTask; - public int m_iWorldContribution; // 世界贡献度要求 // World contribution requirement } + public class ATaskTempl { public ATaskTemplFixedData m_FixedData; @@ -2397,6 +1862,8 @@ namespace PerfectWorld.Scripts.Task public ATaskTempl m_pFirstChild; const int MAX_TASK_NAME_LEN = 30; + const int TASK_AWARD_MAX_CHANGE_VALUE = 255; + public byte m_uValidCount; public bool LoadFromBinFile(FileStream fp) { @@ -2458,164 +1925,1202 @@ namespace PerfectWorld.Scripts.Task ConvertFixedData(fp, 1); return true; } + + public void convert_txt(char[] buffer, int len, char code) + { + if (buffer == null) return; + if (len < 0) len = 0; + if (len > buffer.Length) len = buffer.Length; + for (int i = 0; i < len; i++) + { + buffer[i] = (char)(buffer[i] ^ code); + } + } + + public void convert_txt(ushort[] buffer, int len, char code) + { + if (buffer == null) return; + if (len < 0) len = 0; + if (len > buffer.Length) len = buffer.Length; + + for (int i = 0; i < len; i++) + { + buffer[i] = (ushort)(buffer[i] ^ code); + } + } + private void ConvertFixedData(FileStream fp, int x2) { long readBytes = 0; BMLogger.Log($"LoadFixedDataFromBinFile: {fp.Length}"); - ATaskTemplFixedData fixedData; + ATaskTemplFixedData fixedData = new ATaskTemplFixedData(); + string logContent = ""; var originalPos = fp.Position; + // Task ID fixedData.m_ID = AAssit.ReadFromBinaryOf(fp, ref readBytes); // unsigned long m_ID; - BMLogger.LogError($"m_ID: {fixedData.m_ID}"); + logContent += $"m_ID: {fixedData.m_ID} \n"; // Task Name (task_char m_szName[MAX_TASK_NAME_LEN];) - var raw = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_TASK_NAME_LEN, ref readBytes); //64 - fixedData.m_szName = Array.ConvertAll(raw, c => (char)c); - BMLogger.LogError($"m_szName: {new string(fixedData.m_szName)}"); //68 - + fixedData.m_szName = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_TASK_NAME_LEN, ref readBytes); //64 + convert_txt(fixedData.m_szName, TaskTemplConstants.MAX_TASK_NAME_LEN, (char)(fixedData.m_ID)); + logContent += $"m_szName: {ByteToStringUtils.UshortArrayToUnicodeString(fixedData.m_szName)}\n"; //68 + // Has Signature (bool m_bHasSign;) fixedData.m_bHasSign = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bHasSign: {fixedData.m_bHasSign}"); //68 + logContent += $"m_bHasSign: {fixedData.m_bHasSign}\n"; //68 // Signature pointer (task_char* m_pszSignature;) // Only the pointer address is stored in the binary (skip 4 bytes) fp.Seek(4, SeekOrigin.Current); - + logContent += $"m_pszSignature: ushort[] and skip 4 bytes \n"; + + // Task Type (unsigned long m_ulType;) fixedData.m_ulType = AAssit.ReadFromBinaryOf(fp, ref readBytes);//value 103 - BMLogger.LogError($"Type: {fixedData.m_ulType}"); + logContent += $"Type: {fixedData.m_ulType}\n"; // Time Limit (unsigned long m_ulTimeLimit;) fixedData.m_ulTimeLimit = AAssit.ReadFromBinaryOf(fp, ref readBytes); - BMLogger.LogError($"m_ulTimeLimit: {fixedData.m_ulTimeLimit}"); + logContent += $"m_ulTimeLimit: {fixedData.m_ulTimeLimit}\n"; // Offline Fail (bool m_bOfflineFail;) fixedData.m_bOfflineFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bOfflineFail: {fixedData.m_bOfflineFail}"); + logContent += $"m_bOfflineFail: {fixedData.m_bOfflineFail}\n"; // Absolute Fail (bool m_bAbsFail;) fixedData.m_bAbsFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bAbsFail: {fixedData.m_bAbsFail}"); + logContent += $"m_bAbsFail: {fixedData.m_bAbsFail}\n"; // Absolute Fail Time (task_tm m_tmAbsFailTime;) fixedData.m_tmAbsFailTime = AAssit.ReadFromBinaryOf(fp, ref readBytes); - BMLogger.LogError($"m_tmAbsFailTime: {fixedData.m_tmAbsFailTime.day}"); + logContent += $"m_tmAbsFailTime.day: {fixedData.m_tmAbsFailTime.day}\n"; // (unsigned long m_ulAbsFailTime;) // commented out in C++ source // Item Not Take Off (bool m_bItemNotTakeOff;) fixedData.m_bItemNotTakeOff = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bItemNotTakeOff: {fixedData.m_bItemNotTakeOff}"); + logContent += $"m_bItemNotTakeOff: {fixedData.m_bItemNotTakeOff}\n"; // Absolute Time (bool m_bAbsTime;) fixedData.m_bAbsTime = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bAbsTime: {fixedData.m_bAbsTime}"); + logContent += $"m_bAbsTime: {fixedData.m_bAbsTime}\n"; // Timetable count (unsigned long m_ulTimetable;) fixedData.m_ulTimetable = AAssit.ReadFromBinaryOf(fp, ref readBytes); - BMLogger.LogError($"m_ulTimetable: {fixedData.m_ulTimetable}"); + logContent += $"m_ulTimetable: {fixedData.m_ulTimetable}\n"; // Timetable type (char m_tmType[MAX_TIMETABLE_SIZE];) fixedData.m_tmType = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_TIMETABLE_SIZE, ref readBytes); - BMLogger.LogError($"m_tmType: {fixedData.m_tmType}"); - + logContent += $"m_tmType: {fixedData.m_tmType}\n"; + + // Start time pointer (task_tm* m_tmStart; [MAX_TIMETABLE_SIZE]) + // if (m_ulTimetable) + // { + // m_tmStart = new task_tm[m_ulTimetable]; + // g_ulNewCount++; + // m_tmEnd = new task_tm[m_ulTimetable]; + // g_ulNewCount++; + // } // Start time pointer (task_tm* m_tmStart; [MAX_TIMETABLE_SIZE]) // Only the pointer address is stored in the binary (skip 4 bytes) fp.Seek(4, SeekOrigin.Current); - + logContent += $"m_tmStart: task_tm[] and skip 4 bytes \n"; + // End time pointer (task_tm* m_tmEnd; [MAX_TIMETABLE_SIZE]) // Only the pointer address is stored in the binary (skip 4 bytes) fp.Seek(4, SeekOrigin.Current); - + logContent += $"m_tmEnd: task_tm[] and skip 4 bytes \n"; + // Available frequency (long m_lAvailFrequency;) fixedData.m_lAvailFrequency = AAssit.ReadFromBinaryOf(fp, ref readBytes); - BMLogger.LogError($"m_lAvailFrequency: {fixedData.m_lAvailFrequency}"); + logContent += $"m_lAvailFrequency: {fixedData.m_lAvailFrequency}\n"; // Period limit (long m_lPeriodLimit;) fixedData.m_lPeriodLimit = AAssit.ReadFromBinaryOf(fp, ref readBytes); - BMLogger.LogError($"m_lPeriodLimit: {fixedData.m_lPeriodLimit}"); + logContent += $"m_lPeriodLimit: {fixedData.m_lPeriodLimit}\n"; // Choose one subtask (bool m_bChooseOne;) fixedData.m_bChooseOne = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bChooseOne: {fixedData.m_bChooseOne}"); + logContent += $"m_bChooseOne: {fixedData.m_bChooseOne}\n"; // Random one subtask (bool m_bRandOne;) fixedData.m_bRandOne = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; - BMLogger.LogError($"m_bRandOne: {fixedData.m_bRandOne}"); + logContent += $"m_bRandOne: {fixedData.m_bRandOne}\n"; // bool m_bExeChildInOrder; // Whether subtasks are executed in order fixedData.m_bExeChildInOrder = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 是否子任务有顺序 // Whether subtasks are executed in order - BMLogger.LogError($"m_bExeChildInOrder: {fixedData.m_bExeChildInOrder}"); + logContent += $"m_bExeChildInOrder: {fixedData.m_bExeChildInOrder}\n"; // bool m_bParentAlsoFail; // Whether the parent task fails if this one does fixedData.m_bParentAlsoFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 失败后是否认为父任务也失败 // Whether the parent task fails if this one does - BMLogger.LogError($"m_bParentAlsoFail: {fixedData.m_bParentAlsoFail}"); + logContent += $"m_bParentAlsoFail: {fixedData.m_bParentAlsoFail}\n"; // Whether parent task succeeds after subtask succeeds // bool m_bParentAlsoSucc; fixedData.m_bParentAlsoSucc = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 子任务成功后父任务成功 // Whether parent task succeeds after subtask succeeds - BMLogger.LogError($"m_bParentAlsoSucc: {fixedData.m_bParentAlsoSucc}"); + logContent += $"m_bParentAlsoSucc: {fixedData.m_bParentAlsoSucc}\n"; // Whether this task can be abandoned // bool m_bCanGiveUp; fixedData.m_bCanGiveUp = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 能否放弃此任务 // Whether this task can be abandoned - BMLogger.LogError($"m_bCanGiveUp: {fixedData.m_bCanGiveUp}"); + logContent += $"m_bCanGiveUp: {fixedData.m_bCanGiveUp}\n"; // Whether the task can be repeated/completed again // bool m_bCanRedo; fixedData.m_bCanRedo = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 是否可重复完成 // Whether the task can be repeated/completed again - BMLogger.LogError($"m_bCanRedo: {fixedData.m_bCanRedo}"); + logContent += $"m_bCanRedo: {fixedData.m_bCanRedo}\n"; // Whether task can be repeated after failure // bool m_bCanRedoAfterFailure; fixedData.m_bCanRedoAfterFailure = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 失败后是否可重新完成 // Whether task can be repeated after failure - BMLogger.LogError($"m_bCanRedoAfterFailure: {fixedData.m_bCanRedoAfterFailure}"); + logContent += $"m_bCanRedoAfterFailure: {fixedData.m_bCanRedoAfterFailure}\n"; // Give up clears the task // bool m_bClearAsGiveUp; fixedData.m_bClearAsGiveUp = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 放弃清空任务 // Give up clears the task - BMLogger.LogError($"m_bClearAsGiveUp: {fixedData.m_bClearAsGiveUp}"); + logContent += $"m_bClearAsGiveUp: {fixedData.m_bClearAsGiveUp}\n"; // Whether recording is needed // bool m_bNeedRecord; fixedData.m_bNeedRecord = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 是否需要记录 // Whether recording is needed - BMLogger.LogError($"m_bNeedRecord: {fixedData.m_bNeedRecord}"); + logContent += $"m_bNeedRecord: {fixedData.m_bNeedRecord}\n"; // Player's death causes failure // bool m_bFailAsPlayerDie; fixedData.m_bFailAsPlayerDie = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 玩家被击杀是否认为失败 // Player's death causes failure - BMLogger.LogError($"m_bFailAsPlayerDie: {fixedData.m_bFailAsPlayerDie}"); + logContent += $"m_bFailAsPlayerDie: {fixedData.m_bFailAsPlayerDie}\n"; // Maximum number of receivers // unsigned long m_ulMaxReceiver; fixedData.m_ulMaxReceiver = AAssit.ReadFromBinaryOf(fp, ref readBytes); // 接受者上限 // Maximum number of receivers - BMLogger.LogError($"m_ulMaxReceiver: {fixedData.m_ulMaxReceiver}"); + logContent += $"m_ulMaxReceiver: {fixedData.m_ulMaxReceiver}\n"; // Is in delivery zone // bool m_bDelvInZone; fixedData.m_bDelvInZone = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 发放区域 // Is in delivery zone - BMLogger.LogError($"m_bDelvInZone: {fixedData.m_bDelvInZone}"); + logContent += $"m_bDelvInZone: {fixedData.m_bDelvInZone}\n"; // Delivery world id // unsigned long m_ulDelvWorld; fixedData.m_ulDelvWorld = AAssit.ReadFromBinaryOf(fp, ref readBytes); // 发放世界 // Delivery world id - BMLogger.LogError($"m_ulDelvWorld: {fixedData.m_ulDelvWorld}"); + logContent += $"m_ulDelvWorld: {fixedData.m_ulDelvWorld}\n"; // Number of delivery regions // unsigned long m_ulDelvRegionCnt; fixedData.m_ulDelvRegionCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); // 发放区域计数 // Number of delivery regions - BMLogger.LogError($"m_ulDelvRegionCnt: {fixedData.m_ulDelvRegionCnt}"); + logContent += $"m_ulDelvRegionCnt: {fixedData.m_ulDelvRegionCnt}\n"; - fp.Seek(originalPos, SeekOrigin.Begin); + // Delivery regions pointer (Task_Region* m_pDelvRegion;) + // Only the pointer address is stored in the binary (skip 4 bytes) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pDelvRegion: Task_Region[] and skip 4 bytes \n\n"; + + // Enter region fail (bool m_bEnterRegionFail;) + fixedData.m_bEnterRegionFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 进入区域任务失败 // Task fails when entering region + logContent += $"m_bEnterRegionFail: {fixedData.m_bEnterRegionFail}\n\n"; + + // Enter region world (unsigned long m_ulEnterRegionWorld;) + fixedData.m_ulEnterRegionWorld = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulEnterRegionWorld: {fixedData.m_ulEnterRegionWorld}\n\n"; + + // Enter region count (unsigned long m_ulEnterRegionCnt;) + fixedData.m_ulEnterRegionCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulEnterRegionCnt: {fixedData.m_ulEnterRegionCnt}\n\n"; + + // Enter region pointer (Task_Region* m_pEnterRegion;) + // Only the pointer address is stored in the binary (skip 4 bytes) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pEnterRegion: Task_Region[] and skip 4 bytes \n\n"; + + // Leave region fail (bool m_bLeaveRegionFail;) + fixedData.m_bLeaveRegionFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 离开区域任务失败 // Task fails when leaving region + logContent += $"m_bLeaveRegionFail: {fixedData.m_bLeaveRegionFail}\n\n"; + + // Leave region world (unsigned long m_ulLeaveRegionWorld;) + fixedData.m_ulLeaveRegionWorld = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulLeaveRegionWorld: {fixedData.m_ulLeaveRegionWorld}\n\n"; + + // Leave region count (unsigned long m_ulLeaveRegionCnt;) + fixedData.m_ulLeaveRegionCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulLeaveRegionCnt: {fixedData.m_ulLeaveRegionCnt}\n\n"; + + // Leave region pointer (Task_Region* m_pLeaveRegion;) + // Only the pointer address is stored in the binary (skip 4 bytes) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pLeaveRegion: Task_Region[] and skip 4 bytes \n\n"; + + // Leave force fail (bool m_bLeaveForceFail;) + fixedData.m_bLeaveForceFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 离开阵营失败 // Fails when leaving force + logContent += $"m_bLeaveForceFail: {fixedData.m_bLeaveForceFail}\n\n"; + + // Teleport to specific point (bool m_bTransTo;) + fixedData.m_bTransTo = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; // 传送到特定点 // Teleport to specific point + logContent += $"m_bTransTo: {fixedData.m_bTransTo}\n\n"; + + // Teleport world id (unsigned long m_ulTransWldId;) + fixedData.m_ulTransWldId = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulTransWldId: {fixedData.m_ulTransWldId}\n\n"; + + // Teleport position (ZONE_VERT m_TransPt;) + fixedData.m_TransPt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_TransPt: ({fixedData.m_TransPt.x}, {fixedData.m_TransPt.y}, {fixedData.m_TransPt.z})\n\n"; + + // Monster controller (long m_lMonsCtrl;) + fixedData.m_lMonsCtrl = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_lMonsCtrl: {fixedData.m_lMonsCtrl}\n\n"; + + // Trigger controller (bool m_bTrigCtrl;) + fixedData.m_bTrigCtrl = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bTrigCtrl: {fixedData.m_bTrigCtrl}\n\n"; + + // Auto deliver (bool m_bAutoDeliver;) + fixedData.m_bAutoDeliver = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bAutoDeliver: {fixedData.m_bAutoDeliver}\n\n"; + + // Display in exclusive UI (bool m_bDisplayInExclusiveUI;) + fixedData.m_bDisplayInExclusiveUI = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bDisplayInExclusiveUI: {fixedData.m_bDisplayInExclusiveUI}\n\n"; + + // Ready to notify server (bool m_bReadyToNotifyServer;) + fixedData.m_bReadyToNotifyServer = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bReadyToNotifyServer: {fixedData.m_bReadyToNotifyServer}\n\n"; + + // Used in token shop (bool m_bUsedInTokenShop;) + fixedData.m_bUsedInTokenShop = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bUsedInTokenShop: {fixedData.m_bUsedInTokenShop}\n\n"; + + // Death trigger (bool m_bDeathTrig;) + fixedData.m_bDeathTrig = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bDeathTrig: {fixedData.m_bDeathTrig}\n\n"; + + // Clear acquired (bool m_bClearAcquired;) + fixedData.m_bClearAcquired = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bClearAcquired: {fixedData.m_bClearAcquired}\n\n"; + + // Suitable level (uint m_ulSuitableLevel;) + fixedData.m_ulSuitableLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulSuitableLevel: {fixedData.m_ulSuitableLevel}\n\n"; + + // Show prompt (bool m_bShowPrompt;) + fixedData.m_bShowPrompt = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowPrompt: {fixedData.m_bShowPrompt}\n\n"; + + // Key task (bool m_bKeyTask;) + fixedData.m_bKeyTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bKeyTask: {fixedData.m_bKeyTask}\n\n"; + + // Delivery NPC (uint m_ulDelvNPC;) + fixedData.m_ulDelvNPC = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulDelvNPC: {fixedData.m_ulDelvNPC}\n\n"; + + // Award NPC (uint m_ulAwardNPC;) + fixedData.m_ulAwardNPC = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulAwardNPC: {fixedData.m_ulAwardNPC}\n\n"; + + // Skill task (bool m_bSkillTask;) + fixedData.m_bSkillTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bSkillTask: {fixedData.m_bSkillTask}\n\n"; + + // Can seek out (bool m_bCanSeekOut;) + fixedData.m_bCanSeekOut = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCanSeekOut: {fixedData.m_bCanSeekOut}\n\n"; + + // Show direction (bool m_bShowDirection;) + fixedData.m_bShowDirection = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowDirection: {fixedData.m_bShowDirection}\n\n"; + + // Marriage (bool m_bMarriage;) + fixedData.m_bMarriage = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bMarriage: {fixedData.m_bMarriage}\n\n"; + + // Change global key/value count (uint m_ulChangeKeyCnt;) + fixedData.m_ulChangeKeyCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulChangeKeyCnt: {fixedData.m_ulChangeKeyCnt}\n\n"; + + // Pointers to basic types (int* m_plChangeKey; int* m_plChangeKeyValue; bool* m_pbChangeType;) + // Skip sizeof(int), sizeof(int), sizeof(bool) respectively per conversion rule + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_plChangeKey: int[] pointer, skip 4 bytes (sizeof(int))\n\n"; + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_plChangeKeyValue: int[] pointer, skip 4 bytes (sizeof(int))\n\n"; + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pbChangeType: bool[] pointer, skip 4 byte (sizeof(bool))\n\n"; + + // Switch scene fail (bool m_bSwitchSceneFail;) + fixedData.m_bSwitchSceneFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bSwitchSceneFail: {fixedData.m_bSwitchSceneFail}\n\n"; + + // Hidden (bool m_bHidden;) + fixedData.m_bHidden = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bHidden: {fixedData.m_bHidden}\n\n"; + + // Delivery skill (bool m_bDeliverySkill;) + fixedData.m_bDeliverySkill = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bDeliverySkill: {fixedData.m_bDeliverySkill}\n\n"; + + // Delivered skill ID/Level (int m_iDeliveredSkillID; int m_iDeliveredSkillLevel;) + fixedData.m_iDeliveredSkillID = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iDeliveredSkillID: {fixedData.m_iDeliveredSkillID}\n\n"; + fixedData.m_iDeliveredSkillLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iDeliveredSkillLevel: {fixedData.m_iDeliveredSkillLevel}\n\n"; + + // Show GFX finished (bool m_bShowGfxFinished;) + fixedData.m_bShowGfxFinished = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowGfxFinished: {fixedData.m_bShowGfxFinished}\n\n"; + + // Change PQ ranking (bool m_bChangePQRanking;) + fixedData.m_bChangePQRanking = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bChangePQRanking: {fixedData.m_bChangePQRanking}\n\n"; + + // Compare items and inventory (bool m_bCompareItemAndInventory;) + fixedData.m_bCompareItemAndInventory = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCompareItemAndInventory: {fixedData.m_bCompareItemAndInventory}\n\n"; + + // Inventory slots (uint m_ulInventorySlotNum;) + fixedData.m_ulInventorySlotNum = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulInventorySlotNum: {fixedData.m_ulInventorySlotNum}\n\n"; + + // PQ task (bool m_bPQTask;) + fixedData.m_bPQTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPQTask: {fixedData.m_bPQTask}\n\n"; + + // PQ expression count (uint m_ulPQExpCnt;) + fixedData.m_ulPQExpCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPQExpCnt: {fixedData.m_ulPQExpCnt}\n\n"; + + // PQ expressions pointer (byte[,] m_pszPQExp;) + // Only the pointer address is stored in the binary (skip 1 bytes) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pszPQExp: byte[,] pointer, skip 4 bytes \n\n"; + + // PQ expression array pointer (TASK_EXPRESSION[,] m_pPQExpArr;) + // Only the pointer address is stored in the binary (skip 4 bytes) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pPQExpArr: TASK_EXPRESSION[,] pointer, skip 4 bytes \n\n"; + + // Is PQ subtask (bool m_bPQSubTask;) + fixedData.m_bPQSubTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPQSubTask: {fixedData.m_bPQSubTask}\n\n"; + + // Clear contribution on start (bool m_bClearContrib;) + fixedData.m_bClearContrib = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bClearContrib: {fixedData.m_bClearContrib}\n\n"; + + // Monster contribution count (uint m_ulMonsterContribCnt;) + fixedData.m_ulMonsterContribCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulMonsterContribCnt: {fixedData.m_ulMonsterContribCnt}\n\n"; + + // Monster contribution pointer (MONSTERS_CONTRIB[] m_MonstersContrib;) + // Only the pointer address is stored in the binary (skip 4 bytes) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_MonstersContrib: MONSTERS_CONTRIB[] pointer, skip 4 bytes \n\n"; + + // Account Task related + fixedData.m_iPremNeedRecordTasksNum = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremNeedRecordTasksNum: {fixedData.m_iPremNeedRecordTasksNum}\n\n"; + + fixedData.m_bShowByNeedRecordTasksNum = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByNeedRecordTasksNum: {fixedData.m_bShowByNeedRecordTasksNum}\n\n"; + + fixedData.m_iPremiseFactionContrib = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremiseFactionContrib: {fixedData.m_iPremiseFactionContrib}\n\n"; + + fixedData.m_bShowByFactionContrib = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByFactionContrib: {fixedData.m_bShowByFactionContrib}\n\n"; + + fixedData.m_bAccountTaskLimit = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bAccountTaskLimit: {fixedData.m_bAccountTaskLimit}\n\n"; + + fixedData.m_bRoleTaskLimit = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bRoleTaskLimit: {fixedData.m_bRoleTaskLimit}\n\n"; + + fixedData.m_ulAccountTaskLimitCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulAccountTaskLimitCnt: {fixedData.m_ulAccountTaskLimitCnt}\n\n"; + + fixedData.m_bLeaveFactionFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bLeaveFactionFail: {fixedData.m_bLeaveFactionFail}\n\n"; + + fixedData.m_bNotIncCntWhenFailed = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bNotIncCntWhenFailed: {fixedData.m_bNotIncCntWhenFailed}\n\n"; + + fixedData.m_bNotClearItemWhenFailed = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bNotClearItemWhenFailed: {fixedData.m_bNotClearItemWhenFailed}\n\n"; + + fixedData.m_bDisplayInTitleTaskUI = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bDisplayInTitleTaskUI: {fixedData.m_bDisplayInTitleTaskUI}\n\n"; + + // Opening conditions + fixedData.m_ucPremiseTransformedForm = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ucPremiseTransformedForm: {fixedData.m_ucPremiseTransformedForm}\n\n"; + + fixedData.m_bShowByTransformed = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByTransformed: {fixedData.m_bShowByTransformed}\n\n"; + + fixedData.m_ulPremise_Lev_Min = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Lev_Min: {fixedData.m_ulPremise_Lev_Min}\n\n"; + + fixedData.m_ulPremise_Lev_Max = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Lev_Max: {fixedData.m_ulPremise_Lev_Max}\n\n"; + + fixedData.m_bPremCheckMaxHistoryLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_bPremCheckMaxHistoryLevel: {fixedData.m_bPremCheckMaxHistoryLevel}\n\n"; + + fixedData.m_bShowByLev = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByLev: {fixedData.m_bShowByLev}\n\n"; + + fixedData.m_bPremCheckReincarnation = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremCheckReincarnation: {fixedData.m_bPremCheckReincarnation}\n\n"; + + fixedData.m_ulPremReincarnationMin = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremReincarnationMin: {fixedData.m_ulPremReincarnationMin}\n\n"; + + fixedData.m_ulPremReincarnationMax = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremReincarnationMax: {fixedData.m_ulPremReincarnationMax}\n\n"; + + fixedData.m_bShowByReincarnation = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByReincarnation: {fixedData.m_bShowByReincarnation}\n\n"; + + fixedData.m_bPremCheckRealmLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremCheckRealmLevel: {fixedData.m_bPremCheckRealmLevel}\n\n"; + + fixedData.m_ulPremRealmLevelMin = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremRealmLevelMin: {fixedData.m_ulPremRealmLevelMin}\n\n"; + + fixedData.m_ulPremRealmLevelMax = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremRealmLevelMax: {fixedData.m_ulPremRealmLevelMax}\n\n"; + + fixedData.m_bPremCheckRealmExpFull = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremCheckRealmExpFull: {fixedData.m_bPremCheckRealmExpFull}\n\n"; + + fixedData.m_bShowByRealmLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByRealmLevel: {fixedData.m_bShowByRealmLevel}\n\n"; + + fixedData.m_ulPremItems = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremItems: {fixedData.m_ulPremItems}\n\n"; + + // PremItems pointer (ITEM_WANTED[] m_PremItems;) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_PremItems: ITEM_WANTED[] pointer, skip 4 bytes \n\n"; + + fixedData.m_bShowByItems = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByItems: {fixedData.m_bShowByItems}\n\n"; + + fixedData.m_bPremItemsAnyOne = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremItemsAnyOne: {fixedData.m_bPremItemsAnyOne}\n\n"; + + fixedData.m_ulGivenItems = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulGivenItems: {fixedData.m_ulGivenItems}\n\n"; + + fixedData.m_ulGivenCmnCount = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulGivenCmnCount: {fixedData.m_ulGivenCmnCount}\n\n"; + + fixedData.m_ulGivenTskCount = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulGivenTskCount: {fixedData.m_ulGivenTskCount}\n\n"; + + // GivenItems pointer (ITEM_WANTED[] m_GivenItems;) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_GivenItems: ITEM_WANTED[] pointer, skip 4 bytes \n\n"; + + fixedData.m_ulPremise_Deposit = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Deposit: {fixedData.m_ulPremise_Deposit}\n\n"; + + fixedData.m_bShowByDeposit = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByDeposit: {fixedData.m_bShowByDeposit}\n\n"; + + fixedData.m_lPremise_Reputation = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_lPremise_Reputation: {fixedData.m_lPremise_Reputation}\n\n"; + + fixedData.m_lPremise_RepuMax = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_lPremise_RepuMax: {fixedData.m_lPremise_RepuMax}\n\n"; + + fixedData.m_bShowByRepu = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByRepu: {fixedData.m_bShowByRepu}\n\n"; + + fixedData.m_ulPremise_Task_Count = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Task_Count: {fixedData.m_ulPremise_Task_Count}\n\n"; + + fixedData.m_ulPremise_Tasks = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_PREM_TASK_COUNT, ref readBytes); + logContent += $"m_ulPremise_Tasks[0..{TaskTemplConstants.MAX_PREM_TASK_COUNT - 1}] loaded\n\n"; + + fixedData.m_bShowByPreTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByPreTask: {fixedData.m_bShowByPreTask}\n\n"; + + fixedData.m_ulPremise_Task_Least_Num = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Task_Least_Num: {fixedData.m_ulPremise_Task_Least_Num}\n\n"; + + fixedData.m_ulPremise_Period = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Period: {fixedData.m_ulPremise_Period}\n\n"; + + fixedData.m_bShowByPeriod = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByPeriod: {fixedData.m_bShowByPeriod}\n\n"; + + fixedData.m_ulPremise_Faction = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Faction: {fixedData.m_ulPremise_Faction}\n\n"; + + fixedData.m_iPremise_FactionRole = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremise_FactionRole: {fixedData.m_iPremise_FactionRole}\n\n"; + + fixedData.m_bShowByFaction = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByFaction: {fixedData.m_bShowByFaction}\n\n"; + + // Gender and occupation restrictions + fixedData.m_ulGender = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulGender: {fixedData.m_ulGender}\n\n"; + + fixedData.m_bShowByGender = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByGender: {fixedData.m_bShowByGender}\n\n"; + + fixedData.m_ulOccupations = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulOccupations: {fixedData.m_ulOccupations}\n\n"; + + fixedData.m_Occupations = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_OCCUPATIONS, ref readBytes); + logContent += $"m_Occupations[0..{TaskTemplConstants.MAX_OCCUPATIONS - 1}] loaded\n\n"; + + fixedData.m_bShowByOccup = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByOccup: {fixedData.m_bShowByOccup}\n\n"; + + // Spouse related + fixedData.m_bPremise_Spouse = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremise_Spouse: {fixedData.m_bPremise_Spouse}\n\n"; + + fixedData.m_bShowBySpouse = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowBySpouse: {fixedData.m_bShowBySpouse}\n\n"; + + fixedData.m_bPremiseWeddingOwner = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremiseWeddingOwner: {fixedData.m_bPremiseWeddingOwner}\n\n"; + + fixedData.m_bShowByWeddingOwner = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByWeddingOwner: {fixedData.m_bShowByWeddingOwner}\n\n"; + + // GM and shield user + fixedData.m_bGM = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bGM: {fixedData.m_bGM}\n\n"; + + fixedData.m_bShieldUser = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShieldUser: {fixedData.m_bShieldUser}\n\n"; + + // RMB limits + fixedData.m_bShowByRMB = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByRMB: {fixedData.m_bShowByRMB}\n\n"; + + fixedData.m_ulPremRMBMin = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremRMBMin: {fixedData.m_ulPremRMBMin}\n\n"; + + fixedData.m_ulPremRMBMax = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremRMBMax: {fixedData.m_ulPremRMBMax}\n\n"; + + // Character time + fixedData.m_bCharTime = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCharTime: {fixedData.m_bCharTime}\n\n"; + + fixedData.m_bShowByCharTime = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByCharTime: {fixedData.m_bShowByCharTime}\n\n"; + + fixedData.m_iCharStartTime = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iCharStartTime: {fixedData.m_iCharStartTime}\n\n"; + + fixedData.m_iCharEndTime = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iCharEndTime: {fixedData.m_iCharEndTime}\n\n"; + + fixedData.m_tmCharEndTime = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_tmCharEndTime.day: {fixedData.m_tmCharEndTime.day}\n\n"; + + fixedData.m_ulCharTimeGreaterThan = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulCharTimeGreaterThan: {fixedData.m_ulCharTimeGreaterThan}\n\n"; + + // Related and mutex tasks + fixedData.m_ulPremise_Cotask = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremise_Cotask: {fixedData.m_ulPremise_Cotask}\n\n"; + + fixedData.m_ulCoTaskCond = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulCoTaskCond: {fixedData.m_ulCoTaskCond}\n\n"; + + fixedData.m_ulMutexTaskCount = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulMutexTaskCount: {fixedData.m_ulMutexTaskCount}\n\n"; + + fixedData.m_ulMutexTasks = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_MUTEX_TASK_COUNT, ref readBytes); + logContent += $"m_ulMutexTasks[0..{TaskTemplConstants.MAX_MUTEX_TASK_COUNT - 1}] loaded\n\n"; + + // Living skills levels (C++ long -> 4 bytes). Read as int and widen to long + var skillLevelsInt = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_LIVING_SKILLS, ref readBytes); + fixedData.m_lSkillLev = Array.ConvertAll(skillLevelsInt, v => (long)v); + logContent += $"m_lSkillLev[0..{TaskTemplConstants.MAX_LIVING_SKILLS - 1}] loaded\n\n"; + + // Dynamic task type and special award + fixedData.m_DynTaskType = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_DynTaskType: {fixedData.m_DynTaskType}\n\n"; + + fixedData.m_ulSpecialAward = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulSpecialAward: {fixedData.m_ulSpecialAward}\n\n"; + + // Team information + fixedData.m_bTeamwork = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bTeamwork: {fixedData.m_bTeamwork}\n\n"; + + fixedData.m_bRcvByTeam = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bRcvByTeam: {fixedData.m_bRcvByTeam}\n\n"; + + fixedData.m_bSharedTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bSharedTask: {fixedData.m_bSharedTask}\n\n"; + + fixedData.m_bSharedAchieved = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bSharedAchieved: {fixedData.m_bSharedAchieved}\n\n"; + + fixedData.m_bCheckTeammate = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCheckTeammate: {fixedData.m_bCheckTeammate}\n\n"; + + fixedData.m_fTeammateDist = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_fTeammateDist: {fixedData.m_fTeammateDist}\n\n"; + + fixedData.m_bAllFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bAllFail: {fixedData.m_bAllFail}\n\n"; + + fixedData.m_bCapFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCapFail: {fixedData.m_bCapFail}\n\n"; + + fixedData.m_bCapSucc = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCapSucc: {fixedData.m_bCapSucc}\n\n"; + + fixedData.m_fSuccDist = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_fSuccDist: {fixedData.m_fSuccDist}\n\n"; + + fixedData.m_bDismAsSelfFail = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bDismAsSelfFail: {fixedData.m_bDismAsSelfFail}\n\n"; + + fixedData.m_bRcvChckMem = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bRcvChckMem: {fixedData.m_bRcvChckMem}\n\n"; + + fixedData.m_fRcvMemDist = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_fRcvMemDist: {fixedData.m_fRcvMemDist}\n\n"; + + fixedData.m_bCntByMemPos = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCntByMemPos: {fixedData.m_bCntByMemPos}\n\n"; + + fixedData.m_fCntMemDist = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_fCntMemDist: {fixedData.m_fCntMemDist}\n\n"; + + fixedData.m_bAllSucc = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bAllSucc: {fixedData.m_bAllSucc}\n\n"; + + fixedData.m_bCoupleOnly = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bCoupleOnly: {fixedData.m_bCoupleOnly}\n\n"; + + fixedData.m_bDistinguishedOcc = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bDistinguishedOcc: {fixedData.m_bDistinguishedOcc}\n\n"; + + fixedData.m_ulTeamMemsWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulTeamMemsWanted: {fixedData.m_ulTeamMemsWanted}\n\n"; + + // TEAM_MEM_WANTED pointer array + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_TeamMemsWanted: TEAM_MEM_WANTED[] pointer, skip 4 bytes \n\n"; + + fixedData.m_bShowByTeam = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByTeam: {fixedData.m_bShowByTeam}\n\n"; + + // Premise global key/value + fixedData.m_bPremNeedComp = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremNeedComp: {fixedData.m_bPremNeedComp}\n\n"; + + fixedData.m_nPremExp1AndOrExp2 = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_nPremExp1AndOrExp2: {fixedData.m_nPremExp1AndOrExp2}\n\n"; + + fixedData.m_Prem1KeyValue = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_Prem1KeyValue loaded\n\n"; + + fixedData.m_Prem2KeyValue = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_Prem2KeyValue loaded\n\n"; + + // Force related + fixedData.m_bPremCheckForce = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremCheckForce: {fixedData.m_bPremCheckForce}\n\n"; + + fixedData.m_iPremForce = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremForce: {fixedData.m_iPremForce}\n\n"; + + fixedData.m_bShowByForce = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByForce: {fixedData.m_bShowByForce}\n\n"; + + fixedData.m_iPremForceReputation = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremForceReputation: {fixedData.m_iPremForceReputation}\n\n"; + + fixedData.m_bShowByForceReputation = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByForceReputation: {fixedData.m_bShowByForceReputation}\n\n"; + + fixedData.m_iPremForceContribution = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremForceContribution: {fixedData.m_iPremForceContribution}\n\n"; + + fixedData.m_bShowByForceContribution = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByForceContribution: {fixedData.m_bShowByForceContribution}\n\n"; + + fixedData.m_iPremForceExp = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremForceExp: {fixedData.m_iPremForceExp}\n\n"; + + fixedData.m_bShowByForceExp = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByForceExp: {fixedData.m_bShowByForceExp}\n\n"; + + fixedData.m_iPremForceSP = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremForceSP: {fixedData.m_iPremForceSP}\n\n"; + + fixedData.m_bShowByForceSP = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByForceSP: {fixedData.m_bShowByForceSP}\n\n"; + + fixedData.m_iPremForceActivityLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremForceActivityLevel: {fixedData.m_iPremForceActivityLevel}\n\n"; + + fixedData.m_bShowByForceActivityLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByForceActivityLevel: {fixedData.m_bShowByForceActivityLevel}\n\n"; + + // King / Not in team / Titles + fixedData.m_bPremIsKing = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremIsKing: {fixedData.m_bPremIsKing}\n\n"; + + fixedData.m_bShowByKing = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByKing: {fixedData.m_bShowByKing}\n\n"; + + fixedData.m_bPremNotInTeam = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bPremNotInTeam: {fixedData.m_bPremNotInTeam}\n\n"; + + fixedData.m_bShowByNotInTeam = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByNotInTeam: {fixedData.m_bShowByNotInTeam}\n\n"; + + fixedData.m_iPremTitleNumTotal = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremTitleNumTotal: {fixedData.m_iPremTitleNumTotal}\n\n"; + + fixedData.m_iPremTitleNumRequired = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremTitleNumRequired: {fixedData.m_iPremTitleNumRequired}\n\n"; + + // PremTitles pointer (int[]) + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_PremTitles: int[] pointer, skip 4 bytes \n\n"; + + fixedData.m_bShowByTitle = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByTitle: {fixedData.m_bShowByTitle}\n\n"; + + var premHistoryIdx = AAssit.ReadArrayFromBinary(fp, 2, ref readBytes); + fixedData.m_iPremHistoryStageIndex = premHistoryIdx; + logContent += $"m_iPremHistoryStageIndex[0..1] loaded\n\n"; + + fixedData.m_bShowByHistoryStage = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByHistoryStage: {fixedData.m_bShowByHistoryStage}\n\n"; + + fixedData.m_ulPremGeneralCardCount = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremGeneralCardCount: {fixedData.m_ulPremGeneralCardCount}\n\n"; + + fixedData.m_bShowByGeneralCard = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByGeneralCard: {fixedData.m_bShowByGeneralCard}\n\n"; + + fixedData.m_iPremGeneralCardRank = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iPremGeneralCardRank: {fixedData.m_iPremGeneralCardRank}\n\n"; + + fixedData.m_ulPremGeneralCardRankCount = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPremGeneralCardRankCount: {fixedData.m_ulPremGeneralCardRankCount}\n\n"; + + fixedData.m_bShowByGeneralCardRank = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bShowByGeneralCardRank: {fixedData.m_bShowByGeneralCardRank}\n\n"; + + // Completion methods and conditions + fixedData.m_enumMethod = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_enumMethod: {fixedData.m_enumMethod}\n\n"; + + fixedData.m_enumFinishType = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_enumFinishType: {fixedData.m_enumFinishType}\n\n"; + + // Task methods + fixedData.m_ulPlayerWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPlayerWanted: {fixedData.m_ulPlayerWanted}\n\n"; + + // PLAYER_WANTED pointer + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_PlayerWanted: PLAYER_WANTED[] pointer, skip 4 bytes \n\n"; + + fixedData.m_ulMonsterWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulMonsterWanted: {fixedData.m_ulMonsterWanted}\n\n"; + + // MONSTER_WANTED pointer + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_MonsterWanted: MONSTER_WANTED[] pointer, skip 4 bytes \n\n"; + + fixedData.m_ulItemsWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulItemsWanted: {fixedData.m_ulItemsWanted}\n\n"; + + // ITEM_WANTED pointer + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_ItemsWanted: ITEM_WANTED[] pointer, skip 4 bytes \n\n"; + + fixedData.m_ulGoldWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulGoldWanted: {fixedData.m_ulGoldWanted}\n\n"; + + fixedData.m_iFactionContribWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iFactionContribWanted: {fixedData.m_iFactionContribWanted}\n\n"; + + fixedData.m_iFactionExpContribWanted = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iFactionExpContribWanted: {fixedData.m_iFactionExpContribWanted}\n\n"; + + fixedData.m_ulNPCToProtect = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulNPCToProtect: {fixedData.m_ulNPCToProtect}\n\n"; + + fixedData.m_ulProtectTimeLen = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulProtectTimeLen: {fixedData.m_ulProtectTimeLen}\n\n"; + + fixedData.m_ulNPCMoving = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulNPCMoving: {fixedData.m_ulNPCMoving}\n\n"; + + fixedData.m_ulNPCDestSite = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulNPCDestSite: {fixedData.m_ulNPCDestSite}\n\n"; + + // Reach site pointer and counts + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pReachSite: Task_Region[] pointer, skip 4 bytes \n\n"; + + fixedData.m_ulReachSiteCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulReachSiteCnt: {fixedData.m_ulReachSiteCnt}\n\n"; + + fixedData.m_ulReachSiteId = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulReachSiteId: {fixedData.m_ulReachSiteId}\n\n"; + + fixedData.m_ulWaitTime = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulWaitTime: {fixedData.m_ulWaitTime}\n\n"; + + // Treasure map (TREA) + fixedData.m_TreasureStartZone = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_TreasureStartZone: ({fixedData.m_TreasureStartZone.x}, {fixedData.m_TreasureStartZone.y}, {fixedData.m_TreasureStartZone.z})\n\n"; + + fixedData.m_ucZonesNumX = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ucZonesNumX: {fixedData.m_ucZonesNumX}\n\n"; + + fixedData.m_ucZonesNumZ = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ucZonesNumZ: {fixedData.m_ucZonesNumZ}\n\n"; + + fixedData.m_ucZoneSide = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ucZoneSide: {fixedData.m_ucZoneSide}\n\n"; + + // Leave site pointer and counts + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pLeaveSite: Task_Region[] pointer, skip 4 bytes \n\n"; + + fixedData.m_ulLeaveSiteCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulLeaveSiteCnt: {fixedData.m_ulLeaveSiteCnt}\n\n"; + + fixedData.m_ulLeaveSiteId = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulLeaveSiteId: {fixedData.m_ulLeaveSiteId}\n\n"; + + // Finish global key/value + fixedData.m_bFinNeedComp = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bFinNeedComp: {fixedData.m_bFinNeedComp}\n\n"; + + fixedData.m_nFinExp1AndOrExp2 = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_nFinExp1AndOrExp2: {fixedData.m_nFinExp1AndOrExp2}\n\n"; + + fixedData.m_Fin1KeyValue = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_Fin1KeyValue loaded\n\n"; + + fixedData.m_Fin2KeyValue = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_Fin2KeyValue loaded\n\n"; + + // Expressions to display + fixedData.m_ulExpCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulExpCnt: {fixedData.m_ulExpCnt}\n\n"; + + // Pointers for expression storage + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pszExp: byte[,] pointer, skip 4 bytes \n\n"; + + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pExpArr: TASK_EXPRESSION[,] pointer, skip 4 bytes \n\n"; + + // Task char prompts + fixedData.m_ulTaskCharCnt = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulTaskCharCnt: {fixedData.m_ulTaskCharCnt}\n\n"; + + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_pTaskChar: ushort[,] pointer, skip 4 bytes \n\n"; + + // Transformation state + fixedData.m_ucTransformedForm = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ucTransformedForm: {fixedData.m_ucTransformedForm}\n\n"; + + // Level/Reincarnation/Realm + fixedData.m_ulReachLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulReachLevel: {fixedData.m_ulReachLevel}\n\n"; + + fixedData.m_ulReachReincarnationCount = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulReachReincarnationCount: {fixedData.m_ulReachReincarnationCount}\n\n"; + + fixedData.m_ulReachRealmLevel = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulReachRealmLevel: {fixedData.m_ulReachRealmLevel}\n\n"; + + fixedData.m_uiEmotion = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_uiEmotion: {fixedData.m_uiEmotion}\n\n"; + + // Award types and pointers + fixedData.m_ulAwardType_S = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulAwardType_S: {fixedData.m_ulAwardType_S}\n\n"; + + fixedData.m_ulAwardType_F = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulAwardType_F: {fixedData.m_ulAwardType_F}\n\n"; + + // AWARD_DATA pointers + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_Award_S_ptr: AWARD_DATA* pointer, skip 4 bytes \n\n"; + + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_Award_F_ptr: AWARD_DATA* pointer, skip 4 bytes \n\n"; + + // Ratio and items scale pointers + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_AwByRatio_S_ptr: AWARD_RATIO_SCALE* pointer, skip 4 bytes \n\n"; + + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_AwByRatio_F_ptr: AWARD_RATIO_SCALE* pointer, skip 4 bytes \n\n"; + + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_AwByItems_S_ptr: AWARD_ITEMS_SCALE* pointer, skip 4 bytes \n\n"; + + fp.Seek(4, SeekOrigin.Current); + logContent += $"m_AwByItems_F_ptr: AWARD_ITEMS_SCALE* pointer, skip 4 bytes \n\n"; + + // Hierarchy + fixedData.m_ulParent = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulParent: {fixedData.m_ulParent}\n\n"; + + fixedData.m_ulPrevSibling = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulPrevSibling: {fixedData.m_ulPrevSibling}\n\n"; + + fixedData.m_ulNextSibling = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulNextSibling: {fixedData.m_ulNextSibling}\n\n"; + + fixedData.m_ulFirstChild = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_ulFirstChild: {fixedData.m_ulFirstChild}\n\n"; + + // Library tasks + fixedData.m_bIsLibraryTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bIsLibraryTask: {fixedData.m_bIsLibraryTask}\n\n"; + + fixedData.m_fLibraryTasksProbability = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_fLibraryTasksProbability: {fixedData.m_fLibraryTasksProbability}\n\n"; + + fixedData.m_bIsUniqueStorageTask = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + logContent += $"m_bIsUniqueStorageTask: {fixedData.m_bIsUniqueStorageTask}\n\n"; + + fixedData.m_iWorldContribution = AAssit.ReadFromBinaryOf(fp, ref readBytes); + logContent += $"m_iWorldContribution: {fixedData.m_iWorldContribution}\n\n"; + + //ConvertPointersOfFixedData(fp, ref fixedData, ref readBytes); + + BMLogger.LogError($" === Task Data {fixedData.m_ID} loaded === \n {logContent} "); + //fp.Seek(originalPos, SeekOrigin.Begin); return; } + private void ConvertPointersOfFixedData(FileStream fp, ref ATaskTemplFixedData fixedData, ref long readBytes) + { + string logContent = ""; + + // C++ pointer: task_char* m_pszSignature; + /*if (m_bHasSign) + { + m_pszSignature = new task_char[MAX_TASK_NAME_LEN]; + g_ulNewCount++; + fread(m_pszSignature, sizeof(task_char), MAX_TASK_NAME_LEN, fp); + convert_txt(m_pszSignature, MAX_TASK_NAME_LEN, (namechar)m_ID); + }*/ + if (fixedData.m_bHasSign) + { + fixedData.m_pszSignature = AAssit.ReadArrayFromBinary(fp, TaskTemplConstants.MAX_TASK_NAME_LEN, ref readBytes); //64 + convert_txt(fixedData.m_pszSignature, TaskTemplConstants.MAX_TASK_NAME_LEN, (char)(fixedData.m_ID)); + logContent += $"m_pszSignature: {ByteToStringUtils.UshortArrayToUnicodeString(fixedData.m_pszSignature)}\n"; //68 + } + else + { + logContent += $"m_pszSignature: {fixedData.m_pszSignature}\n"; + } + + // C++ struct: task_tm* m_tmStart; task_tm* m_tmEnd; + /*if (m_ulTimetable) + { + m_tmStart = new task_tm[m_ulTimetable]; + g_ulNewCount++; + m_tmEnd = new task_tm[m_ulTimetable]; + g_ulNewCount++; + } + + for (i = 0; i < m_ulTimetable; i++) + { + fread(&m_tmStart[i], sizeof(task_tm), 1, fp); + fread(&m_tmEnd[i], sizeof(task_tm), 1, fp); + }*/ + if (fixedData.m_ulTimetable > 0) + { + fixedData.m_tmStart = new task_tm[fixedData.m_ulTimetable]; + fixedData.m_tmEnd = new task_tm[fixedData.m_ulTimetable]; + + string tmStartLog = ""; + string tmEndLog = ""; + + for (int i=0; i < fixedData.m_ulTimetable; i++) + { + fixedData.m_tmStart[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + fixedData.m_tmEnd[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + + tmStartLog += $"{i} = {fixedData.m_tmStart[i].GetLog()} || "; + tmEndLog += $"{i} = {fixedData.m_tmEnd[i].GetLog()} || "; + } + + logContent += $"m_tmStart: {tmStartLog} \n"; + logContent += $"m_tmEnd: {tmEndLog} \n"; + } + + // C++ pointer arrays: long* m_plChangeKey; long* m_plChangeKeyValue; bool* m_pbChangeType; + /*if (m_ulChangeKeyCnt) + { + m_plChangeKey = new long[m_ulChangeKeyCnt]; + m_plChangeKeyValue = new long[m_ulChangeKeyCnt]; + m_pbChangeType = new bool[m_ulChangeKeyCnt]; + } + + for (i=0; i 0) + { + fixedData.m_plChangeKey = new int[fixedData.m_ulChangeKeyCnt]; + fixedData.m_plChangeKeyValue = new int[fixedData.m_ulChangeKeyCnt]; + fixedData.m_pbChangeType = new bool[fixedData.m_ulChangeKeyCnt]; + + string changeKeyLog = ""; + string changeKeyValueLog = ""; + string changeTypeLog = ""; + + for (int i=0; i < fixedData.m_ulChangeKeyCnt; i++) + { + fixedData.m_plChangeKey[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + fixedData.m_plChangeKeyValue[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + fixedData.m_pbChangeType[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes) > 0; + + changeKeyLog += $"{i} = {fixedData.m_plChangeKey[i]} || "; + changeKeyValueLog += $"{i} = {fixedData.m_plChangeKeyValue[i]} || "; + changeTypeLog += $"{i} = {fixedData.m_pbChangeType[i]} || "; + } + + logContent += $"m_plChangeKey: {changeKeyLog} \n"; + logContent += $"m_plChangeKeyValue: {changeKeyValueLog} \n"; + logContent += $"m_pbChangeType: {changeTypeLog} \n"; + } + else + { + logContent += $"m_plChangeKey: {fixedData.m_plChangeKey}\n"; + logContent += $"m_plChangeKeyValue: {fixedData.m_plChangeKeyValue}\n"; + logContent += $"m_pbChangeType: {fixedData.m_pbChangeType}\n"; + } + + + /*if (m_ulPQExpCnt) + { + m_pszPQExp = new char[m_ulPQExpCnt][TASK_AWARD_MAX_DISPLAY_CHAR_LEN]; + memset(m_pszPQExp, 0, m_ulPQExpCnt*TASK_AWARD_MAX_DISPLAY_CHAR_LEN); + + m_pPQExpArr = new TASK_EXPRESSION[m_ulPQExpCnt][TASK_AWARD_MAX_DISPLAY_CHAR_LEN]; + memset(m_pPQExpArr, 0, sizeof(TASK_EXPRESSION)*m_ulPQExpCnt*TASK_AWARD_MAX_DISPLAY_CHAR_LEN); + + for (i=0; i 0) + { + int rowCount = (int)fixedData.m_ulPQExpCnt; + int colCount = TaskTemplConstants.TASK_AWARD_MAX_DISPLAY_CHAR_LEN; + + fixedData.m_pszPQExp = new byte[rowCount, colCount]; + fixedData.m_pPQExpArr = new TASK_EXPRESSION[rowCount, colCount]; + + for (int i = 0; i < rowCount; i++) + { + // Read PQ expression display bytes (length TASK_AWARD_MAX_DISPLAY_CHAR_LEN) + byte[] expBytes = AAssit.ReadArrayFromBinary(fp, colCount, ref readBytes); + for (int j = 0; j < colCount; j++) + { + fixedData.m_pszPQExp[i, j] = expBytes[j]; + } + + // Read TASK_EXPRESSION array (length TASK_AWARD_MAX_DISPLAY_CHAR_LEN) + for (int j = 0; j < colCount; j++) + { + fixedData.m_pPQExpArr[i, j] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + } + } + + logContent += $"m_pszPQExp and m_pPQExpArr loaded, count: {fixedData.m_ulPQExpCnt} (each {TaskTemplConstants.TASK_AWARD_MAX_DISPLAY_CHAR_LEN})\n"; + } + else + { + logContent += $"m_pszPQExp: {fixedData.m_pszPQExp}\n"; + logContent += $"m_pPQExpArr: {fixedData.m_pPQExpArr}\n"; + } + + // Convert C++ lines 3866-3896 + if (fixedData.m_ulMonsterContribCnt > 0) + { + fixedData.m_MonstersContrib = new MONSTERS_CONTRIB[fixedData.m_ulMonsterContribCnt]; + + string mcLog = ""; + for (int i = 0; i < fixedData.m_ulMonsterContribCnt; i++) + { + fixedData.m_MonstersContrib[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + mcLog += $"{i} = (MonsterId:{fixedData.m_MonstersContrib[i].m_ulMonsterTemplId}) || "; + } + logContent += $"m_MonstersContrib: {mcLog}\n"; + } + else + { + logContent += $"m_MonstersContrib: {fixedData.m_MonstersContrib}\n"; + } + + // version 80: delivery regions + if (fixedData.m_ulDelvRegionCnt > 0) + { + fixedData.m_pDelvRegion = new Task_Region[fixedData.m_ulDelvRegionCnt]; + string dLog = ""; + for (int i = 0; i < fixedData.m_ulDelvRegionCnt; i++) + { + fixedData.m_pDelvRegion[i] = AAssit.ReadFromBinaryOf(fp, ref readBytes); + dLog += $" {i} = (RegionId:{fixedData.m_pDelvRegion[i].GetLog()}) || "; + } + logContent += $"m_pDelvRegion: {dLog}\n"; + } + else + { + fixedData.m_pDelvRegion = null; + logContent += $"m_pDelvRegion: {fixedData.m_pDelvRegion}\n"; + } + + + if (fixedData.m_ulEnterRegionCnt > 0) + { + fixedData.m_pEnterRegion = new Task_Region[fixedData.m_ulEnterRegionCnt]; + } + else + { + fixedData.m_pEnterRegion = null; + } + + + BMLogger.LogError($" === Task Pointer Datas {fixedData.m_ID} loaded === \n {logContent} "); + } + #region convert from c++ to cs @@ -3021,7 +3526,7 @@ namespace PerfectWorld.Scripts.Task // LoadAwardDataItemsScale(fp, *m_AwByItems_F, _task_templ_cur_version); #endregion - string ConvertTxt(string str, char code) + string convert_txt(string str, char code) { char[] chars = str.ToCharArray(); for (int i = 0; i < chars.Length; i++)