Commit bc085258 authored by JoyJ's avatar JoyJ

fix buildlist; add centaur

parent eec38579
......@@ -25,8 +25,6 @@ local nTalentBuildList = J.Skill.GetTalentBuild( tTalentTreeList )
local tOutFitList = {}
tOutFitList['outfit_mid'] = tOutFitList['outfit_carry']
tOutFitList['outfit_priest'] = {
"item_bristleback_outfit",
......@@ -54,6 +52,12 @@ tOutFitList['outfit_tank'] = {
"item_monkey_king_bar",
}
tOutFitList['outfit_mid'] = tOutFitList['outfit_tank']
tOutFitList['outfit_carry'] = tOutFitList['outfit_tank']
tOutFitList['outfit_mage'] = tOutFitList['outfit_priest']
X['sBuyList'] = tOutFitList[sOutfitType]
X['sSellList'] = {
......
local X = {}
local bDebugMode = true
local bDebugMode = false
local bot = GetBot()
_G.W2Time = _G.W2Time or {}
_G.W2Time[bot] = _G.W2Time[bot] or 999999
......@@ -42,6 +42,8 @@ tOutFitList['outfit_carry'] = {
tOutFitList['outfit_tank'] = tOutFitList['outfit_carry']
tOutFitList['outfit_mid'] = tOutFitList['outfit_tank']
tOutFitList['outfit_mage'] = tOutFitList['outfit_carry']
tOutFitList['outfit_priest'] = tOutFitList['outfit_priest']
X['sBuyList'] = tOutFitList[sOutfitType]
......@@ -110,7 +112,7 @@ function X.SkillsComplement()
J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbilityOnEntity( abilityW2, castW2Target )
bot:ActionPush_UseAbilityOnEntity( abilityW2, castW2Target )
return
end
......@@ -210,7 +212,7 @@ function X.ConsiderW2()
if J.IsValid( nEnemysHeroesInCastRange[i] )
and J.CanCastOnNonMagicImmune( nEnemysHeroesInCastRange[i] )
and J.CanCastOnTargetAdvanced( nEnemysHeroesInCastRange[i] )
and J.WillKillTarget(nEnemysHeroesInCastRange[i],DAMAGE_TYPE_PHYSICAL, nCastPoint + GetUnitToUnitDistance(bot,nEnemysHeroesInCastRange[i])/900)
and J.WillKillTarget(nEnemysHeroesInCastRange[i], nDamage, DAMAGE_TYPE_PHYSICAL, nCastPoint + GetUnitToUnitDistance(bot,nEnemysHeroesInCastRange[i])/900)
then
return BOT_ACTION_DESIRE_HIGH, nEnemysHeroesInCastRange[i], "W-击杀"..J.Chat.GetNormName( botTarget )
end
......@@ -228,7 +230,6 @@ function X.ConsiderW2()
and J.CanCastOnNonMagicImmune( npcEnemy )
and J.CanCastOnTargetAdvanced( npcEnemy )
and not J.IsDisabled( npcEnemy )
and not npcEnemy:IsDisarmed()
then
local npcEnemyDamage = npcEnemy:GetEstimatedDamageToTarget( false, bot, 3.0, DAMAGE_TYPE_ALL )
if ( npcEnemyDamage > nMostDangerousDamage )
......@@ -238,9 +239,7 @@ function X.ConsiderW2()
end
end
end
if ( npcMostDangerousEnemy ~= nil )
then
if ( npcMostDangerousEnemy ~= nil ) then
return BOT_ACTION_DESIRE_HIGH, npcMostDangerousEnemy, "W-团战晕眩高威胁目标"..J.Chat.GetNormName( botTarget )
end
end
......@@ -255,7 +254,7 @@ function X.ConsiderW2()
and J.IsInRange( target, bot, nCastRange )
and (((GetUnitToLocationDistance(bot,target:GetExtrapolatedLocation(0.5 + nCastPoint))>(nCastRange/2))
and not J.IsDisabled( target )
and not target:IsDisarmed()) or remainTime <= 1.0 or nHP < 0.2 or target:GetHealth() < 500 )
and not target:IsDisarmed()) or remainTime <= 1.0 or nHP < 0.2 or target: GetHealth() < 500 )
then
return BOT_ACTION_DESIRE_HIGH, target,"W-追杀"..J.Chat.GetNormName( target )
end
......@@ -287,8 +286,8 @@ function X.ConsiderQ()
local nCastPoint = abilityQ:GetCastPoint()
local nManaCost = abilityQ:GetManaCost()
local nDamageType = DAMAGE_TYPE_PHYSICAL
local nRadius = 425
if bot:GetLevel()>=10 then nRadius = 525 end
local nRadius = abilityQ:GetSpecialValueInt( 'radius' )
if bot:GetLevel()>=10 then nRadius = nRadius + 100 end
local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange + nRadius * 0.5, true, BOT_MODE_NONE )
local nTargetLocation = nil
......
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'] = {0, 10},
}
local tAllAbilityBuildList = {
{1,2,2,3,2,6,2,1,3,1,6,3,1,3,6},
}
local nAbilityBuildList = J.Skill.GetRandomBuild( tAllAbilityBuildList )
local nTalentBuildList = J.Skill.GetTalentBuild( tTalentTreeList )
local tOutFitList = {}
tOutFitList['outfit_tank'] = {
"item_centaur_outfit",
"item_vanguard",
"item_aghanims_shard",
"item_hood_of_defiance",
"item_blink",
"item_boots_of_bearing",
"item_crimson_guard",
"item_pipe",
"item_heart",
"item_overwhelming_blink",
"item_radiance",
"item_ultimate_scepter_2",
}
tOutFitList['outfit_mid'] = tOutFitList['outfit_tank']
X['sBuyList'] = tOutFitList[sOutfitType]
X['sSellList'] = {
"item_magic_wand",
}
if J.Role.IsPvNMode() or J.Role.IsAllShadow() then X['sBuyList'], X['sSellList'] = { 'PvN_tank' }, {} 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
local abilityQ = bot:GetAbilityByName( sAbilityList[1] )
local abilityW = bot:GetAbilityByName( sAbilityList[2] )
local abilityD = bot:GetAbilityByName( sAbilityList[4] )
local abilityR = bot:GetAbilityByName( sAbilityList[6] )
local castQDesire
local castWDesire, castWTarget
local castDDesire, castDTarget
local castRDesire
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, sMotive = X.ConsiderQ()
if ( castQDesire > 0 ) then
J.SetReportMotive( bDebugMode, sMotive )
J.SetQueuePtToINT( bot, true )
bot:ActionQueue_UseAbility( abilityQ )
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, 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 nRadius = abilityQ:GetSpecialValueInt( 'radius' )
local nCastPoint = abilityQ:GetCastPoint()
local nManaCost = abilityQ:GetManaCost()
local nDamage = abilityQ:GetAbilityDamage()
local nDamageType = DAMAGE_TYPE_MAGICAL
local nInRangeEnemyList = bot:GetNearbyHeroes( nRadius, true, BOT_MODE_NONE )
local hCastTarget
local sCastMotive
--打断敌人施法
for _, npcEnemy in pairs( nInRangeEnemyList )
do
if npcEnemy:IsChanneling()
and not npcEnemy:IsMagicImmune()
then
hCastTarget = npcEnemy
sCastMotive = 'Q-打断'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, sCastMotive
end
end
--攻击敌人时
if J.IsGoingOnSomeone( bot )
then
if J.IsValidHero( botTarget )
and J.IsInRange( botTarget, bot, nRadius - 90 )
and J.CanCastOnNonMagicImmune( botTarget )
and not J.IsDisabled( botTarget )
then
hCastTarget = botTarget
sCastMotive = 'Q-先手'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, sCastMotive
end
end
--打肉时
if bot:GetActiveMode() == BOT_MODE_ROSHAN
then
if J.IsRoshan( botTarget )
and not J.IsDisabled( botTarget )
and J.IsInRange( botTarget, bot, nRadius )
then
hCastTarget = botTarget
sCastMotive = 'Q-肉山'
return BOT_ACTION_DESIRE_HIGH, sCastMotive
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderW()
if not abilityW:IsFullyCastable() then return 0 end
local castRange = abilityW:GetCastRange() + aetherRange
local target = J.GetProperTarget( bot )
local aTarget = bot:GetAttackTarget()
local nDamage = abilityW:GetAbilityDamage()
local nCastPoint = abilityW:GetCastPoint()
local enemies = bot:GetNearbyHeroes( castRange, true, BOT_MODE_NONE )
local nRadius = 300
if aTarget ~= nil
and aTarget:IsAlive()
and J.IsInRange( aTarget, bot, castRange )
and nHP > 0.6
then
return BOT_ACTION_DESIRE_HIGH, aTarget, "W-攻击"
end
if (J.IsPushing( bot ) or J.IsDefending( bot )) and nHP > 0.7
then
local creeps = bot:GetNearbyLaneCreeps( castRange, true )
if #creeps >= 2 and creeps[1] ~= nil and not creeps[1]:HasModifier( "modifier_fountain_glyph" )
then
return BOT_ACTION_DESIRE_HIGH, creeps[1], "W-推进"
end
end
if J.IsLaning( bot ) and nHP > 0.5 then
local creeps = bot:GetNearbyLaneCreeps( castRange, true )
if #creeps > 1 then
for i=1, #creeps do
if J.WillMagicKillTarget(bot, creeps[i], nDamage, nCastPoint) then
return BOT_ACTION_DESIRE_HIGH, creeps[i], "W-对线"
end
end
end
end
if J.IsGoingOnSomeone( bot )
then
if J.IsValidHero( target )
and J.CanCastOnNonMagicImmune( target )
and J.IsInRange( target, bot, castRange )
and (nHP > 0.3 or J.WillMagicKillTarget(bot, target, nDamage,nCastPoint))
then
return BOT_ACTION_DESIRE_HIGH, target, "W-追杀"
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderR()
local nInRangeEnemyList = bot:GetNearbyHeroes( 600, true, BOT_MODE_NONE )
local target = J.GetProperTarget( bot )
if not abilityR:IsFullyCastable() then return 0 end
if J.IsInTeamFight(bot,800) then
return BOT_ACTION_DESIRE_HIGH, "R-团战"
end
if J.IsGoingOnSomeone( bot )
then
if J.IsValidHero( target )
and J.CanCastOnNonMagicImmune( target )
and (not J.IsInRange( target, bot, 300 ))
then
return BOT_ACTION_DESIRE_HIGH, "R-追杀"
end
end
for i = 1, 5
do
local npcAlly = GetTeamMember( i )
if npcAlly ~= nil
and npcAlly:IsAlive()
and nHP < 0.2 and npcAlly:WasRecentlyDamagedByAnyHero(2.0)
then
return BOT_ACTION_DESIRE_HIGH, "R-帮助队友逃跑"
end
end
return BOT_ACTION_DESIRE_NONE
end
function X.ConsiderD()
if not abilityD:IsFullyCastable() then return 0 end
local nSkillLV = abilityD:GetLevel()
local nCastRange = abilityD:GetCastRange() + aetherRange
local nRadius = 600
local nCastPoint = abilityD:GetCastPoint()
local nManaCost = abilityD:GetManaCost()
local nDamage = 0
local nDamageType = DAMAGE_TYPE_MAGICAL
-- local nInRangeEnemyList = J.GetAroundEnemyHeroList( nCastRange )
-- local nInBonusEnemyList = J.GetAroundEnemyHeroList( nCastRange + 200 )
local hCastTarget = nil
local sCastMotive = nil
for _, npcAlly in pairs( hAllyList ) do
if J.IsValidHero( npcAlly )
and J.IsInRange( bot, npcAlly, nCastRange + 300 )
and not npcAlly:IsMagicImmune()
and not npcAlly:IsInvulnerable()
and not npcAlly:IsIllusion()
then
--救援被控制队友
if J.IsDisabled( npcAlly )
then
hCastTarget = npcAlly
sCastMotive = 'D-救援被控制队友:'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, hCastTarget, sCastMotive
end
--为准备打架的远程队友辅助
if J.IsGoingOnSomeone( npcAlly )
and npcAlly:GetAttackRange() > 300
then
local allyTarget = J.GetProperTarget( npcAlly )
if J.IsValidHero( allyTarget ) then
hCastTarget = npcAlly
sCastMotive = 'W-辅助队友进攻:'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, hCastTarget, sCastMotive
end
end
--救援残血队友
if ( npcAlly:WasRecentlyDamagedByAnyHero( 5.0 ) or J.GetHP( npcAlly ) < 0.25 )
and not npcAlly:HasModifier( 'modifier_fountain_aura' )
then
hCastTarget = npcAlly
sCastMotive = 'W-救援残血队友:'..J.Chat.GetNormName( hCastTarget )
return BOT_ACTION_DESIRE_HIGH, hCastTarget, sCastMotive
end
end
end
return BOT_ACTION_DESIRE_NONE
end
return X
if AIUtils then return end
AIUtils = {}
local J = require( GetScriptDirectory()..'/FunLib/jmz_func' )
local Minion = dofile( GetScriptDirectory()..'/FunLib/aba_minion' )
TARGET_TYPE_TARGET = (1<<0) --是对单位施放的技能
TARGET_TYPE_LOCATION = (1<<1) --是对地板施放的技能
TARGET_TYPE_NOTARGET = (1<<2) --是按了就会施放的技能
CONSIDER_LANING = (1<<0) --是可以在对线期使用的技能
CONSIDER_TEAM_BATTLE = (1<<2) --是可以在团战使用的技能
CONSIDER_RETREAT = (1<<3) --是可以在团战使用的技能
CONSIDER_FARM = (1<<3) --是可以在打钱时使用的技能
CONSIDER_PUSH = (1<<4) --是可以在推进时使用的清兵技能
CONSIDER_ROSHAN = (1<<5) --是可以对肉山使用的技能
ALLOW_TO_ENEMY_CREEP = (1<<1) --是可以对敌方小兵使用的技能
ALLOW_TO_ALLY_HERO = (1<<2) --是可以对友方英雄使用的技能
ALLOW_TO_ENEMY_HERO = (1<<3) --是可以对敌方英雄使用的技能
ALLOW_TO_ROSHAN = (1<<4) --是应当对肉山使用的技能
ABILITY_EFFECT_AOE = (1<<0) --是带有AOE的技能
ABILITY_EFFECT_STUN = (1<<1) --是带有晕眩的技能
ABILITY_EFFECT_SLOW = (1<<2) --是带有减速的技能
ABILITY_EFFECT_DOT = (1<<3) --是会导致持续掉血的技能
ABILITY_EFFECT_HEAL = (1<<4) --是会导致恢复的技能
ABILITY_EFFECT_PURGE = (1<<5) --是带有弱驱散的技能
ABILITY_EFFECT_HARD_PURGE = (1<<6) --是带有强驱散的技能
function AIUtils.ThinkToEnemyHero(ability,data)
data = data or {}
if not (data.considerType and data.targetType) then return 0 end
local consider = data.considerType
local targetType = data.targetType
local castPoint = data.castPoint or ability:GetCastPoint()
local damage = data.damage or ability:GetAbilityDamage()
local damageType = damage.damageType or DAMAGE_TYPE_MAGICAL
local castRange = damage.castRange or ability:GetCastRange()
local lv = ability:GetLevel()
local useLv = 2 or data.useLv
local aoeNum = 2 or data.aoeNum
end
function AIUtils.ThinkToEnemyCreep(ability, data)
end
\ No newline at end of file
......@@ -900,6 +900,8 @@ Item['item_sven_outfit'] = { 'item_tango', 'item_flask', 'item_quelling_blade
Item['item_bristleback_outfit'] = { 'item_tango', 'item_flask', 'item_quelling_blade', 'item_double_branches', 'item_circlet', 'item_magic_stick', 'item_gauntlets', 'item_recipe_bracer', 'item_flask', 'item_recipe_magic_wand', 'item_power_treads_str' }
Item['item_centaur_outfit'] = { 'item_tango', 'item_flask', 'item_quelling_blade', 'item_double_branches', 'item_circlet', 'item_magic_stick', 'item_gauntlets', 'item_recipe_bracer', 'item_flask', 'item_recipe_magic_wand', 'item_tranquil_boots' }
----------------------------------------------------------------------
......
......@@ -59,7 +59,7 @@ local sUserKeyDir = Chat.GetUserKeyDir()
'npc_dota_hero_brewmaster',
--'npc_dota_hero_bristleback',
'npc_dota_hero_broodmother',
'npc_dota_hero_centaur',
--'npc_dota_hero_centaur',
--'npc_dota_hero_chaos_knight',
'npc_dota_hero_chen',
--'npc_dota_hero_clinkz',
......@@ -287,7 +287,7 @@ local sThirdList = {
"npc_dota_hero_axe",
"npc_dota_hero_slark",
"npc_dota_hero_juggernaut",
"npc_dota_hero_centaur",
}
local sFourthList = {
......@@ -418,6 +418,7 @@ local sTankList = {
"npc_dota_hero_alchemist",
"npc_dota_hero_bristleback",
"npc_dota_hero_abyssal_underlord",
"npc_dota_hero_centaur",
"npc_dota_hero_chaos_knight",
"npc_dota_hero_dragon_knight",
"npc_dota_hero_kunkka",
......@@ -438,6 +439,7 @@ local sMidList = {
"npc_dota_hero_abaddon",
"npc_dota_hero_templar_assassin",
"npc_dota_hero_abyssal_underlord",
"npc_dota_hero_centaur",
"npc_dota_hero_phantom_lancer",
"npc_dota_hero_arc_warden",
"npc_dota_hero_bristleback",
......@@ -991,8 +993,8 @@ function Think()
sSelectHero = sSelectList[i]
end
if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_alchemist" end
--if GetTeam() ~= TEAM_DIRE and i == 3 then sSelectHero = "npc_dota_hero_abaddon" end
--if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_alchemist" end
if GetTeam() ~= TEAM_DIRE and i == 3 then sSelectHero = "npc_dota_hero_centaur" end
-------******************************-----------------------------------------------
-- if GetTeam() ~= TEAM_DIRE and i == 2 then sSelectHero = "npc_dota_hero_lina" end
-- if GetTeam() ~= TEAM_DIRE and i == 1 then sSelectHero = "npc_dota_hero_antimage" end
......
......@@ -586,16 +586,24 @@ end
function X.CouldBlink(bot,nLocation)
local blinkSlot = bot:FindItemSlot("item_blink")
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_overwhelming_blink") end
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_swift_blink") end
if not blinkSlot then blinkSlot = bot:FindItemSlot("item_arcane_blink") end
if bot:GetItemSlotType(blinkSlot) == ITEM_SLOT_TYPE_MAIN
or bot:GetUnitName() == "npc_dota_hero_antimage"
or (bot:GetUnitName() == "npc_dota_hero_antimage" or bot:GetUnitName() == "npc_dota_hero_queenofpain")
then
local blink = bot:GetItemInSlot(blinkSlot)
local blink = bot:GetItemInSlot(blinkSlot)
if bot:GetUnitName() == "npc_dota_hero_antimage"
then
blink = bot:GetAbilityByName( "antimage_blink" )
end
if bot:GetUnitName() == "npc_dota_hero_queenofpain"
then
blink = bot:GetAbilityByName( "queenofpain_blink" )
end
if blink ~= nil
and blink:IsFullyCastable()
then
......
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