killing all 5 units in map?

ironfist19

New Member
Reaction score
3
hello, my second trigger made by me... kills all 5 units in map when someone cast "Dark Bishop"..

JASS:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AUan' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Func004Func001C takes nothing returns boolean
    if ( not ( IsUnitEnemy(GetEnumUnit(), Player(0)) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Func004A takes nothing returns nothing
    if ( Trig_Untitled_Trigger_001_Func004Func001C() ) then
    loop
        exitwhen udg_kills == 5
        call KillUnit(udg_firstunit)
        set udg_kills = ( udg_kills + 1 )
    endloop
        endif
  call DestroyGroup(udg_temp_group)
  call RemoveUnit(udg_firstunit)
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    set udg_firstunit = FirstOfGroup(udg_temp_group)
    set udg_temp_group = GetUnitsInRectAll(GetPlayableMapRect())
    set udg_kills = 0
    call ForGroupBJ( udg_temp_group, function Trig_Untitled_Trigger_001_Func004A )
endfunction

//---ironfist19
function InitTrig_Practice_06 takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction(t, function Trig_Untitled_Trigger_001_Actions )
endfunction


i know, i suck at jass but ;] i need some help here guys

Edit : Renewed the trigger but still i had a problem.. it doesn't work.. ;/
 

The Undaddy

Creating with the power of rage
Reaction score
55
JASS:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AUan' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Func004A takes nothing returns nothing
    if IsUnitEnemy(GetEnumUnit(), Player(0)) == true then
        call KillUnit(GetEnumUnit())
    endif        
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    set udg_temp_group = GetUnitsInRectAll(GetPlayableMapRect())
    call ForGroupBJ( udg_temp_group, function Trig_Untitled_Trigger_001_Func004A )
    call DestroyGroup(udg_tempgroup)
endfunction

//---ironfist19
function InitTrig_Practice_06 takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction(t, function Trig_Untitled_Trigger_001_Actions )
endfunction


If you know they are all the units why would you need to count them?
 

ironfist19

New Member
Reaction score
3
hehe, i don't know but how do i make a unit group with a random of 5 units in the playable map? (enemy)

JASS:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AUan' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Func004A takes nothing returns nothing
    if IsUnitEnemy(GetEnumUnit(), Player(0)) == true then
        call KillUnit(GetEnumUnit())
    endif        
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    set udg_temp_group = GetUnitsInRectAll(GetPlayableMapRect())
    call ForGroupBJ( udg_temp_group, function Trig_Untitled_Trigger_001_Func004A )
    call DestroyGroup(udg_tempgroup)
endfunction

//---ironfist19
function InitTrig_Practice_06 takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction(t, function Trig_Untitled_Trigger_001_Actions )
endfunction


If you know they are all the units why would you need to count them?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top