
local auto_farm_build = {
	npc_dota_hero_abaddon = 			{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_abyssal_underlord = 	{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_alchemist = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_ancient_apparition = 	{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_antimage = 			{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_arc_warden = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_axe = 				{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_bane = 				{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_batrider = 			{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_beastmaster = 		{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_bloodseeker = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_bounty_hunter = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_brewmaster = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_bristleback = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_broodmother = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_centaur = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_chaos_knight = 		{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_chen = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_clinkz = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_crystal_maiden = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_dark_seer = 			{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_dark_willow = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_dawnbreaker = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_dazzle = 				{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_death_prophet = 		{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_disruptor = 			{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_doom_bringer = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_dragon_knight = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_drow_ranger = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_earthshaker = 		{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_earth_spirit = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_elder_titan = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_ember_spirit = 		{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_enchantress = 		{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_enigma = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_faceless_void = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_furion = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_grimstroke = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_gyrocopter = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_hoodwink = 			{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_huskar = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_invoker = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_jakiro = 				{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_juggernaut = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_keeper_of_the_light = {skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_kunkka = 				{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_legion_commander = 	{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_leshrac = 			{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_lich = 				{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_life_stealer = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_lina = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_lion = 				{skill={1,3,1},talant={2,4,6,8}},
	npc_dota_hero_lone_druid = 			{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_luna = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_lycan = 				{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_magnataur = 			{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_marci = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_mars = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_medusa = 				{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_meepo = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_mirana = 				{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_monkey_king = 		{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_morphling = 			{skill={4,1,2},talant={2,4,6,8},skip=3},
	npc_dota_hero_muerta = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_naga_siren = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_necrolyte = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_nevermore = 			{skill={1,2,3},talant={2,4,6,8},shift=2},
	npc_dota_hero_night_stalker = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_nyx_assassin = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_obsidian_destroyer = 	{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_ogre_magi = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_omniknight = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_oracle = 				{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_pangolier = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_phantom_assassin = 	{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_phantom_lancer = 		{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_phoenix = 			{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_primal_beast = 		{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_puck = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_pudge = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_pugna = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_queenofpain = 		{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_rattletrap = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_razor = 				{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_riki = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_rubick = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_sand_king = 			{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_shadow_demon = 		{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_shadow_shaman = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_shredder = 			{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_silencer = 			{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_skeleton_king = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_skywrath_mage = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_slardar = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_slark = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_snapfire = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_sniper = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_spectre = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_spirit_breaker = 		{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_storm_spirit = 		{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_sven = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_techies = 			{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_templar_assassin = 	{skill={1,3,2},talant={2,4,6,8}},
	npc_dota_hero_terrorblade = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_tidehunter = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_tinker = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_tiny = 				{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_treant = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_troll_warlord = 		{skill={1,4,2},talant={2,4,6,8},skip=3},
	npc_dota_hero_tusk = 				{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_undying = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_ursa = 				{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_vengefulspirit = 		{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_venomancer = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_viper = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_visage = 				{skill={3,1,2},talant={2,4,6,8}},
	npc_dota_hero_void_spirit = 		{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_warlock = 			{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_weaver = 				{skill={2,3,1},talant={2,4,6,8}},
	npc_dota_hero_windrunner = 			{skill={3,2,1},talant={2,4,6,8}},
	npc_dota_hero_winter_wyvern = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_wisp = 				{skill={2,1,3},talant={2,4,6,8}},
	npc_dota_hero_witch_doctor = 		{skill={1,2,3},talant={2,4,6,8}},
	npc_dota_hero_zuus = 				{skill={1,2,3},talant={2,4,6,8}},
}

local projectileDistance = {

	npc_dota_hero_ancient_apparition=-35,
	npc_dota_hero_arc_warden	=-80,
	npc_dota_hero_bane			=26,
	npc_dota_hero_batrider		=51,
	npc_dota_hero_chen			=159,
	npc_dota_hero_clinkz		=88,
	npc_dota_hero_crystal_maiden=31,
	npc_dota_hero_dazzle		=6,
	npc_dota_hero_death_prophet	=-95,
	npc_dota_hero_dark_willow	=70,
	npc_dota_hero_disruptor		=-60,
	npc_dota_hero_drow_ranger	=41,
	npc_dota_hero_enchantress	=29,
	npc_dota_hero_enigma		=140,
	npc_dota_hero_furion		=202,
	npc_dota_hero_gyrocopter	=51,
	npc_dota_hero_grimstroke	=-36,
	npc_dota_hero_huskar		=-50,
	npc_dota_hero_hoodwink		=116,
	npc_dota_hero_invoker		=90,
	npc_dota_hero_jakiro		=115,
	npc_dota_hero_keeper_of_the_light=150,
	npc_dota_hero_leshrac		=122,
	npc_dota_hero_lich			=-13,
	npc_dota_hero_lina			=97,
	npc_dota_hero_lion			=-38,
	npc_dota_hero_lone_druid	=98,
	npc_dota_hero_luna			=54,
	npc_dota_hero_medusa		=105,
	npc_dota_hero_mirana		=2,
	npc_dota_hero_morphling		=50,
	npc_dota_hero_muerta		=170,
	npc_dota_hero_necrolyte		=22,
	npc_dota_hero_nevermore		=-30, -- -40,
	npc_dota_hero_obsidian_destroyer=170,
	npc_dota_hero_oracle		=5,
	npc_dota_hero_phoenix		=-30,
	npc_dota_hero_puck			=55,
	npc_dota_hero_pugna			=3,
	npc_dota_hero_queenofpain	=12,
	npc_dota_hero_razor			=80,
	npc_dota_hero_ringmaster	=0,
	npc_dota_hero_rubick		=-30,
	npc_dota_hero_shadow_demon	=130,
	npc_dota_hero_shadow_shaman	=52,
	npc_dota_hero_silencer		=105,
	npc_dota_hero_skywrath_mage	=136,
	npc_dota_hero_snapfire		=119,
	npc_dota_hero_sniper		=136,
	npc_dota_hero_storm_spirit	=20,
	npc_dota_hero_techies		=107,
	npc_dota_hero_templar_assassin=3,
	npc_dota_hero_tinker		=11,
	npc_dota_hero_troll_warlord	=80,
	npc_dota_hero_vengefulspirit=50,
	npc_dota_hero_venomancer	=71,
	npc_dota_hero_viper			=79,
	npc_dota_hero_visage		=80,
	npc_dota_hero_warlock		=160,
	npc_dota_hero_weaver		=14,
	npc_dota_hero_windrunner	=17,
	npc_dota_hero_winter_wyvern	=63,
	npc_dota_hero_wisp			=20,
	npc_dota_hero_witch_doctor	=116,
	npc_dota_hero_zuus			=3,

	npc_dota_hero_terrorblade	=40,
	npc_dota_hero_dragon_knight	=110,

	--units
	npc_dota_venomancer_plague_ward_1 = 44,
	npc_dota_venomancer_plague_ward_2 = 44,
	npc_dota_venomancer_plague_ward_3 = 44,
	npc_dota_venomancer_plague_ward_4 = 44,
	npc_dota_visage_familiar1 = 20,
	npc_dota_visage_familiar2 = 20,
	npc_dota_visage_familiar3 = 20,

	--neutrals
	npc_dota_neutral_satyr_trickster = 83,
	npc_dota_neutral_dark_troll = 100,
	npc_dota_neutral_dark_troll_warlord = 155,
	npc_dota_neutral_black_dragon = 114,
	npc_dota_neutral_black_drake = 71,
	npc_dota_neutral_small_thunder_lizard = 144,
	npc_dota_neutral_harpy_scout = 24,
	npc_dota_neutral_harpy_storm = 60,
	npc_dota_neutral_ghost = 47,
	npc_dota_neutral_gnoll_assassin = 128,
	npc_dota_neutral_forest_troll_high_priest = 20,
	npc_dota_neutral_ice_shaman = 282,

	npc_dota_creep_badguys_ranged = 136,

}

importantItems = {
	rapier = true,
    basher = true,
    ultimate_scepter = true,
    ward_sentry = true,
    ward_dispenser = true,
    ward_observer = true,
    dust = true,
    infused_raindrop = true,
    bottle = true,
    aegis = true,
    cheese = true,
    refresher_shard = true,
    dagon = true,
    dagon_2 = true,
    dagon_3 = true,
    dagon_4 = true,
    dagon_5 = true,
    aeon_disk = true,
    magic_wand = true,
    magic_stick = true,

    overwhelming_blink = true,
    swift_blink = true,
    blink = true,
    arcane_blink = true,

    faerie_fire = true,
    tango = true,
    flask = true,
    enchanted_mango = true,
    famango = true,
    great_famango = true,
    greater_famango = true,

    cyclone = true,
    wind_waker = true,
	orchid = true,
    bloodthorn = true,
    rod_of_atos = true,
    gungir = true,
    ethereal_blade = true,
    nullifier = true,
	heavens_halberd = true,
    harpoon = true,
    abyssal_blade = true,
    sheepstick = true,

    guardian_greaves = true,
    mekansm = true,
    manta = true,
    black_king_bar = true,
    lotus_orb = true,
    blade_mail = true,
    pipe = true,
    satanic = true,
    ghost = true,
    sphere = true,
	glimmer_cape = true,
    force_staff = true,
    hurricane_pike = true,

    invis_sword = true,
    silver_edge = true,
	quelling_blade = true,
}

function GetProjectileDistance(name)
	return projectileDistance[name] or 100
end

function GetAutoBuildData(name)
	return auto_farm_build[name] or auto_farm_build["npc_dota_hero_abaddon"]
end

function LoadLastHitActivity(self,func)	
	local data = {
		muerta_gunslinger = 1512,
		viper_poison_attack = 1510,
		drow_ranger_marksmanship = 1758,
		huskar_burning_spear = -1,
	}
	for i,v in pairs(data) do
		if func(self,i) then 
			return v
		end 
	end 
	return nil 
end


function LoadShowMoreSpells()
	return {

	modifier_radar_thinker = {
		name1="particles/ui_mouseactions/selected_ring_b.vpcf",
		color = dota.Vector( 145, 163, 200),
		radius = 900},

	modifier_invoker_sun_strike = {
		name1="particles/units/heroes/hero_invoker/invoker_sun_strike_team.vpcf",
		name2="particles/units/heroes/hero_invoker/invoker_sun_strike_ring_b.vpcf",
		color = dota.Vector( 255, 200, 0),
		radius = 175},

	modifier_lina_light_strike_array = {
		name1="particles/units/heroes/hero_lina/lina_spell_light_strike_array_ring_collapse.vpcf",
		name2="particles/units/heroes/hero_lina/lina_spell_light_strike_array_sphere.vpcf",
		color = dota.Vector( 183, 0, 65),
		radius = 225},

	modifier_kunkka_torrent_thinker = {
		name1="particles/units/heroes/hero_kunkka/kunkka_spell_torrent_pool.vpcf",
		name2="particles/units/heroes/hero_kunkka/kunkka_spell_torrent_bubbles_b.vpcf",
		color = dota.Vector( 37, 184, 195),
		radius = 225},

	modifier_leshrac_split_earth_thinker = {
		name1= "particles/units/heroes/hero_leshrac/leshrac_split_earth_b.vpcf",
		name2= "particles/units/heroes/hero_leshrac/leshrac_split_earth_c.vpcf",
		color = dota.Vector( 216, 25, 25),
		radius = 225},

	modifier_monkey_king_spring_thinker = {
		name1="particles/units/heroes/hero_monkey_king/monkey_king_spring_cast.vpcf",
		color = dota.Vector( 216, 175, 84),
		radius = 375},	
		
	modifier_ringmaster_tame_the_beasts_thinker = {
		name1="particles/ui_mouseactions/selected_ring_b.vpcf",
		color = dota.Vector( 255, 110, 44),
		radius = 375},

	modifier_dawnbreaker_solar_guardian_thinker = {
		name1="particles/ui_mouseactions/selected_ring_b.vpcf",
		color = dota.Vector( 255, 255, 0),
		radius = 900},

	-- modifier_disruptor_static_storm_thinker = {
	-- 	color = dota.Vector( 50, 50, 255),
	-- 	no_evade = true,
	-- 	radius = 550},

	modifier_bloodseeker_bloodbath_thinker = {
		radius = 900},

	modifier_item_meteor_hammer_land = {
		radius = 300},

	modifier_invoker_sun_strike_cataclysm = {
		radius = 175},

	}
end

function LoadShowMoreItems()
	return {
		{item_name="item_sphere",effect_name="particles/items_fx/immunity_sphere_buff.vpcf",path="sph1"},
		{item_name="item_mirror_shield",effect_name="particles/items3_fx/lotus_orb_shell.vpcf",path="sph2"},
		{item_name="item_aeon_disk",effect_name="particles/items4_fx/combo_breaker_buff_points.vpcf",path="sph3"},
	}
end 

--// Skinchanger
function HeroEmblemEffectList(ent,pattch,num)
	local list = {
		--full
		--{"particles/econ/events/ti7/ti7_hero_effect.vpcf"},		
		--{"particles/econ/events/ti8/ti8_hero_effect.vpcf"},
		--{"particles/econ/events/ti9/ti9_emblem_effect.vpcf"},
		-- {"particles/econ/events/ti10/emblem/ti10_emblem_effect.vpcf"},
		--{"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect.vpcf"},
		-- {"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect.vpcf"},
		-- {"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect.vpcf"},
		-- {"particles/econ/events/summer_2021/summer_2021_emblem_effect.vpcf"},
		-- {"particles/econ/events/fall_2021/fall_2021_emblem_game_effect.vpcf"},
		-- {"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_base.vpcf"},

		--0
		{
			"particles/econ/events/ti7/ti7_hero_effect_ring_puddle.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_light.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_ground_detail.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_caustic.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_splash.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_aegis_back.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_ground_dark.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_core.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_aegis_top.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_magic.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_smoke.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_rings.vpcf",
			"particles/econ/events/ti7/ti7_hero_effect_light_aura.vpcf",
		},
		--1
		{
			"particles/econ/events/ti8/ti8_hero_effect_crystal.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_light.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_ground_crystal_base.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_light_aura.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_aegis_back.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_ground_detail.vpcf",
			--"particles/econ/events/ti8/ti8_hero_effect_gems.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_core.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_smoke.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_ring_darken.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_ground_dark.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_magic.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_detail.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_base_detail.vpcf",
			"particles/econ/events/ti8/ti8_hero_effect_aegis_top.vpcf",
		},
		--2
		{
			"particles/econ/events/ti9/ti9_emblem_effect_ring_darken.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_aegis_top.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_ground_dark.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_flower.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_magic.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_light.vpcf",
			--"particles/econ/events/ti9/ti9_emblem_effect_gems.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_ground_flower_base.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_core.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_aegis_back.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_light_aura.vpcf",
			"particles/econ/events/ti9/ti9_emblem_effect_detail.vpcf",
		},
		--3
		{
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_smoke_detail.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_core.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_swirl.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_ground_base.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_smoke.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_aegis_back.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_detail.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_ring.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_ground_crack.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_aegis_top.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_ring_darken.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_ground_dark.vpcf",
			--"particles/econ/events/ti10/emblem/ti10_emblem_effect_gems.vpcf",
			"particles/econ/events/ti10/emblem/ti10_emblem_effect_light_aura.vpcf",
		},
		-- --4
		-- {
		-- 	"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_projected.vpcf",
		-- 	--"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_gems.vpcf",
		-- 	"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_rope.vpcf",
		-- 	"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_darken.vpcf",
		-- 	"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_ground_dark.vpcf",
		-- 	"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_highlight.vpcf",
		-- },
		--4
		{
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect_highlight.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect_rope.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect_projected.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect_darken.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_ground_dark.vpcf",
			--"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect_gems.vpcf",
		},
		--5
		{
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v2_effect_highlight.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v2_effect_rope.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v2_effect_projected.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v2_effect_darken.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_ground_dark.vpcf",
			--"particles/econ/events/diretide_2020/emblem/fall20_emblem_v3_effect_gems.vpcf",
		},
		--6
		{
			--"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect_gems.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect_darken.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect_rope.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect_projected.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_effect_ground_dark.vpcf",
			"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect_highlight.vpcf",
		},
		--7
		{
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_light_aura.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_grass.vpcf",
			--"particles/econ/events/summer_2021/summer_2021_emblem_effect_gems.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_ground_energy.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_particulate.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_flowers.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_ground_rope.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_ring_darken.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_ground_base.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_ring.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_aegis_back.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_gem_trail.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_core.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_aegis_top.vpcf",
			"particles/econ/events/summer_2021/summer_2021_emblem_effect_ground_dark.vpcf",
		},
		--8
		{
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_light_aura.vpcf",
			--"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_gems.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_ground_rope.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_core.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_particulate.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_ground_dark.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_effect_ground_energy.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_aegis_top.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_ring_darken.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_ground_base.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_ring.vpcf",
			"particles/econ/events/fall_2021/fall_2021_emblem_game_effect_aegis_back.vpcf",
		},
		--9
		{
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_ground_crack_darken.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_steam.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_bubble_spawn.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_lava_goop.vpcf",
			--"particles/econ/events/fall_2022/fall_2022_emblem_gems_player.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_embers.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_emblem_center.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_bodyglow.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_ground_crack_spawner.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_ground_crack_darken_glow.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_emblem_inner.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_ash.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_lava_goop_sploosh.vpcf",
			"particles/econ/events/fall_2022/player/fall_2022_emblem_effect_player_emblem_outer.vpcf",
		},
	}

	local temp = {}
	num = (num and tonumber(num) and num + 1) or 1
	if list[num] then 
		for i,v in ipairs(list[num]) do 
			temp[i] = dota.CreateParticle(v, pattch, ent)
		end 
	end 
	return temp
end

function Shaders(dire,aghanim)
	if dire then
		dota.SetShaders("materials/dev/deferred_post_process_graphic.vmat")
	elseif aghanim then
		dota.SetShaders("materials/dev/deferred_post_process_aghanim_bp.vmat")
	else
		dota.SetShaders("")
	end
end

function VisibleEffectList()
	local list = {
	"materials/NtUI/particles/visible_enemy.vpcf",
	"particles/econ/events/ti10/emblem/ti10_emblem_effect.vpcf",
	"particles/items_fx/aura_shivas.vpcf",
	"particles/econ/events/ti7/ti7_hero_effect.vpcf",
	"particles/econ/events/diretide_2020/emblem/fall20_emblem_v1_effect.vpcf",
	"materials/NtUI/particles/vby_onmi.vpcf"
	}
	list[0] = "materials/NtUI/particles/visiblebyenemy_ring_wave.vpcf"
	return list
end

function TreeEffectList()
	local list = nil

	if not dota.IsUnlockedModels() then
		list = {
		"models/props_magic/bad_magic_tower001.vmdl",			-- 4!
		"models/props_tree/mango_tree.vmdl", 					-- 5
		"models/props_stone/stone_column001a.vmdl", 			-- 6!
		-- "models/props_structures/midas_throne/baskets.vmdl", -- 7
		-- "models/props_tree/tree_bamboo_01_inspector.vmdl", 	-- 8
		-- "models/props_tree/tree_pine_02_inspector.vmdl",
		}
	else
		list = {
		"models/props_magic/bad_magic_tower001.vmdl",	--1
		"models/props_tree/mango_tree.vmdl",			--2
		"models/props_stone/stone_column002a.vmdl",		--3
		"models/props_garden/tree_garden002.vmdl",		--4
		"models/props_frostivus/frostivus_snowman.vmdl",--5
		"models/props_winter/present.vmdl",				--6
		"models/props_structures/pumpkin003.vmdl",		--7
		"models/props_debris/barrel002a.vmdl",			--8
		"models/props_tree/palm_03_stump.vmdl", --"models/props_tree/mango_tree.vmdl", 
		}
	end
	list[0] = "models/props_gameplay/pumpkin_bucket.vmdl"
	return list
end

function GetBottleImage(item)
	local b_type = item:GetStoredRuneType()
	if b_type >-1 and b_type < 10 then
		return GetTextureId(BottleToImage(b_type))
	end
	local charges = item:GetCharges()
	if charges == 0 then
		return GetTextureId2("item_bottle_empty")
	elseif charges == 1 then
		return GetTextureId2("item_bottle_small")
	elseif charges == 2 then
		return GetTextureId2("item_bottle_medium")
	end
end 

function BottleToImage(num,start,_end)
	local text = start or "panorama/images/items/"
	local end_ = _end or "_png.vtex_c"
	if num == 0 then 
		return text.."bottle_doubledamage"..end_
	elseif num==1 then 
		return text.."bottle_haste"..end_
	elseif num==2 then 
		return text.."bottle_illusion"..end_
	elseif num==3 then 
		return text.."bottle_invisibility"..end_
	elseif num==4 then 
		return text.."bottle_regeneration"..end_
	elseif num==5 then 
		return text.."bottle_bounty"..end_
	elseif num==6 then 
		return text.."bottle_arcane"..end_
	elseif num==7 then 
		return text.."bottle_water"..end_
	elseif num==8 then 
		return text.."bottle_xp"..end_
	elseif num==9 then 
		return text.."bottle_shield"..end_
	elseif num == -999 then
		return text.."empty"..end_
	elseif num == 999 then
		return text.."fill"..end_
	else
		return text.."bottle_bounty"..end_
	end 
end

function ProcentXpToNextLVL(lvl,exp)
	if exp==0 or lvl==0 then 
		return 0
	end
	local lvl_data = {0,240,640,1160,1760,2440,3200}
	local current = exp-lvl_data[lvl]
	local need = lvl_data[lvl+1]-lvl_data[lvl]
	return current/need
end 

local function hex2rgb(rgb)

	rgb = (rgb/ 0x100)%0x1000000 -- 0xffffff + 1

	local b = rgb%0x100 -- 0xff + 1 or 256
	local g = (rgb - b)%0x10000 -- 0xffff + 1
	local r = (rgb - g - b)

	g = g/0x100 -- 0xff + 1 or 256
	r = r/0x10000 -- 0xffff + 1
  
	return r, g, b
end 
function PlayersColor(unit,dire,reVector)

	local hero_color = bit.bswap(unit:GetPlayerColor())
	if reVector then
		local r,g,b = hex2rgb(hero_color)
		return dota.Vector(r, g, b)
	end
	return hero_color

	-- local num = resurs:GetTeamSlot(unit:GetPlayerId()) + 1 + (dire and 5 or 0)

	-- local colors = {
	-- 	0x415fffaa,	0x83ffdaaa,	0xc3009caa,	0xd5ff16aa,	0xf16900aa,
	-- 	0xff6ca5aa,	0x85c83baa,	0x74d6f9aa,	0x009e31aa,	0x8f6f00aa,
	-- }

	-- if reVector then
	-- 	local i = colors[num] or colors[#colors]		
	-- 	local r,g,b = hex2rgb(i)
	-- 	return dota.Vector(r, g, b)
	-- end
	
	-- return colors[num] or colors[#colors]
end

local screen = dota.GetScreenSize()
local con = screen.y/900
local F13 = dota.CreateFont("Arial",12*con,700*con)
local dev = {}

local modifier_functions = {
	PREATTACK_BONUS_DAMAGE	=0,
	PREATTACK_BONUS_DAMAGE_TARGET	=1,
	PREATTACK_BONUS_DAMAGE_PROC	=2,
	PREATTACK_BONUS_DAMAGE_POST_CRIT	=3,
	BASEATTACK_BONUSDAMAGE	=4,
	PROCATTACK_BONUS_DAMAGE_PHYSICAL	=5,
	PROCATTACK_CONVERT_PHYSICAL_TO_MAGICAL	=6,
	PROCATTACK_BONUS_DAMAGE_MAGICAL	=7,
	PROCATTACK_BONUS_DAMAGE_PURE	=8,
	PROCATTACK_BONUS_DAMAGE_MAGICAL_TARGET	=9,
	PROCATTACK_FEEDBACK	=10,
	OVERRIDE_ATTACK_DAMAGE	=11,
	PRE_ATTACK	=12,
	INVISIBILITY_LEVEL	=13,
	INVISIBILITY_ATTACK_BEHAVIOR_EXCEPTION	=14,
	PERSISTENT_INVISIBILITY	=15,
	MOVESPEED_BONUS_CONSTANT	=16,
	MOVESPEED_BASE_OVERRIDE	=17,
	MOVESPEED_BONUS_PERCENTAGE	=18,
	MOVESPEED_BONUS_PERCENTAGE_UNIQUE	=19,
	MOVESPEED_BONUS_UNIQUE	=20,
	MOVESPEED_BONUS_UNIQUE_=2,
	MOVESPEED_BONUS_CONSTANT_UNIQUE	=22,
	MOVESPEED_BONUS_CONSTANT_UNIQUE_=2,
	MOVESPEED_ABSOLUTE	=24,
	MOVESPEED_ABSOLUTE_MIN	=25,
	MOVESPEED_ABSOLUTE_MAX	=26,
	IGNORE_MOVESPEED_LIMIT	=27,
	MOVESPEED_LIMIT	=28,
	ATTACKSPEED_BASE_OVERRIDE	=29,
	FIXED_ATTACK_RATE	=30,
	ATTACKSPEED_BONUS_CONSTANT	=31,
	IGNORE_ATTACKSPEED_LIMIT	=32,
	COOLDOWN_REDUCTION_CONSTANT	=33,
	MANACOST_REDUCTION_CONSTANT	=34,
	HEALTHCOST_REDUCTION_CONSTANT	=35,
	BASE_ATTACK_TIME_CONSTANT	=36,
	BASE_ATTACK_TIME_CONSTANT_ADJUST	=37,
	BASE_ATTACK_TIME_PERCENTAGE	=38,
	ATTACK_POINT_CONSTANT	=39,
	BONUSDAMAGEOUTGOING_PERCENTAGE	=40,
	DAMAGEOUTGOING_PERCENTAGE	=41,
	DAMAGEOUTGOING_PERCENTAGE_ILLUSION	=42,
	DAMAGEOUTGOING_PERCENTAGE_ILLUSION_AMPLIFY	=43,
	TOTALDAMAGEOUTGOING_PERCENTAGE	=44,
	SPELL_AMPLIFY_PERCENTAGE_CREEP	=45,
	SPELL_AMPLIFY_PERCENTAGE	=46,
	SPELL_AMPLIFY_PERCENTAGE_UNIQUE	=47,
	HEAL_AMPLIFY_PERCENTAGE_SOURCE	=48,
	HEAL_AMPLIFY_PERCENTAGE_TARGET	=49,
	HP_REGEN_CAN_BE_NEGATIVE	=50,
	HP_REGEN_AMPLIFY_PERCENTAGE	=51,
	LIFESTEAL_AMPLIFY_PERCENTAGE	=52,
	SPELL_LIFESTEAL_AMPLIFY_PERCENTAGE	=53,
	MP_REGEN_AMPLIFY_PERCENTAGE	=54,
	MANA_DRAIN_AMPLIFY_PERCENTAGE	=55,
	MP_RESTORE_AMPLIFY_PERCENTAGE	=56,
	BASEDAMAGEOUTGOING_PERCENTAGE	=57,
	BASEDAMAGEOUTGOING_PERCENTAGE_UNIQUE	=58,
	INCOMING_DAMAGE_PERCENTAGE	=59,
	INCOMING_PHYSICAL_DAMAGE_PERCENTAGE	=60,
	INCOMING_PHYSICAL_DAMAGE_CONSTANT	=61,
	INCOMING_SPELL_DAMAGE_CONSTANT	=62,
	EVASION_CONSTANT	=63,
	NEGATIVE_EVASION_CONSTANT	=64,
	STATUS_RESISTANCE	=65,
	STATUS_RESISTANCE_STACKING	=66,
	STATUS_RESISTANCE_CASTER	=67,
	AVOID_DAMAGE	=68,
	AVOID_SPELL	=69,
	MISS_PERCENTAGE	=70,
	PHYSICAL_ARMOR_BASE_PERCENTAGE	=71,
	PHYSICAL_ARMOR_TOTAL_PERCENTAGE	=72,
	PHYSICAL_ARMOR_BONUS	=73,
	PHYSICAL_ARMOR_BONUS_UNIQUE	=74,
	PHYSICAL_ARMOR_BONUS_UNIQUE_ACTIVE	=75,
	PHYSICAL_ARMOR_BONUS_POST	=76,
	MIN_PHYSICAL_ARMOR	=77,
	IGNORE_PHYSICAL_ARMOR	=78,
	MAGICAL_RESISTANCE_BASE_REDUCTION	=79,
	MAGICAL_RESISTANCE_DIRECT_MODIFICATION	=80,
	MAGICAL_RESISTANCE_BONUS	=81, --(broken)
	MAGICAL_RESISTANCE_BONUS_ILLUSIONS	=82,
	MAGICAL_RESISTANCE_BONUS_UNIQUE	=83,
	MAGICAL_RESISTANCE_DECREPIFY_UNIQUE	=84,
	BASE_MANA_REGEN	=85,
	MANA_REGEN_CONSTANT	=86,
	MANA_REGEN_CONSTANT_UNIQUE	=87,
	MANA_REGEN_TOTAL_PERCENTAGE	=88,
	HEALTH_REGEN_CONSTANT	=89,
	HEALTH_REGEN_PERCENTAGE	=90,
	HEALTH_REGEN_PERCENTAGE_UNIQUE	=91,
	HEALTH_BONUS	=92,
	MANA_BONUS	=93,
	EXTRA_STRENGTH_BONUS	=94,
	EXTRA_HEALTH_BONUS	=95,
	EXTRA_MANA_BONUS	=96,
	EXTRA_MANA_BONUS_PERCENTAGE	=97,
	EXTRA_HEALTH_PERCENTAGE	=98,
	EXTRA_MANA_PERCENTAGE	=99,
	STATS_STRENGTH_BONUS	=100,
	STATS_AGILITY_BONUS	=101,
	STATS_INTELLECT_BONUS	=102,
	STATS_STRENGTH_BONUS_PERCENTAGE	=103,
	STATS_AGILITY_BONUS_PERCENTAGE	=104,
	STATS_INTELLECT_BONUS_PERCENTAGE	=105,
	CAST_RANGE_BONUS	=106,
	CAST_RANGE_BONUS_PERCENTAGE	=107,
	CAST_RANGE_BONUS_TARGET	=108,
	CAST_RANGE_BONUS_STACKING	=109,
	ATTACK_RANGE_BASE_OVERRIDE	=110,
	ATTACK_RANGE_BONUS	=111,
	ATTACK_RANGE_BONUS_UNIQUE	=112,
	ATTACK_RANGE_BONUS_PERCENTAGE	=113,
	MAX_ATTACK_RANGE	=114,
	PROJECTILE_SPEED_BONUS	=115,
	PROJECTILE_SPEED_BONUS_PERCENTAGE	=116,
	PROJECTILE_NAME	=117,
	REINCARNATION	=118,
	REINCARNATION_SUPPRESS_FX	=119,
	RESPAWNTIME	=120,
	RESPAWNTIME_PERCENTAGE	=121,
	RESPAWNTIME_STACKING	=122,
	COOLDOWN_PERCENTAGE	=123,
	COOLDOWN_PERCENTAGE_ONGOING	=124,
	CASTTIME_PERCENTAGE	=125,
	ATTACK_ANIM_TIME_PERCENTAGE	=126,
	MANACOST_PERCENTAGE	=127,
	MANACOST_PERCENTAGE_STACKING	=128,
	HEALTHCOST_PERCENTAGE	=129,
	HEALTHCOST_PERCENTAGE_STACKING	=130,
	DEATHGOLDCOST	=131,
	PERCENTAGE_DEATHGOLDCOST	=132,
	EXP_RATE_BOOST	=133,
	GOLD_RATE_BOOST	=134,
	PREATTACK_CRITICALSTRIKE	=135,
	PREATTACK_TARGET_CRITICALSTRIKE	=136,
	MAGICAL_CONSTANT_BLOCK	=137,
	PHYSICAL_CONSTANT_BLOCK	=138,
	PHYSICAL_CONSTANT_BLOCK_SPECIAL	=139,
	TOTAL_CONSTANT_BLOCK_UNAVOIDABLE_PRE_ARMOR	=140,
	TOTAL_CONSTANT_BLOCK	=141,
	OVERRIDE_ANIMATION	=142,
	OVERRIDE_ANIMATION_RATE	=143,
	ABSORB_SPELL	=144,
	REFLECT_SPELL	=145,
	DISABLE_AUTOATTACK	=146,
	BONUS_DAY_VISION	=147,
	BONUS_DAY_VISION_PERCENTAGE	=148,
	BONUS_NIGHT_VISION	=149,
	BONUS_NIGHT_VISION_UNIQUE	=150,
	BONUS_VISION_PERCENTAGE	=151,
	FIXED_DAY_VISION	=152,
	FIXED_NIGHT_VISION	=153,
	MIN_HEALTH	=154,
	ABSOLUTE_NO_DAMAGE_PHYSICAL	=155,
	ABSOLUTE_NO_DAMAGE_MAGICAL	=156,
	ABSOLUTE_NO_DAMAGE_PURE	=157,
	IS_ILLUSION	=158,
	ILLUSION_LABEL	=159,
	STRONG_ILLUSION	=160,
	SUPER_ILLUSION	=161,
	SUPER_ILLUSION_WITH_ULTIMATE	=161,
	XP_DURING_DEATH	=163,
	TURN_RATE_PERCENTAGE	=164,
	TURN_RATE_OVERRIDE	=165,
	DISABLE_HEALING	=166,
	ALWAYS_ALLOW_ATTACK	=167,
	ALWAYS_ETHEREAL_ATTACK	=168,
	OVERRIDE_ATTACK_MAGICAL	=169,
	UNIT_STATS_NEEDS_REFRESH	=170,
	BOUNTY_CREEP_MULTIPLIER	=171,
	BOUNTY_OTHER_MULTIPLIER	=172,
	UNIT_DISALLOW_UPGRADING	=173,
	DODGE_PROJECTILE	=174,
	TRIGGER_COSMETIC_AND_END_ATTACK	=175,
	MAX_DEBUFF_DURATION	=176,
	PRIMARY_STAT_DAMAGE_MULTIPLIER	=177,
	PREATTACK_DEADLY_BLOW	=178,
	ALWAYS_AUTOATTACK_WHILE_HOLD_POSITION	=179,
	SPELL_TARGET_READY	=180,
	ATTACK_RECORD	=181,
	ATTACK_START	=182,
	ATTACK	=183,
	ATTACK_LANDED	=184,
	ATTACK_FAIL	=185,
	ATTACK_ALLIED	=186,
	PROJECTILE_DODGE	=187,
	ORDER	=188,
	UNIT_MOVED	=189,
	ABILITY_START	=190,
	ABILITY_EXECUTED	=191,
	ABILITY_FULLY_CAST	=192,
	BREAK_INVISIBILITY	=193,
	ABILITY_END_CHANNEL	=194,
	PROCESS_UPGRADE	=195,
	REFRESH	=196,
	TAKEDAMAGE	=197,
	DEATH_PREVENTED	=198,
	STATE_CHANGED	=199,
	ORB_EFFECT	=200,
	PROCESS_CLEAVE	=201,
	DAMAGE_CALCULATED	=202,
	MAGIC_DAMAGE_CALCULATED	=203,
	ATTACKED	=204,
	DEATH	=205,
	DEATH_COMPLETED	=206,
	RESPAWN	=207,
	SPENT_MANA	=208,
	SPENT_HEALTH	=209,
	TELEPORTING	=210,
	TELEPORTED	=211,
	SET_LOCATION	=212,
	HEALTH_GAINED	=213,
	MANA_GAINED	=214,
	TAKEDAMAGE_KILLCREDIT	=215,
	HERO_KILLED	=216,
	HEAL_RECEIVED	=217,
	BUILDING_KILLED	=218,
	MODEL_CHANGED	=219,
	MODIFIER_ADDED	=220,
	MODIFIER_REMOVED	=221,
	TOOLTIP	=222,
	MODEL_CHANGE	=223,
	MODEL_SCALE	=224,
	MODEL_SCALE_ANIMATE_TIME	=225,
	MODEL_SCALE_USE_IN_OUT_EASE	=226,
	MODEL_SCALE_CONSTANT	=227,
	IS_SCEPTER	=228,
	IS_SHARD	=229,
	RADAR_COOLDOWN_REDUCTION	=230,
	TRANSLATE_ACTIVITY_MODIFIERS	=231,
	TRANSLATE_ATTACK_SOUND	=232,
	LIFETIME_FRACTION	=233,
	PROVIDES_FOW_POSITION	=234,
	SPELLS_REQUIRE_HP	=235,
	CONVERT_MANA_COST_TO_HEALTH_COST	=236,
	FORCE_DRAW_MINIMAP	=237,
	DISABLE_TURNING	=238,
	IGNORE_CAST_ANGLE	=239,
	CHANGE_ABILITY_VALUE	=240,
	OVERRIDE_ABILITY_SPECIAL	=241,
	OVERRIDE_ABILITY_SPECIAL_VALUE	=242,
	ABILITY_LAYOUT	=243,
	DOMINATED	=244,
	KILL	=245,
	ASSIST	=246,
	TEMPEST_DOUBLE	=247,
	PRESERVE_PARTICLES_ON_MODEL_CHANGE	=248,
	ATTACK_FINISHED	=249,
	IGNORE_COOLDOWN	=250,
	CAN_ATTACK_TREES	=251,
	VISUAL_Z_DELTA	=252,
	VISUAL_Z_SPEED_BASE_OVERRIDE	=253,
	INCOMING_DAMAGE_ILLUSION	=254,
	DONT_GIVE_VISION_OF_ATTACKER	=255,
	TOOLTIP2=256,
	ATTACK_RECORD_DESTROY	=257,
	PROJECTILE_OBSTRUCTION_HIT	=258,
	SUPPRESS_TELEPORT	=259,
	ATTACK_CANCELLED	=260,
	SUPPRESS_CLEAVE	=261,
	BOT_ATTACK_SCORE_BONUS	=262,
	ATTACKSPEED_REDUCTION_PERCENTAGE	=263,
	MOVESPEED_REDUCTION_PERCENTAGE	=264,
	ATTACK_WHILE_MOVING_TARGET	=265,
	ATTACKSPEED_PERCENTAGE	=266,
	ATTEMPT_PROJECTILE_DODGE	=267,
	PREDEBUFF_APPLIED	=268,
	COOLDOWN_PERCENTAGE_STACKING	=269,
	SPELL_REDIRECT_TARGET	=270,
	TURN_RATE_CONSTANT	=271,
	PACK_RAT	=272,
	PHYSICALDAMAGEOUTGOING_PERCENTAGE	=273,
	KNOCKBACK_AMPLIFICATION_PERCENTAGE	=274,
	HEALTHBAR_PIPS	=275,
	INCOMING_DAMAGE_CONSTANT	=276,
	LL_APPLIED_SUCCESSFULLY	=277,
	AVOID_DAMAGE_AFTER_REDUCTIONS	=278,
	FAIL_ATTACK	=279,
	PREREDUCE_INCOMING_DAMAGE_MULT	=280,
	SUPPRESS_FULLSCREEN_DEATH_FX	=281,
	INCOMING_DAMAGE_CONSTANT_POST	=282,
	DAMAGEOUTGOING_PERCENTAGE_MULTIPLICATIVE	=283,
	TICK_GOLD_MULTIPLIER	=284,
	SLOW_RESISTANCE_UNIQUE	=285,
	SLOW_RESISTANCE_STACKING	=286,
	AOE_BONUS_PERCENTAGE	=287,
	PROJECTILE_SPEED	=288,
	PROJECTILE_SPEED_TARGET	=289,
	BECOME_STRENGTH	=290,
	BECOME_AGILITY	=291,
	BECOME_INTELLIGENCE	=292,
	BECOME_UNIVERSAL	=293,
	FORCE_PROC_MAGIC_STICK	=294,
	DAMAGE_HPLOSS	=295,
	SHARE_XPRUNE	=296,
	NO_FREE_TP_SCROLL_ON_DEATH	=297,
	HAS_BONUS_NEUTRAL_ITEM_CHOICE	=298,
	FORCE_MAX_HEALTH	=299,
	FORCE_MAX_MANA	=300,
	AOE_BONUS_CONSTANT	=301,
	AOE_BONUS_CONSTANT_STACKING	=302,
	TAKEDAMAGE_POST_UNAVOIDABLE_BLOCK	=303,
	MUTE_DAMAGE_ABILITIES	=304,
	SUPPRESS_CRIT	=305,
	ABILITY_POINTS	=306,
	BUYBACK_PENALTY_PERCENT	=307,
	ITEM_SELLBACK_COST	=308,
	DISASSEMBLE_ANYTHING	=309,
	FIXED_MANA_REGEN	=310,
	BONUS_UPHILL_MISS_CHANCE	=311,
	CREEP_DENY_PERCENT	=312,
	ATTACKSPEED_ABSOLUTE_MAX	=313,
	FOW_TEAM	=314,
	HERO_BEGIN_DYING	=315,
	BONUS_LOTUS_HEAL	=316,
	BASE_HP_REGEN_PER_STR_BONUS_PERCENTAGE	=317,
	BASE_ARMOR_PER_AGI_BONUS_PERCENTAGE	=318,
	BASE_MP_REGEN_PER_INT_BONUS_PERCENTAGE	=319,
	BASE_MRES_PER_INT_BONUS_PERCENTAGE	=320,
	DAY_STARTED	=321,
	CREATE_BONUS_ILLUSION_CHANCE	=322,
	CREATE_BONUS_ILLUSION_COUNT	=323,
	PSEUDORANDOM_BONUS	=324,
	ATTACK_HEIGHT_BONUS	=325,
	SKIP_ATTACK_REGULATOR	=326,
	MISS_PERCENTAGE_TARGET	=327,
	ADDITIONAL_NEUTRAL_ITEM_DROPS	=328,
	KILL_STREAK_BONUS_GOLD_PERCENTAGE	=329,
	HP_REGEN_MULTIPLIER_PRE_AMPLIFICATION	=330,
	HEROFACET_OVERRIDE	=331,
	TREE_CUT_DOWN	=332,
	CLEAVE_ATTACK_LANDED	=333,
}

function DevPanel(me,PLAYER,Enum,eCache,onupdatework)

	local MyIndex = me:GetIndex()

	if not dev.init then 
		dev = {init=true, skin_plus = {}, skin_number=1, abiity_number=1, item_number=1, mod_number=1, draw={}}
	end

	--= DevMode
	if dev.nvar then
		local tar = PLAYER:GetSelection()[1]			
		
		local class = "C_DOTA_BaseNPC"

		if not dev.set_skin then
			dev.set_skin = true
			-- tar:SetModel("models/heroes/shadow_fiend/shadow_fiend_arcana.vmdl")
			-- dota.EntityToBaseNPCHero(tar):FixSkinNew()
		end 
		
		--C_BaseEntity
		--C_DOTABaseAbility
		--C_DOTA_Item
		--C_DOTA_BaseNPC
		--C_DOTAPlayerController
		--CBasePlayerController
		--C_DOTA_BaseNPC_Hero
		--C_DOTA_BaseNPC_Additive
		--C_DOTA_Ability_Rubick_SpellSteal
		--DOTAAbilityDefinition_t
		local count = 0 local count_x = 0
		if class == "C_DOTABaseAbility" or class == "DOTAAbilityDefinition_t" or class:find("DOTA_Ability_") then
			tar = PLAYER:GetSelection()[1]:GetAbility(dev.abiity_number)
		elseif class == "C_DOTA_Item" then
			tar = PLAYER:GetSelection()[1]:GetInventory():GetItemInSlot(dev.item_number-1 or 0)
		elseif class == "C_DOTAPlayerController" or class == "CBasePlayerController" then 
			tar = PLAYER		
		elseif class ~= "C_DOTAWearableItem" and class ~= "C_EconEntity" then
			tar = dota.GetEntityUnderCursor() or me
		end

		if tar and tar:GetBaseClassName() == "C_DOTA_Item_Physical" then
			tar = dota.EntityToItem(tar):GetItemPhysicalItem()
			class = "C_DOTA_Item"
		end 

		print_address(tar)

		if not dev.net_vars then
			dev.net_vars = {}
			dev.net_vars.logo = DrawText(225,50,Enum.WHITE,tar and tar:GetBaseClassName() or "",F13,true)
			dev.net_vars.bg = DrawRect(0,0,screen.x,screen.y,0x00000055,-1,true)
			dev.net_vars.data = LoadNetvars(class)
			dev.net_vars.safe = {}
		else 
			dev.net_vars.logo.text = tar and tar:GetBaseClassName() or ""
			if tar and tar:GetBaseClassName() == "C_DOTAWearableItem" then 
				dev.net_vars.logo.text = (tar:GetSkinName() or " nan ").." id : "..(tar:GetSkinId() or " nan").." count : "..dev.skin_number.." index :"..tar:GetHandle()
			end
		end
		
		local function pairsByKeys(t, f)
			local a = {}
			for n in pairs(t) do table.insert(a, n) end
			table.sort(a, f)
			local i = 0
			local iter = function ()
				i = i + 1
				if a[i] == nil then return nil
				else return a[i], t[a[i]]
				end
			end
			return iter
		end

		for i,v in pairsByKeys(dev.net_vars.data) do
		
			if not dev.net_vars[i] then
				count=count+1
				local dimanic_y = 800
				dev.net_vars[i] = DrawText((count_x)*300*con/1.2+150*con/1.2,50+ (count)*20*con/1.2 - count_x*dimanic_y*con/1.2,Enum.WHITE,i,F13,true)
				if count%40 == 0 then
					count_x = count_x + 1
				end
			elseif tar then

				local typ =i:sub(1,3)

				local function GetStr() 
					
					if class == "DOTAAbilityDefinition_t" then 
						if typ == "m_f" then
							return i.." : "..tar:GetNetVarAbilityFloat(i)
						elseif typ == "m_b" then
							return i.." : "..tostring(tar:GetNetVarAbilityBool(i))
						elseif i:sub(1,4) == "m_sz" then
							return i.." : "..tar:GetNetVarAbilityStr(i)
						end
						return i.." : "..tar:GetNetVarAbilityInt(i)
					end

					if typ == "m_i" then
						return i.." : "..tar:GetPropertyInt(class,i)
					elseif typ == "m_f" then
						return i.." : "..tar:GetPropertyFloat(class,i)
					elseif typ == "m_b" then
						return i.." : "..tostring(tar:GetPropertyBool(class,i))
					elseif typ == "m_v" then
						local prop = tar:GetPropertyVector(class,i)
						return i.." : "..tostring(prop.x)..","..tostring(prop.y)
					elseif i:sub(1,4) == "m_sz" then
						local prop = tar:GetPropertyString(class,i)
						return i.." : "..tostring(prop)
					else
						return i.." : "..tar:GetPropertyInt(class,i)
					end
					return ""
				end
				
				local text = GetStr()

				if text ~= dev.net_vars[i].text then
					dev.net_vars.safe[i.."!"] = dota.GetTick()+1500
				end
				if not dev.net_vars.safe[i.."!"] or dev.net_vars.safe[i.."!"] < dota.GetTick() then
					dev.net_vars[i].color = Enum.WHITE
				else 
					dev.net_vars[i].color = 0x50ff50ff
				end
				dev.net_vars[i].text = text

			end
		end

	end

	local pl = PLAYER:GetSelection()[1]
	if not pl or (pl:IsMe(MyIndex) and dota.GetEntityUnderCursor()~=nil) then pl = dota.GetEntityUnderCursor() or me end

	if pl:GetBaseClassName() == "C_DOTA_Item_Physical" then
		pl = dota.EntityToItem(pl):GetItemPhysicalItem()
	end 

	local xx_ = 0.833*con
		local zz = 525*con
	local back_color = 0x00000090 

	if not dev.draw.com and not dev.off_com then
		dev.draw.com = {}
		dev.draw.com.bg = DrawRect(255*xx_,zz,215*xx_,550*xx_,back_color,-1,true)
		dev.draw.com.logo = DrawText(325*xx_,zz,Enum.WHITE,"Common",F13,true)
		dev.draw.com.txt = {}
	end 
	if not dev.draw.ent and not dev.off_ent then
		dev.draw.ent = {}
		dev.draw.ent.bg = DrawRect(1675*xx_,0,350*xx_,1080*xx_,back_color,-1,true)
		dev.draw.ent.logo = DrawText(1750*xx_,50*xx_,Enum.WHITE,"SelectionUnit",F13,true)
		dev.draw.ent.txt = {}
		dev.draw.ent.img = DrawRect(1850*xx_,42*xx_,40*xx_,22*xx_,Enum.WHITE,-1,true)
	end 
	if not dev.draw.mod and not dev.off_mod then
		dev.draw.mod = {}
		dev.draw.mod.bg = DrawRect(475*xx_,zz,320*xx_,550*xx_,back_color,-1,true)
		dev.draw.mod.logo = DrawText(550*xx_,zz,Enum.WHITE,"Modifer",F13,true)
		dev.draw.mod.txt = {}
		dev.draw.mod.img = DrawRound(740*xx_,zz,25*xx_,25*xx_,Enum.WHITE,-1,true,6,Enum.WHITE,2*con)
	end 
	if not dev.draw.spell and not dev.off_spell then
		dev.draw.spell = {}
		dev.draw.spell.bg = DrawRect(800*xx_,zz,200*xx_,550*xx_,back_color,-1,true)
		dev.draw.spell.logo = DrawText(850*xx_,zz,Enum.WHITE,"Ability",F13,true)
		dev.draw.spell.txt = {}
		dev.draw.spell.img = DrawRect(950*xx_,zz,25*xx_,25*xx_,Enum.WHITE,-1,true)

		dev.draw.spell.bg2 = DrawRect(1003*xx_,zz,200*xx_,550*xx_,back_color,-1,true)
		dev.draw.spell.bg3 = DrawRect(1206*xx_,zz,200*xx_,550*xx_,back_color,-1,true)
	end 
	if not dev.draw.item and not dev.off_item then
		dev.draw.item = {}
		dev.draw.item.bg = DrawRect(1410*xx_,zz,260*xx_,550*xx_,back_color,-1,true)
		dev.draw.item.logo = DrawText(1480*xx_,zz,Enum.WHITE,"Item in 1st slot",F13,true)
		dev.draw.item.txt = {}
		dev.draw.item.img = DrawRect(1600*xx_,zz,30*xx_,25*xx_,Enum.WHITE,-1,false)
	end 
	if not dev.draw.mod_fn then 
		dev.draw.mod_fn = {}
		dev.draw.mod_fn.bg = DrawRound(1320*con,170*con,56*con,15*con,Enum.COLOR_BG,-1,true,6*con,0x505050,2*con)
		dev.draw.mod_fn.logo = DrawText(dev.draw.mod_fn.bg.x+4*con,dev.draw.mod_fn.bg.y,Enum.WHITE,"Mod Func",F13,true)
		dev.draw.mod_fn.txt = {}
		dev.draw.mod_fn.show = false
		dev.draw.mod_fn.bg2 = DrawRound(dev.draw.mod_fn.bg.x-200*con,dev.draw.mod_fn.bg.y+40*con,10*con,10*con,back_color,-1,false,4*con)
	end
	if not dev.draw.proj then 
		dev.draw.proj = {}
		dev.draw.proj.bg = DrawRound(dev.draw.mod_fn.bg.x,dev.draw.mod_fn.bg.y+20*con,56*con,15*con,Enum.COLOR_BG,-1,true,6*con,0x505050,2*con)
		dev.draw.proj.logo = DrawText(dev.draw.proj.bg.x+4*con,dev.draw.proj.bg.y,Enum.WHITE,"Projectie",F13,true)
		dev.draw.proj.txt = {}
		dev.draw.proj.show = false
		dev.draw.proj.bg2 = DrawRound(dev.draw.mod_fn.bg2.x+50*con,dev.draw.mod_fn.bg2.y,dev.draw.mod_fn.bg2.w,dev.draw.mod_fn.bg2.h,back_color,-1,false,4*con)
	end

	--common
	if dev.draw.com then
		dev.draw.com.logo.text = "Common : ("..tostring(onupdatework)..")"
		local cursor = dota.Get3dPositionUnderCursor()
		local n = 0
		local function inc() n = n + 1 if not dev.draw.com.txt[n] then dev.draw.com.txt[n] = DrawText(280*xx_,zz+n*23*xx_,Enum.WHITE,"",F13,true) end end

		inc() dev.draw.com.txt[n].text = "Tick : "					..dota.GetTick().."  Paused "..tostring(dota.GameRules.IsPaused())
		inc() dev.draw.com.txt[n].text = "ScreenXY : "				..dota.GetScreenSize().x..','..dota.GetScreenSize().y
		inc() dev.draw.com.txt[n].text = "Latency : "				..round(dota.GetLatency(),3).." "..round(dota.GetAvgLatency(),3)
		inc() dev.draw.com.txt[n].text = "Ent : "					..tostring(dota.GetEntityUnderCursor() and dota.GetEntityUnderCursor():GetEntName()) dev.draw.com.txt[n].color = Enum.COLOR_YELLOW
		inc() dev.draw.com.txt[n].text = "IngameXYZ : "				..math.floor(cursor.x)..','..math.floor(cursor.y)..','..math.floor(cursor.z)
		inc() dev.draw.com.txt[n].text = "MouseXY : "				..dota.GetMousePosition().x..','..dota.GetMousePosition().y
		-- inc() txt_data[n].text = "WindowsXY : "				..dota.GetCursorPosUnSafe().x..','..dota.GetCursorPosUnSafe().y
		inc() dev.draw.com.txt[n].text = "Time : "					..SecondsToClock(dota.GetGameTime(),true).." | "..(SecondsToClock(dota.GetMapTime(),true))
		inc() dev.draw.com.txt[n].text = "IsChat/IsConOpen : "		..tostring(dota.IsChat())..','..tostring(dota.IsConOpen())
		inc() dev.draw.com.txt[n].text = "Shop/Search/Alt : "		..tostring(dota.IsShopOpen())..','..tostring(dota.IsShopSearch())..","..tostring(dota.IsAltDown() and 1 or 0)..","..tostring(dota.IsKeyDown(1) and 1 or 0)
		inc() dev.draw.com.txt[n].text = "IsFreePosition : "		..tostring(dota.IsFreePosition(cursor))
		inc() dev.draw.com.txt[n].text = "GroundHeight/Terrain : "	..math.floor(dota.GetGroundHeight(cursor))..'/'..math.floor(dota.GetTerrainHeight(camera.GetEye()))
		inc() dev.draw.com.txt[n].text = "EntityVirtualCur : "		..tostring(dota.GetEntityUnderVirtualCursor(camera.GetEye(),dota.GetMousePosition()))
		inc() dev.draw.com.txt[n].text = "Camera : "				..(math.floor(camera.GetPosition().x).."x"..math.floor(camera.GetPosition().y).."x"..math.floor(camera.GetPosition().z))
		inc() dev.draw.com.txt[n].text = "Eye : "					..math.floor(camera.GetEye().x)..'x'..math.floor(camera.GetEye().y)..'x'..math.floor(camera.GetEye().z)
		inc() dev.draw.com.txt[n].text = "Distance : "				..math.floor(camera.GetCameraDistance())
		inc() dev.draw.com.txt[n].text = "game | attack mode : "	..(dota.GameRules.GetInstance():GetGameMode()..' | '..dota.GetAttackMode())
		inc() dev.draw.com.txt[n].text = "IsDay : "					..tostring(IsDay(true))
		inc() dev.draw.com.txt[n].text = "IsCustom : "				..tostring(dota.GameManager.IsCustomGame()).." "..dota.GameManager.GetMapName()
		inc() dev.draw.com.txt[n].text = "Max Ent : "				..dota.GlobalInstanceManager:GetClientEntityList():GetHighestEntityIndex()

		-- local is_key_num = nil
		-- for i = 65,90 do if dota.IsKeyDown(i) then 	is_key_num = i	end end
		-- inc() dev.draw.com.txt[n].text = "IsUpdate / key : "				..tostring(not is_update_work).." / "..(is_key_num and string.char(is_key_num) or "")
	end
	
	--select unit
	if dev.draw.ent and pl then

		pl = dota.EntityToBaseNPCHero(pl) local n = 0
		local pos = pl:GetAbsOrigin()
		local valid_name = pl:GetName() or ""

		local function inc() n = n + 1 if not dev.draw.ent.txt[n] then dev.draw.ent.txt[n] = DrawText(1700*xx_,50*xx_+n*23*xx_,Enum.WHITE,"",F13,true) end end
		local function lite() dev.draw.ent.txt[n].color = Enum.COLOR_YELLOW end

		dev.draw.ent.img.textureId = GetTextureId2(valid_name) if dev.draw.ent.img.textureId == 0 then dev.draw.ent.img.textureId = -1 end
		inc() dev.draw.ent.txt[n].text = ""						..valid_name 
		inc() dev.draw.ent.txt[n].text = ""						..pl:GetBaseClassName()  dev.draw.ent.txt[n].color = Enum.COLOR_SCROLL_ON
		inc() dev.draw.ent.txt[n].text = ""						..pl:GetNewClassName()
		inc() dev.draw.ent.txt[n].text = "Name : "				..dota.Localize(valid_name)
		if pl:IsDotaNPC() and valid_name ~= "" then
		inc() dev.draw.ent.txt[n].text = "Skin : "				..pl:GetSkinName() 		lite() dev.draw.ent.txt[n].center = true
		--inc() dev.draw.ent.txt[n].text = "Sound : "				..pl:GetSoundSet() 		lite()
		inc() dev.draw.ent.txt[n].text = "UnitType : "			..pl:GetUnitType().." : "..PrintFlagsUnit(pl)
		inc() dev.draw.ent.txt[n].text = "LVL : "				..pl:GetLevel().."("..pl:GetCurrentXP()..")"
		inc() dev.draw.ent.txt[n].text = "dmg | dmgBonus : "	..((pl:GetDamageMax()+pl:GetDamageMin())/2).." | "..pl:GetBonusDamage()
		inc() dev.draw.ent.txt[n].text = "HP | MP | Regen : "	..pl:GetHealth().." | "..math.floor(pl:GetMana()) .." | "..round(pl:GetHealthRegenEx(),2) 	lite()
		inc() dev.draw.ent.txt[n].text = "physArm | mgcArm : "	..round(pl:GetPhysicalArmorReduction(),2).." | " ..(round(pl:GetMagicDmgResist(),2)*100)	lite()
		inc() dev.draw.ent.txt[n].text = "move | attack speed : "..pl:GetMoveSpeed().." / "..round(pl:GetAttackSpeed(),2)*100								lite()
		inc() dev.draw.ent.txt[n].text = "AttackTime : "		..round(pl:GetBaseAttackTime(),2).." | "..round(GetAttackTime(pl),2).."s".." | "..round(GetAttackDelayKV(pl),2).."s" lite()
		inc() dev.draw.ent.txt[n].text = "Attack Ready : "		..tostring(IsNewAttackReady(pl))
		if IsHero(pl) then
		inc() dev.draw.ent.txt[n].text = "STR | AGL | INT : "	..math.floor(pl:GetStrengthTotal()).." | "..math.floor(pl:GetAgilityTotal()).." | "..math.floor(pl:GetIntellectTotal())
		end
		inc() dev.draw.ent.txt[n].text = "State : "				..PrintFlags(pl)
		end
		inc() dev.draw.ent.txt[n].text = "Pos : "				..(math.floor(pos.x*10)/10)..","..(math.floor(pos.y*10)/10)
		inc() dev.draw.ent.txt[n].text = "WordScreen : "		..math.floor(dota.WorldToScreen(pos,dota.Vector(0,0,100)).x)..","..math.floor(dota.WorldToScreen(pos,dota.Vector(0,0,100)).y)
		inc() dev.draw.ent.txt[n].text = "RotR : "				..round(pl:GetRotation().y*math.pi/180,3).." / "..round(pl:GetRotation().y,3)
		inc() dev.draw.ent.txt[n].text = "Visible : "			..tostring(pl:IsVisible())
		inc() dev.draw.ent.txt[n].text = "Team : "				..pl:GetTeamIndex()
		inc() dev.draw.ent.txt[n].text = "IsDotaNPC : "			..tostring(pl:IsDotaNPC())
		inc() dev.draw.ent.txt[n].text = "Handle : "			..pl:GetHandle().." / "..pl:GetIndex().." / "..(pl:GetHandle()+pl:GetIndex())/2
		inc() dev.draw.ent.txt[n].text = "DistanceToMe : "		..math.floor(GetDistance2D(me:GetNetworkOrigin(),pos))
		inc() dev.draw.ent.txt[n].text = "HullRange : "			..pl:GetHullRadius()
		inc() dev.draw.ent.txt[n].text = "GetOwner : "			..(pl:GetOwner() and pl:GetOwner():GetBaseClassName() or "")
		inc() dev.draw.ent.txt[n].text = "PlayerId : "			..(pl:IsDotaNPC() and IsHero(pl) and pl:GetPlayerId() or "false")
		if pl:IsDotaNPC() then
		inc() dev.draw.ent.txt[n].text = "GetTurnTime : "		..round(GetTurnTimeLatence(pl,dota.Get3dPositionUnderCursor()),3).." "..GetTurn(pl)
		inc() dev.draw.ent.txt[n].text = "HpOfset : "			..pl:GetHealthbarOffset().." - "..pl:GetHealthbarOffsetOverride()
		inc() dev.draw.ent.txt[n].text = "Activity / Seq : "	..pl:GetActivity().." / "..pl:GetPropertyInt("C_DOTA_BaseNPC","m_NetworkSequenceIndex")
		inc() dev.draw.ent.txt[n].text = "IsRange : "			..tostring(IsRanged(pl))
		inc() dev.draw.ent.txt[n].text = "AttackRange : "		..pl:GetAttackRange() 		lite()
		inc() dev.draw.ent.txt[n].text = "IsIllusion : "		..tostring(IsHeroOrBear(pl) and pl:IsIllusion())
		inc() dev.draw.ent.txt[n].text = "CanInvisibleCast : "	..tostring(CanInvisibleCast(pl))
		inc() dev.draw.ent.txt[n].text = "IsWaitingToSpawn : "	..tostring(pl:IsWaitingToSpawn())
		inc() dev.draw.ent.txt[n].text = "IsHaveBarier : "		..tostring(pl:GetBarriers():IsShow())
		inc() dev.draw.ent.txt[n].text = "Eul/Stn/Hx/Sal/Rot : "..round(GetInvulTime(pl),1).."/"..round(GetStunTime(pl,true),1).."/"..round(GetHexTime(pl),1).."/"..round(GetSilenceTime(pl,true),1).."/"..round(GetRootTime(pl),1) lite()
		if Enum.MOD_FLAG_VERSION then
			Enum.MOD_FLAG_VERSION = false
			inc() dev.draw.ent.txt[n].text = "Eul/Stn/Hx/Sal/Rot : "..round(GetInvulTime(pl),1).."/"..round(GetStunTime(pl,true),1).."/"..round(GetHexTime(pl),1).."/"..round(GetSilenceTime(pl,true),1).."/"..round(GetRootTime(pl),1) lite()
			Enum.MOD_FLAG_VERSION = true
		end
		inc() dev.draw.ent.txt[n].text = "Status/Amplify : "	..GetStatusResist(pl).."/"..CalculateSpellAmplW(pl)
		inc() dev.draw.ent.txt[n].text = "IsCasting : "			..tostring(IsCasting(pl)).." : "..tonumber(GetCastingTime(pl))
		inc() dev.draw.ent.txt[n].text = "IsMeepoClones : "			..tostring(pl:IsMeepoClones())

		local bar = pl:GetBarriers()
		local function inF(val)	return "("..math.floor(val or -1)..")" end 				
		inc() dev.draw.ent.txt[n].text = "Bar P/M/A : "	..math.floor(bar.PHYS)..inF(bar.PHYS_MAX).." "..math.floor(bar.MGC)..inF(bar.MGC_MAX).." "..math.floor(bar.ALL)..inF(bar.ALL_MAX)

		if pl:GetBaseClassName() == "C_DOTA_Unit_Courier" then
			inc() dev.draw.ent.txt[n].text = "GetCourierState : "			..dota.EntityToCourier(pl):GetCourierState()
		end
		if IsHeroOrBear(pl) then
			inc() dev.draw.ent.txt[n].text = "GetFacet : "			..dota.EntityToBaseNPCHero(pl):GetFacetID()
		end 
		end

	end

	--modifier
	if dev.draw.mod and pl and pl:IsDotaNPC() then 
		local modifiers = pl:GetModifierManager()
		local count = modifiers and modifiers:GetCurrentBuffCount() or 0
		local abs_count = math.min(dev.mod_number,count)

		dev.draw.mod.logo.text = "Modifier : "..count..". Show : "..(abs_count)..". #"..dev.mod_number..""

		if count > 0 then
			local buff = modifiers:GetBuffByIndex(abs_count-1)
			if buff then

				dev.draw.mod.img.textureId = GetTextureId2(buff:GetTexture())
				dev.draw.mod.img.border = buff:IsDebuff() and 0xff0000ff or 0x00ff00ff

				local n = 0
				local function inc() n = n + 1 if not dev.draw.mod.txt[n] then dev.draw.mod.txt[n] = DrawText(500*xx_,zz+n*23*xx_,Enum.WHITE,"",F13,true) end end

				inc() dev.draw.mod.txt[n].text = ""									..buff:GetName() dev.draw.mod.txt[n].color = Enum.COLOR_SCROLL_ON
				inc() dev.draw.mod.txt[n].text = "GetCaster : "						..(buff:GetCaster() and buff:GetCaster():GetName() or "null")
				inc() dev.draw.mod.txt[n].text = "GetAbility : "					..(buff:GetAbility() and buff:GetAbility():GetName() or "null")
				inc() dev.draw.mod.txt[n].text = "IsDebuff : "						..tostring(buff:IsDebuff())
				inc() dev.draw.mod.txt[n].text = "GetStackCount : "					..buff:GetStackCount()
				inc() dev.draw.mod.txt[n].text = "GetDieTime : "					..SecondsToClock(buff:GetDieTime(),true)
				inc() dev.draw.mod.txt[n].text = "CreationTime : "					..SecondsToClock(buff:GetCreationTime(),true)
				inc() dev.draw.mod.txt[n].text = "GetDuration : "					..buff:GetDuration()
				inc() dev.draw.mod.txt[n].text = "Tex: "							..buff:GetTexture()
				inc() dev.draw.mod.txt[n].text = "GetRemainingTime : "				..buff:GetRemainingTime()
				inc() dev.draw.mod.txt[n].text = "GetElapsedTime : "				..buff:GetElapsedTime()
				inc() dev.draw.mod.txt[n].text = "GetBuffIndex : "					..buff:GetBuffIndex()
				if Enum.MOD_FLAG_VERSION then
					inc() dev.draw.mod.txt[n].text = "GetBuffType : "					..PrintFlags(buff) dev.draw.mod.txt[n].color = Enum.COLOR_SCROLL_ON
				end

			elseif dev.draw.mod.txt[1] then
				dev.draw.mod.txt = {}
				dev.draw.mod.img.textureId = 0
				collectgarbage("collect")
			end
		else
			if dev.draw.mod.txt[1] then
				dev.draw.mod.txt = {}
				dev.draw.mod.img.textureId = 0
				collectgarbage("collect")
			end
		end
	end

	--items
	if dev.draw.item and pl and pl:IsDotaNPC() then
		pl = dota.EntityToBaseNPC(pl)
		local inv = pl:GetInventory()
		local item = inv:GetItemInSlot(dev.item_number-1)
		dev.draw.item.logo.text = "Items # "..(dev.item_number-1)

		if item then

			dev.draw.item.img.textureId= GetTextureId2(item:GetTextureName())
			dev.draw.item.img.visible = true	
			
			local n = 0
			local function inc() n = n + 1 if not dev.draw.item.txt[n] then dev.draw.item.txt[n] = DrawText(1425*xx_ ,zz+n*23*xx_,Enum.WHITE,"",F13,true) end end

			inc() dev.draw.item.txt[n].text = ""								..item:GetName()  dev.draw.item.txt[n].color = Enum.COLOR_SCROLL_ON
			inc() dev.draw.item.txt[n].text = ""								..item:GetBaseClassName()
			inc() dev.draw.item.txt[n].text = "GetId : "						..item:GetId() .. " index("..item:GetIndex()..")"
			inc() dev.draw.item.txt[n].text = "GetCooldownLength : "			..round(item:GetCooldownLength(1),2)
			inc() dev.draw.item.txt[n].text = "GetLevel : "						..item:GetLevel()
			inc() dev.draw.item.txt[n].text = "GetCastRange / AOE : "			..item:GetCastRange().." / "..item:GetAOERadius()
			inc() dev.draw.item.txt[n].text = "GetManaCost : "					..item:GetManaCost()
			inc() dev.draw.item.txt[n].text = "GetCost : "						..item:GetCost()
			inc() dev.draw.item.txt[n].text = "Requires/Current/Secound: "		..tostring(item:GetRequiresCharges()).."/"..item:GetCurrentCharges().."/"..item:GetSecondaryCharges()
			inc() dev.draw.item.txt[n].text = "GetChargeCooldown : "			..item:GetChargeCooldown()
			inc() dev.draw.item.txt[n].text = "CanBeExecuted : "				..tostring(item:CanBeExecuted())
			inc() dev.draw.item.txt[n].text = "Breaklinkin? : "					..tostring(item:GetAbilityTargetTeam() ~= Enum.ABILITY_TEAM_FRIENDLY and IsBehaviour(item,Enum.BEHAVIOR_UNIT_TARGET) and not HasFlag(item:GetAbilityTargetType(),Enum.ABILITY_TARGET_TREE) and item:GetAbilityTargetType()~=Enum.ABILITY_TARGET_CREEP)
			inc() dev.draw.item.txt[n].text = "GetAOERadius : "					..item:GetAOERadius()
			inc() dev.draw.item.txt[n].text = "ToggleState : "					..tostring(item:ToggleState())
			inc() dev.draw.item.txt[n].text = "GetCastPoint : "					..round(item:GetCastPoint(),2).." "..round(item:GetOverrideCastPoint(),3)
			inc() dev.draw.item.txt[n].text = "TierIndex/TokenLevel : "			..item:GetNetVarAbilityInt("m_iItemNeutralTierIndex").."/"..item:GetNetVarAbilityInt("m_iTokenTier")
			inc() dev.draw.item.txt[n].text = "IsNeutral : "					..tostring(item:GetPropertyBool("C_DOTA_Item","m_bIsNeutralActiveDrop"))
			if item:GetOwner() then
			inc() dev.draw.item.txt[n].text = "CanBuyInShop : "					..tostring(dota.GameRules.GetInstance():CanBuyItem(item:GetOwner():GetTeamIndex(),item:GetId()))
			end

		elseif dev.draw.item.txt[1] then
			dev.draw.item.txt = {}
			collectgarbage("collect")
		end
	end

	--ability
	if dev.draw.spell and pl and pl:IsDotaNPC() then 
		pl = dota.EntityToBaseNPC(pl)
		debug_spell = pl:GetAbility(dev.abiity_number)

		dev.draw.spell.logo.text = "Ability # "..dev.abiity_number

		if debug_spell then

			dev.draw.spell.img.textureId = GetTextureId2(debug_spell:GetName())

			local qwe1 = {"GetName","GetLevel","GetCooldownLength","GetCooldown","GetCastRange","GetCastRangeBonus","GetManaCost","InAbilityPhase",
			"IsActivated","ToggleState","IsHidden","IsStealable","GetChannelStartTime","GetAutoCastState","GetAltCastState","CanBeExecuted",
			"GetAbilityType","GetAbilityDamage","GetBehavior","GetKeyBind","GetAbilityState","GetAbilityDamageType",
			"GetAbilityTargetFlags","GetAbilityTargetType","GetAbilityTargetTeam","GetCastPoint","GetMaxLevel","GetAOERadius",
			"GetChannelTime","GetCharges","GetChargeCooldown","GetChannelTime","GetDispellableType",
			"GetImmunityType","GetTextureName","GetCastActivity", "GetIndex","GetSpecial Range", "Base/Ult/Tal", "IsInnate", "GetBaseClassName", "GetNewClassName"
			}

			for i,v in ipairs(qwe1) do
				if not dev.draw.spell.txt[i] then
					if i < 14 then
						dev.draw.spell.txt[i] = DrawText(dev.draw.spell.bg.x+25*xx_,zz+i*22*xx_,v ~= "IsStealable" and Enum.WHITE or 0xCCCC00ff,"",F13,true)
					elseif i < 14*2 then
						dev.draw.spell.txt[i] = DrawText(dev.draw.spell.bg2.x+10*xx_,zz+(i-14)*22*xx_,Enum.WHITE,"",F13,true)
					else
						dev.draw.spell.txt[i] = DrawText(dev.draw.spell.bg3.x+10*xx_,zz+(i-14*2)*22*xx_,Enum.WHITE,"",F13,true)
					end
				end
				if v == "GetName" then dev.draw.spell.txt[i].color = Enum.COLOR_SCROLL_ON end
				local value
				if v == "GetCooldownLength" then
					value = debug_spell:GetCooldownLength(debug_spell:GetLevel())
				elseif v == "GetSpecial Range" then
					local info = GetRealCastRange(debug_spell)
					value = tostring(info)
				elseif v == "Base/Ult/Tal" then
					value = tostring(debug_spell:IsBase()).." "..tostring(debug_spell:IsUlt()).." "..tostring(debug_spell:IsTalant())
				elseif v == "GetCastPoint" then
					value = round(debug_spell:GetCastPoint(),3).."/"..round(RealCastPoint(debug_spell),2).." ("..round(debug_spell:GetOverrideCastPoint(),3)..")"				
				elseif v == "GetIndex" then
					value = debug_spell:GetIndex().." / "..debug_spell:GetHandle()
				else
					value = load("return debug_spell:"..v.."()")()
				end
				if type(value) == "number" then 
					value = round(value,3)
				end 
				v = v:gsub("GetName","")
				v = v:gsub("GetTextureName","")
				v = v:gsub("GetBaseClassName","")
				v = v:gsub("GetNewClassName","")
				v = v:gsub("Get","")
				v = v:gsub("AltCastState","                         AltCastState")
				dev.draw.spell.txt[i].text = v..": "..tostring(value)
			end

		elseif dev.draw.spell.txt[1] then
			dev.draw.spell.txt = {}
			collectgarbage("collect")
		end
	end

	--projectile
	if dev.draw.proj then 
		if (IsMouseOnButton(dev.draw.proj.bg) or dev.draw.proj.show) and not dev.draw.mod_fn.show then
			dev.draw.proj.bg2.visible = true

			if dota.IsKeyDown(1) then
				dev.draw.proj.show = true
				dev.draw.proj.logo.color = Enum.COLOR_SCROLL_ON
			elseif dota.IsKeyDown(Enum.KEY_ESC) then
				dev.draw.proj.show = false
				dev.draw.proj.logo.color = Enum.WHITE
			end

			local projectie
			for i = 0, 50 do
				local project = dota.ProjectileManager.GetInstance():GetProjectileByIndex(i)
				if project then
					projectie = project
				end
			end 

			if projectie then
				local n = 0
				local function inc() n = n + 1 if not dev.draw.proj.txt[n] then 
					dev.draw.proj.txt[n] = DrawText(dev.draw.proj.bg2.x+5*con, dev.draw.proj.bg.y+5*con+n*20*xx_,Enum.WHITE,"",F13,true) 
				end 
				dev.draw.proj.txt[n].visible = true end

				inc() dev.draw.proj.txt[n].text = "handle : "			..projectie.handle
				inc() dev.draw.proj.txt[n].text = "speed : "			..projectie.speed
				inc() dev.draw.proj.txt[n].text = "position : "			..print_vertor(projectie.position)
				inc() dev.draw.proj.txt[n].text = "h_source : "		..tostring(projectie.h_source)
				inc() dev.draw.proj.txt[n].text = "h_target : "		..tostring(projectie.h_target)
				inc() dev.draw.proj.txt[n].text = "target : "			..print_vertor(projectie.target)
				inc() dev.draw.proj.txt[n].text = "m_bDodgeable : "		..tostring(projectie.m_bDodgeable)
				inc() dev.draw.proj.txt[n].text = "m_bIsAttack : "		..tostring(projectie.m_bIsAttack)
				inc() dev.draw.proj.txt[n].text = "m_bIsEvaded : "		..tostring(projectie.m_bIsEvaded)

				local ent_system = dota.GlobalInstanceManager:GetClientEntityList()
				local ssource = ent_system:GetClientBaseNPC(dota.HandleToIndex(projectie.h_source))
				local sstarget = ent_system:GetClientBaseNPC(dota.HandleToIndex(projectie.h_target))
				inc() dev.draw.proj.txt[n].text = "source "		..(ssource and ssource:GetName() or "null")
				inc() dev.draw.proj.txt[n].text = "target "		..(sstarget and sstarget:GetName() or "null")

				local max_size = {w=0,h=0}
				for z,x in ipairs(dev.draw.proj.txt) do
					local size = dota.GetTextSize(F13,x.text)
					max_size.w = math.max(size.x+5*con,max_size.w)
					max_size.h = max_size.h + size.y+1*con
				end 
				dev.draw.proj.bg2.w = max_size.w
				dev.draw.proj.bg2.h = max_size.h + 2
			end

		else 
			dev.draw.proj.bg2.visible = false
			for i,v in ipairs(dev.draw.proj.txt) do 
				v.visible = false
			end
		end
	end

	--mod function
	if dev.draw.mod_fn then 
		if (IsMouseOnButton(dev.draw.mod_fn.bg) or dev.draw.mod_fn.show) and not dev.draw.proj.show and pl and IsHeroOrBear(pl) then
			dev.draw.mod_fn.bg2.visible = true

			if dota.IsKeyDown(1) then
				dev.draw.mod_fn.show = true
				dev.draw.mod_fn.logo.color = Enum.COLOR_SCROLL_ON
			elseif dota.IsKeyDown(Enum.KEY_ESC) then
				dev.draw.mod_fn.show = false
				dev.draw.mod_fn.logo.color = Enum.WHITE
			end

			-- local target = dota.EntityToBaseNPCHero(pl):GetModifierManager()

			local max_size = {w=0,h=0}
			local count = {all=0,current=0}
			for i,v in pairs(modifier_functions) do
				
				count.all = count.all + 1
				if not dev.draw.mod_fn.txt[count.all] then 
					dev.draw.mod_fn.txt[count.all] = DrawText(dev.draw.mod_fn.bg2.x+2, dev.draw.mod_fn.bg2.y+2*con+(count.all-1)*20*xx_,Enum.WHITE,"",F13,false) 
				end
				local value = 0--round(target:ModifierFunction(v,false),2)
				if value ~= 0 then
					count.current = count.current + 1
					dev.draw.mod_fn.txt[count.current].text = "("..v..")"..i.."="..value
					dev.draw.mod_fn.txt[count.current].visible = true
					local size = dota.GetTextSize(F13,dev.draw.mod_fn.txt[count.current].text)
					max_size.w = math.max(size.x+5*con,max_size.w)
					max_size.h = max_size.h + size.y+1*con
				else
					dev.draw.mod_fn.txt[count.all].visible = false
				end
			end 

			dev.draw.mod_fn.bg2.w = max_size.w
			dev.draw.mod_fn.bg2.h = max_size.h + 2

		else 
			dev.draw.mod_fn.bg2.visible = false
			for i,v in ipairs(dev.draw.mod_fn.txt) do 
				v.visible = false
			end
		end
	end

	local collectg = false --Num 0
	if dota.IsKeyDown(100) or dota.IsKeyDown(96) then
		if dev.draw.com then 
			dev.draw.com = nil	dev.off_com = true collectg = true
		else 
			dev.off_com = false
		end
	end
	if dota.IsKeyDown(101) or dota.IsKeyDown(96) then
		if dev.draw.mod then 
			dev.draw.mod = nil	dev.off_mod = true collectg = true
		else 
			dev.off_mod = false
		end
	end
	if dota.IsKeyDown(102) or dota.IsKeyDown(96) then
		if dev.draw.spell then 
			dev.draw.spell = nil  dev.off_spell = true collectg = true
		else 
			dev.off_spell = false
		end
	end
	if dota.IsKeyDown(102) or dota.IsKeyDown(96) then
		if dev.draw.item then 
			dev.draw.item = nil	 dev.off_item = true collectg = true
		else 
			dev.off_item = false
		end
	end
	if dota.IsKeyDown(103) or dota.IsKeyDown(96) then
		if dev.draw.ent then 
			dev.draw.ent = nil	 dev.off_ent = true	collectg = true
		else 
			dev.off_ent = false
		end
	end

	if dota.IsKeyDown(106) then
		dev.nvar = not dev.nvar
		dev.net_vars = nil
		collectg = true
	end

	if collectg then collectgarbage("collect") end

	if dota.IsKeyDown(27) then -- escape
		local name = ""
		if dev.draw.ent and IsMouseOnButton(dev.draw.ent.bg) then 
			if not dev.last_ent_time then
				name = pl:GetName()
				dev.last_ent_time = 1
			elseif dev.last_ent_time == 1 then
				name = pl:GetBaseClassName()
				dev.last_ent_time = 2
			elseif dev.last_ent_time == 2 then
				local ppp = pl:GetAbsOrigin()
				name = "dota.Vector("..math.floor(ppp.x)..","..math.floor(ppp.y)..","..math.floor(ppp.z)..")"
				dev.last_ent_time = nil
			end
		end
		if dev.draw.spell and IsMouseOnButton(dev.draw.spell.bg) then 
			name = debug_spell and debug_spell:GetName() or ""
		end
		if dev.draw.item and IsMouseOnButton(dev.draw.item.bg) then 
			name = dev.draw.item.txt and dev.draw.item.txt[1] and dev.draw.item.txt[1].text or ""
		end
		if dev.draw.mod and IsMouseOnButton(dev.draw.mod.bg) then 
			name =  dev.draw.mod.txt and dev.draw.mod.txt[1] and dev.draw.mod.txt[1].text or ""
		end
		if dev.draw.com and IsMouseOnButton(dev.draw.com.bg) then 
			local ppp = dota.Get3dPositionUnderCursor()
			name = "dota.Vector("..math.floor(ppp.x)..","..math.floor(ppp.y)..","..math.floor(ppp.z)..")"
		end
		if name ~= "" then 
			dota.SetTextToBuffer(name)
			Msg(name)
		end 
	end 
end

function DevPanelControle(code)
	if dev.init then
		if code > 0 then
			if dev.draw.mod and IsMouseOnButton(dev.draw.mod.bg) then
				dev.mod_number = dev.mod_number + 1
			elseif dev.draw.spell and IsMouseOnButton(dev.draw.spell.bg) then
				dev.abiity_number = dev.abiity_number + 1
			elseif dev.draw.item and IsMouseOnButton(dev.draw.item.bg) then
				dev.item_number = dev.item_number + 1
			end
		else
			if dev.draw.mod and IsMouseOnButton(dev.draw.mod.bg) then
				dev.mod_number = math.max(dev.mod_number - 1,1)
			elseif dev.draw.spell and IsMouseOnButton(dev.draw.spell.bg) then
				dev.abiity_number = math.max(dev.abiity_number - 1,1)
			elseif dev.draw.item and IsMouseOnButton(dev.draw.item.bg) then
				dev.item_number = math.max(dev.item_number - 1,1)
			end
		end
	end
end 

function LoadNetvars(class)
	local myTable = {}
	local file = io.open( dota.GetLuaPath().."etc/netvars_dump.json", "r" )
	if file then
		local JSONs = require("libs.JSON") 
		myTable = JSONs:decode(file:read( "*all" ))
		io.close( file )
	end
	  
	local tabs = myTable[class]
	if not tabs then return {} end
	for z,x in pairs(myTable[class]) do 
		if x ~= 0 then 
			tabs[z] = x
		end
	end 
	return tabs
end 

function DevPanelOff()
	if dev.init then
		local arr = {dev.draw.com, dev.draw.mod, dev.draw.spell, dev.draw.ent, dev.draw.proj, dev.draw.mod_fn}
		for i,v in pairs(arr) do
			for z,x in ipairs(v.txt) do 
				x.visible = false
			end 
			v.bg.visible = false
			v.logo.visible = false
			if v.img then v.img.visible = false end
			if v.bg2 then v.bg2.visible = false end
			if v.bg3 then v.bg3.visible = false end
		end 
		dev = {}
		collectgarbage("collect")
	end
end


local cache_proj = {}
function DebugProjectileSize()
	for i = 0, 50 do
		local project = dota.ProjectileManager.GetInstance():GetProjectileByIndex(i)
		if project and project:GetSource() then
			if not cache_proj[project.handle] then
				cache_proj[project.handle] = true
				Msg(GetDistance2D(project:GetSource(),project.position))
				dota.SetTextToBuffer(project:GetSource():GetName())
			end 
			return
		end
	end 
end


-- 00007FF9F4408F6D B9 01 00 00 00       mov         ecx,1  
-- 00007FF9F4408F72 45 8B CD             mov         r9d,r13d  
-- 00007FF9F4408F75 4D 8B C7             mov         r8,r15  
-- 00007FF9F4408F78 85 32                test        dword ptr [rdx],esi  

-- 45 32 D3 41 80 F2 8A 44 02 D2


--48 33 C4 48 89 45 E0 48 8B 81 90 00 00 00 4D 8B F1 0F 28 F1 4C 8B E9    