--//  box.strCampName box.m_vMinBounds box.m_vMaxBounds box.m_vSpawnBoxOrigin
local camps = nil
function LoadCampBox()
	if not camps then camps = {}
		local NeutralSpawnBoxes=dota.GameRules.GetInstance():GetNeutralSpawnBoxes()
		for i = 0,NeutralSpawnBoxes.count-1  do
			local box=NeutralSpawnBoxes:GetNeutralSpawnBox(i)
			if box then
				camps[#camps+1] = box
			end
		end
		NeutralSpawnBoxes = nil
	end
	return camps
end

local CAMP_EASY = 0
local CAMP_MEDIUM = 1
local CAMP_HARD = 2
local CAMP_ANCIENT = 3

function GetStuckInfo()
	return {
	     {
            CampPosition = dota.Vector(-1526,-3568,128),
            StackPosition = dota.Vector(-1398,-4584,128),
            WaitPosition = dota.Vector(-1546,-3977,128),
            Id= 0,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_good_5",
			Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-989,-3035,-2037,-3881},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(243,-5085,134),
            StackPosition = dota.Vector(783,-3288,256),
            WaitPosition = dota.Vector(317,-4702,134),
            Id= 1,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_good_4",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {636,-4776,-251,-5532},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}},
            Water = true,
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(4736,-3840,128),
            StackPosition = dota.Vector(3103,-4717,128),
            WaitPosition = dota.Vector(4230,-4130,128),
            Id= 2,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_good_2",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box=  {5121,-3496,4379,-4313},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,2}
            },
            Pull = {start_pos=dota.Vector(5219,-3962,128), go=dota.Vector(5867,-3230,128), time=18, on=false, team=3, lane="bot"},
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition =  dota.Vector(3904,-4864,212),
            StackPosition = dota.Vector(5350,-4495,128),
            WaitPosition = dota.Vector(4531,-5116,128),
            Id= 3,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_EASY,
			DotaName = "neutralcamp_good_1",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {4442,-4649,3647,-5438},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            Pull = {start_pos=dota.Vector(4018,-5626,128), go=dota.Vector(4052,-6358,128), time=20, on=false, team=2, lane="bot"},
            TorrentStack  = {img=nil,enable=nil},
            --PullTime= "x=18 / x=48",
            --DrawPullTime= true
        },
        {
            CampPosition = dota.Vector(1890,-4101,256),
            StackPosition = dota.Vector(1230,-5340,136),
            WaitPosition = dota.Vector(1815,-4529,256),
            Id= 4,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_good_15",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {2205,-3618,1458,-4449},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(-4804,-51,256),
            StackPosition = dota.Vector(-4962.3,1987.2, 256),
            WaitPosition = dota.Vector(-4573,465,256),
            Id= 5,
            StackTime= 53,
            Team= 2,
            Strong= CAMP_ANCIENT,
			DotaName = "neutralcamp_good_8",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-4245,385,-5349,-592},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            Linked = 6,
        },
        {
            CampPosition =  dota.Vector(-4032,895,8),
            StackPosition = dota.Vector(-3780,-1124,255),
            WaitPosition = dota.Vector(-3932,436,256),
            Id= 6,
            StackTime= 54,
            Team= 2,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_good_7",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-3696,1255,-4368,535},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            TorrentStack  = {img=nil,enable=nil},
            LinkedBack = 5,
        },
        {
            CampPosition = dota.Vector(-1840,-4812,128),
            StackPosition = dota.Vector(-869,-5788,128),
            WaitPosition = dota.Vector(-1521,-4817,128),
            Id= 7,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_good_9",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-1619,-4393,-2304,-5088},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(1120,2640,128),
            StackPosition = dota.Vector(331,3739,134),
            WaitPosition = dota.Vector(997,3020,133),
            Id= 8,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_evil_5",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {1539,2931,636,2142},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(-832,4765,136),
            StackPosition = dota.Vector(-369,3227,256),
            WaitPosition = dota.Vector(-861,4436,134),
            Id= 9,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_evil_6",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-316,5304,-1216,4520},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            Water = true,
        },
        {
            CampPosition = dota.Vector(1226,4201,128),
            StackPosition = dota.Vector(1480,3018,128),
            WaitPosition = dota.Vector(1235,3694,128),
            Id= 10,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_evil_4",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {1520,4420,783,3772},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(-4019,4918,128),
            StackPosition = dota.Vector(-5193,4933,128),
            WaitPosition = dota.Vector(-4391,4937,128),
            Id= 11,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_EASY,
			DotaName = "neutralcamp_evil_2",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-3620,5340,-4260,4550},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,4}
            },
            Pull = {start_pos=dota.Vector(-4354,5181,128), go=dota.Vector(-3307,5799,128), time=17, on=false, team=3, lane="top"},
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(-4869,4060,128),
            StackPosition = dota.Vector(-3593,3318,0),
            WaitPosition = dota.Vector(-4819,4492,128),
            Id= 12,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_evil_1",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box=   {-4496,4397,-5212,3584},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,4}
            },
            Pull = {start_pos=dota.Vector(-5309,4081,128), go=dota.Vector(-5926,3271,128), time=20, on=false, team=2, lane="top"},
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(3360,-1248,440),
            StackPosition = dota.Vector(2645, 146, 256),
            WaitPosition = dota.Vector(3629.5, -829, 256),
            Id= 13,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_evil_9",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {3776,-896,3008,-1537},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,4}
            },
            Linked = 14,
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition =  dota.Vector(4256,96,128),
            StackPosition = dota.Vector(4294, -1695, 128),
            WaitPosition = dota.Vector(4014,-468,256),
            Id= 14,
            StackTime= 55,
            Team= 3,
            Name= CAMP_ANCIENT,
			DotaName = "neutralcamp_evil_8",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {4670,528,3528,-403},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,4}
            },
            TorrentStack  = {img=nil,enable=nil},
            LinkedBack = 13,
        },
        {
            CampPosition = dota.Vector(-2592,3970,256),
            StackPosition = dota.Vector(-2632,5189,256),
            WaitPosition = dota.Vector(-2570,4283,256),
            Id= 15,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_evil_15",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box=  { -2214,4170,-2923,3542},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
        },

        -------Newewnenwnenw
        {
            CampPosition =  dota.Vector(1878,7904,128),
            StackPosition = dota.Vector(714,8288,128),
            WaitPosition = dota.Vector(1541,7878,128),
            Id= 16,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_evil_12",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {2530,8267,1629,7524},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition =  dota.Vector(-744,-7856,134),
            StackPosition = dota.Vector(461,-8341,134),
            WaitPosition = dota.Vector(-624,-8134,134),
            Id= 17,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_good_11",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-470,-7351,-1069,-8020},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            Water = true,
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition =  dota.Vector(-2446,-8268,128),
            StackPosition = dota.Vector(-3005,-6359,128),
            WaitPosition = dota.Vector(-2441,-7965,134),
            Id= 18,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_good_12",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-2104,-8032,-2856,-8768},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
        },
        {
            CampPosition = dota.Vector(8377,1323,256),
            StackPosition = dota.Vector(7295,2383,256),
            WaitPosition = dota.Vector(8093,1314,256),
            Id= 19,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_evil_13",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {8704,1536,8192,896},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(8050,-102,256),
            StackPosition = dota.Vector(8743,-1482,256),
            WaitPosition = dota.Vector(8354,-48,256),
            Id= 20,
            StackTime= 55, --позже на 1
            Team= 3,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_good_7",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {8257,295,7617,-409},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition =  dota.Vector(-8187,-473,256),
            StackPosition = dota.Vector(-6922,577,128),
            WaitPosition = dota.Vector(-7794,-249,256),
            Id= 21,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_MEDIUM,
			DotaName = "neutralcamp_good_13",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-7877,-48,-8645,-816},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition = dota.Vector(256,7533,134),
            StackPosition = dota.Vector(-1258,7382,134),
            WaitPosition = dota.Vector(252,7269,134),
            Id= 22,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_HARD,
			DotaName = "neutralcamp_evil_14",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= { 654,8062,-40,7358},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            Water = true,
        },
        {
            CampPosition =  dota.Vector(-7952,-1750,256),
            StackPosition = dota.Vector(-7536,-531,256),
            WaitPosition = dota.Vector(-7685,-1315,256),
            Id= 23,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_MEDIUM,
			DotaName = " neutralcamp_good_16",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-7608,-1392,-8357,-2174},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            TorrentStack  = {img=nil,enable=nil},
        },
        {
            CampPosition =  dota.Vector(-2810,7504,0),
            StackPosition = dota.Vector(-1541,7367,0),
            WaitPosition = dota.Vector(-2508,7462,0),
            Id= 24,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_EASY,
			DotaName = "neutralcamp_evil_11",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-2610,7764,-3319,7060},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
            Water = true,
        },
        {
            CampPosition =  dota.Vector(-4148,8238,0),
            StackPosition = dota.Vector(-2879,8243,0),
            WaitPosition = dota.Vector(-3799,8070,0),
            Id= 25,
            StackTime= 55,
            Team= 3,
            Strong= CAMP_ANCIENT,
			DotaName = " neutralcamp_evil_15",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {-3886,8608,-4595,7904},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={1,2}
            },
        },
        {
            CampPosition = dota.Vector(2693,-8161,0),
            StackPosition = dota.Vector(1265,-8320,136),
            WaitPosition = dota.Vector(2721,-7928,0),
            Id= 26,
            StackTime= 56,
            Team= 2,
            Strong= CAMP_EASY,
			DotaName = "neutralcamp_good_14",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {2998,-8027,2343,-8715},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
            Water = true,
        },
        {
            CampPosition =  dota.Vector(4312,-8262,6),
            StackPosition = dota.Vector(4576,-6944,128),
            WaitPosition = dota.Vector(3982,-8130,0),
            Id= 27,
            StackTime= 55,
            Team= 2,
            Strong= CAMP_ANCIENT,
			DotaName = " neutralcamp_good_10",
            Index= {spawn={},wait={}},
            Spawned= 0,
            Waiting= 0,
            WaitingType= nil,
            SpawnedType = nil,
            GoldPre= 0,
            Gold= 0,
            Box= {4726,-7947,4071,-8635},
			Staking= {enable=false, stack= false, remove= false, go= false, attack= false},
			Farming = {enable=false,num=0},
            Status = {
                farm={enable=true,enable2=true,img=nil},  
                stack={enable=true,enable2=true,img=nil},
                gold={txt=nil,img=nil},
                creep={current=nil,next=nil},
                draw_corner={3,4}
            },
        },       


	}

