發新話題
打印

問野._.

[Close]

問野._.

1. 如何移除蝗蟲群技能
2. 如何模擬被動閃避技能 (姐係當閃左就觸發事件-w-)

TOP

冇人答你  咁我答下你:    E個係模擬閃避  後既動作   姐係觸技  
MISS 1:
function MISS_2Conditions takes nothing returns boolean
    return GetEventDamage() == 1
endfunction

function Trig_MISS_2Actions takes nothing returns nothing
    local texttag tx = CreateTextTagUnitBJ( "失誤", GetEventDamageSource(), 0, 10, 100, 0, 0, 0 )
    call SetTextTagVelocity( tx, 0, 0.05 )
    call SetTextTagPermanent( tx, false )
    call SetTextTagFadepoint( tx, 0.75 )
    call SetTextTagLifespan( tx, 1.0 )
endfunction

//===========================================================================
function InitTrig_MISS_2 takes nothing returns nothing
    set gg_trg_MISS_2 = CreateTrigger()
    call TriggerAddCondition(gg_trg_MISS_2, Condition(function MISS_2Conditions))
    call YDWESyStemAnyUnitDamagedRegistTrigger( gg_trg_MISS_2 )
    call TriggerAddAction(gg_trg_MISS_2, function Trig_MISS_2Actions)
endfunction






MISS 2:
function MISSConditions takes nothing returns boolean
    return GetEventDamage() == 1
endfunction

function MISSActions takes nothing returns nothing
    local unit u = CreateUnit(GetOwningPlayer(GetTriggerUnit()), 'o000', GetUnitX(GetTriggerUnit()), GetUnitY(GetTriggerUnit()), 0)
    call UnitAddAbility( u, 'A001' )
    call SetUnitAbilityLevel( u, 'A001', GetUnitAbilityLevel(GetTriggerUnit(), 'A000') )
    call IssueTargetOrder(u, "thunderbolt", GetEventDamageSource() )
    call YDWETimerRemoveUnit(1.00, u)
    call UnitDamageTarget( GetTriggerUnit(), GetEventDamageSource(),I2R(GetHeroAgi(GetTriggerUnit(), true)), true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNKNOWN, WEAPON_TYPE_WHOKNOWS )
    call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Orc\\MirrorImage\\MirrorImageCaster.mdl",GetEventDamageSource(),"origin"))
    call SetUnitX(GetTriggerUnit(),GetUnitX(GetEventDamageSource()))
    call SetUnitY(GetTriggerUnit(),GetUnitY(GetEventDamageSource()))
    set u = null
endfunction

//===========================================================================
function InitTrig_MISS takes nothing returns nothing
    set gg_trg_MISS = CreateTrigger()
    call TriggerAddCondition(gg_trg_MISS, Condition(function MISSConditions))
    call YDWESyStemAnyUnitDamagedRegistTrigger( gg_trg_MISS )
    call TriggerAddAction(gg_trg_MISS, function MISSActions)
endfunction



移除蝗蟲群技能  咪就係移除技能  伸手-.-?

TOP

K Y O果邊都有人問類似問題
都係答用觸發模擬一血
不過我冇UI睇唔到佢果個範例

蝗蟲群技能唔可以用觸發移除
不過你將果個部隊hide完再unhide佢就可以解除了
不過要控佢我就唔知了 直接創造第2個部隊吧

TOP

引用:
原帖由 kwai 於 2011-8-26 12:34 發表
冇人答你  咁我答下你:    E個係模擬閃避  後既動作   姐係觸技  
MISS 1:
function MISS_2Conditions takes nothing returns boolean
    return GetEventDamage() == 1
endfunction

function Trig_MISS_2Actions  ...
抄我個方法0,0 你都講埋係要邊招先得嫁-_-
人地點明..
function Trig_MISS2_Actions takes nothing returns nothing
    local texttag tx = CreateTextTag()
    call SetTextTagPosUnit(tx, GetEventDamageSource(), 0)
    call SetTextTagText(tx,"失誤",0.023)
    call SetTextTagColor(tx,255,0,0,0)
    call SetTextTagVelocity( tx, 0, 0.05 )
    call SetTextTagPermanent( tx, false )
    call SetTextTagFadepoint( tx, 0.75 )
    call SetTextTagLifespan( tx, 2 )
    set tx = null
endfunction


改做咁
會比較好

[ 本帖最後由 leoiii12 於 2011-9-26 01:27 編輯 ]

TOP

發新話題