- Joined
- May 4, 2007
- Messages
- 2,260
Hi guys, I have this trigger in GUI:
Now, every1 knows this is not efficient. Trying to solve that i created the following trigger:
Now this trigger is for LEVEL ONE only ... but it does NOT work ... i already asked for help that my problem continues ... nothign happens, the spell does nothing ... which is bad ...
I tried to make a trigger for all 3 levels, but because i couldn't do so, now i as for your help to do a trigger for level 1 ... please ... Maybe if i figure out how to make it work for level , i may be able to make it work for all 3 levels.
-
Icy Aura Lv1
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in (Random 1 units from (Units in (Playable map area) matching (((Matching unit) has buff Icy Aura (Lv1)) Equal to True))) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- 5 Greater than or equal to (Random integer number between 1 and 100)
-
Then - Actions
- Unit - Create 1 Frsot Trap for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing degrees
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
- Unit - Create 1 Icy Aura for Player 1 (Red) at (Position of (Picked unit)) facing Default building facing degrees
- Unit - Add Icy Aura (Dummy Spell Lv1) to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
- Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
-
Else - Actions
- Do nothing
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Unit Group - Pick every unit in (Random 1 units from (Units in (Playable map area) matching (((Matching unit) has buff Icy Aura (Lv1)) Equal to True))) and do (Actions)
-
Events
JASS:
function Trig_Icy_Aura_Lv1_Func001001002002 takes nothing returns boolean
return ( UnitHasBuffBJ(GetFilterUnit(), 'B01G') == true )
endfunction
function Trig_Icy_Aura_Lv1_Func001Func001C takes nothing returns boolean
if ( not ( 5 >= GetRandomInt(1, 100) ) ) then
return false
endif
return true
endfunction
function Trig_Icy_Aura_Lv1_Func001A takes nothing returns nothing
if ( Trig_Icy_Aura_Lv1_Func001Func001C() ) then
call CreateNUnitsAtLoc( 1, 'h01N', Player(0), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
call CreateNUnitsAtLoc( 1, 'h01M', Player(0), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A02K', GetLastCreatedUnit() )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", GetEnumUnit() )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', GetLastCreatedUnit() )
else
call DoNothing( )
endif
endfunction
function Trig_Icy_Aura_Lv1_Actions takes nothing returns nothing
call ForGroupBJ( GetRandomSubGroup(1, GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Icy_Aura_Lv1_Func001001002002))), function Trig_Icy_Aura_Lv1_Func001A )
endfunction
//===========================================================================
function InitTrig_Icy_Aura_Lv1 takes nothing returns nothing
set gg_trg_Icy_Aura_Lv1 = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Icy_Aura_Lv1, 2 )
call TriggerAddAction( gg_trg_Icy_Aura_Lv1, function Trig_Icy_Aura_Lv1_Actions )
endfunction
Now, every1 knows this is not efficient. Trying to solve that i created the following trigger:
JASS:
function IcyAura_Conds takes nothing returns boolean
local integer ICchance = 5
local integer lv = GetUnitAbilityLevel(GetFilterUnit(), 'B01G')
return lv > 0 and GetRandomInt(1, 100) <= ICchance
endfunction
//==========================================================================
function IcyAura_Acts takes nothing returns nothing
local effect e
local unit en
local unit dum
local integer lvl = GetUnitAbilityLevel(GetFilterUnit(), 'B01G')
if lvl == 1 then
set en = GetEnumUnit()
call AddSpecialEffect("Doodads\\Cinematic\\FrostTrapUp\\FrostTrapUp.mdl", GetUnitX(en), GetUnitY(en))
set dum = CreateUnit(Player(0), 'h01H', GetUnitX(en), GetUnitY(en), 0)
call UnitApplyTimedLife(dum, 'BTLF', 2.00)
call UnitAddAbility(dum, 'A02K')
call SetUnitAbilityLevel(dum, 'A02K', 1)
call IssueTargetOrder(dum, "thunderbolt", en)
call TriggerSleepAction(3.0)
call DestroyEffect(e)
endif
set e = null
set en = null
set dum = null
endfunction
//==========================================================================
function Icy_Aura_GroupCall takes nothing returns nothing
call ForGroup( GetRandomSubGroup(1, GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function IcyAura_Conds))), function IcyAura_Acts )
endfunction
//===========================================================================
function InitTrig_Icy_Aura takes nothing returns nothing
local trigger IcyAura = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( IcyAura, 2 )
call TriggerAddCondition(IcyAura, Condition(function IcyAura_Conds))
call TriggerAddAction( IcyAura, function Icy_Aura_GroupCall )
set IcyAura = null
endfunction
Now this trigger is for LEVEL ONE only ... but it does NOT work ... i already asked for help that my problem continues ... nothign happens, the spell does nothing ... which is bad ...
I tried to make a trigger for all 3 levels, but because i couldn't do so, now i as for your help to do a trigger for level 1 ... please ... Maybe if i figure out how to make it work for level , i may be able to make it work for all 3 levels.