|
为什么我在单位接受伤害中添加UnitDamageTarget他就给我跳出来了?
代码如下:
[codes=jass]
function Trig_AUcs_effect_Conditions takes nothing returns boolean
if ((GetEventDamage() > 0.00) and (UnitHasBuffBJ(GetTriggerUnit(),'B001') == true)) then
return true
endif
return false
endfunction
function Trig_AUcs_effect_Actions takes nothing returns nothing
local location tp = GetUnitLoc(GetTriggerUnit())
local unit u
call CreateNUnitsAtLocFacingLocBJ( 1, 'h000', Player(PLAYER_NEUTRAL_PASSIVE), Location(0, 0), tp )
set u = bj_lastCreatedUnit
call UnitAddAbilityBJ( 'A008', u )
call IssueTargetOrderById( u, 852095, GetTriggerUnit() )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', u )
call RemoveLocation(tp)
// 这行
call UnitDamageTarget( GetEventDamageSource(), GetTriggerUnit(), ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, GetEventDamageSource(), true)) * 12.00 ), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_COLD, WEAPON_TYPE_WHOKNOWS )
set tp = null
set u = null
endfunction
function Trig_AUcs_start_G_A takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterUnitEvent( t,GetEnumUnit(), EVENT_UNIT_DAMAGED )
call TriggerAddCondition( t, Condition( function Trig_AUcs_effect_Conditions ) )
call TriggerAddAction( t, function Trig_AUcs_effect_Actions )
set t = null
endfunction
[/codes]
|
|