Commit 753c7ce6 authored by JoyJ's avatar JoyJ

modify diff blade and echo sabre

parent 8667e00e
......@@ -188,7 +188,7 @@ function X.ConsiderQ()
local nDamage = abilityQ:GetAbilityDamage()
local nDamageType = DAMAGE_TYPE_MAGICAL
local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE )
local heroList = J.FilterGroup(nInRangeEnemyList,function(u)
local heroList = FilterTable(nInRangeEnemyList,function(u)
return J.IsValidHero(u) and J.IsInRange( bot, u, nCastRange )
and J.CanCastOnNonMagicImmune(u)
end)
......
......@@ -32,8 +32,10 @@ tOutFitList['outfit_carry'] = {
"item_bristleback_outfit",
"item_soul_ring",
"item_yasha",
"item_echo_sabre",
"item_black_king_bar",
"item_radiance",
"item_harpoon",
"item_travel_boots",
"item_sange_and_yasha",
"item_basher",
......
......@@ -40,6 +40,7 @@ tOutFitList['outfit_carry'] = {
"item_hand_of_midas",
"item_aghanims_shard",
"item_black_king_bar",
"item_disperser",
"item_manta",
"item_travel_boots",
"item_sheepstick",
......
......@@ -45,6 +45,7 @@ tOutFitList['outfit_carry'] = {
"item_diffusal_blade",
"item_sange_and_yasha",
"item_black_king_bar",
"item_disperser",
"item_travel_boots",
"item_abyssal_blade",
sRandomItem_1,
......
......@@ -36,9 +36,9 @@ local tOutFitList = {}
tOutFitList['outfit_carry'] = {
"item_crystal_maiden_outfit",
"item_aghanims_shard",
"item_force_staff",
"item_glimmer_cape",
"item_aghanims_shard",
"item_rod_of_atos",
"item_ultimate_scepter",
"item_sheepstick",
......@@ -238,7 +238,7 @@ function X.ConsiderQ()
local nInRangeEnemyList = bot:GetNearbyHeroes( nCastRange, true, BOT_MODE_NONE )
local nInBonusEnemyList = bot:GetNearbyHeroes( nCastRange + 200, true, BOT_MODE_NONE )
nInRangeEnemyList = J.FilterGroup(nInRangeEnemyList,J.CanCastOnNonMagicImmune)
nInRangeEnemyList = FilterTable(nInRangeEnemyList,J.CanCastOnNonMagicImmune)
--击杀
for _, npcEnemy in pairs( nInRangeEnemyList )
......@@ -253,7 +253,7 @@ function X.ConsiderQ()
--团战
if J.IsInTeamFight( bot, 1200 )
then
local valid = J.FilterGroup(nInRangeEnemyList,J.IsValidHero)
local valid = FilterTable(nInRangeEnemyList,J.IsValidHero)
local enemy = J.GetLeastHpUnit( valid )
if enemy ~= nil then
return BOT_ACTION_DESIRE_HIGH, enemy, 'Q-团战攻击血量最少单位'
......@@ -286,11 +286,9 @@ function X.ConsiderQ()
--Push
if ( J.IsPushing( bot ) or J.IsDefending( bot ) or J.IsFarming( bot ) or (J.IsLaning(bot) and bot:GetAssignedLane()==LANE_MID))
and J.IsAllowedToSpam( bot, nManaCost )
and nSkillLV >= 2 or DotaTime() > 9 * 60
and #hAllyList <= 2 and #hEnemyList == 0
then
and nSkillLV >= 2 or DotaTime() > 9 * 60 then
local laneCreepList = bot:GetNearbyLaneCreeps( nCastRange, true )
laneCreepList = J.FilterGroup(laneCreepList, function(u)
laneCreepList = FilterTable(laneCreepList, function(u)
return J.IsValid(u) and not u:HasModifier( "modifier_fountain_glyph" )
end)
if #laneCreepList >= 3 then
......@@ -378,7 +376,7 @@ function X.ConsiderW()
local nDamageType = DAMAGE_TYPE_MAGICAL
local nInRangeEnemyList = GetUnitList( UNIT_LIST_ENEMY_HEROES )
nInRangeEnemyList = J.FilterGroup(nInRangeEnemyList,function(u)
nInRangeEnemyList = FilterTable(nInRangeEnemyList,function(u)
return J.IsValidHero(u) and J.CanCastOnNonMagicImmune(u)
and J.IsInRange(bot,u,nCastRange)
end)
......
......@@ -122,11 +122,13 @@ modifier_drow_ranger_marksmanship_reduction
local abilityQ = bot:GetAbilityByName( sAbilityList[1] )
local abilityW = bot:GetAbilityByName( sAbilityList[2] )
local abilityE = bot:GetAbilityByName( sAbilityList[3] )
local abilityD = bot:GetAbilityByName( sAbilityList[4] )
local abilityM = nil
local castQDesire, castQTarget
local castWDesire, castWLocation
local castEDesire, castELocation
local castDDesire
local castMDesire
local castWMDesire, castWMLocation
......@@ -146,6 +148,15 @@ function X.SkillsComplement()
hAllyList = J.GetAlliesNearLoc( bot:GetLocation(), 1600 )
abilityM = J.IsItemAvailable( "item_mask_of_madness" )
castDDesire = X.ConsiderD()
if castDDesire > 0
then
bot:Action_UseAbility( abilityD )
return
end
castEDesire, castELocation = X.ConsiderE()
if castEDesire > 0
then
......@@ -727,6 +738,14 @@ function X.ConsiderQ()
return BOT_ACTION_DESIRE_NONE, nil
end
function X.ConsiderD()
local nEnemysHeroesNearBy = bot:GetNearbyHeroes( bot:GetAttackRange() / 2 , true, BOT_MODE_NONE )
local nEnemysHeroesNearByImmediate = bot:GetNearbyHeroes( 175 , true, BOT_MODE_NONE )
if (J.IsGoingOnSomeone(bot) and #nEnemysHeroesNearBy>0) or #nEnemysHeroesNearByImmediate>0 then
return BOT_ACTION_DESIRE_HIGH
end
return BOT_ACTION_DESIRE_NONE
end
return X
-- dota2jmz@163.com QQ:2462331592..
......@@ -39,16 +39,15 @@ tOutFitList['outfit_carry'] = {
"item_sven_outfit",
--"item_bracer",
"item_blade_mail",
"item_echo_sabre",
"item_aghanims_shard",
"item_black_king_bar",
"item_travel_boots",
"item_greater_crit",
"item_abyssal_blade",
-- "item_heart",
"item_assault",
"item_moon_shard",
"item_travel_boots_2",
-- "item_ultimate_scepter_2",
"item_ultimate_scepter_2",
}
......
......@@ -169,7 +169,7 @@ function X.SkillsComplement()
bot:Action_UseAbility( abilityMoM )
end
local attackList = J.FilterGroup(hEnemyList,function(u)
local attackList = FilterTable(hEnemyList,function(u)
return not u:IsMagicImmune() and GetUnitToUnitDistance(bot,u)<=bot:GetAttackRange()+200
end)
if #attackList>0 then
......
......@@ -40,6 +40,7 @@ tOutFitList['outfit_carry'] = {
"item_diffusal_blade",
"item_manta",
"item_skadi",
"item_disperser",
"item_travel_boots",
"item_aghanims_shard",
"item_abyssal_blade",
......
......@@ -89,6 +89,7 @@ tOutFitList['outfit_carry'] = {
"item_echo_sabre",
"item_black_king_bar",
"item_basher",
"item_harpoon",
"item_blink",
"item_abyssal_blade",
"item_assault",
......@@ -123,9 +124,6 @@ X['sSellList'] = {
"item_assault",
"item_bracer",
"item_ultimate_scepter",
"item_echo_sabre",
"item_travel_boots",
"item_phase_boots",
}
......
......@@ -41,6 +41,7 @@ tOutFitList['outfit_carry'] = {
"item_echo_sabre",
"item_aghanims_shard",
"item_ultimate_scepter",
"item_harpoon",
"item_lotus_orb",
"item_black_king_bar",
"item_travel_boots",
......@@ -65,6 +66,7 @@ tOutFitList['outfit_tank'] = {
"item_echo_sabre",
"item_aghanims_shard",
"item_crimson_guard",
"item_harpoon",
"item_ultimate_scepter",
"item_heavens_halberd",
"item_travel_boots",
......@@ -88,9 +90,6 @@ X['sSellList'] = {
"item_black_king_bar",
"item_magic_wand",
"item_ultimate_scepter",
"item_echo_sabre",
"item_travel_boots",
"item_magic_wand",
......
......@@ -44,6 +44,7 @@ tOutFitList['outfit_carry'] = {
"item_aghanims_shard",
"item_diffusal_blade",
"item_manta",
"item_disperser",
"item_ultimate_scepter",
"item_travel_boots",
"item_skadi",
......
......@@ -34,10 +34,11 @@ local nTalentBuildList = J.Skill.GetTalentBuild( tTalentTreeList )
X['sBuyList'] = {
"item_melee_carry_outfit",
"item_aghanims_shard",
"item_yasha",
"item_diffusal_blade",
"item_aghanims_shard",
"item_manta",
"item_disperser",
"item_basher",
"item_black_king_bar",
"item_travel_boots",
......
......@@ -41,6 +41,7 @@ tOutFitList['outfit_carry'] = {
"item_echo_sabre",
"item_ultimate_scepter",
"item_blink",
"item_harpoon",
-- "item_aghanims_shard",
"item_black_king_bar",
"item_travel_boots",
......@@ -65,6 +66,7 @@ tOutFitList['outfit_tank'] = {
"item_echo_sabre",
"item_crimson_guard",
"item_ultimate_scepter",
"item_harpoon",
"item_heavens_halberd",
"item_assault",
"item_travel_boots",
......
......@@ -40,6 +40,7 @@ tOutFitList['outfit_carry'] = {
"item_hand_of_midas",
"item_aghanims_shard",
"item_blink",
"item_harpoon",
"item_black_king_bar",
"item_travel_boots",
"item_satanic",
......@@ -72,8 +73,6 @@ X['sSellList'] = {
"item_greater_crit",
"item_hand_of_midas",
"item_overwhelming_blink",
"item_echo_sabre",
}
if J.Role.IsPvNMode() or J.Role.IsAllShadow() then X['sBuyList'], X['sSellList'] = { 'PvN_str_carry' }, {"item_power_treads", 'item_quelling_blade'} end
......
......@@ -43,7 +43,8 @@ tOutFitList['outfit_carry'] = {
"item_blink",
"item_ultimate_scepter",
-- "item_aghanims_shard",
"item_black_king_bar",
"item_black_king_bar",
"item_harpoon",
"item_travel_boots",
"item_skadi",
"item_satanic",
......
......@@ -215,7 +215,7 @@ local abilityR = bot:GetAbilityByName( sAbilityList[6] )
local castQDesire, castQLocation
local castEDesire, castELocation
local castDDesire, castDTarget
local castRDesire
local castRDesire, castRTarget
local nKeepMana, nMP, nHP, nLV, botTarget, hEnemyList, hAllyList, sMotive
local bonusRange = 0
......@@ -621,41 +621,58 @@ function X.ConsiderR()
if not abilityR:IsFullyCastable() then return BOT_ACTION_DESIRE_NONE, nil end
local nSkillLV = abilityR:GetLevel()
local nRadius = abilityR:GetSpecialValueInt( 'start_radius' ) + abilityR:GetSpecialValueInt( 'radius' )
local nRadius = abilityR:GetVal('debuff_radius')
local nCastPoint = abilityR:GetCastPoint()
local nManaCost = abilityR:GetManaCost()
local nAlliedHeroesInRange = bot:GetNearbyHeroes( nRadius, false, BOT_MODE_NONE )
local nEnemyHeroesInRange = bot:GetNearbyHeroes( nRadius - 300, true, BOT_MODE_NONE )
local nTargetLocation = nil
nEnemyHeroesInRange=FilterTable(nEnemyHeroesInRange, function(u)
return J.IsValidHero(u) and not u:IsMagicImmune()
and J.CanCastOnMagicImmune( botTarget )
end)
if J.IsInTeamFight( bot, 1200 )
then
if #nEnemyHeroesInRange >= 3
then
return BOT_ACTION_DESIRE_HIGH, 'R-Battle'
for _,u in pairs(nEnemyHeroesInRange) do
local hd=abilityR:GetVal('health_damage')
if bot:GetTalent('special_bonus_unique_venomancer_4') then hd=hd+1.5 end
hd = hd/100.0
local damage = abilityR:GetVal('impact_damage') + u:GetMaxHealth() * hd * 2 --少计算一点
if J.WillMagicKillTarget(bot, u, damage, 2.0) then
return BOT_ACTION_DESIRE_HIGH, u, "R-击杀"
end
end
if J.IsGoingOnSomeone( bot )
then
local most=0
local mostUnit=nil
if J.IsInTeamFight( bot, 1200 ) then
for _,u in pairs(nEnemyHeroesInRange) do
local units=u:GetNearbyHeroes(nRadius, false, BOT_MODE_NONE)
units=FilterTable(units,function(u2)
return u2~=u
end)
if #units>most then
most=#units
mostUnit=u
end
end
if mostUnit then return BOT_ACTION_DESIRE_HIGH, mostUnit, "R-团战" end
end
if J.IsGoingOnSomeone( bot ) then
if J.IsValidHero( botTarget )
and J.CanCastOnMagicImmune( botTarget )
and J.IsInRange( botTarget, bot, nRadius - 150 )
and #nEnemyHeroesInRange >= 2
and #nEnemyHeroesInRange >= #nAlliedHeroesInRange
and J.IsInRange( botTarget, bot, nRadius - 50 )
then
return BOT_ACTION_DESIRE_HIGH, 'R-Chase:'..J.Chat.GetNormName( botTarget )
return BOT_ACTION_DESIRE_HIGH, botTarget, 'R-追杀:'..J.Chat.GetNormName( botTarget )
end
end
if J.IsRetreating( bot )
and bot:WasRecentlyDamagedByHero( npcEnemy, 3.0 )
and #nEnemyHeroesInRange >= 2
and #nEnemyHeroesInRange >= #hAllyList
then
and bot:WasRecentlyDamagedByHero( npcEnemy, 2.0 ) then
return BOT_ACTION_DESIRE_HIGH, 'R-Retreat'
end
......
......@@ -260,7 +260,7 @@ function X.ConsiderW()
end
--通常
local valid = J.FilterGroup(nEnemysHeroesInCastRange,function(u)
local valid = FilterTable(nEnemysHeroesInCastRange,function(u)
return J.IsValid( u )
and J.CanCastOnNonMagicImmune( u )
and J.CanCastOnTargetAdvanced( u )
......
......@@ -500,7 +500,7 @@ end
function J.GetEnemiesNearLoc(vLoc, nRadius)
local enemies = GetUnitList( UNIT_LIST_ENEMY_HEROES )
return J.FilterGroup(enemies,function(u)
return FilterTable(enemies,function(u)
return GetUnitToLocationDistance( u, vLoc ) <= nRadius
end)
......@@ -3462,16 +3462,6 @@ function J.GetMagicToPhysicalDamage( bot, nUnit, nMagicDamage )
end
function J.FilterGroup(nList,func)
local newGroup={}
for _, npc in pairs( nList ) do
if func(npc) then
table.insert(newGroup,npc)
end
end
return newGroup
end
function J.MergeGroup(nList,...)
local args = {...}
for a in arg do
......@@ -3682,11 +3672,11 @@ function J.FindAoeLocationForLinearSkill(data)
local filter = data.filter or J.FindAoeLocationForLinearSkillFilter
local least = data.least or 2
enemies = J.FilterGroup(enemies, function(u)
enemies = FilterTable(enemies, function(u)
return J.IsValidHero(u)
end)
creeps = J.FilterGroup(creeps, function(u)
creeps = FilterTable(creeps, function(u)
return J.IsValid(u)
end)
if not onlyHero then
......@@ -3699,7 +3689,7 @@ function J.FindAoeLocationForLinearSkill(data)
for i=1,36 do
local angle = 10 * i
local unstablity = 0
local hitEnemy = J.FilterGroup(enemies,J.And(filter, function(u)
local hitEnemy = FilterTable(enemies,J.And(filter, function(u)
local distance = J.GetDistanceFromUnitToUnit(bot, u)
local uLoc = J.GetCorrectLoc(u,distance / projSpeed + castPoint)
if J.IsVectorInRectangle(uLoc,loc,angle,radius,range) then
......
......@@ -275,7 +275,7 @@ end
local gnh=CDOTA_Bot_Script.GetNearbyHeroes
CDOTA_Bot_Script.GetNearbyHeroes = function(u,nRadius,bEnemies,eBotMode)
if not u:CanBeSeen() then return {} end
if nRadius <= 1600 and u:IsBot() then return gnh(u,nRadius,bEnemies,eBotMode) end
if nRadius <= 1600 and u:IsAlly() then return gnh(u,nRadius,bEnemies,eBotMode) end
local list
if bEnemies then
list=GetUnitList(UNIT_LIST_ENEMY_HEROES)
......@@ -292,7 +292,7 @@ end
local gnc=CDOTA_Bot_Script.GetNearbyCreeps
CDOTA_Bot_Script.GetNearbyCreeps = function(u,nRadius,bEnemies)
if not u:CanBeSeen() then return {} end
if nRadius <= 1600 and u:IsBot() then return gnc(u,nRadius,bEnemies) end
if nRadius <= 1600 and u:IsAlly() then return gnc(u,nRadius,bEnemies) end
local list
if bEnemies then
list=GetUnitList(UNIT_LIST_ENEMY_CREEPS) or {}
......
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