Results 1 to 2 of 2

Thread: Ember Remnants, Bot or Modifer?

  1. #1
    Basic Member
    Join Date
    Oct 2016
    Posts
    88

    Ember Remnants, Bot or Modifer?

    Scripts dont seem to pick up the ember spirit remnants properly, i have done every modifer call i can think of and have played around with the remnant as a bot (hero)
    i have posted my latest attempt, he uses the skills, but usually too early, i need to find the handle, etc for the remnant so i can do a unit to location distance hopefully.

    Code:
    function ConsiderActivateRemnant(remlocation)
    
    	local npcBot = GetBot();
    	remlocation = Vector(remlocation);
    
    	-- Make sure it's castable
    	if ( not abilityAFR:IsFullyCastable() ) 
    	then 
    		return BOT_ACTION_DESIRE_NONE, 0;
    	end
    
    
    if npcBot:HasModifier("modifier_ember_spirit_fire_remnant_timer") then
    
    	local tableNearbyAllies = npcBot:GetNearbyHeroes( 1600, false, BOT_MODE_NONE );
    	for _,npcAlly in pairs( tableNearbyAllies )
    	do
    		if string.find(npcAlly:GetUnitName(), "ember_spirit_remnant") then
    		remnant = npcAlly;
    
    			if GetUnitToLocationDistance( remnant, remlocation ) <= 150 then
    			print("Distance 150")
    			end
    		end
    	end
    	
    	return BOT_ACTION_DESIRE_HIGH, remlocation;
    end
    
    	return BOT_ACTION_DESIRE_NONE, 0;
    end
    
    
    
    
    function ConsiderFireRemnant()
    
    	local npcBot = GetBot();
    
    	-- Make sure it's castable
    	if ( not abilityFR:IsFullyCastable() ) 
    	then 
    		return BOT_ACTION_DESIRE_NONE, 0;
    	end
    	
    	-- Get some of its values
    	local nCastRange = abilityFR:GetCastRange();
    
    
    
    ---------- TEST ------------------------------
    
    	if ( npcBot:GetMana()/npcBot:GetMaxMana() >= 0.2  ) 
    	then
    	local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE );
    		for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
    		do 
    			if ( GetUnitToUnitDistance( npcEnemy, npcBot ) <= nCastRange and npcBot:HasModifier("modifier_ember_spirit_fire_remnant_charge_counter")) then
    				print("2")
    			remlocation = npcEnemy:GetLocation();
    			return BOT_ACTION_DESIRE_HIGH, remlocation + RandomVector(150);
    			end
    		end
    	end
    any help would be great.

  2. #2
    Basic Member
    Join Date
    Oct 2016
    Posts
    88
    Code:
    function ConsiderActivateRemnant(remlocation)
    
    	local npcBot = GetBot();
    	remlocation = Vector(remlocation);
    	-- Make sure it's castable
    	if ( not abilityAFR:IsFullyCastable() ) 
    	then 
    		return BOT_ACTION_DESIRE_NONE, 0;
    	end
    
    
    if npcBot:HasModifier("modifier_ember_spirit_fire_remnant_timer") then
    
    	local tableNearbyAllies = npcBot:GetNearbyHeroes( 1600, false, BOT_MODE_NONE );
    	for _,npcAlly in pairs( tableNearbyAllies )
    	do
    		if (npcAlly:GetUnitName() == "npc_dota_ember_spirit_remnant") then
    		remnant = npcAlly
    		end
    	end
    		if GetUnitToLocationDistance( remnant, remlocation ) <= 15 then
    		print("Distance under 15")
    		return BOT_ACTION_DESIRE_HIGH, remlocation;
    		end
    
    end
    
    	return BOT_ACTION_DESIRE_NONE, 0;
    end
    
    
    
    
    function ConsiderFireRemnant()
    
    	local npcBot = GetBot();
    
    	-- Make sure it's castable
    	if ( not abilityFR:IsFullyCastable() ) 
    	then 
    		return BOT_ACTION_DESIRE_NONE, 0;
    	end
    	
    	-- Get some of its values
    	local nCastRange = abilityFR:GetCastRange();
    
    
    
    ---------- TEST ------------------------------
    
    	if ( npcBot:GetMana()/npcBot:GetMaxMana() >= 0.2  ) 
    	then
    	local tableNearbyEnemyHeroes = npcBot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE );
    		for _,npcEnemy in pairs( tableNearbyEnemyHeroes )
    		do 
    			if ( GetUnitToUnitDistance( npcEnemy, npcBot ) <= nCastRange and npcBot:HasModifier("modifier_ember_spirit_fire_remnant_charge_counter")) then
    				print("2")
    			remlocation = npcEnemy:GetLocation();
    			return BOT_ACTION_DESIRE_HIGH, remlocation + RandomVector(150);
    			end
    		end
    	end
    still the same result - uses the activate almost straight away, before remnant reaches destination.
    anyone see what im doing wrong?
    the remnant doesnt seem to be picked up still.

    Code:
    function ConsiderActivateRemnant(remlocation)
    
    	local npcBot = GetBot();
    	remlocation = Vector(remlocation);
    	-- Make sure it's castable
    	if ( not abilityAFR:IsFullyCastable() ) 
    	then 
    		return BOT_ACTION_DESIRE_NONE, 0;
    	end
    
    
    if npcBot:HasModifier("modifier_ember_spirit_fire_remnant_timer") then
    
    	local tableNearbyAllies = npcBot:GetNearbyHeroes( 1600, false, BOT_MODE_NONE );
    
    if (tableNearbyAllies[1] ~= nil) then
    print("people")
    if (tableNearbyAllies[1]:GetUnitName() == "npc_dota_ember_spirit_remnant") then
    print("right person")
    		return BOT_ACTION_DESIRE_HIGH, remlocation;
    else
    print("not right")
    end
    end
    end
    	return BOT_ACTION_DESIRE_NONE, 0;
    end
    returns that the remnant "isnt right", however in the modifier dump it is basically put down as a unit that has its own modifers.
    it cant be found as a creep either.

    so is there any way at all to query the remnant??
    Last edited by Yavimaya; 03-15-2017 at 10:15 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •