Charapanga
New Member
- Reaction score
- 46
Hi!
I made a spell, with 3 triggers, then converted to jass, added some special effects, etc.
Well now i want to know how to make them fit into one trigger, if possible, i have been told to use countdown timers, but i have no idea how to impliment them into a code...
Here are the codes:
Thanx,
Chara
I made a spell, with 3 triggers, then converted to jass, added some special effects, etc.
Well now i want to know how to make them fit into one trigger, if possible, i have been told to use countdown timers, but i have no idea how to impliment them into a code...
Here are the codes:
JASS:
function Trig_AirstrikeCast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A01F039; ) ) then
return false
endif
return true
endfunction
function Trig_AirstrikeCast_Actions takes nothing returns nothing
set udg_AirCaster = GetTriggerUnit()
set udg_AirCasterPos = GetUnitLoc(udg_AirCaster)
set udg_AirTargetPoint = GetSpellTargetLoc()
set udg_AirDummyPos = PolarProjectionBJ(udg_AirTargetPoint, 1000.00, AngleBetweenPoints(udg_AirTargetPoint, udg_AirCasterPos))
set udg_AirMoveTarget = PolarProjectionBJ(udg_AirTargetPoint, 1000.00, AngleBetweenPoints(udg_AirCasterPos, udg_AirTargetPoint))
call CreateNUnitsAtLocFacingLocBJ( 1, 039;o005039;, GetOwningPlayer(udg_AirCaster), udg_AirDummyPos, udg_AirMoveTarget )
set udg_AirDummy = GetLastCreatedUnit()
call MoveRectToLoc( gg_rct_AirstrikeRegion, udg_AirMoveTarget )
endfunction
//===========================================================================
function InitTrig_AirstrikeCast takes nothing returns nothing
set gg_trg_AirstrikeCast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_AirstrikeCast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_AirstrikeCast, Condition( function Trig_AirstrikeCast_Conditions ) )
call TriggerAddAction( gg_trg_AirstrikeCast, function Trig_AirstrikeCast_Actions )
endfunction
JASS:
function Trig_AirstrikeMove_Conditions takes nothing returns boolean
if ( not ( IsUnitAliveBJ(udg_AirDummy) == true ) ) then
return false
endif
return true
endfunction
function Trig_AirstrikeMove_Func005C takes nothing returns boolean
if ( not ( RectContainsUnit(gg_rct_AirstrikeRegion, udg_AirDummy) == true ) ) then
return false
endif
return true
endfunction
function Trig_AirstrikeMove_Actions takes nothing returns nothing
set udg_AirDummyPos = GetUnitLoc(udg_AirDummy)
set udg_AirMovePoint = PolarProjectionBJ(udg_AirDummyPos, 5.00, AngleBetweenPoints(udg_AirTargetPoint, udg_AirMoveTarget))
call SetUnitPositionLoc( udg_AirDummy, udg_AirMovePoint )
if ( Trig_AirstrikeMove_Func005C() ) then
call KillUnit( udg_AirDummy )
call RemoveLocation(udg_AirCasterPos)
call RemoveLocation(udg_AirMoveTarget)
call RemoveLocation(udg_AirDummyPos)
call RemoveLocation(udg_AirMovePoint)
call RemoveLocation(udg_AirTargetPoint)
else
endif
endfunction
//===========================================================================
function InitTrig_AirstrikeMove takes nothing returns nothing
set gg_trg_AirstrikeMove = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_AirstrikeMove, 0.02 )
call TriggerAddCondition( gg_trg_AirstrikeMove, Condition( function Trig_AirstrikeMove_Conditions ) )
call TriggerAddAction( gg_trg_AirstrikeMove, function Trig_AirstrikeMove_Actions )
endfunction
JASS:
function Trig_AirstrikeDropBomb_Conditions takes nothing returns boolean
if ( not ( IsUnitAliveBJ(udg_AirDummy) == true ) ) then
return false
endif
return true
endfunction
function Trig_AirstrikeDropBomb_Func008Func001C takes nothing returns boolean
if ( not ( GetDestructableTypeId(GetEnumDestructable()) == 039;NTtw039; ) ) then
return false
endif
return true
endfunction
function Trig_AirstrikeDropBomb_Func008A takes nothing returns nothing
if ( Trig_AirstrikeDropBomb_Func008Func001C() ) then
call KillDestructable( GetEnumDestructable() )
else
endif
endfunction
function Trig_AirstrikeDropBomb_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 039;h00I039;, GetOwningPlayer(udg_AirCaster), udg_AirDummyPos, bj_UNIT_FACING )
call UnitAddAbilityBJ( 039;A01E039;, GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 1.00, 039;BTLF039;, GetLastCreatedUnit() )
call IssuePointOrderLoc( GetLastCreatedUnit(), "clusterrockets", udg_AirMovePoint )
call AddSpecialEffectLocBJ( udg_AirMovePoint, "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
call DestroyEffect( GetLastCreatedEffectBJ() )
call EnumDestructablesInCircleBJ( 200.00, udg_AirMovePoint, function Trig_AirstrikeDropBomb_Func008A )
endfunction
//===========================================================================
function InitTrig_AirstrikeDropBomb takes nothing returns nothing
set gg_trg_AirstrikeDropBomb = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_AirstrikeDropBomb, 1.00 )
call TriggerAddCondition( gg_trg_AirstrikeDropBomb, Condition( function Trig_AirstrikeDropBomb_Conditions ) )
call TriggerAddAction( gg_trg_AirstrikeDropBomb, function Trig_AirstrikeDropBomb_Actions )
endfunction
Chara