|
楼主 |
发表于 2010-3-13 17:04:37
|
显示全部楼层
还是没懂..求修改..
function EngineerTurretConditions takes nothing returns boolean
return GetSpellAbilityId()=='A08S'
endfunction
function EngineerTurretActions takes nothing returns nothing
local group g = GetUnitsOfTypeIdAll('h00S')
local unit u = FirstOfGroup(g)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local player p = GetOwningPlayer(GetTriggerUnit())
call DestroyGroup(g)
call RemoveUnit(u)
set u = null
set g = null
call PolledWait(0.1)
if udg_TurretNumber>8 then
call IssueImmediateOrder(GetTriggerUnit(),"stop")
else
set udg_LightTurret = CreateUnit(p,'h00S',x,y,0.0)
endif
set udg_soundpath = "war3mapImported\\\\AmmoLink.mp3"
call ExecuteFunc("PlaySoundPath3D")
call PolledWait(2.25)
if GetWidgetLife(udg_Hero[GetConvertedPlayerId(p)])>0.405 then
call ModifyHeroStat( bj_HEROSTAT_INT, udg_Hero[GetConvertedPlayerId(p)], bj_MODIFYMETHOD_SUB, 1 )
endif
endfunction
//===========================================================================
function InitTrig_EngineerTurret takes nothing returns nothing
set udg_EngineerTurret = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_EngineerTurret, EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(udg_EngineerTurret, Condition( function EngineerTurretConditions))
call TriggerAddAction(udg_EngineerTurret, function EngineerTurretActions)
endfunction |
|