end

function GetNeutralsType(name)
    if (name=="centaur_khan" or name == "centaur_outrunner") then
        return "centaur_khan"
    elseif (name=="alpha_wolf" or name == "giant_wolf") then
        return "alpha_wolf"
    elseif (name=="satyr_hellcaller" or name == "satyr_soulstealer" or name == "satyr_trickster") then
        return "satyr_soulstealer"
    elseif (name=="ogre_magi" or name == "ogre_mauler") then
        return "ogre_magi"
    elseif (name=="mud_golem") then
        return "mud_golem"
    elseif (name=="polar_furbolg_champion" or name == "polar_furbolg_ursa_warrior") then
        return "polar_furbolg_ursa_warrior"
    elseif (name=="wildkin" or name == "enraged_wildkin") then
        return "wildkin"
    elseif (name=="dark_troll" or name == "dark_troll_warlord") then
        return "dark_troll_warlord"
    elseif (name=="black_dragon" or name == "black_drake") then
        return "black_dragon"
    elseif (name=="rock_golem" or name == "granite_golem") then
        return "rock_golem"
    elseif (name=="small_thunder_lizard" or name == "big_thunder_lizard") then
        return "big_thunder_lizard"
    elseif (name=="prowler_shaman" or name == "prowler_acolyte") then
        return "prowler_shaman"
    elseif (name=="harpy_scout" or name == "harpy_storm") then
        return "harpy_scout"
    elseif (name=="ghost" or name == "fel_beast") then
        return "ghost"
    elseif (name=="gnoll_assassin") then
        return "gnoll_assassin"
    elseif (name=="kobold" or name =="kobold_tunneler") then
        return "kobold"
    elseif (name=="forest_troll_high_priest") then
        return "forest_troll_high_priest"
    elseif (name=="kobold_taskmaster") then
        return "kobold_taskmaster"    	
	elseif (name=="warpine_raider") then
        return "warpine_raider"
    elseif (name=="ice_shaman" or name == "frostbitten_golem") then
        return "ice_shaman"

    elseif (name=="tadpole") then
        return "tadpole"      
     elseif (name=="froglet" or name == "froglet_mage") then
        return "froglet_mage"       
    elseif (name=="grown_frog" or name == "grown_frog_mage") then
        return "grown_frog_mage"   
     elseif (name=="ancient_frog" or name == "ancient_frog_mage") then
        return "ancient_frog_mage"
	else
        return "forest_troll_high_priest"
	end
