- Joined
- Nov 6, 2014
- Messages
- 70
I have a set of 6 'arakkaoa' units and I want to make a unit type of it.
So I made a unit type variable called "RaceArakkoa" then all the index is 0 to 6.
Then my problem is that I have made an ability like "Ancient Spirit"
I made a trigger when unit dies and conditioning that if the unit type of the dying unit is "RaceArakkoa", so it's too confusing what will I put in the [index] part of it.
I don't think I should use "MAX" (0,6) because the unit revived might be confusing. Any ideas how can I categorize units and successfully input them in such abilities like that?
HERE IS THE SCREENIE
So I made a unit type variable called "RaceArakkoa" then all the index is 0 to 6.
Then my problem is that I have made an ability like "Ancient Spirit"
I made a trigger when unit dies and conditioning that if the unit type of the dying unit is "RaceArakkoa", so it's too confusing what will I put in the [index] part of it.
I don't think I should use "MAX" (0,6) because the unit revived might be confusing. Any ideas how can I categorize units and successfully input them in such abilities like that?
HERE IS THE SCREENIE
-
function Trig_RaceOgre_Copy_Actions takes nothing returns nothing
- set udg_RaceOgre[0] = 'o008'
- set udg_RaceOgre[1] = 'o00A'
- set udg_RaceOgre[2] = 'o00D'
- set udg_RaceOgre[3] = 'o00F'
- set udg_RaceOgre[4] = 'n005'
- set udg_RaceOgre[5] = 'n007'
- set udg_RaceOgre[6] = 'n006'
- endfunction
- //===========================================================================
-
function InitTrig_RaceOgre_Copy takes nothing returns nothing
- set gg_trg_RaceOgre_Copy = CreateTrigger( )
- call TriggerRegisterTimerEventSingle( gg_trg_RaceOgre_Copy, 2.00 )
- call TriggerAddAction( gg_trg_RaceOgre_Copy, function Trig_RaceOgre_Copy_Actions )
- endfunction
-
function Trig_A_Ogre_Rising_Copy_Conditions takes nothing returns boolean
-
if ( not ( GetUnitTypeId(GetDyingUnit()) == udg_RaceOgre[IMaxBJ(0, 6)] ) ) then
- return false
- endif
- return true
-
if ( not ( GetUnitTypeId(GetDyingUnit()) == udg_RaceOgre[IMaxBJ(0, 6)] ) ) then
- endfunction
- function Trig_A_Ogre_Rising_Copy_Actions takes nothing returns nothing
- endfunction
- //===========================================================================
-
function InitTrig_A_Ogre_Rising_Copy takes nothing returns nothing
- set gg_trg_A_Ogre_Rising_Copy = CreateTrigger( )
- call TriggerRegisterAnyUnitEventBJ( gg_trg_A_Ogre_Rising_Copy, EVENT_PLAYER_UNIT_DEATH )
- call TriggerAddCondition( gg_trg_A_Ogre_Rising_Copy, Condition( function Trig_A_Ogre_Rising_Copy_Conditions ) )
- call TriggerAddAction( gg_trg_A_Ogre_Rising_Copy, function Trig_A_Ogre_Rising_Copy_Actions )
- endfunction
Last edited: