local Num = 2
local ALL_SERVERHUNT=1
local CROSS_SERVERHUNT = 2

local Task = {
    [1] = {
        id=2111,
        type=1,
        BeginTime=20210420000000,
        EndTime=20210517235959,
        pic="XunBao_TB1",
        ItemType="3334598:1:0,730004:1:1,3009101:1:0,3321077:1:0",  -- 字符串显示，用“，”隔开，第一位ID，第二位数量，第三位0表示非赠，1表示赠品
        ItemNeed=3600340,
        MapBg="XunBao_BG3",
        DebrisSerialPic="XunBao_Map",
        DebrisNum=12,
        TitlePic="XunBao_TB1",                  ------新增标题图片下面的都是测试图片
    },
    [2] = {
        id=2112,
        type=1,
        BeginTime=20210420000000,
        EndTime=20210517235959,
        pic="XunBao_TB1",
        ItemType="3334599:1:0,730005:1:1,3009101:1:0,4060001:15:1",
        ItemNeed=3600341,
        MapBg="XunBao_BG3",
        DebrisSerialPic="XunBao_Map",
        DebrisNum=12,
        TitlePic="XunBao_TB1",                  ------新增标题图片下面的都是测试图片
    },
}

local function GetNum()
    return Num
end
local function GetTaskInfo(index,key)
    local task = Task[index]
    
    if (task ~= nil) then
        local ret = task[key]
		if (ret ~= nil) then
			return ret
		end
	end
	return nil
end


---------------------------------------------------------------------------------------------------------------------------------------------------------
local global_Info = {
    --全服寻宝开启时间
    -- ["Time"] = 20220320235959,
    --寻获奖励界面的显示时间
    ["ShowTime"] = 5000,
    --寻获奖励界面的物品底框
    ["ItemBg"] = "NewJiuGong_Item1Pic",
    --奖励物品为几个是的偏移，为了居中
    ["RewardNumOffset1"] = 128,
    ["RewardNumOffset2"] = 96,
    ["RewardNumOffset3"] = 64,
    ["RewardNumOffset4"] = 32,
    ["RewardNumOffset5"] = 0,
	["data0"] = 300,
    ["data1"] = 76,
    --全服开启时间，原先的[Time]变成Time1
    ["Time1"] = 2411260000,
    ["Time2"] = 2412092359,

    --跨服数据
    ["Time3"] = 2301170000,
    ["Time4"] = 2302062359,
    ["Crossdata0"] = 35203,
    ["Crossdata1"] = 76,
} 

local PlaceIndex = {
    [0] = 1,
    [1] = 2,
    [2] = 3,
    [3] = 4,
    [4] = 5,
    [5] = 6,
    [6] = 7,
    [7] = 8,
    [8] = 9,
    [9] = 10,
    [10] = 11,
    [11] = 12,
}

local CrossPlaceIndex = {
    [0] = 13,
    [1] = 14,
    [2] = 15,
    [3] = 16,
    [4] = 17,
    [5] = 18,
    [6] = 19,
    [7] = 20,
}

