3a05b94366
# Conflicts: # Assets/PerfectWorld/Scripts/Managers/CECNPCMan.cs # Assets/PerfectWorld/Scripts/Managers/EC_HPWorkMelee.cs # Assets/PerfectWorld/Scripts/Managers/EC_HPWorkTrace.cs # Assets/PerfectWorld/Scripts/Managers/EC_HostPlayer.cs # Assets/PerfectWorld/Scripts/Managers/EC_ManMatter.cs # Assets/PerfectWorld/Scripts/Managers/EC_ManPlayer.cs # Assets/PerfectWorld/Scripts/Managers/EC_Object.cs # Assets/PerfectWorld/Scripts/Move/CECHostMove.cs # Assets/PerfectWorld/Scripts/NPC/CECMonster.cs # Assets/PerfectWorld/Scripts/NPC/CECNPC.cs # Assets/PerfectWorld/Scripts/NPC/CECNPCModelDefaultPolicy.cs # Assets/PerfectWorld/Scripts/Network/UnityGameSession.cs # Assets/PerfectWorld/Scripts/PlayerState/PlayerIdleState.cs # Assets/PerfectWorld/Scripts/PlayerState/PlayerMoveState.cs # Assets/PerfectWorld/Scripts/Players/EC_ElsePlayer.cs # Assets/PerfectWorld/Scripts/UI/pickupItem.cs # Assets/Scripts/CECHostPlayer.cs # Assets/Scripts/EC_Utility.cs # Assets/Scripts/GameController.cs # Assets/Scripts/InitializePlayer.cs # Assets/Scripts/Move/EC_Player.cs # Assets/Scripts/PlayerVisual.cs
742 lines
24 KiB
C#
742 lines
24 KiB
C#
using UnityEngine;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
namespace BrewMonster.Scripts.Task
|
|
{
|
|
public sealed class TaskConstant
|
|
{
|
|
public const int MAX_OCCUPATIONS = 12;
|
|
|
|
public const int MAX_TASK_NAME_LEN = 30;
|
|
public const int MAX_AWARD_NPC_NUM = 8;
|
|
public const int MAX_PREM_TASK_COUNT = 20;
|
|
public const int MAX_MUTEX_TASK_COUNT = 5;
|
|
public const int MAX_TEAM_MEM_WANTED = MAX_OCCUPATIONS;
|
|
public const int MAX_TIMETABLE_SIZE = 24;
|
|
public const int MAX_AWARD_SCALES = 5;
|
|
public const int MAX_AWARD_CANDIDATES = 12;
|
|
public const int MAX_LIVING_SKILLS = 4;
|
|
public const int MAX_CONTRIB_MONSTERS = 100;
|
|
public const int MAX_AWARD_PQ_RANKING = 32;
|
|
public const int MAX_TITLE_NUM = 10;
|
|
public const int MAX_TASKREGION = 8;
|
|
public const int TASK_GENDER_NONE = 0;
|
|
public const int TASK_GENDER_MALE = 1;
|
|
public const int TASK_GENDER_FEMALE = 2;
|
|
public const int TASK_MAX_PATH = 260;
|
|
|
|
public const int INVALID_VAL = -1;
|
|
public const int TASK_MAX_LINE_LEN = TASK_MAX_PATH;
|
|
public const int TASK_MAX_VALID_COUNT = 6;
|
|
public const int TASK_TREASURE_MAP_SIDE_MULTIPLE = 30;
|
|
|
|
|
|
|
|
public readonly long[] task_week_map =
|
|
{
|
|
7,
|
|
1,
|
|
2,
|
|
3,
|
|
4,
|
|
5,
|
|
6
|
|
};
|
|
}
|
|
|
|
public struct task_tm
|
|
{
|
|
public int year;
|
|
public int month;
|
|
public int day;
|
|
public int hour;
|
|
public int min;
|
|
public int wday;
|
|
}
|
|
|
|
public struct TASK_PACK_HEADER
|
|
{
|
|
public uint magic;
|
|
public uint version;
|
|
public int item_count;
|
|
}
|
|
|
|
public struct MONSTERS_CONTRIB
|
|
{
|
|
public ulong m_ulMonsterTemplId; // Monster ID
|
|
public int m_iWholeContrib; // Team exclusive contribution
|
|
public int m_iShareContrib; // Team shared contribution
|
|
public int m_iPersonalWholeContrib; // Personal exclusive contribution
|
|
|
|
public bool Equals(MONSTERS_CONTRIB src)
|
|
{
|
|
return (m_ulMonsterTemplId == src.m_ulMonsterTemplId &&
|
|
m_iWholeContrib == src.m_iWholeContrib &&
|
|
m_iShareContrib == src.m_iShareContrib &&
|
|
m_iPersonalWholeContrib == src.m_iPersonalWholeContrib);
|
|
}
|
|
}
|
|
|
|
public struct ZONE_VERT
|
|
{
|
|
public float x;
|
|
public float y;
|
|
public float z;
|
|
}
|
|
|
|
public enum task_tm_type
|
|
{
|
|
enumTaskTimeDate = 0,
|
|
enumTaskTimeMonth,
|
|
enumTaskTimeWeek,
|
|
enumTaskTimeDay
|
|
};
|
|
|
|
|
|
/// <summary>
|
|
/// Completion Method
|
|
/// </summary>
|
|
public enum TaskMethod
|
|
{
|
|
enumTMNone = 0, // None
|
|
enumTMKillNumMonster, // Kill a number of monsters
|
|
enumTMCollectNumArticle, // Collect a number of items
|
|
enumTMTalkToNPC, // Talk to a specific NPC
|
|
enumTMReachSite, // Reach a specific location
|
|
enumTMWaitTime, // Wait for a specified time
|
|
enumTMAnswerQuestion, // Answer a question
|
|
enumTMTinyGame, // Mini-game
|
|
enumTMProtectNPC, // Protect a specific NPC
|
|
enumTMNPCReachSite, // NPC reaches a specific location
|
|
enumTMGlobalValOK, // Global variable condition satisfied
|
|
enumTMLeaveSite, // Leave a specific location
|
|
enumTMReachTreasureZone, // Reach the treasure area
|
|
enumTMKillPlayer, // Kill another player
|
|
enumTMTransform, // Transform state
|
|
enumTMReachLevel, // Check level: normal level, rebirth count, realm level
|
|
enumTMSimpleClientTask, // Simple client task (only client-side validation, currently just checks UI triggers)
|
|
enumTMSimpleClientTaskForceNavi // Force navigation
|
|
}
|
|
|
|
public struct Task_Region
|
|
{
|
|
public ZONE_VERT zvMin;
|
|
public ZONE_VERT zvMax;
|
|
|
|
public bool Equals(Task_Region src)
|
|
{
|
|
return (zvMin.x == src.zvMin.x && zvMin.y == src.zvMin.y && zvMin.z == src.zvMin.z &&
|
|
zvMax.x == src.zvMax.x && zvMax.y == src.zvMax.y && zvMax.z == src.zvMax.z);
|
|
}
|
|
|
|
public static bool operator ==(Task_Region a, Task_Region b)
|
|
{
|
|
return a.Equals(b);
|
|
}
|
|
|
|
public static bool operator !=(Task_Region a, Task_Region b)
|
|
{
|
|
return !a.Equals(b);
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj is Task_Region)
|
|
return Equals((Task_Region)obj);
|
|
return false;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return zvMin.GetHashCode() ^ zvMax.GetHashCode();
|
|
}
|
|
}
|
|
|
|
public struct ATaskTemplFixedData
|
|
{
|
|
/* Task object properties */
|
|
|
|
// Task ID
|
|
public uint m_ID;
|
|
// Task name
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskConstant.MAX_TASK_NAME_LEN)]
|
|
public ushort[] m_szName;
|
|
// Task signature
|
|
public bool m_bHasSign;
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskConstant.MAX_TASK_NAME_LEN)]
|
|
public ushort[] m_pszSignature;
|
|
// Task type
|
|
public uint m_ulType;
|
|
// Time limit
|
|
public uint m_ulTimeLimit;
|
|
|
|
// Task fails when offline
|
|
public bool m_bOfflineFail;
|
|
|
|
// Absolute failure time
|
|
public bool m_bAbsFail;
|
|
public task_tm m_tmAbsFailTime;
|
|
|
|
// Do not take items during task validation
|
|
public bool m_bItemNotTakeOff;
|
|
|
|
// Whether using absolute time
|
|
public bool m_bAbsTime;
|
|
// Number of time periods
|
|
public ulong m_ulTimetable;
|
|
// Time method
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskConstant.MAX_TIMETABLE_SIZE)]
|
|
public byte[] m_tmType;
|
|
// Start time for delivery
|
|
public task_tm[] m_tmStart; // [MAX_TIMETABLE_SIZE]
|
|
// End time for delivery
|
|
public task_tm[] m_tmEnd; // [MAX_TIMETABLE_SIZE]
|
|
// Delivery frequency
|
|
public long m_lAvailFrequency;
|
|
public long 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;
|
|
// Whether 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 on abandonment
|
|
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;
|
|
// Delivery zone
|
|
public bool m_bDelvInZone;
|
|
public uint m_ulDelvWorld;
|
|
public uint m_ulDelvRegionCnt;
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskConstant.MAX_TASKREGION)]
|
|
public Task_Region[] m_pDelvRegion;
|
|
|
|
// Enter region task failure
|
|
public bool m_bEnterRegionFail;
|
|
public uint m_ulEnterRegionWorld;
|
|
public uint m_ulEnterRegionCnt;
|
|
//public ZONE_VERT m_EnterRegionMinVert;
|
|
//public ZONE_VERT m_EnterRegionMaxVert;
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskConstant.MAX_TASKREGION)]
|
|
public Task_Region[] m_pEnterRegion;
|
|
|
|
// Leave region task failure
|
|
public bool m_bLeaveRegionFail;
|
|
public uint m_ulLeaveRegionWorld;
|
|
public uint m_ulLeaveRegionCnt;
|
|
//public ZONE_VERT m_LeaveRegionMinVert;
|
|
//public ZONE_VERT m_LeaveRegionMaxVert;
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TaskConstant.MAX_TASKREGION)]
|
|
public Task_Region[] m_pLeaveRegion;
|
|
|
|
// Leave force failure
|
|
public bool m_bLeaveForceFail;
|
|
|
|
// Transport 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;
|
|
public long[] m_plChangeKey; // [TASK_AWARD_MAX_CHANGE_VALUE]
|
|
public long[] m_plChangeKeyValue;
|
|
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 start
|
|
// 是否是PQ任务
|
|
public bool m_bPQTask;
|
|
// PQ任务全局变量显示
|
|
public uint m_ulPQExpCnt;
|
|
|
|
|
|
|
|
|
|
public uint m_ulNPCToProtect;
|
|
public uint m_ulProtectTimeLen;
|
|
public uint m_enumMethod;
|
|
public uint m_enumFinishType;
|
|
|
|
// Required items
|
|
public ulong m_ulPremItems;
|
|
// public ItemWanted[] m_PremItems; // [MAX_ITEM_WANTED]
|
|
public bool m_bShowByItems;
|
|
public bool m_bPremItemsAnyOne;
|
|
|
|
// Level condition
|
|
public ulong m_ulPremise_Lev_Min;
|
|
public ulong m_ulPremise_Lev_Max;
|
|
public ulong m_bPremCheckMaxHistoryLevel;
|
|
public bool m_bShowByLev;
|
|
|
|
// Dynamic task type
|
|
public string m_DynTaskType;
|
|
|
|
// Special award ID, used for events
|
|
public ulong m_ulSpecialAward;
|
|
// Whether to display in the title task UI
|
|
public bool m_bDisplayInTitleTaskUI;
|
|
|
|
|
|
|
|
}
|
|
public class ATaskTempl
|
|
{
|
|
public ATaskTemplFixedData m_FixedData;
|
|
|
|
//Hierarchy
|
|
public ATaskTempl m_pParent;
|
|
public ATaskTempl m_pPrevSibling;
|
|
public ATaskTempl m_pNextSibling;
|
|
public ATaskTempl m_pFirstChild;
|
|
|
|
const int MAX_TASK_NAME_LEN = 30;
|
|
public byte m_uValidCount;
|
|
public bool LoadFromBinFile(FileStream fp)
|
|
{
|
|
LoadBinary(fp);
|
|
// CheckDepth();
|
|
return true;
|
|
}
|
|
private void LoadBinary(FileStream fp)
|
|
{
|
|
LoadFixedDataFromBinFile(fp);
|
|
// LoadDescriptionBin(fp);
|
|
// LoadTributeBin(fp);
|
|
|
|
//# ifndef _TASK_CLIENT
|
|
// CheckMask();
|
|
//#else
|
|
// SyncTaskType();
|
|
//#endif
|
|
|
|
|
|
// namechar code = (namechar)m_ID;
|
|
|
|
// m_DelvTaskTalk.load(fp);
|
|
// convert_talk_text(&m_DelvTaskTalk, code);
|
|
|
|
// m_UnqualifiedTalk.load(fp);
|
|
// convert_talk_text(&m_UnqualifiedTalk, code);
|
|
|
|
// m_DelvItemTalk.load(fp);
|
|
// convert_talk_text(&m_DelvItemTalk, code);
|
|
|
|
// m_ExeTalk.load(fp);
|
|
// convert_talk_text(&m_ExeTalk, code);
|
|
|
|
// m_AwardTalk.load(fp);
|
|
// convert_talk_text(&m_AwardTalk, code);
|
|
|
|
// fread(&m_nSubCount, sizeof(m_nSubCount), 1, fp);
|
|
|
|
// for (int i = 0; i < m_nSubCount; i++)
|
|
// {
|
|
// ATaskTempl* pSub = new ATaskTempl;
|
|
// g_ulNewCount++;
|
|
// AddSubTaskTempl(pSub);
|
|
// pSub->LoadBinary(fp);
|
|
// }
|
|
|
|
// SynchID();
|
|
//return true;
|
|
}
|
|
private bool LoadFixedDataFromBinFile(FileStream fp)
|
|
{
|
|
|
|
ulong i;
|
|
long readBytes = 0;
|
|
ATaskTemplFixedData fixedData = AAssit.ReadFromBinaryOf<ATaskTemplFixedData>(fp, ref readBytes);
|
|
|
|
//convert_txt(m_szName, MAX_TASK_NAME_LEN, (namechar)m_ID);
|
|
|
|
// m_Award_S = new AWARD_DATA;
|
|
// g_ulNewCount++;
|
|
// m_Award_F = new AWARD_DATA;
|
|
// g_ulNewCount++;
|
|
// m_AwByRatio_S = new AWARD_RATIO_SCALE;
|
|
// g_ulNewCount++;
|
|
// m_AwByRatio_F = new AWARD_RATIO_SCALE;
|
|
// g_ulNewCount++;
|
|
// m_AwByItems_S = new AWARD_ITEMS_SCALE;
|
|
// g_ulNewCount++;
|
|
// m_AwByItems_F = new AWARD_ITEMS_SCALE;
|
|
// g_ulNewCount++;
|
|
// m_tmStart = NULL;
|
|
// m_tmEnd = NULL;
|
|
// m_plChangeKey = NULL;
|
|
// m_plChangeKeyValue = NULL;
|
|
// m_pbChangeType = NULL;
|
|
// m_PremItems = NULL;
|
|
// m_GivenItems = NULL;
|
|
// m_TeamMemsWanted= NULL;
|
|
// m_ItemsWanted = NULL;
|
|
// m_PlayerWanted = NULL;
|
|
// m_MonsterWanted = NULL;
|
|
// m_pszSignature = NULL;
|
|
// m_pszExp = NULL;
|
|
// m_pExpArr = NULL;
|
|
// m_pTaskChar = NULL;
|
|
// m_pszPQExp = NULL;
|
|
// m_pPQExpArr = NULL;
|
|
// m_MonstersContrib = NULL;
|
|
// m_PremTitles = NULL;
|
|
|
|
// 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 (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 (m_ulChangeKeyCnt)
|
|
// {
|
|
// m_plChangeKey = new long[m_ulChangeKeyCnt];
|
|
// m_plChangeKeyValue = new long[m_ulChangeKeyCnt];
|
|
// m_pbChangeType = new bool[m_ulChangeKeyCnt];
|
|
// }
|
|
|
|
// for (i=0; i<m_ulChangeKeyCnt; i++)
|
|
// {
|
|
// fread(&m_plChangeKey[i], sizeof(long), 1, fp);
|
|
// fread(&m_plChangeKeyValue[i], sizeof(long), 1, fp);
|
|
// fread(&m_pbChangeType[i], sizeof(bool), 1, fp);
|
|
// }
|
|
|
|
// 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<m_ulPQExpCnt; i++)
|
|
// {
|
|
// fread(m_pszPQExp[i], 1, TASK_AWARD_MAX_DISPLAY_CHAR_LEN, fp);
|
|
// fread(m_pPQExpArr[i], sizeof(TASK_EXPRESSION), TASK_AWARD_MAX_DISPLAY_CHAR_LEN, fp);
|
|
// }
|
|
// }
|
|
|
|
// if (m_ulMonsterContribCnt)
|
|
// {
|
|
// m_MonstersContrib = new MONSTERS_CONTRIB[m_ulMonsterContribCnt];
|
|
// g_ulNewCount++;
|
|
// }
|
|
|
|
// for (i = 0; i < m_ulMonsterContribCnt; i++)
|
|
// {
|
|
// MONSTERS_CONTRIB& mc = m_MonstersContrib[i];
|
|
// fread(&mc, sizeof(mc), 1, fp);
|
|
// }
|
|
|
|
// // version 80
|
|
// if (m_ulDelvRegionCnt>0)
|
|
// {
|
|
// m_pDelvRegion = new Task_Region[m_ulDelvRegionCnt];
|
|
// g_ulNewCount++;
|
|
// }
|
|
// else m_pDelvRegion = NULL;
|
|
|
|
// for (i=0;i<m_ulDelvRegionCnt;i++)
|
|
// {
|
|
// Task_Region& t = m_pDelvRegion[i];
|
|
// fread(&t,sizeof(Task_Region),1,fp);
|
|
// }
|
|
// if (m_ulEnterRegionCnt>0)
|
|
// {
|
|
// m_pEnterRegion = new Task_Region[m_ulEnterRegionCnt];
|
|
// g_ulNewCount++;
|
|
// }
|
|
// else m_pEnterRegion = NULL;
|
|
|
|
// for (i=0;i<m_ulEnterRegionCnt;i++)
|
|
// {
|
|
// Task_Region& t = m_pEnterRegion[i];
|
|
// fread(&t,sizeof(Task_Region),1,fp);
|
|
// }
|
|
// if (m_ulLeaveRegionCnt>0)
|
|
// {
|
|
// m_pLeaveRegion = new Task_Region[m_ulLeaveRegionCnt];
|
|
// g_ulNewCount++;
|
|
// }
|
|
// else m_pLeaveRegion = NULL;
|
|
|
|
// for (i=0;i<m_ulLeaveRegionCnt;i++)
|
|
// {
|
|
// Task_Region& t = m_pLeaveRegion[i];
|
|
// fread(&t,sizeof(Task_Region),1,fp);
|
|
// }
|
|
|
|
// // ÈÎÎñ¿ªÆôÌõ¼þ¼°·½Ê½
|
|
// if (m_ulPremItems)
|
|
// {
|
|
// m_PremItems = new ITEM_WANTED[m_ulPremItems];
|
|
// g_ulNewCount++;
|
|
// }
|
|
|
|
// for (i = 0; i < m_ulPremItems; i++)
|
|
// {
|
|
// ITEM_WANTED& iw = m_PremItems[i];
|
|
// fread(&iw, sizeof(iw), 1, fp);
|
|
// }
|
|
|
|
// m_ulGivenCmnCount = 0;
|
|
// m_ulGivenTskCount = 0;
|
|
|
|
// if (m_ulGivenItems)
|
|
// {
|
|
// m_GivenItems = new ITEM_WANTED[m_ulGivenItems];
|
|
// g_ulNewCount++;
|
|
// }
|
|
|
|
// for (i = 0; i < m_ulGivenItems; i++)
|
|
// {
|
|
// ITEM_WANTED& iw = m_GivenItems[i];
|
|
// fread(&iw, sizeof(iw), 1, fp);
|
|
|
|
// if (iw.m_bCommonItem) m_ulGivenCmnCount++;
|
|
// else m_ulGivenTskCount++;
|
|
// }
|
|
|
|
// if (m_bTeamwork)
|
|
// {
|
|
// if (m_ulTeamMemsWanted)
|
|
// {
|
|
// m_TeamMemsWanted = new TEAM_MEM_WANTED[m_ulTeamMemsWanted];
|
|
// g_ulNewCount++;
|
|
// }
|
|
|
|
// for (i = 0; i < m_ulTeamMemsWanted; i++)
|
|
// {
|
|
// TEAM_MEM_WANTED& tmw = m_TeamMemsWanted[i];
|
|
// fread(&tmw, sizeof(tmw), 1, fp);
|
|
// }
|
|
// }
|
|
// if (m_iPremTitleNumTotal)
|
|
// {
|
|
// m_PremTitles = new int[m_iPremTitleNumTotal];
|
|
// g_ulNewCount++;
|
|
// for (i = 0; i < m_iPremTitleNumTotal; i++)
|
|
// {
|
|
// fread(&m_PremTitles[i], sizeof(int), 1, fp);
|
|
// }
|
|
// }
|
|
|
|
// /* ÈÎÎñÍê³ÉµÄ·½Ê½¼°Ìõ¼þ */
|
|
|
|
// if (m_ulMonsterWanted)
|
|
// {
|
|
// m_MonsterWanted = new MONSTER_WANTED[m_ulMonsterWanted];
|
|
// g_ulNewCount++;
|
|
// }
|
|
|
|
// for (i = 0; i < m_ulMonsterWanted; i++)
|
|
// {
|
|
// MONSTER_WANTED& mw = m_MonsterWanted[i];
|
|
// fread(&mw, sizeof(mw), 1, fp);
|
|
// }
|
|
|
|
// if (m_ulPlayerWanted)
|
|
// {
|
|
// m_PlayerWanted = new PLAYER_WANTED[m_ulPlayerWanted];
|
|
// g_ulNewCount++;
|
|
// }
|
|
// for (i = 0; i < m_ulPlayerWanted; ++i)
|
|
// {
|
|
// PLAYER_WANTED& pw = m_PlayerWanted[i];
|
|
// fread(&pw, sizeof(pw), 1, fp);
|
|
// }
|
|
|
|
// if (m_ulItemsWanted)
|
|
// {
|
|
// m_ItemsWanted = new ITEM_WANTED[m_ulItemsWanted];
|
|
// g_ulNewCount++;
|
|
// }
|
|
|
|
// for (i = 0; i < m_ulItemsWanted; i++)
|
|
// {
|
|
// ITEM_WANTED& iw = m_ItemsWanted[i];
|
|
// fread(&iw, sizeof(iw), 1, fp);
|
|
// }
|
|
|
|
// if (m_ulExpCnt)
|
|
// {
|
|
// m_pszExp = new char[m_ulExpCnt][TASK_AWARD_MAX_DISPLAY_CHAR_LEN];
|
|
// memset(m_pszExp, 0, m_ulExpCnt*TASK_AWARD_MAX_DISPLAY_CHAR_LEN);
|
|
|
|
// m_pExpArr = new TASK_EXPRESSION[m_ulExpCnt][TASK_AWARD_MAX_DISPLAY_CHAR_LEN];
|
|
// memset(m_pExpArr, 0, sizeof(TASK_EXPRESSION)*m_ulExpCnt*TASK_AWARD_MAX_DISPLAY_CHAR_LEN);
|
|
|
|
// for (i=0; i<m_ulExpCnt; i++)
|
|
// {
|
|
// fread(m_pszExp[i], 1, TASK_AWARD_MAX_DISPLAY_CHAR_LEN, fp);
|
|
// fread(m_pExpArr[i], sizeof(TASK_EXPRESSION), TASK_AWARD_MAX_DISPLAY_CHAR_LEN, fp);
|
|
// }
|
|
// }
|
|
|
|
// if (m_ulTaskCharCnt)
|
|
// {
|
|
// m_pTaskChar = new task_char[m_ulTaskCharCnt][TASK_AWARD_MAX_DISPLAY_CHAR_LEN];
|
|
// memset(m_pTaskChar, 0, sizeof(task_char)*m_ulTaskCharCnt*TASK_AWARD_MAX_DISPLAY_CHAR_LEN);
|
|
|
|
// for (i=0; i<m_ulTaskCharCnt; i++)
|
|
// {
|
|
// fread(m_pTaskChar[i], sizeof(task_char), TASK_AWARD_MAX_DISPLAY_CHAR_LEN, fp);
|
|
// }
|
|
// }
|
|
|
|
// // version 80
|
|
// if (m_ulReachSiteCnt>0)
|
|
// {
|
|
// m_pReachSite = new Task_Region[m_ulReachSiteCnt];
|
|
// g_ulNewCount++;
|
|
// }
|
|
// else m_pReachSite = NULL;
|
|
|
|
// for (i=0;i<m_ulReachSiteCnt;i++)
|
|
// {
|
|
// Task_Region& t = m_pReachSite[i];
|
|
// fread(&t,sizeof(Task_Region),1,fp);
|
|
// }
|
|
// if (m_ulLeaveSiteCnt>0)
|
|
// {
|
|
// m_pLeaveSite = new Task_Region[m_ulLeaveSiteCnt];
|
|
// g_ulNewCount++;
|
|
// }
|
|
// else m_pLeaveSite = NULL;
|
|
|
|
// for (i=0;i<m_ulLeaveSiteCnt;i++)
|
|
// {
|
|
// Task_Region& t = m_pLeaveSite[i];
|
|
// fread(&t,sizeof(Task_Region),1,fp);
|
|
// }
|
|
|
|
// LoadAwardDataBin(fp, *m_Award_S, _task_templ_cur_version);
|
|
// LoadAwardDataBin(fp, *m_Award_F, _task_templ_cur_version);
|
|
|
|
// LoadAwardDataRatioScale(fp, *m_AwByRatio_S, _task_templ_cur_version);
|
|
// LoadAwardDataRatioScale(fp, *m_AwByRatio_F, _task_templ_cur_version);
|
|
|
|
// LoadAwardDataItemsScale(fp, *m_AwByItems_S, _task_templ_cur_version);
|
|
// LoadAwardDataItemsScale(fp, *m_AwByItems_F, _task_templ_cur_version);
|
|
|
|
return true;
|
|
}
|
|
|
|
string ConvertTxt(string str, char code)
|
|
{
|
|
char[] chars = str.ToCharArray();
|
|
for (int i = 0; i < chars.Length; i++)
|
|
{
|
|
chars[i] = (char)(chars[i] ^ code);
|
|
}
|
|
return new string(chars);
|
|
}
|
|
|
|
public void IncValidCount() { m_uValidCount++; }
|
|
|
|
}
|
|
} |