local _, core = ...;

local frame = CreateFrame("FRAME");
frame:RegisterEvent("ADDON_LOADED");
function frame:OnEvent(event, arg1)
	if event == "ADDON_LOADED" and arg1 == "WoWChallenger" then		
		if Prefer == nil then
			Prefer = {
				hide = false,
			}
		end
		if WC_Ranking == nil then
			WC_Ranking = {
				Guild  = {},
				People = {},
			}
		end
		if DBProfile == nil then
			DBProfile = {
				Equip = {76390, 46471}, -- [1]: Weapon, [2]: Armor
				pdv = 50,
				pdvMax = 50,
				damage = 5,
				damageMax = 5,
				skillPoints = 0,
				firstVisit = true,
				showTuto = true,
				itemUnlock = {
					{0, 2, 2, 2, 2},			-- Skin armes   -- 2: Lock, 1: CanBuy, 0: Unlock
					{0, 2, 2, 2, 2}, 			-- Skin armures -- 2: Lock, 1: CanBuy, 0: Unlock
					{0, 0, 2, 2, 2, 2, 2, 2}, 	-- Spells 	 	-- 2: Lock, 1: CanBuy, 0: Unlock
					{2, 2, 2}, 		 			-- Bonus 		-- 2: Lock, 1: CanBuy, 0: Unlock
				},
				bonusLvL = {0, 0, 0},
			}
		end
		if Campaign1 == nil then
			Campaign1 = {
				[1] = {
					done = false,
				},
				[2] = {
					done = false,
				},
				[3] = {
					done = false,
				},
				[4] = {
					done = false,
				},
				[5] = {
					done = false,
				}
			}
		end
		if Campaign2 == nil then
			Campaign2 = {
				[1] = {
					done = false,
				},
				[2] = {
					done = false,
				},
				[3] = {
					done = false,
				},
				[4] = {
					done = false,
				},
				[5] = {
					done = false,
				},
				[6] = {
					done = false,
				},
			}
		end
		if Campaign3 == nil then
			Campaign3 = {
				[1] = {
					done = false,
				},
				[2] = {
					done = false,
				},
				[3] = {
					done = false,
				},
				[4] = {
					done = false,
				},
				[5] = {
					done = false,
				},
				[6] = {
					done = false,
				},
			}
		end
		if Campaign4 == nil then
			Campaign4 = {
				[1] = {
					done = false,
				},
				[2] = {
					done = false,
				},
				[3] = {
					done = false,
				},
				[4] = {
					done = false,
				},
				[5] = {
					done = false,
				},
				[6] = {
					done = false,
				},
				[7] = {
					done = false,
				},
				[8] = {
					done = false,
				},
				[9] = {
					done = false,
				},
			}
		end
		if (WC_Guides == nil) then
			WC_Guides = {};
		end
		if (WC_ListGuides == nil) then
			WC_ListGuides = {};
			for i = 1, #WC_Guides do
				WC_ListGuides[i] = WC_ListGuides[i].idGuide;
			end
		end
		if (WC_arrIsDone == nil) then
			WC_arrIsDone = {};
		end
	end
end
frame:SetScript("OnEvent", frame.OnEvent);