--全服寻宝区域信息
local PlaceInfo = {
    --这个id与Task集合的id不能重复
    [001] = {
        --该地区的详细信息中的奖励索引
        ["RewardId1"] = 1001,
        ["RewardId2"] = 1001,
        ["RewardId3"] = 1001,
        ["RewardId4"] = 1001,
        ["RewardId5"] = 1001,
        ["RewardId6"] = 1001,
        ["RewardId7"] = 1001,
        ["RewardId8"] = 1001,
        --该地区的地图图片
        ["Ani"]="XunBao_xmap1", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\1_0.rgn",
        --该地区宝箱的最大值
        ["NaxNum"] = 90,
        --地区名字
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME1",
    },
    [002] = {
        ["RewardId1"] = 1002,
        ["RewardId2"] = 1002,
        ["RewardId3"] = 1002,
        ["RewardId4"] = 1002,
        ["RewardId5"] = 1002,
        ["RewardId6"] = 1002,
        ["RewardId7"] = 1002,
        ["RewardId8"] = 1002,
        ["Ani"]="XunBao_xmap2", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\2_0.rgn",
        ["NaxNum"] = 15,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME2",
    },
    [003] = {
        ["RewardId1"] = 1003,
        ["RewardId2"] = 1003,
        ["RewardId3"] = 1003,
        ["RewardId4"] = 1003,
        ["RewardId5"] = 1003,
        ["RewardId6"] = 1003,
        ["RewardId7"] = 1003,
        ["RewardId8"] = 1003,
        ["Ani"]="XunBao_xmap3", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\3_0.rgn",
        ["NaxNum"] = 90,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME3",
    },
    [004] = {
        ["RewardId1"] = 1004,
        ["RewardId2"] = 1004,
        ["RewardId3"] = 1004,
        ["RewardId4"] = 1004,
        ["RewardId5"] = 1004,
        ["RewardId6"] = 1004,
        ["RewardId7"] = 1004,
        ["RewardId8"] = 1004,
        ["Ani"]="XunBao_xmap4", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\4_0.rgn",
        ["NaxNum"] = 45,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME4",
    },
    [005] = {
        ["RewardId1"] = 1005,
        ["RewardId2"] = 1005,
        ["RewardId3"] = 1005,
        ["RewardId4"] = 1005,
        ["RewardId5"] = 1005,
        ["RewardId6"] = 1005,
        ["RewardId7"] = 1005,
        ["RewardId8"] = 1005,
        ["Ani"]="XunBao_xmap5", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\5_0.rgn",
        ["NaxNum"] = 45,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME5",
    },
    [006] = {
        ["RewardId1"] = 1006,
        ["RewardId2"] = 1006,
        ["RewardId3"] = 1006,
        ["RewardId4"] = 1006,
        ["RewardId5"] = 1006,
        ["RewardId6"] = 1006,
        ["RewardId7"] = 1006,
        ["RewardId8"] = 1006,
        ["Ani"]="XunBao_xmap6", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\6_0.rgn",
        ["NaxNum"] = 120,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME6",
    },
    [007] = {
        ["RewardId1"] = 1007,
        ["RewardId2"] = 1007,
        ["RewardId3"] = 1007,
        ["RewardId4"] = 1007,
        ["RewardId5"] = 1007,
        ["RewardId6"] = 1007,
        ["RewardId7"] = 1007,
        ["RewardId8"] = 1007,
        ["Ani"]="XunBao_xmap7", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\7_0.rgn",
        ["NaxNum"] = 90,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME7",
    },
    [008] = {
        ["RewardId1"] = 1008,
        ["RewardId2"] = 1008,
        ["RewardId3"] = 1008,
        ["RewardId4"] = 1008,
        ["RewardId5"] = 1008,
        ["RewardId6"] = 1008,
        ["RewardId7"] = 1008,
        ["RewardId8"] = 1008,
        ["Ani"]="XunBao_xmap8", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\8_0.rgn",
        ["NaxNum"] = 45,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME8",
    },
    [009] = {
        ["RewardId1"] = 1009,
        ["RewardId2"] = 1009,
        ["RewardId3"] = 1009,
        ["RewardId4"] = 1009,
        ["RewardId5"] = 1009,
        ["RewardId6"] = 1009,
        ["RewardId7"] = 1009,
        ["RewardId8"] = 1009,
        ["Ani"]="XunBao_xmap9", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\9_0.rgn",
        ["NaxNum"] = 90,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME9",
    },
    [010] = {
        ["RewardId1"] = 1010,
        ["RewardId2"] = 1010,
        ["RewardId3"] = 1010,
        ["RewardId4"] = 1010,
        ["RewardId5"] = 1010,
        ["RewardId6"] = 1010,
        ["RewardId7"] = 1010,
        ["RewardId8"] = 1010,
        ["Ani"]="XunBao_xmap10", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\10_0.rgn",
        ["NaxNum"] = 90,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME10",
    },
    [011] = {
        ["RewardId1"] = 1011,
        ["RewardId2"] = 1011,
        ["RewardId3"] = 1011,
        ["RewardId4"] = 1011,
        ["RewardId5"] = 1011,
        ["RewardId6"] = 1011,
        ["RewardId7"] = 1011,
        ["RewardId8"] = 1011,
        ["Ani"]="XunBao_xmap11", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\11_0.rgn",
        ["NaxNum"] = 30,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME11",
    },
    [012] = {
        ["RewardId1"] = 1012,
        ["RewardId2"] = 1012,
        ["RewardId3"] = 1012,
        ["RewardId4"] = 1012,
        ["RewardId5"] = 1012,
        ["RewardId6"] = 1012,
        ["RewardId7"] = 1012,
        ["RewardId8"] = 1012,
        ["Ani"]="XunBao_xmap12", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\map\\12_0.rgn",
        ["NaxNum"] = 30,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME12",
    },




    --另一张地图

    
    --这个id与Task集合的id不能重复
    [0013] = {
        --该地区的详细信息中的奖励索引
        ["RewardId1"] = 2021,
        ["RewardId2"] = 2021,
        ["RewardId3"] = 2021,
        ["RewardId4"] = 2021,
        ["RewardId5"] = 2021,
        ["RewardId6"] = 2021,
        ["RewardId7"] = 2021,
        ["RewardId8"] = 2021,
        --该地区的地图图片
        ["Ani"]="XunBao_kfmap1", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\1_0.rgn",
        --该地区宝箱的最大值
        ["NaxNum"] = 50,
        --地区名字
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME13",
    },
    [0014] = {
        ["RewardId1"] = 2022,
        ["RewardId2"] = 2022,
        ["RewardId3"] = 2022,
        ["RewardId4"] = 2022,
        ["RewardId5"] = 2022,
        ["RewardId6"] = 2022,
        ["RewardId7"] = 2022,
        ["RewardId8"] = 2022,
        ["Ani"]="XunBao_kfmap2", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\2_0.rgn",
        ["NaxNum"] = 100,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME14",
    },
    [0015] = {
        ["RewardId1"] = 2023,
        ["RewardId2"] = 2023,
        ["RewardId3"] = 2023,
        ["RewardId4"] = 2023,
        ["RewardId5"] = 2023,
        ["RewardId6"] = 2023,
        ["RewardId7"] = 2023,
        ["RewardId8"] = 2023,
        ["Ani"]="XunBao_kfmap3", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\3_0.rgn",
        ["NaxNum"] = 200,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME15",
    },
    [016] = {
        ["RewardId1"] = 2024,
        ["RewardId2"] = 2024,
        ["RewardId3"] = 2024,
        ["RewardId4"] = 2024,
        ["RewardId5"] = 2024,
        ["RewardId6"] = 2024,
        ["RewardId7"] = 2024,
        ["RewardId8"] = 2024,
        ["Ani"]="XunBao_kfmap4", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\4_0.rgn",
        ["NaxNum"] = 100,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME16",
    },
    [017] = {
        ["RewardId1"] = 2025,
        ["RewardId2"] = 2025,
        ["RewardId3"] = 2025,
        ["RewardId4"] = 2025,
        ["RewardId5"] = 2025,
        ["RewardId6"] = 2025,
        ["RewardId7"] = 2025,
        ["RewardId8"] = 2025,
        ["Ani"]="XunBao_kfmap5", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\5_0.rgn",
        ["NaxNum"] = 100,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME17",
    },
    [018] = {
        ["RewardId1"] = 2026,
        ["RewardId2"] = 2026,
        ["RewardId3"] = 2026,
        ["RewardId4"] = 2026,
        ["RewardId5"] = 2026,
        ["RewardId6"] = 2026,
        ["RewardId7"] = 2026,
        ["RewardId8"] = 2026,
        ["Ani"]="XunBao_kfmap6", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\6_0.rgn",
        ["NaxNum"] = 100,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME18",
    },
    [019] = {
        ["RewardId1"] = 2027,
        ["RewardId2"] = 2027,
        ["RewardId3"] = 2027,
        ["RewardId4"] = 2027,
        ["RewardId5"] = 2027,
        ["RewardId6"] = 2027,
        ["RewardId7"] = 2027,
        ["RewardId8"] = 2027,
        ["Ani"]="XunBao_kfmap7", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\7_0.rgn",
        ["NaxNum"] = 200,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME19",
    },
    [020] = {
        ["RewardId1"] = 2028,
        ["RewardId2"] = 2028,
        ["RewardId3"] = 2028,
        ["RewardId4"] = 2028,
        ["RewardId5"] = 2028,
        ["RewardId6"] = 2028,
        ["RewardId7"] = 2028,
        ["RewardId8"] = 2028,
        ["Ani"]="XunBao_kfmap8", 
        ["Rgn"] = "data\\interface\\Style01\\XunBao\\kfmap\\8_0.rgn",
        ["NaxNum"] = 200,
        ["Name"] = "STR_ALL_SERVER_HUNT_MAP_NAME20",
    },
}


