--Type:0 属性 1 技能
--TypeID:Type为0时属性枚举 Type为1时技能ID
local SurvivorNode =  {
	[01] = {["Type"] = 0, ["TypeID"] = 1, ["Value"] = 200,		["MiniIcon"] = "xingcunzhewanfa_buffx18",  ["Icon"] = "xingcunzhewanfa_buff18", ["Quality"] = 1,},
	[02] = {["Type"] = 0, ["TypeID"] = 1, ["Value"] = 400,		["MiniIcon"] = "xingcunzhewanfa_buffx18",  ["Icon"] = "xingcunzhewanfa_buff18", ["Quality"] = 2,},
	[03] = {["Type"] = 0, ["TypeID"] = 1, ["Value"] = 600,		["MiniIcon"] = "xingcunzhewanfa_buffx18",  ["Icon"] = "xingcunzhewanfa_buff18", ["Quality"] = 3,},
	[04] = {["Type"] = 0, ["TypeID"] = 1, ["Value"] = 800,		["MiniIcon"] = "xingcunzhewanfa_buffx18",  ["Icon"] = "xingcunzhewanfa_buff18", ["Quality"] = 4,},
	[05] = {["Type"] = 0, ["TypeID"] = 34, ["Value"] = 100,		["MiniIcon"] = "xingcunzhewanfa_buffx20",  ["Icon"] = "xingcunzhewanfa_buff20", ["Quality"] = 1,},
	[06] = {["Type"] = 0, ["TypeID"] = 34, ["Value"] = 200,		["MiniIcon"] = "xingcunzhewanfa_buffx20",  ["Icon"] = "xingcunzhewanfa_buff20", ["Quality"] = 2,},
	[07] = {["Type"] = 0, ["TypeID"] = 34, ["Value"] = 300,		["MiniIcon"] = "xingcunzhewanfa_buffx20",  ["Icon"] = "xingcunzhewanfa_buff20", ["Quality"] = 3,},
	[08] = {["Type"] = 0, ["TypeID"] = 34, ["Value"] = 400,		["MiniIcon"] = "xingcunzhewanfa_buffx20",  ["Icon"] = "xingcunzhewanfa_buff20", ["Quality"] = 4,},
	[09] = {["Type"] = 0, ["TypeID"] = 10, ["Value"] = 5,		["MiniIcon"] = "xingcunzhewanfa_buffx1",  ["Icon"] = "xingcunzhewanfa_buff1", ["Quality"] = 1,},
	[10] = {["Type"] = 0, ["TypeID"] = 10, ["Value"] = 10,		["MiniIcon"] = "xingcunzhewanfa_buffx1",  ["Icon"] = "xingcunzhewanfa_buff1", ["Quality"] = 2,},
	[11] = {["Type"] = 0, ["TypeID"] = 10, ["Value"] = 15,		["MiniIcon"] = "xingcunzhewanfa_buffx1",  ["Icon"] = "xingcunzhewanfa_buff1", ["Quality"] = 3,},
	[12] = {["Type"] = 0, ["TypeID"] = 10, ["Value"] = 20,		["MiniIcon"] = "xingcunzhewanfa_buffx1",  ["Icon"] = "xingcunzhewanfa_buff1", ["Quality"] = 4,},
	[13] = {["Type"] = 0, ["TypeID"] = 36, ["Value"] = 20,		["MiniIcon"] = "xingcunzhewanfa_buffx2",  ["Icon"] = "xingcunzhewanfa_buff2", ["Quality"] = 1,},
	[14] = {["Type"] = 0, ["TypeID"] = 36, ["Value"] = 40,		["MiniIcon"] = "xingcunzhewanfa_buffx2",  ["Icon"] = "xingcunzhewanfa_buff2", ["Quality"] = 2,},
	[15] = {["Type"] = 0, ["TypeID"] = 36, ["Value"] = 60,		["MiniIcon"] = "xingcunzhewanfa_buffx2",  ["Icon"] = "xingcunzhewanfa_buff2", ["Quality"] = 3,},
	[16] = {["Type"] = 0, ["TypeID"] = 36, ["Value"] = 90,		["MiniIcon"] = "xingcunzhewanfa_buffx2",  ["Icon"] = "xingcunzhewanfa_buff2", ["Quality"] = 4,},
	[17] = {["Type"] = 0, ["TypeID"] = 37, ["Value"] = 5,		["MiniIcon"] = "xingcunzhewanfa_buffx8",  ["Icon"] = "xingcunzhewanfa_buff8", ["Quality"] = 1,},
	[18] = {["Type"] = 0, ["TypeID"] = 37, ["Value"] = 10,		["MiniIcon"] = "xingcunzhewanfa_buffx8",  ["Icon"] = "xingcunzhewanfa_buff8", ["Quality"] = 2,},
	[19] = {["Type"] = 0, ["TypeID"] = 37, ["Value"] = 15,		["MiniIcon"] = "xingcunzhewanfa_buffx8",  ["Icon"] = "xingcunzhewanfa_buff8", ["Quality"] = 3,},
	[20] = {["Type"] = 0, ["TypeID"] = 37, ["Value"] = 20,		["MiniIcon"] = "xingcunzhewanfa_buffx8",  ["Icon"] = "xingcunzhewanfa_buff8", ["Quality"] = 4,},
	[21] = {["Type"] = 1, ["TypeID"] = 24550, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx17",  ["Icon"] = "xingcunzhewanfa_buff17", ["Quality"] = 1,},
	[22] = {["Type"] = 1, ["TypeID"] = 24560, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx7",  ["Icon"] = "xingcunzhewanfa_buff7", ["Quality"] = 1,},
	[23] = {["Type"] = 1, ["TypeID"] = 24570, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx5",  ["Icon"] = "xingcunzhewanfa_buff5", ["Quality"] = 1,},
	[24] = {["Type"] = 1, ["TypeID"] = 24580, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx11",  ["Icon"] = "xingcunzhewanfa_buff11", ["Quality"] = 1,},
	[25] = {["Type"] = 1, ["TypeID"] = 24590, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx13",  ["Icon"] = "xingcunzhewanfa_buff13", ["Quality"] = 1,},
	[26] = {["Type"] = 1, ["TypeID"] = 24600, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx6",  ["Icon"] = "xingcunzhewanfa_buff6", ["Quality"] = 1,},
	[27] = {["Type"] = 1, ["TypeID"] = 24610, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx12",  ["Icon"] = "xingcunzhewanfa_buff12", ["Quality"] = 1,},
	[28] = {["Type"] = 1, ["TypeID"] = 24870, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx24",  ["Icon"] = "xingcunzhewanfa_buff24", ["Quality"] = 1,},
	[29] = {["Type"] = 1, ["TypeID"] = 24630, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx4",  ["Icon"] = "xingcunzhewanfa_buff4", ["Quality"] = 1,},
	[30] = {["Type"] = 1, ["TypeID"] = 24640, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx21",  ["Icon"] = "xingcunzhewanfa_buff21", ["Quality"] = 1,},
	[31] = {["Type"] = 1, ["TypeID"] = 24880, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx25",  ["Icon"] = "xingcunzhewanfa_buff25", ["Quality"] = 1,},
	[32] = {["Type"] = 1, ["TypeID"] = 24890, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx23",  ["Icon"] = "xingcunzhewanfa_buff23", ["Quality"] = 1,},
	-- [33] = {["Type"] = 1, ["TypeID"] = 24670, ["Value"] = 0,	["MiniIcon"] = "xingcunzhewanfa_buffx9",  ["Icon"] = "xingcunzhewanfa_buff9", ["Quality"] = 1,},
	[33] = {["Type"] = 0, ["TypeID"] = 7, ["Value"] = 100,		["MiniIcon"] = "xingcunzhewanfa_buffx19",  ["Icon"] = "xingcunzhewanfa_buff19", ["Quality"] = 1,},
	[34] = {["Type"] = 0, ["TypeID"] = 7, ["Value"] = 200,		["MiniIcon"] = "xingcunzhewanfa_buffx19",  ["Icon"] = "xingcunzhewanfa_buff19", ["Quality"] = 2,},
	[35] = {["Type"] = 0, ["TypeID"] = 7, ["Value"] = 300,		["MiniIcon"] = "xingcunzhewanfa_buffx19",  ["Icon"] = "xingcunzhewanfa_buff19", ["Quality"] = 3,},
	[36] = {["Type"] = 0, ["TypeID"] = 7, ["Value"] = 400,		["MiniIcon"] = "xingcunzhewanfa_buffx19",  ["Icon"] = "xingcunzhewanfa_buff19", ["Quality"] = 4,},
}

local SurvivorGameTypeBaseInfo = {
	-- 奖励重置花费类型 0:金币 1:天石 
	-- 奖励重置花费类型 0:金币 1:天石 
	-- ["InstanceCostItem"] 副本进入消耗物品ItemType
	--["InstanceCostNum"] 副本进入消耗的物品数量
	["InstanceCostItem"] = 3348519,
	["InstanceCostNum"] = 3,
	["BaseLife"] = 1000,
	["ResetCostType"] = 0,
	["ResetCostValue"] = 50000,
	["RankCrossdata0"] = 35276,
    ["RankCrossdata1"] = 76,
}

local SurvivorUplev = {
	[00] = 0,
	[01] = 600,
	[02] = 1300,
	[03] = 2100,
	[04] = 3000,
	[05] = 4000,
	[06] = 5100,
	[07] = 6300,
	[08] = 7600,
	[09] = 9000,
	[10] = 10500,
	[11] = 12100,
	[12] = 13800,
	[13] = 15600,
	[14] = 17500,
	[15] = 19500,
	[16] = 21600,
	[17] = 23800,
	[18] = 26100,
	[19] = 28500,
	[20] = 31100,
	[21] = 34100,
	[22] = 37300,
	[23] = 40700,
	[24] = 44300,
	[25] = 48100,
	[26] = 52100,
	[27] = 56300,
	[28] = 60700,
	[29] = 65300,
	[30] = 70100,
	[31] = 75100,
	[32] = 80300,
	[33] = 85700,
	[34] = 91300,
	[35] = 97100,
	[36] = 103100,
	[37] = 109200,
	[38] = 115400,
	[39] = 121700,
	[40] = 128100,
	[41] = 134600,
	[42] = 141200,
	[43] = 147900,
	[44] = 154700,
	[45] = 161600,
	[46] = 168600,
	[47] = 175700,
	[48] = 182900,
	[49] = 190200,
	[50] = 197600,
	[51] = 205100,
	[52] = 212700,
	[53] = 220400,
	[54] = 228200,
	[55] = 236100,
	[56] = 244100,
	[57] = 252200,
	[58] = 260400,
	[59] = 268700,
	[60] = 277100,
}

-- 排名奖励
local RankRewardInfo = {
	[1] = {
		[1] = 3348792,
	},
	[2] = {
		[1] = 3348793,
	},
	[3] = {
		[1] = 3348794,
	},
	[4] = {
		[1] = 3348795,
	},
}

-- 副本入口奖励
local InstanceDlgRewardInfo = {
	--ItemType * 10 + Monopoly
	[1] = 33483770,
	[2] = 7300021,
	[3] = 30090010,
	[4] = 40600011,
}

local function GetInstanceDlgRewardInfo(index, key)
	if index == "Count" then
		return #InstanceDlgRewardInfo
	end

	if InstanceDlgRewardInfo[index]== nil then
		return nil
	end

	if key == "ItemType" then
		return InstanceDlgRewardInfo[index] / 10
	elseif key == "Monopoly" then
		return InstanceDlgRewardInfo[index] % 10
	end

	return InstanceDlgRewardInfo[index]
end



local function GetRankRewardInfo(index, index2)
	if RankRewardInfo[index] == nil then
		return nil
	end

	if index2 == "Count" then
		return #RankRewardInfo[index]
	end

	if RankRewardInfo[index][index2] == nil then
		return nil
	end

	return RankRewardInfo[index][index2]
end

local function GetGradeImgInfo(score)
	if score >= 0 and score < 500 then
		return "tongyong_pfc"
	elseif score >= 500 and score < 600 then
		return "tongyong_pfb"
	elseif score >= 600 and score < 700 then
		return "tongyong_pfa"
	elseif score >= 700 and score < 800 then
		return "tongyong_pfs"
	elseif score >= 800 and score < 900 then
		return "tongyong_pfss"
	elseif score >= 900 then
		return "tongyong_pfsss"
	end

	return 0
end

local function GetNodeIdByTypeID(idTypeID)
	for k,v in pairs(SurvivorNode) do
		if v.TypeID == idTypeID then
			return k
		end
	end
end

local function GetSurvivorUplev(lev)
	if SurvivorUplev[lev] ~= nil then
		return SurvivorUplev[lev] 
	end
end

local function GetSurvivorNodeInfo(Index, Key)
	if SurvivorNode[Index][Key] ~= nil then
		return SurvivorNode[Index][Key]
	end
end

local function GetSurvivorGameTypeBaseInfo(key)
	if SurvivorGameTypeBaseInfo[key] ~= nil then
		return SurvivorGameTypeBaseInfo[key]
	end
end

-- 清理变量释放内存
local function Unload()
	GetSurvivorGameTypeBaseInfo = nil
	GetSurvivorNodeInfo = nil
	GetSurvivorUplev = nil
end

-- 通过require传给其他Lua脚本使用
local Survivor = {
	GetSurvivorNodeInfo = GetSurvivorNodeInfo,
	GetSurvivorGameTypeBaseInfo = GetSurvivorGameTypeBaseInfo,
	GetSurvivorUplev = GetSurvivorUplev,
	GetRankRewardInfo = GetRankRewardInfo,
	GetGradeImgInfo = GetGradeImgInfo,
	GetNodeIdByTypeID = GetNodeIdByTypeID,
	GetInstanceDlgRewardInfo = GetInstanceDlgRewardInfo,
	Unload = Unload,
}

-- C++程序使用的global函数名
Survivor_GetSurvivorNodeInfo = Survivor.GetSurvivorNodeInfo
Survivor_GetSurvivorGameTypeBaseInfo = Survivor.GetSurvivorGameTypeBaseInfo
Survivor_GetSurvivorUplev = Survivor.GetSurvivorUplev
Survivor_GetNodeIdByTypeID= Survivor.GetNodeIdByTypeID
Survivor_GetRankRewardInfo = Survivor.GetRankRewardInfo
Survivor_GetGradeImgInfo = Survivor.GetGradeImgInfo
Survivor_GetInstanceDlgRewardInfo = Survivor.GetInstanceDlgRewardInfo
Survivor_Unload = Survivor.Unload

-- require返回值
return Survivor

