|
楼主 |
发表于 2021-1-12 08:52:43
|
显示全部楼层
技能学习模板, 两种建议 可以用逆天AI学习 也可以用我的,//-------------------------------注册英雄技能------------------------------------------- 这个几乎每个版本都能用 原理就是为了 就是简单
function RestoreHeroSkills takes integer i,integer a1,integer a2,integer a3,integer a4,integer a5 returns nothing //AIskll1 ..... 2- 5 之类 请在地图globals 中注册好 integer array 这样个格式 - - 不想多说
set AIskll1[i]=a1
set AIskll2[i]=a2
set AIskll3[i]=a3
set AIskll4[i]=a4
set AIskll5[i]=a5
endfunction
function SetVars takes nothing returns nothing //注册英雄技能 地图初始化调用一下 修改技能 和前面的 1
call RestoreHeroSkills(1,'A03A','A034','A00N','A03I','A035')
call RestoreHeroSkills(2,'A04I','A049','A03H','A04D','A03J')
endfunction
function AILearnSkills takes unit u,integer i returns nothing //提升登记 进入 区域调用,call AILearnSkills 方法是 触发单位类型 以及上面 绑定的1 2 3 4 5- 之类的
loop
if GetHeroSkillPoints(u)>0 then
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll1[i], true )
call SelectHeroSkill(u,AIskll1[i])
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll1[i],false)
endif
if GetHeroSkillPoints(u)>0 then
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll2[i], true )
call SelectHeroSkill(u,AIskll2[i])
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll2[i],false)
endif
if GetHeroSkillPoints(u)>0 then
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll3[i], true )
call SelectHeroSkill(u,AIskll3[i])
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll3[i],false)
endif
if GetHeroSkillPoints(u)>0 then
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll4[i], true )
call SelectHeroSkill(u,AIskll4[i])
call SetPlayerAbilityAvailable(GetOwningPlayer(u), AIskll4[i],false)
endif
if GetHeroSkillPoints(u)>0 then
call SelectHeroSkill(u,AIskll5[i])
endif
exitwhen GetHeroSkillPoints(u)==0
call TriggerSleepAction(0.05)
endloop
set u=null
endfunction
不明白就别问了就 3个 自己测试修改下应该能懂 |
|