--奖励数据的集合
local RewardInfo = {
	--区域黄金大奖
    --与脚本的奖励索引对应
    [1001] = {
        --里面索引从1开始
        [1] = {
            ["ItemType"] = 3314250,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
    [1002] = {
        [1] = {
            ["ItemType"] = 3314245,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1003] = {
        [1] = {
            ["ItemType"] = 3335820,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1004] = {
        [1] = {
            ["ItemType"] = 197965,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1005] = {
        [1] = {
            ["ItemType"] = 200822,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1006] = {
        [1] = {
            ["ItemType"] = 3349734,
            ["Num"]=5,
            ["Monopoly"] = 0,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1007] = {
        [1] = {
            ["ItemType"] = 730007,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1008] = {
        [1] = {
            ["ItemType"] = 723695,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1009] = {
        [1] = {
            ["ItemType"] = 3009003,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1010] = {
        [1] = {
            ["ItemType"] = 3328814,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1011] = {
        [1] = {
            ["ItemType"] = 3335925,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	[1012] = {
        [1] = {
            ["ItemType"] = 3344446,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
		-- [2] = {
            -- ["ItemType"] = 199325,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
		-- [3] = {
            -- ["ItemType"] = 723694,
            -- ["Num"]=1,
            -- ["Monopoly"] = 1,
        -- },
    },
	--排行榜奖励
	[1013] = {
        [1] = {
            ["ItemType"] = 3335925,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[2] = {
            ["ItemType"] = 3344446,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
		[3] = {
            ["ItemType"] = 730005,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		[4] = {
            ["ItemType"] = 3009002,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[5] = {
            ["ItemType"] = 3328813,
            ["Num"]=5,
            ["Monopoly"] = 0,
        },
    },
	[1014] = {
        [1] = {
            ["ItemType"] = 3335924,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[2] = {
            ["ItemType"] = 3344445,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
		[3] = {
            ["ItemType"] = 730005,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		[4] = {
            ["ItemType"] = 3328813,
            ["Num"]=5,
            ["Monopoly"] = 0,
        },
    },
	[1015] = {
        [1] = {
            ["ItemType"] = 3335923,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[2] = {
            ["ItemType"] = 3344444,
            ["Num"]=15,
            ["Monopoly"] = 0,
        },
		[3] = {
            ["ItemType"] = 3328813,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },
	[1016] = {
        [1] = {
            ["ItemType"] = 3344444,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
		[2] = {
            ["ItemType"] = 3328813,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },
	[1017] = {
		[1] = {
            ["ItemType"] = 3344443,
            ["Num"]=12,
            ["Monopoly"] = 0,
        },
    },
	
	[2021] = {
		[1] = {
            ["ItemType"] = 3319013,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
    },
	[2022] = {
		[1] = {
            ["ItemType"] = 3335931,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },
	[2023] = {
		[1] = {
            ["ItemType"] = 3009104,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
    },
	[2024] = {
		[1] = {
            ["ItemType"] = 3336145,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
    },	
	[2025] = {
		[1] = {
            ["ItemType"] = 3336144,
            ["Num"]=10,
            ["Monopoly"] = 0,
        },
    },	
	[2026] = {
		[1] = {
            ["ItemType"] = 3600438,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	[2027] = {
		[1] = {
            ["ItemType"] = 3009003,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	[2028] = {
		[1] = {
            ["ItemType"] = 3328814,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	--排名奖励
	[2029] = {
		[1] = {
            ["ItemType"] = 3311746,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		[2] = {
            ["ItemType"] = 3335931,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[3] = {
            ["ItemType"] = 4060001,
            ["Num"]=500,
            ["Monopoly"] = 1,
        },
		[4] = {
            ["ItemType"] = 4200010,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[5] = {
            ["ItemType"] = 3339725,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	
	[2030] = {
		[1] = {
            ["ItemType"] = 3319013,
            ["Num"]=1,
            ["Monopoly"] = 1,
        },
		[2] = {
            ["ItemType"] = 3335931,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[3] = {
            ["ItemType"] = 4060001,
            ["Num"]=500,
            ["Monopoly"] = 1,
        },
		[4] = {
            ["ItemType"] = 4200009,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[5] = {
            ["ItemType"] = 3339726,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	
	[2031] = {
		[1] = {
            ["ItemType"] = 3335930,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[2] = {
            ["ItemType"] = 4060001,
            ["Num"]=300,
            ["Monopoly"] = 1,
        },
		[3] = {
            ["ItemType"] = 3009002,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
		[4] = {
            ["ItemType"] = 3339727,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	
	[2032] = {
		[1] = {
            ["ItemType"] = 4060001,
            ["Num"]=100,
            ["Monopoly"] = 0,
        },
		[2] = {
            ["ItemType"] = 3009002,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
	[2033] = {
		[1] = {
            ["ItemType"] = 3600432,
            ["Num"]=1,
            ["Monopoly"] = 0,
        },
    },	
}

local DlgInfo = {
    --排行榜界面
        --全服寻宝排行榜界面奖励的索引
        ["RankRewardId1"] = 1013,
        ["RankRewardId2"] = 1014,
        ["RankRewardId3"] = 1015,
        ["RankRewardId4"] = 1016,
        ["RankRewardId5"] = 1017,
        --奖励背景图
        ["RankRewardBg"] = "NewJiuGong_Item6Pic",

        ["RankBg"] = "XunBao_BG9",
        --排行榜右侧排名的图标
        ["RankLev1"] = "JiuGong_no1pic",
        --排行榜右侧排名的图标
        ["RankLev2"] = "JiuGong_no2pic",
        --排行榜右侧排名的图标
        ["RankLev3"] = "JiuGong_no3pic",

        --2~3名图标
        ["RewardLevIcon2"] = "XunBao_pic4",
        --4~10名图标
        ["RewardLevIcon3"] = "XunBao_pic3",
        --11~50名图标
        ["RewardLevIcon4"] = "XunBao_pic2",
        --参与奖图标
        ["RewardLevIcon5"] = "XunBao_pic1",

    --区域数量
        ["PlaceNum"] = #PlaceIndex + 1,

    --宝箱相对于地图的偏移
        ["BoxNumOffsetX"] = 20,
        ["BoxNumOffsetY"] = -15,

    --全服寻宝消耗的物品itemtype
        ["UseItem"] = 3328812,
    --寻宝地图详细信息中奖励物品的底框图片
        ["RewardBg"] = "XunBao_ItemBG",


    --跨服寻宝
    --区域数量
        ["CrossPlaceNum"] = #CrossPlaceIndex + 1,
    --全服寻宝消耗的物品itemtype
        ["CrossUseItem"] = 3600423,
        --全服寻宝排行榜界面奖励的索引
        ["CrossRankRewardId5"] = 2033,
        ["CrossRankRewardId4"] = 2032,
        ["CrossRankRewardId3"] = 2031,
        ["CrossRankRewardId2"] = 2030,
        ["CrossRankRewardId1"] = 2029,
        ["AllHeight"] = 36,
        ["CrossHeight"] = 50,
        ["CrossItemImg"] = "XunBao_pic8",
        ["ItemImg"] = "XunBao_pic9",
}

local function GetAllServerDlgInfo(nType, HuntType)
    if HuntType == CROSS_SERVERHUNT and (
        nType == "PlaceNum" or
        nType == "UseItem" or
        nType == "RankRewardId1" or
        nType == "RankRewardId2" or
        nType == "RankRewardId3" or
        nType == "RankRewardId4" or
        nType == "RankRewardId5"
    ) then
        nType = "Cross"..nType
        return DlgInfo[nType]
    else 
        return DlgInfo[nType]
    end
end

local function GetPlaceInfo(id, nType, ...)
    local args = {...}
    if #args > 0 then
        if nType == "RewardId" then
            nType = "RewardId"..tostring(math.floor(args[1]))
            print("RewardId==="..nType)
        end
    end

    return PlaceInfo[id][nType]
end

local function GetPlaceIdByIndex(nIndex, nType)
    local id = PlaceIndex[nIndex]
    if nType == CROSS_SERVERHUNT then
        id = CrossPlaceIndex[nIndex]
    end

    if id ~= nil then
        return id
    end

    return 0
end

local function GetRewardItemInfoByIndex(nId, nIndex, nType)
    if nType == "RewardNum" then
        return #RewardInfo[nId]
    else
        return RewardInfo[nId][nIndex + 1][nType]
    end
end

local function IsOpen(year, mon,day,hour,min,second,nType)
    local time = {mon + 1,day,hour,min}
    local timeStamp = year - 100
    for i=1,4,1 do
        timeStamp = timeStamp * 100 + time[i]
    end

    if nType == 2 then
        if timeStamp > global_Info["Time3"] then
            if timeStamp > global_Info["Time4"] then
                return false
            end	
            return true		
        else
            return false
        end	
    else  
        local str = "Time"..math.floor(nType)
        if timeStamp > global_Info[str] then
            if timeStamp > global_Info["Time2"] then
                return false
            end	
            return true		
        else
            return false
        end
    end
end

local function GetglobalInfo(nType)
    return global_Info[nType]
end

local function GetHuntTypeByHuntId(nHuntId)
    for i = 1 , Num ,1 do
        if nHuntId == Task[i].id then
            return false
        end
    end

    return true
end

local function GetPersonHuntuID(nHuntId)
    for i = 1 , Num ,1 do
        if nHuntId == Task[i].id then
            return i + 2033 - 1
        end
    end

    return 0
end

local function Unload()
	Task = nil
end

local TreasureHunt = {
    GetTaskInfo = GetTaskInfo,
    GetNum = GetNum,
    GetAllServerDlgInfo = GetAllServerDlgInfo,
    GetPlaceInfo = GetPlaceInfo,
    GetPlaceInfoByIndex = GetPlaceInfoByIndex,
    GetPlaceIdByIndex = GetPlaceIdByIndex,
    GetRewardItemInfoByIndex = GetRewardItemInfoByIndex,
    IsOpen = IsOpen,
    GetglobalInfo = GetglobalInfo,
    GetHuntTypeByHuntId = GetHuntTypeByHuntId,
    GetPersonHuntuID = GetPersonHuntuID,
}

TreasureHunt_GetTaskInfo = TreasureHunt.GetTaskInfo
TreasureHunt_GetNum = TreasureHunt.GetNum
TreasureHunt_GetAllServerDlgInfo = TreasureHunt.GetAllServerDlgInfo
TreasureHunt_GetPlaceIdByIndex = TreasureHunt.GetPlaceIdByIndex
TreasureHunt_GetPlaceInfo = TreasureHunt.GetPlaceInfo
TreasureHunt_GetPlaceInfoByIndex= TreasureHunt.GetPlaceInfoByIndex
TreasureHunt_GetRewardItemInfoByIndex = TreasureHunt.GetRewardItemInfoByIndex
TreasureHunt_IsOpen = TreasureHunt.IsOpen
TreasureHunt_GetglobalInfo = TreasureHunt.GetglobalInfo
TreasureHunt_GetHuntTypeByHuntId = TreasureHunt.GetHuntTypeByHuntId
TreasureHunt_GetPersonHuntuID = TreasureHunt.GetPersonHuntuID
return TreasureHunt



