Commit e2bc7f9b authored by JoyJ's avatar JoyJ

add visage

parent 7d71950a
......@@ -23,7 +23,7 @@ local tTalentTreeList = {
['t10'] = {10, 0},
}
local nAbilityBuildList = {3,2,3,1,3,6,3,2,2,2,6,1,1,1,6}
local nAbilityBuildList = {2,3,1,3,3,6,3,2,2,2,6,1,1,1,6}
local nTalentBuildList = J.Skill.GetTalentBuild( tTalentTreeList )
......@@ -121,7 +121,7 @@ function X.SkillsComplement()
J.ConsiderForMkbDisassembleMask( bot )
if bot.theRole == 'support' and nAbilityBuildList[1]==3 then
nAbilityBuildList = {1,2,1,2,1,6,1,2,2,3,6,3,3,3,6}
nAbilityBuildList = {2,1,1,2,1,6,1,2,2,3,6,3,3,3,6}
tTalentTreeList = {
['t25'] = {0, 10},
['t20'] = {0, 10},
......@@ -149,7 +149,7 @@ function X.SkillsComplement()
if aether ~= nil then aetherRange = 250 end
castRDesire, castRTarget, sMotive = X.ConsiderR()
castRDesire, sMotive = X.ConsiderR()
if castRDesire > 0 then
J.SetReportMotive( bDebugMode, sMotive )
......
----------------------------------------------------------------------------------------------------
--- The Creation Come From: BOT EXPERIMENT Credit:FURIOUSPUPPY
--- BOT EXPERIMENT Author: Arizona Fauzie 2018.11.21
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=837040016
--- Refactor: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
----------------------------------------------------------------------------------------------------
local X = {}
local bDebugMode = ( 1 == 10 )
local bot = GetBot()
local J = require( GetScriptDirectory()..'/FunLib/jmz_func' )
local Minion = dofile( GetScriptDirectory()..'/FunLib/aba_minion' )
local sTalentList = J.Skill.GetTalentList( bot )
local sAbilityList = J.Skill.GetAbilityList( bot )
local sOutfitType = J.Item.GetOutfitType( bot )
local tTalentTreeList = {
['t25'] = {10, 0},
['t20'] = {10, 0},
['t15'] = {0, 10},
['t10'] = {10, 0},
}
local tAllAbilityBuildList = {
{1,2,3,1,1,6,1,3,2,2,6,3,2,3,6},
}
local nAbilityBuildList = J.Skill.GetRandomBuild( tAllAbilityBuildList )
local nTalentBuildList = J.Skill.GetTalentBuild( tTalentTreeList )
local tOutFitList = {}
tOutFitList['outfit_carry'] = {
"item_mage_outfit",
"item_aghanims_shard",
"item_ancient_janggo",
"item_desolator",
"item_boots_of_bearing",
"item_ultimate_scepter",
"item_cyclone",
"item_assault",
"item_wind_waker",
"item_gungir",
"item_moon_shard",
"item_sheepstick",
}
tOutFitList['outfit_mid'] = tOutFitList['outfit_carry']
tOutFitList['outfit_priest'] = tOutFitList['outfit_carry']
tOutFitList['outfit_mage'] = tOutFitList['outfit_carry']
tOutFitList['outfit_tank'] = tOutFitList['outfit_carry']
X['sBuyList'] = tOutFitList[sOutfitType]
X['sSellList'] = {
"item_assault",
"item_magic_wand",
}
if J.Role.IsPvNMode() or J.Role.IsAllShadow() then X['sBuyList'], X['sSellList'] = { 'PvN_tank' }, {"item_power_treads", 'item_quelling_blade'} end
nAbilityBuildList, nTalentBuildList, X['sBuyList'], X['sSellList'] = J.SetUserHeroInit( nAbilityBuildList, nTalentBuildList, X['sBuyList'], X['sSellList'] )
X['sSkillList'] = J.Skill.GetSkillList( sAbilityList, nAbilityBuildList, sTalentList, nTalentBuildList )
X['bDeafaultAbility'] = true
X['bDeafaultItem'] = false
function X.MinionThink( hMinionUnit )
if Minion.IsValidUnit( hMinionUnit )
then
if Minion.IsFamiliar(hMinionUnit:GetUnitName()) then --npc_dota_visage_familiar1,2,3
Minion.FamiliarThink( hMinionUnit )
else
Minion.IllusionThink( hMinionUnit )
end
end
end
local abilityQ = bot:GetAbilityByName( sAbilityList[1] )
local abilityW = bot:GetAbilityByName( sAbilityList[2] )
local abilityE = bot:GetAbilityByName( sAbilityList[3] )
local abilityD = bot:GetAbilityByName( sAbilityList[5] )
local abilityR = bot:GetAbilityByName( sAbilityList[6] )
local castQDesire, castQTarget
local castWDesire, castWTarget
local castRDesire
local castEDesire
local castDDesire
local nKeepMana, nMP, nHP, nLV, hEnemyHeroList
function X.SkillsComplement()
if J.CanNotUseAbility( bot ) or bot:IsInvisible() then return end
nKeepMana = 450
nMP = bot:GetMana()/bot:GetMaxMana()
nHP = bot:GetHealth()/bot:GetMaxHealth()
nLV = bot:GetLevel()
hEnemyHeroList = bot:GetNearbyHeroes( 1600, true, BOT_MODE_NONE )
castRDesire = X.ConsiderR()
if ( castRDesire > 0 )
then
bot:ActionQueue_UseAbility( abilityR )
return
end
castWDesire, castWTarget = X.ConsiderW()
if ( castWDesire > 0 )
then
J.SetQueuePtToINT( bot, false )
bot:ActionQueue_UseAbilityOnEntity( abilityW, castWTarget )
return
end
castQDesire, castQTarget = X.ConsiderQ()
if ( castQDesire > 0 )
then
J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbilityOnEntity( abilityQ, castQTarget )
return
end
castEDesire = X.ConsiderE()
if ( castEDesire > 0 )
then
bot:ActionQueue_UseAbility( abilityE )
return
end
castDDesire = X.ConsiderD()
if ( castDDesire > 0 ) then
bot:ActionQueue_UseAbility( abilityD )
return
end
end
function X.ConsiderD()
if not abilityD:IsTrained() or not abilityD:IsFullyCastable() then return 0 end
if J.IsGoingOnSomeone(bot) or J.IsRetreating(bot) then return BOT_ACTION_DESIRE_HIGH end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderE()
if abilityE:IsPassive() then return 0 end
if nHP<0.5 then return BOT_ACTION_DESIRE_HIGH end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderQ()
if not abilityQ:IsFullyCastable() then return BOT_ACTION_DESIRE_NONE end
local nCastRange = abilityQ:GetCastRange()
local nCastPoint = abilityQ:GetCastPoint()
local nSkillLV = abilityQ:GetLevel()
local nDamage = 30 + nSkillLV * 30 + 120 * 0.38
local nEnemysHeroesInCastRange = bot:GetNearbyHeroes( nCastRange + 99, true, BOT_MODE_NONE )
local nEnemysHeroesInView = bot:GetNearbyHeroes( 880, true, BOT_MODE_NONE )
--追杀
if J.IsGoingOnSomeone( bot ) then
local target = J.GetProperTarget( bot )
if J.IsValidHero( target )
and J.CanCastOnNonMagicImmune( target )
and J.CanCastOnTargetAdvanced( target )
and J.IsInRange( target, bot, nCastRange ) then
return BOT_ACTION_DESIRE_HIGH, target
end
end
--逃跑
if J.IsRetreating( bot )
then
if J.IsValid( nEnemysHeroesInCastRange[1] )
and J.CanCastOnNonMagicImmune( nEnemysHeroesInCastRange[1] )
and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[1] )
and not J.IsDisabled( nEnemysHeroesInCastRange[1] )
and not nEnemysHeroesInCastRange[1]:IsDisarmed()
and GetUnitToUnitDistance( bot, nEnemysHeroesInCastRange[1] ) <= nCastRange - 60
then
return BOT_ACTION_DESIRE_HIGH, nEnemysHeroesInCastRange[1]
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderW()
if not abilityW:IsFullyCastable() or bot:IsRooted() then return BOT_ACTION_DESIRE_NONE end
if not bot:HasModifier('modifier_visage_soul_assumption') then return end
local nCastRange = abilityW:GetCastRange()
local nCastPoint = abilityW:GetCastPoint()
local nManaCost = abilityW:GetManaCost()
local nSkillLV = abilityW:GetLevel()
local nDamage = 70
if nLV > 27 then nDamage=90 end
local nSoul = bot:GetModifierStackCount('modifier_visage_soul_assumption')
nDamage = nSoul * nDamage + 20
local nEnemysHeroesInCastRange = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE )
--击杀
if #nEnemysHeroesInCastRange > 0 then
for i=1, #nEnemysHeroesInCastRange do
if J.IsValid( nEnemysHeroesInCastRange[i] )
and J.CanCastOnNonMagicImmune( nEnemysHeroesInCastRange[i] )
and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[i] )
and J.WillMagicKillTarget( bot, nEnemysHeroesInCastRange[i], nDamage,
nCastPoint + GetUnitToUnitDistance(bot, nEnemysHeroesInCastRange[i]) / 1000.0 )
and not J.IsDisabled( nEnemysHeroesInCastRange[i] )
then
return BOT_ACTION_DESIRE_HIGH, nEnemysHeroesInCastRange[i]
end
end
end
if nSoul < 2 + nSkillLV then return end
--追杀
if J.IsGoingOnSomeone( bot ) then
local target = J.GetProperTarget( bot )
if J.IsValidHero( target )
and J.IsInRange( target, bot, nCastRange + 50 )
and ( not J.IsInRange( bot, target, 200 ) or not target:HasModifier( 'modifier_chaos_knight_reality_rift' ) )
and J.CanCastOnNonMagicImmune( target )
and J.CanCastOnTargetAdvanced( target )
then
return BOT_ACTION_DESIRE_HIGH, target
end
end
--通常
local valid = J.FilterGroup(nEnemysHeroesInCastRange,function(u)
return J.IsValid( u )
and J.CanCastOnNonMagicImmune( u )
and J.CanCastOnTargetAdvanced( u )
end)
local target=J.GetLeastHpUnit(valid)
if target and J.IsAllowedToSpam(bot, nManaCost) then
return BOT_ACTION_DESIRE_HIGH, target
end
--Roshan
if bot:GetActiveMode() == BOT_MODE_ROSHAN and bot:GetMana() > nKeepMana then
local target = bot:GetAttackTarget()
if target ~= nil then
return BOT_ACTION_DESIRE_HIGH, target
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderR()
if not abilityR:IsFullyCastable() then return BOT_ACTION_DESIRE_NONE end
local nMaxUnit = 2
if nLV >= 25 then nMaxUnit = 3 end
local listFamiliar = GetUnitList(UNIT_LIST_ALLIES)
for _,unit in pairs(listFamiliar) do
if Minion.IsFamiliar(unit:GetUnitName()) then
nMaxUnit = nMaxUnit - 1
end
end
if nMaxUnit > 0 then
return BOT_ACTION_DESIRE_HIGH
end
return BOT_ACTION_DESIRE_NONE
end
return X
-- dota2jmz@163.com QQ:2462331592..
......@@ -9,6 +9,7 @@
local X = {};
local J = require( GetScriptDirectory()..'/FunLib/jmz_func' )
local bot = GetBot();
......@@ -381,6 +382,73 @@ function X.AttackingWardThink(minion)
end
end
function X.FamiliarThink(minion)
if minion:IsStunned() or minion:IsInvulnerable() then return end
local nHP = minion:GetHealth() / minion:GetMaxHealth()
local abilityQ = bot:GetAbilityByName( 'visage_summon_familiars_stone_form' )
local canCast = abilityQ:IsFullyCastable() and not minion:IsSilenced() and not minion:IsStunned()
local nEnemyHeroes = minion:GetNearbyHeroes( 1200, true, BOT_MODE_DESIRE_NONE )
local nEnemyHeroesFromBot = bot:GetNearbyHeroes( 1200, true, BOT_MODE_DESIRE_NONE )
--石化不可用,逃跑
if nHP < 0.7 and not canCast and #nEnemyHeroes>0 then
local moveTo = J.GetVectorFromVectorToAngleWithDistance(nEnemyHeroes[1]:GetLocation(),
J.GetAngleFromUnitToUnit(nEnemyHeroes[1],minion),200 + nEnemyHeroes[1]:GetAttackRange() )
minion:Action_MoveToLocation(moveTo)
return
end
--石化可用,闲时石化回血
if nHP < 0.99 and canCast and #nEnemyHeroes==0 then
minion:Action_UseAbility(abilityQ)
return
end
--石化可用,低血量回血
if nHP < 0.5 and canCast then
minion:Action_UseAbility(abilityQ)
return
end
--英雄死亡状态,返回泉水
if not bot:IsAlive() then
minion:Action_MoveToLocation(J.GetTeamFountain())
return
end
--有可用目标,跟随追杀
if J.IsGoingOnSomeone(bot) then
local target = J.GetProperTarget( bot )
if J.IsValid( target ) then
minion:Action_AttackUnit(target, true)
end
return
end
--逃跑状态,可石化则进行晕眩,否则攻击最近的敌人
if J.IsRetreating(bot) and #nEnemyHeroesFromBot>0 and J.IsValid(nEnemyHeroesFromBot[1]) then
if canCast then
local expoLocation = nEnemyHeroesFromBot[1]:GetExtrapolatedLocation(0.6)
if GetUnitToLocationDistance(minion,expoLocation)<200 then
minion:Action_UseAbility(abilityQ)
else
minion:Action_MoveToLocation(expoLocation)
end
return
else
minion:Action_AttackUnit(nEnemyHeroesFromBot[1],false)
end
end
--其他状态,跟随英雄移动
minion:Action_MoveToLocation(bot:GetLocation())
end
function X.HealingWardThink(minion)
local nEnemyHeroes = minion:GetNearbyHeroes( 1200, true, BOT_MODE_DESIRE_NONE )
......
......@@ -154,7 +154,7 @@ local sUserKeyDir = Chat.GetUserKeyDir()
'npc_dota_hero_vengefulspirit',
'npc_dota_hero_venomancer',
--'npc_dota_hero_viper',
'npc_dota_hero_visage',
--'npc_dota_hero_visage',
'npc_dota_hero_void_spirit',
--'npc_dota_hero_warlock',
'npc_dota_hero_weaver',
......@@ -167,6 +167,7 @@ local sUserKeyDir = Chat.GetUserKeyDir()
'npc_dota_hero_dawnbreaker',
'npc_dota_hero_marci',
'npc_dota_hero_primal_beast',
--'npc_dota_hero_muerta',
--]]
......@@ -231,6 +232,7 @@ local sHasDevelopmentHeroList = {
"npc_dota_hero_razor",
"npc_dota_hero_mirana",
"npc_dota_hero_muerta",
"npc_dota_hero_visage",
}
......@@ -253,7 +255,6 @@ local sFirstList = {
local sSecondList = {
"npc_dota_hero_abaddon",
"npc_dota_hero_centaur",
"npc_dota_hero_crystal_maiden",
"npc_dota_hero_zuus",
......@@ -266,6 +267,7 @@ local sSecondList = {
"npc_dota_hero_shadow_shaman",
"npc_dota_hero_bane",
"npc_dota_hero_abyssal_underlord",
"npc_dota_hero_visage",
}
......@@ -288,7 +290,6 @@ local sThirdList = {
"npc_dota_hero_axe",
"npc_dota_hero_slark",
"npc_dota_hero_juggernaut",
"npc_dota_hero_muerta",
}
local sFourthList = {
......@@ -304,6 +305,7 @@ local sFourthList = {
"npc_dota_hero_slardar",
"npc_dota_hero_legion_commander",
"npc_dota_hero_omniknight",
"npc_dota_hero_muerta",
}
......@@ -353,6 +355,7 @@ local sMageList = {
"npc_dota_hero_crystal_maiden",
"npc_dota_hero_death_prophet",
"npc_dota_hero_visage",
"npc_dota_hero_abyssal_underlord",
"npc_dota_hero_jakiro",
"npc_dota_hero_lich",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment