- Joined
- Mar 23, 2008
- Messages
- 942
I'm very newbie with Jass, so normaly I try to do the spell with gui and them convert to jass when I need to use jass-only codes.
The trigger bellow should summon a sword in front of a gate and them start moving them forward. It is still missing the part where if a unit comes in 80 range of the sword it deals damage: (5 * Level of Gate of Babylon for Sumerian King).
Someone could help-me putting all the actions in the same function? So I can use locals ^^
Thanks!
The trigger bellow should summon a sword in front of a gate and them start moving them forward. It is still missing the part where if a unit comes in 80 range of the sword it deals damage: (5 * Level of Gate of Babylon for Sumerian King).
-
Gate move
-
Events
- Time - Every 0.04 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in (Units of type Sumerian King) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Picked unit)) Greater than or equal to 15
-
Then - Actions
-
Unit Group - Pick every unit in (Units of type Gate of Babylon) and do (Actions)
-
Loop - Actions
- Set tempunit[0] = (Picked unit)
-
Loop - Actions
- Set tempreal = (Facing of tempunit[0])
- Unit - Create 1 Sword for (Owner of (Picked unit)) at temppoint facing (Facing of tempunit[0]) degrees
- Unit Group - Add (Last created unit) to tempgroup
-
Unit Group - Pick every unit in (Units of type Gate of Babylon) and do (Actions)
-
Else - Actions
- Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in tempgroup and do (Actions)
-
Loop - Actions
- Set temppoint = ((Position of (Picked unit)) offset by 40.00 towards (Facing of (Picked unit)) degrees)
- Unit - Move (Picked unit) instantly to temppoint
-
Loop - Actions
-
Unit Group - Pick every unit in (Units of type Sumerian King) and do (Actions)
-
Events
JASS:
function Trig_Gate_move_Func001Func001Func001A takes nothing returns nothing
set udg_tempunit[0] = GetEnumUnit()
set udg_temppoint = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), GetRandomReal(0, 100.00), ( ( GetUnitFacing(GetEnumUnit()) + ( I2R(GetRandomInt(-1, 1)) * 90.00 ) ) + 1 ))
endfunction
function Trig_Gate_move_Func001Func001C takes nothing returns boolean
if ( not ( GetUnitUserData(GetEnumUnit()) >= 15 ) ) then
return false
endif
return true
endfunction
function Trig_Gate_move_Func001A takes nothing returns nothing
if ( Trig_Gate_move_Func001Func001C() ) then
call ForGroupBJ( GetUnitsOfTypeIdAll('h00N'), function Trig_Gate_move_Func001Func001Func001A )
set udg_tempreal = GetUnitFacing(udg_tempunit[0])
call CreateNUnitsAtLoc( 1, 'h00I', GetOwningPlayer(GetEnumUnit()), udg_temppoint, GetUnitFacing(udg_tempunit[0]) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_tempgroup )
else
call SetUnitUserData( GetEnumUnit(), ( GetUnitUserData(GetEnumUnit()) + 1 ) )
endif
endfunction
function Trig_Gate_move_Func002A takes nothing returns nothing
set udg_temppoint = PolarProjectionBJ(GetUnitLoc(GetEnumUnit()), 40.00, GetUnitFacing(GetEnumUnit()))
call SetUnitPositionLoc( GetEnumUnit(), udg_temppoint )
endfunction
function Trig_Gate_move_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsOfTypeIdAll('H00L'), function Trig_Gate_move_Func001A )
call ForGroupBJ( udg_tempgroup, function Trig_Gate_move_Func002A )
endfunction
//===========================================================================
function InitTrig_Gate_move takes nothing returns nothing
set gg_trg_Gate_move = CreateTrigger( )
call DisableTrigger( gg_trg_Gate_move )
call TriggerRegisterTimerEventPeriodic( gg_trg_Gate_move, 0.04 )
call TriggerAddAction( gg_trg_Gate_move, function Trig_Gate_move_Actions )
endfunction
Someone could help-me putting all the actions in the same function? So I can use locals ^^
Thanks!