Commit 22d65b13 authored by JoyJ's avatar JoyJ

Initial commit

parents
local X = {}
local bDebugMode = false
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'] = {0, 10},
['t15'] = {10, 0},
['t10'] = {10, 0},
}
local tAllAbilityBuildList = {
{2,1,1,3,2,6,1,1,2,2,6,3,3,3,6},
}
local nAbilityBuildList = J.Skill.GetRandomBuild( tAllAbilityBuildList )
local nTalentBuildList = J.Skill.GetTalentBuild( tTalentTreeList )
local tOutFitList = {}
tOutFitList['outfit_mid'] = tOutFitList['outfit_carry']
tOutFitList['outfit_priest'] = {
"item_bristleback_outfit",
"item_urn_of_shadows",
"item_glimmer_cape",
"item_mekansm",
"item_ultimate_scepter",
"item_aghanims_shard",
"item_sphere",
"item_radiance",
}
tOutFitList['outfit_tank'] = {
"item_bristleback_outfit",
"item_sange_and_yasha",
"item_aghanims_shard",
"item_solar_crest",
"item_black_king_bar",
"item_assault",
"item_ultimate_scepter",
"item_radiance",
"item_ultimate_scepter_2",
"item_monkey_king_bar",
}
X['sBuyList'] = tOutFitList[sOutfitType]
X['sSellList'] = {
"item_shivas_guard",
"item_magic_wand",
"item_cyclone",
"item_magic_wand",
}
if J.Role.IsPvNMode() or J.Role.IsAllShadow() then X['sBuyList'], X['sSellList'] = { 'PvN_mage' }, {} 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'] = true
function X.MinionThink( hMinionUnit )
if Minion.IsValidUnit( hMinionUnit )
then
Minion.IllusionThink( hMinionUnit )
end
end
--[[
npc_dota_hero_oracle
"Ability1" "abaddon_death_coil"
"Ability2" "abaddon_aphotic_shield"
"Ability3" "abaddon_frostmourne"
"Ability4" "generic_hidden"
"Ability5" "generic_hidden"
"Ability6" "abaddon_borrowed_time"
"Ability10" "special_bonus_movement_speed_15"
"Ability11" "special_bonus_strength_8"
"Ability12" "special_bonus_attack_damage_65"
"Ability13" "special_bonus_unique_abaddon_2"
"Ability14" "special_bonus_unique_abaddon"
"Ability15" "special_bonus_unique_abaddon_5"
"Ability16" "special_bonus_unique_abaddon_3"
"Ability17" "special_bonus_unique_abaddon_4"
modifier_abaddon_aphotic_shield
--]]
local abilityQ = bot:GetAbilityByName( sAbilityList[1] )
local abilityW = bot:GetAbilityByName( sAbilityList[2] )
local abilityR = bot:GetAbilityByName( sAbilityList[6] )
local castQDesire, castQTarget
local castWDesire, castWTarget
local castRDesire, castRTarget
local nKeepMana, nMP, nHP, nLV, hEnemyList, hAllyList, botTarget, sMotive
local aetherRange = 0
function X.SkillsComplement()
if J.CanNotUseAbility( bot ) or bot:IsInvisible() then return end
nKeepMana = 350
aetherRange = 0
nLV = bot:GetLevel()
nMP = bot:GetMana()/bot:GetMaxMana()
nHP = bot:GetHealth()/bot:GetMaxHealth()
botTarget = J.GetProperTarget( bot )
hEnemyList = bot:GetNearbyHeroes( 1600, true, BOT_MODE_NONE )
hAllyList = J.GetAlliesNearLoc( bot:GetLocation(), 1600 )
local aether = J.IsItemAvailable( "item_aether_lens" )
if aether ~= nil then aetherRange = 250 end
castQDesire, castQTarget, sMotive = X.ConsiderQ()
if ( castQDesire > 0 ) then
J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbilityOnEntity( abilityQ, castQTarget )
return
end
castWDesire, castWTarget, sMotive = X.ConsiderW()
if ( castWDesire > 0 )
then
J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, false )
bot:ActionQueue_UseAbilityOnEntity( abilityW, castWTarget )
return
end
castRDesire, castRTarget, sMotive = X.ConsiderR()
if ( castRDesire > 0 )
then
J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbility( abilityR )
return
end
end
function X.ConsiderQ()
if not abilityQ:IsFullyCastable() then return 0 end
local nSkillLV = abilityQ:GetLevel()
local nCastRange = abilityQ:GetCastRange() + aetherRange
local nCastPoint = abilityQ:GetCastPoint()
local nManaCost = abilityQ:GetManaCost()
local nDamage = abilityQ:GetAbilityDamage()
local nDamageType = DAMAGE_TYPE_MAGICAL
local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE )
--治疗队友
for _, npcAlly in pairs( hAllyList )
do
if J.IsValidHero( npcAlly )
and J.IsAllysTarget( npcAlly )
and npcAlly ~= bot
and J.IsInRange( bot, npcAlly, nCastRange )
and J.CanCastOnNonMagicImmune( npcAlly )
and (J.GetHP( npcAlly ) < 0.3 or ((J.IsPushing(npcAlly) or npcAlly:WasRecentlyDamagedByAnyHero(3.0)) and J.GetHP(npcAlly)<0.5) )
then
return BOT_ACTION_DESIRE_HIGH, npcAlly, "Q-治疗"..J.Chat.GetNormName( npcAlly )
end
end
--攻击敌人
if J.IsGoingOnSomeone( bot ) and J.IsValidHero( botTarget )
and J.IsInRange( bot, botTarget, nCastRange )
and J.CanCastOnNonMagicImmune( botTarget)
and (nSkillLV>2 or J.WillMagicKillTarget(bot, botTarget, nDamage, nCastPoint))
and (J.GetHP(bot)>J.GetHP(botTarget)
or J.GetModifierTime(bot, 'modifier_abaddon_borrowed_time')>nCastPoint
or J.GetModifierTime(bot, 'modifier_abaddon_aphotic_shield')>nCastPoint) then
return BOT_ACTION_DESIRE_HIGH, botTarget, "Q-攻击"..J.Chat.GetNormName( botTarget )
end
for _, npcEnemy in pairs( hEnemyList )
do
if J.IsValidHero( npcEnemy )
and J.IsInRange( bot, npcEnemy, nCastRange )
and J.CanCastOnNonMagicImmune( npcEnemy )
and (J.WillMagicKillTarget(bot, npcEnemy, nDamage, nCastPoint) or (nSkillLV>1 and nMP > 0.6)
or J.GetModifierTime(bot, 'modifier_abaddon_borrowed_time')>nCastPoint
or J.GetModifierTime(bot, 'modifier_abaddon_aphotic_shield')>nCastPoint) then
return BOT_ACTION_DESIRE_HIGH, npcEnemy, "Q-对"..J.Chat.GetNormName( npcEnemy ).."耗血"
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderW()
if not abilityW:IsFullyCastable() then return 0 end
local nSkillLV = abilityQ:GetLevel()
local nCastRange = abilityQ:GetCastRange() + aetherRange
local nRadius = abilityQ:GetSpecialValueInt( 'radius' )
local nCastPoint = abilityQ:GetCastPoint()
local nManaCost = abilityQ:GetManaCost()
local nDamage = abilityQ:GetSpecialValueInt( 'heal' )
local nInRangeEnemyList = J.GetAroundEnemyHeroList( nCastRange + nRadius )
local nInBonusEnemyList = J.GetAroundEnemyHeroList( nCastRange + 200 + nRadius )
local nInRangeAllyHeroList = bot:GetNearbyHeroes( nCastRange + 350, false, BOT_MODE_NONE )
local nInRangeAllyCreepList = bot:GetNearbyCreeps( nCastRange + 200, false )
local hCastTarget = nil
local sCastMotive = nil
--奶队友,包含解状态
for i = 1, 5
do
local npcAlly = GetTeamMember(i)
if npcAlly ~= nil
and npcAlly:IsAlive()
and not npcAlly:HasModifier( 'modifier_fountain_aura' )
and not npcAlly:HasModifier( 'modifier_abaddon_aphotic_shield' )
and J.IsInRange( bot, npcAlly, nCastRange )
and ( J.GetHP( npcAlly ) < 0.3
or ( J.GetHP( npcAlly ) < 0.5 and npcAlly:WasRecentlyDamagedByAnyHero( 3.0 ) )
or J.GetRemainStunTime(npcAlly)>1.0+nCastPoint)
then
hCastTarget = npcAlly
sCastMotive = 'W-奶队友:'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, hCastTarget, sCastMotive
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderR()
local nInRangeEnemyList = bot:GetNearbyHeroes( 600, true, BOT_MODE_NONE )
if not abilityR:IsFullyCastable() then return 0 end
--解晕,旁边人越多阈值越高
if J.GetRemainStunTime(bot) > 1.0 and J.GetHP(bot)<(0.5+0.1*#nInRangeEnemyList) then
return BOT_ACTION_DESIRE_HIGH, bot, "R-解晕"..J.Chat.GetNormName( bot )
end
if J.IsInTeamFight(bot,800) and bot:HasScepter() then
return BOT_ACTION_DESIRE_HIGH, bot, "R-团战A杖"..J.Chat.GetNormName( bot )
end
return BOT_ACTION_DESIRE_NONE
end
return X
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
----------------------------------------------------------------------------------------------------
--- The Creation Come From: A Beginner AI
--- Author: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
----------------------------------------------------------------------------------------------------
local bot = GetBot()
local botName = bot:GetUnitName()
if bot:IsInvulnerable()
or not bot:IsHero()
or bot:IsIllusion()
or not string.find( botName, "hero" )
or botName == "npc_dota_hero_techies"
then
return
end
local BotBuild = dofile(GetScriptDirectory() .. "/BotLib/" .. string.gsub(bot:GetUnitName(), "npc_dota_", ""));
if BotBuild == nil
or botName == 'npc_dota_hero_spectre'
then
return
end
function MinionThink(hMinionUnit)
BotBuild.MinionThink(hMinionUnit)
end
-- dota2jmz@163.com QQ:2462331592..
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
---------------------------------------------------------------------------
--- The Creation Come From: A Beginner AI
--- Author: 决明子 Email: dota2jmz@163.com 微博@Dota2_决明子
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1573671599
--- Link:http://steamcommunity.com/sharedfiles/filedetails/?id=1627071163
---------------------------------------------------------------------------
if GetBot():IsInvulnerable() or not GetBot():IsHero() or not string.find(GetBot():GetUnitName(), "hero") or GetBot():IsIllusion() then
return
end
local X = {}
local bot = GetBot()
function GetDesire()
local currentTime = DotaTime()
local botLV = bot:GetLevel()
if currentTime <= 10
then
return 0.268
end
if currentTime <= 9 * 60
and botLV <= 7
then
return 0.446
end
if currentTime <= 12 * 60
and botLV <= 11
then
return 0.369
end
if botLV <= 17
then
return 0.228
end
return 0
end
-- dota2jmz@163.com QQ:2462331592..
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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