|
发表于 2008-12-11 14:45:17
|
显示全部楼层
- function jineng5_trg2 takes nothing returns boolean
- local unit Ds=GetEventDamageSource()
- local integer n=GetUnitTypeId(Ds)
- local integer i=GetUnitAbilityLevel(GetTriggerUnit(),'B003')
- local boolean b=false
- if(n=='Obla')then
- if(IsUnitType(Ds,UNIT_TYPE_HERO) and i>0)then
- call UnitRemoveAbility(GetTriggerUnit(),'B003')
- if(GetRandomReal(0,100)<=40)then
- set b=true
- endif
- elseif(not IsUnitType(Ds,UNIT_TYPE_HERO) and GetRandomReal(0,100)<=20)then
- set b=true
- endif
- if(b and i<8)then
- call IssueTargetOrderById(u,852274,Ds)
- set i=i+1
- endif
- endif
- return false
- endfunction
- function jineng5_trg1 takes nothing returns boolean
- local unit u=GetTriggerUnit()
- local integer i1=GetUnitUserData(u)
- if(i1!=0)then
- if(i1<i)then
- set a[i1]=a[i]
- call SetUnitUserData(h[i],i1)
- endif
- set i=i-1
- elseif(GetUnitTypeId(u)=='Obla')then
- call SetUnitUserData(u,i)
- set h[i]=u
- call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_TARGET_IN_RANGE)
- call TriggerRegisterUnitEvent(t1,u,EVENT_UNIT_DEATH )
- endif
- return false
- endfunction
- function jineng5_trg takes nothing returns boolean
- local unit u=GetTriggerUnit()
- local unit u1=GetEventTargetUnit()
- local integer i
- if(IsUnitType(u,UNIT_TYPE_HERO))then
- if(u1!=a[0])then
- call Damage_AddUnit("jineng5",u1)
- set a[0]=u1
- endif
- else
- set i1=GetUnitUserData(u)
- if(u1!=a[i])then
- call Damage_AddUnit("jineng5",u1)
- set a[i]=u1
- endif
- endif
- set u=null
- set u1=null
- return false
- endfunction
- function InitTrig_jineng5 takes nothing returns nothing
- call Damage_trg("jineng5",Condition(function jineng5_trg2))
- call SelectHeroSkill(u,'A009')
- set u=CreateUnit(GetOwningPlayer(u),'e000',0,0,0)
- call UnitAddAbility(u,'A004')
- set t=CreateTrigger()
- call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_TARGET_IN_RANGE)
- call TriggerAddCondition(t,Condition(function jineng5_trg))
- set t1=CreateTrigger()
- call TriggerRegisterEnterRectSimple(t1,GetPlayableMapRect())
- call TriggerAddCondition(t1,Condition(function jineng5_trg1))
- set u=null
- endfunction
复制代码 ... |
|