soulmaka
New Member
- Reaction score
- 2
hey guys..
I just made my 1st 2 triggers using JASS, I converted some GUI codes into JASS.. and this was the result
I was trying to make 3 fireballs which then ordered to go to the target point of Ability being casts
then
turns on the seconds JASS trigger which kills any unit that the fireball passes by..
BUT...............
SOLVED!!OK!! i just forgot to put integer in the 2nd trigger..
anyways i was wondering if I can create multiple events in one JASS trigger? cause I'm definitely confused on this one.. O_O
here's the code by the way..
I just made my 1st 2 triggers using JASS, I converted some GUI codes into JASS.. and this was the result
I was trying to make 3 fireballs which then ordered to go to the target point of Ability being casts
then
turns on the seconds JASS trigger which kills any unit that the fireball passes by..
BUT...............
SOLVED!!OK!! i just forgot to put integer in the 2nd trigger..
anyways i was wondering if I can create multiple events in one JASS trigger? cause I'm definitely confused on this one.. O_O
here's the code by the way..
JASS:
function Trig_Firaga_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A02B039; ) ) then
return false
endif
return true
endfunction
function Trig_Firaga_Actions takes nothing returns nothing
local location FireabllTPOABC = GetSpellTargetLoc()
set udg_FireballTU = GetTriggerUnit()
set udg_FireballInteger = 1
loop
exitwhen udg_FireballInteger > 3
call CreateNUnitsAtLoc( 1, 039;h00C039;, GetOwningPlayer(GetTriggerUnit()), PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 150.00, ( GetUnitFacing(GetTriggerUnit()) + ( I2R(udg_FireballInteger) * 120.00 ) )), bj_UNIT_FACING )
set udg_Fireball[udg_FireballInteger] = GetLastCreatedUnit()
call IssuePointOrderLocBJ( udg_Fireball[udg_FireballInteger], "move", GetSpellTargetLoc() )
set udg_FireballInteger = udg_FireballInteger + 1
endloop
call TriggerSleepAction( 1 )
call EnableTrigger( gg_trg_Firaga_Activation )
endfunction
//===========================================================================
function InitTrig_Firaga takes nothing returns nothing
set gg_trg_Firaga = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Firaga, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Firaga, Condition( function Trig_Firaga_Conditions ) )
call TriggerAddAction( gg_trg_Firaga, function Trig_Firaga_Actions )
endfunction
JASS:
// trigger 2
// this trigger is for the periodic event, which kills units that the fireball passes through..
// but It doesn't work!!! O_O
function Trig_Firaga_Activation_Func001002003 takes nothing returns boolean
if ( not ( IsUnitEnemy(GetEnumUnit(), GetOwningPlayer(udg_FireballTU)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Firaga_Activation_Func002A takes nothing returns nothing
if (Trig_Firaga_Activation_Func001002003() ) then
call KillUnit( GetEnumUnit() )
else
endif
endfunction
function Trig_Firaga_Activation_Actions takes nothing returns nothing
local location FireballUGLOC= GetUnitLoc(udg_Fireball[udg_FireballInteger])
set udg_FireballUG = GetUnitsInRangeOfLocAll(200.00, GetUnitLoc(udg_Fireball[udg_FireballInteger]))
call ForGroupBJ( udg_FireballUG, function Trig_Firaga_Activation_Func002A )
endfunction
//===========================================================================
function InitTrig_Firaga_Activation takes nothing returns nothing
set gg_trg_Firaga_Activation = CreateTrigger( )
call DisableTrigger( gg_trg_Firaga_Activation )
call TriggerRegisterTimerEventPeriodic( gg_trg_Firaga_Activation, 0.03 )
call TriggerAddAction( gg_trg_Firaga_Activation, function Trig_Firaga_Activation_Actions )
endfunction