|
楼主 |
发表于 2008-4-18 09:10:08
|
显示全部楼层
大大,偶说的是澄海的暗影猎手30呀
代码如下
[jass]
unit array udg_Divine_Unit1
unit array udg_Divine_Unit2
trigger gg_trg_Divine_Cast=CreateTrigger()
trigger gg_trg_Divine_Action=CreateTrigger()
trigger gg_trg_Divine_End=CreateTrigger()
trigger gg_trg_Divine_Cast_Action=CreateTrigger()
trigger gg_trg_Divine_Cast_End=CreateTrigger()
function Trig_Divine_Cast_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A043')
endfunction
function Trig_Divine_Cast_Func013Func002002001002003 takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function Trig_Divine_Cast_Actions takes nothing returns nothing
set udg_Temp_Trigger=CreateTrigger()
call TriggerExecute(gg_trg_Divine_Action)
call UnitAddAbility(udg_Init_Hero_Unit[15],'Amrf')
call UnitRemoveAbility(udg_Init_Hero_Unit[15],'Amrf')
call SetUnitFlyHeight(udg_Init_Hero_Unit[15],300.,100.)
call TriggerRegisterUnitEvent(udg_Temp_Trigger,udg_Init_Hero_Unit[15],EVENT_UNIT_SPELL_ENDCAST)
call TriggerRegisterUnitEvent(udg_Temp_Trigger,udg_Init_Hero_Unit[15],EVENT_UNIT_SPELL_FINISH)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set udg_Temp_Point=PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),350.,(I2R(bj_forLoopAIndex)*72.))
call CreateNUnitsAtLoc(1,'e00N',GetOwningPlayer(GetTriggerUnit()),udg_Temp_Point,bj_UNIT_FACING)
call RemoveLocation(udg_Temp_Point)
set udg_Divine_Unit1[bj_forLoopAIndex]=bj_lastCreatedUnit
call UnitRemoveAbility(udg_Divine_Unit1[bj_forLoopAIndex],'Aloc')
call UnitApplyTimedLifeBJ(30.,'BTLF',bj_lastCreatedUnit)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=15
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set udg_Temp_Point=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00N',GetOwningPlayer(GetTriggerUnit()),udg_Temp_Point,bj_UNIT_FACING)
call RemoveLocation(udg_Temp_Point)
call SetUnitFlyHeight(bj_lastCreatedUnit,300.,100.)
call UnitApplyTimedLifeBJ(30.,'BTLF',bj_lastCreatedUnit)
set udg_Divine_Unit1[bj_forLoopAIndex]=bj_lastCreatedUnit
call ShowUnitHide(bj_lastCreatedUnit)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
loop
exitwhen GetTriggerEvalCount(udg_Temp_Trigger)>0
set bj_forLoopAIndex=6
set bj_forLoopAIndexEnd=10
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetWidgetLife(udg_Divine_Unit1[(bj_forLoopAIndex-5)],1.)
call IssueImmediateOrderById(udg_Divine_Unit1[bj_forLoopAIndex],851972)
call IssueTargetOrderById(udg_Divine_Unit1[bj_forLoopAIndex],852501,udg_Divine_Unit1[(bj_forLoopAIndex-5)])
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=11
set bj_forLoopAIndexEnd=15
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call IssueImmediateOrderById(udg_Divine_Unit1[bj_forLoopAIndex],851972)
set udg_Temp_Unit=GroupPickRandomUnit(GetRandomSubGroup(1,GetUnitsInRangeOfLocMatching(1200.,GetUnitLoc(GetTriggerUnit()),Condition(function Trig_Divine_Cast_Func013Func002002001002003))))
call IssueTargetOrderById(udg_Divine_Unit1[bj_forLoopAIndex],852119,udg_Temp_Unit)
set udg_Temp_Unit=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call TriggerSleepAction(1.)
set udg_Temp_Point=GetUnitLoc(udg_Divine_Unit1[3])
call IssuePointOrderByIdLoc(udg_Divine_Unit1[1],851986,udg_Temp_Point)
call RemoveLocation(udg_Temp_Point)
set udg_Temp_Point=GetUnitLoc(udg_Divine_Unit1[5])
call IssuePointOrderByIdLoc(udg_Divine_Unit1[3],851986,udg_Temp_Point)
call RemoveLocation(udg_Temp_Point)
set udg_Temp_Point=GetUnitLoc(udg_Divine_Unit1[2])
call IssuePointOrderByIdLoc(udg_Divine_Unit1[5],851986,udg_Temp_Point)
call RemoveLocation(udg_Temp_Point)
set udg_Temp_Point=GetUnitLoc(udg_Divine_Unit1[4])
call IssuePointOrderByIdLoc(udg_Divine_Unit1[2],851986,udg_Temp_Point)
call RemoveLocation(udg_Temp_Point)
set udg_Temp_Point=GetUnitLoc(udg_Divine_Unit1[1])
call IssuePointOrderByIdLoc(udg_Divine_Unit1[4],851986,udg_Temp_Point)
call RemoveLocation(udg_Temp_Point)
call TriggerSleepAction(1.33)
endloop
call SetUnitFlyHeight(udg_Init_Hero_Unit[16],.0,.0)
call TriggerSleepAction(2)
set udg_Temp_Trigger=null
endfunction
function Trig_Divine_Action_Actions takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=50
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set udg_Temp_Point=PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),300.,(I2R(bj_forLoopAIndex)*20.))
call CreateNUnitsAtLoc(1,'e00M',GetOwningPlayer(GetTriggerUnit()),udg_Temp_Point,bj_UNIT_FACING)
call RemoveLocation(udg_Temp_Point)
set udg_Divine_Unit2[bj_forLoopAIndex]=bj_lastCreatedUnit
call UnitApplyTimedLifeBJ(30.,'BTLF',bj_lastCreatedUnit)
call SetUnitFlyHeight(udg_Divine_Unit2[bj_forLoopAIndex],(I2R(bj_forLoopAIndex)*10.),.0)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
loop
exitwhen GetTriggerEvalCount(udg_Temp_Trigger)>0
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=49
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetUnitFlyHeight(udg_Divine_Unit2[bj_forLoopAIndex],(GetUnitFlyHeight(udg_Divine_Unit2[bj_forLoopAIndex])+10.),100.)
set udg_Temp_Point=PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),300.,((I2R(bj_forLoopAIndex)*20.)+20.))
call IssuePointOrderByIdLoc(udg_Divine_Unit2[bj_forLoopAIndex],851986,udg_Temp_Point)
call RemoveLocation(udg_Temp_Point)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveUnit(udg_Divine_Unit2[50])
call TriggerSleepAction(.1)
set udg_i=50
loop
exitwhen udg_i==1
set udg_Divine_Unit2[udg_i]=udg_Divine_Unit2[(udg_i-1)]
set udg_i=(udg_i-1)
endloop
set udg_Temp_Point=PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()),300.,0)
call CreateNUnitsAtLoc(1,'e00M',GetOwningPlayer(GetTriggerUnit()),udg_Temp_Point,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(30.,'BTLF',bj_lastCreatedUnit)
call RemoveLocation(udg_Temp_Point)
set udg_Divine_Unit2[1]=bj_lastCreatedUnit
endloop
call SetUnitFlyHeight(udg_Init_Hero_Unit[16],.0,.0)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=15
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call RemoveUnit(udg_Divine_Unit1[bj_forLoopAIndex])
set udg_Divine_Unit1[bj_forLoopAIndex]=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=50
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call RemoveUnit(udg_Divine_Unit2[bj_forLoopAIndex])
set udg_Divine_Unit2[bj_forLoopAIndex]=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function Trig_Divine_End_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A043')
endfunction
function Trig_Divine_End_Actions takes nothing returns nothing
call SetUnitFlyHeight(udg_Init_Hero_Unit[15],.0,.0)
call DisableTrigger(gg_trg_Divine_Action)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=15
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call RemoveUnit(udg_Divine_Unit1[bj_forLoopAIndex])
set udg_Divine_Unit1[bj_forLoopAIndex]=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=50
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call RemoveUnit(udg_Divine_Unit2[bj_forLoopAIndex])
set udg_Divine_Unit2[bj_forLoopAIndex]=null
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call TriggerSleepAction(30.)
call EnableTrigger(gg_trg_Divine_Action)
endfunction
function Trig_Divine_Cast_Action_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A043')
endfunction
function Trig_Divine_Cast_Action_Func001Func001C takes nothing returns boolean
return(IsUnitAlly(GetTriggerUnit(),Player(5)))
endfunction
function Trig_Divine_Cast_Action_Func001C takes nothing returns boolean
return(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_COMPUTER)
endfunction
function Trig_Divine_Cast_Action_Func007Func001Func001Func001C takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))and(IsUnitInGroup(GetTriggerUnit(),udg_AI_Hero_Group_Light))and(IsPlayerInForce(GetOwningPlayer(GetTriggerUnit()),udg_AI_Player_Light))and(UnitHasItemOfTypeBJ(GetTriggerUnit(),'ssil'))
endfunction
function Trig_Divine_Cast_Action_Func007Func001Func001C takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))and(IsUnitInGroup(GetTriggerUnit(),udg_AI_Hero_Group_Dark))and(IsPlayerInForce(GetOwningPlayer(GetTriggerUnit()),udg_AI_Player_Dark))and(UnitHasItemOfTypeBJ(GetTriggerUnit(),'ssil'))
endfunction
function Trig_Divine_Cast_Action_Func007Func001A takes nothing returns nothing
if(Trig_Divine_Cast_Action_Func007Func001Func001C())then
call UnitUseItemPointLoc(GetEnumUnit(),GetItemOfTypeFromUnitBJ(GetEnumUnit(),'ssil'),udg_AI_Silence_Point)
return
else
if(Trig_Divine_Cast_Action_Func007Func001Func001Func001C())then
call UnitUseItemPointLoc(GetEnumUnit(),GetItemOfTypeFromUnitBJ(GetEnumUnit(),'ssil'),udg_AI_Silence_Point)
return
endif
endif
endfunction
function Trig_Divine_Cast_Action_Func007C takes nothing returns boolean
return((1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))<7)
endfunction
function Trig_Divine_Cast_Action_Actions takes nothing returns nothing
if(Trig_Divine_Cast_Action_Func001C())then
if(Trig_Divine_Cast_Action_Func001Func001C())then
call GroupRemoveUnit(udg_AI_Hero_Group_Light,GetTriggerUnit())
else
call GroupRemoveUnit(udg_AI_Hero_Group_Light,GetTriggerUnit())
endif
endif
call SetUnitInvulnerable(GetTriggerUnit(),true)
call TriggerSleepAction(3.)
call SetUnitInvulnerable(GetTriggerUnit(),false)
set udg_AI_Silence_Point=GetUnitLoc(GetTriggerUnit())
set udg_AI_Silence_Range=1500.
if(Trig_Divine_Cast_Action_Func007C())then
call ForGroupBJ(GetUnitsInRangeOfLocAll(udg_AI_Silence_Range,udg_AI_Silence_Point),function Trig_Divine_Cast_Action_Func007Func001A)
endif
endfunction
function Trig_Divine_Cast_End_Conditions takes nothing returns boolean
return(GetSpellAbilityId()=='A043')
endfunction
function Trig_Divine_Cast_End_Func002Func001C takes nothing returns boolean
return(IsUnitAlly(GetTriggerUnit(),Player(5)))
endfunction
function Trig_Divine_Cast_End_Func002C takes nothing returns boolean
return(GetPlayerController(GetOwningPlayer(GetTriggerUnit()))==MAP_CONTROL_COMPUTER)
endfunction
function Trig_Divine_Cast_End_Actions takes nothing returns nothing
call SetUnitInvulnerable(GetTriggerUnit(),false)
if(Trig_Divine_Cast_End_Func002C())then
if(Trig_Divine_Cast_End_Func002Func001C())then
call GroupAddUnit(udg_AI_Hero_Group_Light,GetTriggerUnit())
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,udg_Region_Centers[5])
else
call GroupAddUnit(udg_AI_Hero_Group_Dark,GetTriggerUnit())
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,udg_Region_Centers[1])
endif
endif
endfunction
call TriggerRegisterUnitEvent(gg_trg_Divine_Cast,gg_unit_Oshd_0341,EVENT_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Divine_Cast,Condition(function Trig_Divine_Cast_Conditions))
call TriggerAddAction(gg_trg_Divine_Cast,function Trig_Divine_Cast_Actions)
call TriggerAddAction(gg_trg_Divine_Action,function Trig_Divine_Action_Actions)
call TriggerRegisterUnitEvent(gg_trg_Divine_End,gg_unit_Oshd_0341,EVENT_UNIT_SPELL_FINISH)
call TriggerRegisterUnitEvent(gg_trg_Divine_End,gg_unit_Oshd_0341,EVENT_UNIT_SPELL_ENDCAST)
call TriggerAddCondition(gg_trg_Divine_End,Condition(function Trig_Divine_End_Conditions))
call TriggerAddAction(gg_trg_Divine_End,function Trig_Divine_End_Actions)
call TriggerRegisterUnitEvent(gg_trg_Divine_Cast_Action,gg_unit_Oshd_0341,EVENT_UNIT_SPELL_CAST)
call TriggerAddCondition(gg_trg_Divine_Cast_Action,Condition(function Trig_Divine_Cast_Action_Conditions))
call TriggerAddAction(gg_trg_Divine_Cast_Action,function Trig_Divine_Cast_Action_Actions)
call TriggerRegisterUnitEvent(gg_trg_Divine_Cast_End,gg_unit_Oshd_0341,EVENT_UNIT_SPELL_ENDCAST)
call TriggerRegisterUnitEvent(gg_trg_Divine_Cast_End,gg_unit_Oshd_0341,EVENT_UNIT_SPELL_FINISH)
call TriggerAddCondition(gg_trg_Divine_Cast_End,Condition(function Trig_Divine_Cast_End_Conditions))
call TriggerAddAction(gg_trg_Divine_Cast_End,function Trig_Divine_Cast_End_Actions)
[/jass] |
|