Ok I understand what your saying but im having problems putting more than 1 player in a player group in my team1 and team2 variables.it only lets me select one player out of 12.
and i can't find (Triggering unit) Equal to WinUnit.
and i can't find (owner of killing unit.)
if i can find these i can probably do it.
and now im having trouble with a new triiger that works on one map and not another. its a spell
it has a problem with this line
----local location targetpoint = udg_VolcanoLoc --- why???
HERE IS THE TRIGGER
function Trig_Volcano_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A000' )
endfunction
function Trig_Volcano_Actions takes nothing returns nothing
local effect array effects
local location targetpoint = udg_VolcanoLoc <---here!!!
call TriggerExecute( udg_VolcanoTriggers[1] )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, -450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, 400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl" )
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.50 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Doodads\\Cinematic\\FireRockSmall\\FireRockSmall.mdl" )
set effects[GetForLoopIndexA() * 2] = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( PolarProjectionBJ(targetpoint, 100.00, ( I2R(GetForLoopIndexA()) * 60.00 )), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
set effects[(GetForLoopIndexA() * 2) + 1] = GetLastCreatedEffectBJ()
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call AddSpecialEffectLocBJ( targetpoint, "Doodads\\Cinematic\\TownBurningFireEmitter\\TownBurningFireEmitter.mdl" )
set effects[1] = GetLastCreatedEffectBJ()
call TriggerSleepAction( 22.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 400.00, 450.00 )
call TerrainDeformationCraterBJ( 0.50, true, targetpoint, 200.00, -400.00 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call DestroyEffectBJ( effects[GetForLoopIndexA() * 2] )
call DestroyEffectBJ( effects[(GetForLoopIndexA() * 2) + 1] )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyEffectBJ( effects[1] )
endfunction
function Trig_Volcano_Target_Conditions takes nothing returns boolean
return ( GetIssuedOrderIdBJ() == String2OrderIdBJ("silence") )
endfunction
function Trig_Volcano_Target_Actions takes nothing returns nothing
set udg_VolcanoLoc = GetOrderPointLoc()
endfunction
function Trig_Volcano_Attack_Actions takes nothing returns nothing
local integer i = 1
local integer j
local unit array volcano
local location target
local location targetpoint = udg_VolcanoLoc
set j = 1
loop
exitwhen j > 3
call CreateNUnitsAtLoc( 1, 'e001', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+1] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e002', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+2] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
call CreateNUnitsAtLoc( 1, 'e003', Player(0), targetpoint, bj_UNIT_FACING )
set volcano[((j-1)*3)+3] = GetLastCreatedUnit()
call SetUnitPathing( GetLastCreatedUnit(), false )
call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
call SetUnitPositionLoc( GetLastCreatedUnit(), targetpoint )
call SetUnitInvulnerable( GetLastCreatedUnit(), true )
set j = j + 1
endloop
loop
exitwhen i > 22
set j = 1
loop
exitwhen j > 9
set target = PolarProjectionBJ(targetpoint, GetRandomReal(300.00, 700.00), GetRandomDirectionDeg())
call IssuePointOrderLocBJ( volcano[j], "attackground", target )
set udg_VolcanoTarget = target
set udg_VolcanoTime = 1.6 * ((DistanceBetweenPoints(GetUnitLoc(volcano[j]), target)) / 500)
call TriggerExecute( udg_VolcanoTriggers[2] )
set j = j + 1
endloop
call TriggerSleepAction( 0.8 )
set i = i + 1
endloop
set j = 1
loop
exitwhen j > 9
call UnitRemoveAbilityBJ( 'Aloc', volcano[j] )
call RemoveUnit( volcano[j] )
set j = j + 1
endloop
endfunction
function Trig_Volcano_Damage_Group takes nothing returns boolean
return (( IsUnitType(GetFilterUnit(), UNIT_TYPE_GROUND) == true ) and ( IsUnitEnemy(GetFilterUnit(), Player(0)) == true ))
endfunction
function Trig_Volcano_Damage_Actions takes nothing returns nothing
local real time = udg_VolcanoTime
local location target = udg_VolcanoTarget
local effect fire
local unit Target2
local group DamageGroup = GetUnitsInRangeOfLocMatching(300.00, target, Condition(function Trig_Volcano_Damage_Group))
call TriggerSleepAction( time )
call AddSpecialEffectLocBJ( target, "Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl" )
set fire = GetLastCreatedEffectBJ()
call TriggerSleepAction( 1.0 )
call DestroyEffectBJ( fire )
loop
set Target2 = GroupPickRandomUnit(DamageGroup)
exitwhen Target2 == null
call SetUnitLifeBJ( Target2, ( GetUnitStateSwap(UNIT_STATE_LIFE, Target2) - 40 ) )
call GroupRemoveUnitSimple( Target2, DamageGroup )
endloop
endfunction
//===========================================================================
function InitTrig_Volcano takes nothing returns nothing
local trigger Volcano_Target = CreateTrigger( )
set udg_VolcanoTriggers[1] = CreateTrigger( )
set udg_VolcanoTriggers[2] = CreateTrigger( )
set gg_trg_Volcano = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Volcano, Player(0), EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Volcano, Condition( function Trig_Volcano_Conditions ) )
call TriggerAddAction( gg_trg_Volcano, function Trig_Volcano_Actions )
call TriggerRegisterPlayerUnitEventSimple( Volcano_Target, Player(0), EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( Volcano_Target, Condition( function Trig_Volcano_Target_Conditions ) )
call TriggerAddAction( Volcano_Target, function Trig_Volcano_Target_Actions )
call TriggerAddAction( udg_VolcanoTriggers[1], function Trig_Volcano_Attack_Actions )
call TriggerAddAction( udg_VolcanoTriggers[2], function Trig_Volcano_Damage_Actions )
endfunction