|
这个技能一点都不华丽-.-!,但是用来做AI很不错,我也给他弄了伤害。你给AI注册一个某敌方单位开始使用某技能(如雷霆一击),然后就命令AI用这招,躲过雷霆一击,然后迅速近身xxxYDYD
function JingYunBuDamage takes nothing returns nothing//伤害
local trigger trg=GetTriggeringTrigger()
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl" , GetTriggerUnit(), "chest" ))
call damage(GetTriggerUnit(),GetTriggerUnit(),400)
set trg=null
endfunction
//-------------------------------------------------------
function JingYunBu1 takes nothing returns nothing//向前直线运动
local timer tm=GetExpiredTimer()
local unit me=LUtm(tm,"me")
local real angle=LRtm(tm,"angle")
local real speed=30
local integer t=LItm(tm,"t")
call SetUnitX(me,GetUnitX(me)+speed*Cos(angle))
call SetUnitY(me,GetUnitY(me)+speed*Sin(angle))
set t=t+1
call SItm(tm,"t",t)
if t>18 then
call DestroyTrigger(LTGtm(tm,"trg"))
call FlushChildHashtable(udg_HT,GetHandleId(tm))
call DestroyTimer(tm)
endif
set me=null
set tm=null
endfunction
//----------------------------------------------------------
function JingYunBu takes nothing returns nothing //等待0.2秒后开启向前的计时器
local timer tm=GetExpiredTimer()
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl",GetUnitX(LUtm(tm,"me")),GetUnitY(LUtm(tm,"me"))))
call TimerStart(tm,0.01,true,function JingYunBu1)
set tm=null
endfunction
function JingYunBu0 takes nothing returns nothing//向后快速退
local timer tm=GetExpiredTimer()
local real angle=LRtm(tm,"angle")+bj_PI
local unit me=LUtm(tm,"me")
local integer t0=LItm(tm,"t0")
call SetUnitX(me,GetUnitX(me)+30*Cos(angle))
call SetUnitY(me,GetUnitY(me)+30*Sin(angle))
set t0=t0+1
call SItm(tm,"t0",t0)
if t0>20 then
call SetUnitAnimation(me,"attack")
call TimerStart(tm,0.2,true,function JingYunBu)
endif
set tm=null
set me=null
endfunction
//-----------------------------------------------------------------
function Trig_jing_yun_bu_Conditions takes nothing returns boolean//技能入口
local timer tm
local real angle
local trigger trg
if ( not ( GetSpellAbilityId() == 'A00E' ) ) then
return false
endif
set tm=CreateTimer()
set trg=CreateTrigger()
set angle=bj_PI*GetUnitFacing(GetTriggerUnit())/180+bj_PI
call SUtm(tm,"me",GetTriggerUnit())
call SRtm(tm,"angle",angle-bj_PI)
call STGtm(tm,"trg",trg)
call TriggerRegisterUnitInRangeSimple(trg,300,GetTriggerUnit())
call TriggerAddCondition(trg,function JingYunBuDamage)
call TimerStart(tm,0.01,true,function JingYunBu0)
return true
endfunction
function Trig_jing_yun_bu_Actions takes nothing returns nothing
endfunction
//===========================================================================
function InitTrig_jing_yun_bu takes nothing returns nothing
set gg_trg_jing_yun_bu = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_jing_yun_bu, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_jing_yun_bu, Condition( function Trig_jing_yun_bu_Conditions ) )
call TriggerAddAction( gg_trg_jing_yun_bu, function Trig_jing_yun_bu_Actions )
endfunction |
|