end

function CampStatusGet(camp,var_name,my_team,only_own)
    if camp.Team == my_team or not only_own then
        return camp.Status[var_name].enable
    else
        return not camp.Status[var_name].enable2
    end 
end 

function CampStatusChange(camp,var_name,my_team,only_own)
    if camp.Team == my_team or not only_own then
        camp.Status[var_name].enable = not camp.Status[var_name].enable
    else
        camp.Status[var_name].enable2 = not camp.Status[var_name].enable2
    end 
end 

function CampStausPos(camp,con)
    local sign_x = (camp.Status.draw_corner[1] > 2 and 25*con or -125*con)
    local sign_y = (camp.Status.draw_corner[2] < 3 and -60*con or 70*con)
    return dota.Vector(camp.Box[camp.Status.draw_corner[1]]+sign_x,camp.Box[camp.Status.draw_corner[2]]+sign_y,0)
end 



function GetWardSpots()
	local tab = {
        {pos=dota.Vector(-1899.25, 4349.13, 256)},
        {pos=dota.Vector(-3273.10, 3972.08, 256)},
        {pos=dota.Vector(-462.63, 2366.38, 256)},
        {pos=dota.Vector(70.46, -3950.44, 256)},
        {pos=dota.Vector(1426.09, -3178.98, 236.44)},
        {pos=dota.Vector(266.80, -2321.61, 256)},
        -- {pos=dota.Vector(-1009.57, -863.94, 128)},
        -- {pos=dota.Vector(49.81, 117.73, 128)},
        {pos=dota.Vector(1001.10, -135.53, 128)},
        {pos=dota.Vector(-1133.71, -2228.67, 128)},
        {pos=dota.Vector(1997.34, -755.60, 256)},
        {pos=dota.Vector(747.06, -1834.60, 128)},
        {pos=dota.Vector(-2126.24, 224.442, 128)},
        {pos=dota.Vector(-3124.83, 501.28, 256)},
        {pos=dota.Vector(-4285.04, -2096.45, 256)},
        {pos=dota.Vector(-5357.44, -1544.76, 256)},
        {pos=dota.Vector(-3232.425, -1374.93, 256)},
        {pos=dota.Vector(-2667.74, -1678.27, 128)},
        {pos=dota.Vector(-2604.93, -3758.83, 128)},
        {pos=dota.Vector(1252.05, -8230.69, 136)},
        {pos=dota.Vector(3215.37, -7876.26, 128)},
        {pos=dota.Vector(8336.03, -6159.11, 256)},
        {pos=dota.Vector(7681.73, -2600.54, 256)},
        {pos=dota.Vector(7717.24, 688.93, 256)},
        {pos=dota.Vector(4076.06, -991.86, 256)},
        {pos=dota.Vector(2816.19, -1504.35, 256)},
        {pos=dota.Vector(2969.80, 100.45, 256)},
        {pos=dota.Vector(3064.91, 3273.73, 128)},
        {pos=dota.Vector(-1537.47, 2536.34, 254.52)},
        {pos=dota.Vector(-2254.28, 3529.32, 256)},
        {pos=dota.Vector(-2548.66, 5362.69, 256)},
        {pos=dota.Vector(-3707.83, 6258.15, 128)},
        {pos=dota.Vector(-6935.56, 6675.08, 256)},
        {pos=dota.Vector(-7409.43, 2316.82, 255.99)},
        {pos=dota.Vector(-7450.07, 675.78, 256)},
        {pos=dota.Vector(-7365.86, -2835.16, 256)},
        {pos=dota.Vector(-3563.16, -6944.62, 256)},
        {pos=dota.Vector(-3845.68, -4973.53, 256)},
        {pos=dota.Vector(-5430.83, -3285.35, 256)},
        {pos=dota.Vector(3020.62, 5004.40, 256)},
        {pos=dota.Vector(5290.43, 2701.83, 256)},
        {pos=dota.Vector(5228.98, 1378.60, 256)},
        {pos=dota.Vector(3971.08, 1168.05, 256)},     

		{pos=dota.Vector(3117,-4052,256)},
		{pos=dota.Vector(-488,1450,128)},
		{pos=dota.Vector(-284,-2589,256)},



		{pos=dota.Vector(1042,-2014,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(2022,-1041,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(-1562,1762,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(-3564,1341,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(-2709,3530,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(-1282,7669,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(1763,-5303,256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(-5142,41,  256),color=dota.Vector(166,134,41)},
		{pos=dota.Vector(3611,-1572,256),color=dota.Vector(166,134,41)},


		{pos=dota.Vector(-2829,-6833,128)},
		{pos=dota.Vector(-798,-7180,128)},
		{pos=dota.Vector(1252,-7911,136)},
		{pos=dota.Vector(7194,2262,256)},


		-- {pos=dota.Vector(-4610,-1076,384),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-4885,-2074,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-3686,-1875,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-3793,1591,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(3760,-2577,0),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(2119,-2045,0),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(1782,-1051,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-5933,8634,128),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-964,4883,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-2274,4404,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-356,1825,128),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-2134,-5610,128),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(2441,910,128),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-2652,319,128),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-7221,6087,128),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(-6341,7739,256),color=dota.Vector(245,245,220)},
		-- {pos=dota.Vector(5014,-8680,128),color=dota.Vector(245,245,220)},


	}
	return tab
end

function CreepPatch(name)
    if name == "good_top" then return
		{dota.Vector(-6576.0, -3720.0,0),   dota.Vector(-6360.0, 880.0,0),
         dota.Vector(-6368.0, 2808.0,0),    dota.Vector(-6164.0, 4276.0,0),
         dota.Vector(-5964.0, 5208.0,0),    dota.Vector(-5792.0, 5464.0,0), 
         dota.Vector(-5160.0, 5712.0,0),    dota.Vector(-4488.0, 5824.0,0), 
         dota.Vector(-3784.0, 5928.0,0),    dota.Vector(-2792.0, 6048.0,0), 
         dota.Vector(-1856.0, 6104.0,0),    dota.Vector(3856.0, 5784.0,0), 
         dota.Vector(5323.0, 4852.0,0)}
         
    elseif name == "bad_top" then return
		{dota.Vector(3856.0, 5768.0,0),     dota.Vector(-1872.0, 6008.0,0),
         dota.Vector(-5264.0, 5552.0,0),    dota.Vector(-6004.0, 5484.0,0),
         dota.Vector(-6236.0, 4872.0,0),    dota.Vector(-6376.0, 3896.0,0),
         dota.Vector(-6576.0, -3720.0,0),   dota.Vector(-5591.0, -5024.0,0)}

    elseif name == "good_bot" then return
		{dota.Vector(-3648.0, -6144.0,0),   dota.Vector(421,-6457,0), 
         dota.Vector(2048.0, -6336.0,0),    dota.Vector(3320.0, -6184.0,0),
         dota.Vector(4028.0, -6140.0,0),    dota.Vector(4672.0, -6044.0,0),
         dota.Vector(5686.0, -5667.3,0),    dota.Vector(5936.0, -5345.0,0),
         dota.Vector(6133.0, -4708.0,0),    dota.Vector(6256.0, -3252.0,0),
         dota.Vector(6320.0, 3328.0,0),     dota.Vector(5941.0, 4251.0,0)}

	elseif name == "bad_bot" then return
		{dota.Vector(6320.0, 3328.0,0),     dota.Vector(6448.0, 352.0,0), 
         dota.Vector(6448.0, -2424.0,0),    --dota.Vector(6000.0, -3004.0,0), 
         dota.Vector(6298.0, -3319.0,0),    dota.Vector(6315.0, -4054.0,0), 
         dota.Vector(6087.0, -5290.0,0),    dota.Vector(5711.0, -5784.0,0), 
         dota.Vector(5312.0, -6140.0,0),    dota.Vector(1036.0, -6428.0,0),
         dota.Vector(-4224.0, -6112.0,0),   dota.Vector(-5527.0, -5088.0,0)}

	elseif name == "good_mid" or name == "good_er4" then return
		{dota.Vector(-4856.0, -4376.0,0),   dota.Vector(-3095.0, -2606.0,0),
         dota.Vector(-1641.0, -1211.0,0),   dota.Vector(-976.0, -824.0,0), 
         dota.Vector(-360.0, -256.0,0),     dota.Vector(176.0, 120.0,0), 
         dota.Vector(912.0, 624.0,0),       dota.Vector(2584.0, 1704.0,0), 
         dota.Vector(4472.0, 3944.0,0),     dota.Vector(5323.0, 4788.0,0)}

    elseif name == "bad_mid" or name == "bad_er4" then return 
        {dota.Vector(3798, 3260,0),         dota.Vector(2534.0, 1830.0,0),
         dota.Vector(864.0, 672.0,0),       dota.Vector(144.0, 152.0,0),
         dota.Vector(-392.0, -224.0,0),     dota.Vector(-1008.0, -760.0,0),
         dota.Vector(-4872.0, -4360.0,0),   dota.Vector(-5527.0, -5024.0,0)}

      else --"good mid"
        return 
        {dota.Vector(-4856.0, -4376.0,0),   dota.Vector(-3095.0, -2606.0,0),
         dota.Vector(-1641.0, -1211.0,0),   dota.Vector(-976.0, -824.0,0), 
         dota.Vector(-360.0, -256.0,0),     dota.Vector(176.0, 120.0,0), 
         dota.Vector(912.0, 624.0,0),       dota.Vector(2584.0, 1704.0,0), 
         dota.Vector(4472.0, 3944.0,0),     dota.Vector(5323.0, 4788.0,0)}
    end
end

function GetCreepWavePatch(team)
	local path = {}
	if team == 3 then
		path[1] = CreepPatch("good_top")
		path[2] = CreepPatch("good_mid")
		path[3] = CreepPatch("good_bot")
	else
		path[1] = CreepPatch("bad_top")
		path[2] = CreepPatch("bad_mid")
		path[3] = CreepPatch("bad_bot")
	end
	return path
end

function IsTurnPath(x)
    return GetDistance2D(x, CreepPatch("good_top")[6]) < 50
    or GetDistance2D(x, CreepPatch("bad_top")[4]) < 50

    or GetDistance2D(x, CreepPatch("good_bot")[8]) < 50
    or GetDistance2D(x, CreepPatch("bad_bot")[7]) < 50
end 


local saved_line_towers = {}
--// PushFarm function
function MakeTowerCache(towers)
    if not towers or #towers == 0 then 
        saved_line_towers = {}
        return 
    end
    for i,v in ipairs(towers) do
        saved_line_towers[#saved_line_towers+1] = {pos=v:GetAbsOrigin(),name=v:GetName():gsub("npc_dota_","")}
    end 
end 

function FindCurrentLane(pos, noTeam)
    if not saved_line_towers or not saved_line_towers[1] then
        if noTeam then
            return "mid"
        else
            return "good_mid"
        end
    end
    table.sort(saved_line_towers,function(x,y) return GetDistance2D(x.pos,pos) < GetDistance2D(y.pos,pos) end)       
    local name = saved_line_towers[1].name
    if noTeam then
        return name:sub(-3)
    end
    local returnName
    if name:startWith("bad") then
        returnName = "bad_"
    else
        returnName = "good_"
    end
    return returnName..name:sub(-3)
end

function FindCreepPathPoints(ent, names, customPos)
    local templ = {}
    local abs = customPos or ent:GetAbsOrigin()
    local name = FindCurrentLane(abs, true)
    if ent:IsTeam(2) then
        name = 'good_'..name
    else
        name = 'bad_'..name
    end
    local patch = CreepPatch(name)
    local maxRange = 99999
    local last = 0
    for i,v in ipairs(patch) do
        local range = GetDistance2D(v,abs)
        if range < maxRange then
            maxRange = range
            last = i
        end
    end
    for i,v in ipairs(patch) do
        if i >= last then
            templ[#templ+1] = v
        end
    end
    if #templ == 0 then
        return GetAncientPosition(ent:GetEnemyTeam())
    end
    return templ
end

function LaneToLane(value)
    if type(value) == "number" then
        if value == 1 then 
            return "top"
        elseif value == 3 then 
            return "bot"
        else 
            return "mid"
        end
    else 
        if value == "top" then 
            return 1
        elseif value == "bot" then 
            return 3
        else 
            return 2
        end
    end
end 