找回密码
 点一下
查看: 956|回复: 1

JASS问题

[复制链接]
发表于 2008-12-2 23:13:37 | 显示全部楼层 |阅读模式
constant function AttackGround_SpellId takes nothing returns integer
    return 'A04L' // The dummy spell ability... based off Channel
endfunction

constant function AttackGround_OrderId takes nothing returns integer
    return OrderId("channel") // The dummy spell ability order id
endfunction

constant function AttackGround_DummyUnitId takes nothing returns integer
    return 'h00A'  // Dummy target unit (semi-locust no model, godlike stats (99999 hp... 1000 divine armor)
endfunction

//===========================================================================

function Trig_AttackGround_Conditions takes nothing returns boolean
    return (GetIssuedOrderId() ==  AttackGround_OrderId()) and GetUnitAbilityLevel(GetTriggerUnit(),AttackGround_SpellId())>0
endfunction

function BlockDamage takes nothing returns boolean
    if GetTriggerEventId()==EVENT_UNIT_DAMAGED then
        call SetUnitState(GetTriggerUnit() ,UNIT_STATE_LIFE, GetUnitState(GetTriggerUnit() , UNIT_STATE_MAX_LIFE))
        return false
    else
        return true
    endif
endfunction

function Trig_AttackGround_Actions takes nothing returns nothing
    local trigger t=CreateTrigger()
    local triggercondition tc
    local unit u=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),AttackGround_DummyUnitId(),GetOrderPointX(),GetOrderPointY(),0.)
    call ShowUnit(u,false)
    call UnitRemoveAbility(u,'Aloc')
    call ShowUnit(u,true)
    call SetUnitX(u,GetOrderPointX())
    call SetUnitY(u,GetOrderPointY())
    call UnitAddAbility(GetOrderedUnit(),'A04J')
    call IssueTargetOrder(GetOrderedUnit(),"attack",u)
    call TriggerRegisterUnitEvent( t ,u, EVENT_UNIT_DAMAGED )
    set tc= TriggerAddCondition(t,Condition(function BlockDamage))
    call TriggerSleepAction(0.00)
    call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_ISSUED_TARGET_ORDER )
    call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_ISSUED_POINT_ORDER )
    call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_ISSUED_ORDER )
    call TriggerRegisterUnitEvent( t ,GetOrderedUnit(), EVENT_UNIT_DEATH)
        loop
            exitwhen GetTriggerExecCount(t)>0
            call TriggerSleepAction(0.00)
       endloop
    call TriggerRemoveCondition(t,tc)
    call UnitRemoveAbility(GetOrderedUnit(),'A04J')
    call DestroyTrigger(t)
    call RemoveUnit(u)
    set u=null
    set tc=null
    set t=null
endfunction

//===========================================================================
function InitTrig_AttackGround takes nothing returns nothing
    set gg_trg_AttackGround = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_AttackGround, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
    call TriggerAddCondition( gg_trg_AttackGround, Condition( function Trig_AttackGround_Conditions ) )
    call TriggerAddAction( gg_trg_AttackGround, function Trig_AttackGround_Actions )
endfunction


这个技能如何把开始施放技能改为发动技能效果
发表于 2008-12-2 23:49:20 | 显示全部楼层
call TriggerRegisterAnyUnitEventBJ( gg_trg_AttackGround, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )


把这个还掉

其实遇到这样看上去很复杂的问题,楼主可以一下一下的试

把事件,条件,动作分开来写,分别开开他们各自在哪里

再还个事件看看需要的事件是什么

然后换进去试试

不行的话就看看还有哪里是需要考虑的

我觉得,学WE终究还是兴趣而已,但是如果在兴趣中可以培养自己思考问题的方法又何乐而不为呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-11-25 05:36 , Processed in 0.037788 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表