importing triggers directly into the war3map.j file

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

Annullus
Newcomer
Posts: 9
Joined: December 31st, 2008, 8:52 am

importing triggers directly into the war3map.j file

Post by Annullus »

have been editing a protected map via editing the war3map files instead of reconstructing it am currently having issues with the trigger for my omnislash ability with the ability not going through the specified amount of loops below is the custom text of the trigger which i imported in the war3map.j file please tell me if you realise why its not functioning correctly

function Trig_omnislash_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0EU' ) ) then
return false
endif
return true
endfunction
function Trig_omnislash_Copy_Func016Func003002003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_omnislash_Copy_Func016Func003002003002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_omnislash_Copy_Func016Func003002003002002001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_o)) == true )
endfunction
function Trig_omnislash_Copy_Func016Func003002003002002002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) == false )
endfunction
function Trig_omnislash_Copy_Func016Func003002003002002 takes nothing returns boolean
return GetBooleanAnd( Trig_omnislash_Copy_Func016Func003002003002002001(), Trig_omnislash_Copy_Func016Func003002003002002002() )
endfunction
function Trig_omnislash_Copy_Func016Func003002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_omnislash_Copy_Func016Func003002003002001(), Trig_omnislash_Copy_Func016Func003002003002002() )
endfunction
function Trig_omnislash_Copy_Func016Func003002003 takes nothing returns boolean
return GetBooleanAnd( Trig_omnislash_Copy_Func016Func003002003001(), Trig_omnislash_Copy_Func016Func003002003002() )
endfunction
function Trig_omnislash_Copy_Func016Func005Func009A takes nothing returns nothing
set udg_p = GetEnumUnit()
set udg_pl = GetUnitLoc(udg_p)
call SelectUnitRemove( udg_o )
call SetUnitPositionLoc( udg_o, udg_pl )
call SetUnitAnimation( udg_o, "attack" )
call SetUnitFacingToFaceUnitTimed( udg_o, udg_p, 0.00 )
call RemoveLocation(udg_pl)
call RemoveLocation(udg_o_current_loc)
call IssueTargetOrderBJ( udg_o, "attack", udg_p )
call UnitDamageTargetBJ( udg_o, udg_p, ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, udg_o, true)) * 2.00 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectTargetUnitBJ( "chest", udg_o, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )

endfunction
function Trig_omnislash_Copy_Func016Func005C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_EG1) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_omnislash_Copy_Actions takes nothing returns nothing
set udg_o = GetTriggerUnit()
set udg_t = GetSpellTargetUnit()
set udg_tl = GetUnitLoc(udg_t)
set udg_loops = ( GetHeroLevel(GetTriggerUnit()) * 4 )
call SetUnitInvulnerable( udg_o, true )
call SetUnitVertexColorBJ( udg_o, 100, 100, 100, 50.00 )
call SelectUnitRemove( udg_o )
call SetUnitPositionLoc( udg_o, udg_tl )
call SetUnitFacingToFaceUnitTimed( udg_o, udg_p, 0.00 )
call RemoveLocation(udg_tl)
call SetUnitAnimation( udg_o, "attack" )
call UnitDamageTargetBJ( udg_o, udg_t, ( I2R(GetHeroStatBJ(bj_HEROSTAT_STR, udg_o, true)) * 2.00 ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call IssueTargetOrderBJ( udg_o, "attack", udg_p )
call AddSpecialEffectTargetUnitBJ( "chest", udg_o, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = udg_loops
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call TriggerSleepAction( 0.100 )
set udg_o_current_loc = GetUnitLoc(udg_o)
set udg_EG1 = GetUnitsInRangeOfLocMatching(2000.00, udg_o_current_loc, Condition(function Trig_omnislash_Copy_Func016Func003002003))
set udg_EG2 = GetRandomSubGroup(1, udg_EG1)
if ( Trig_omnislash_Copy_Func016Func005C() ) then
call ForGroupBJ( udg_EG2, function Trig_omnislash_Copy_Func016Func005Func009A )
else
call DestroyGroup(udg_EG1)
call DestroyGroup(udg_EG2)
call SelectUnitAdd( udg_o )
call SetUnitVertexColorBJ( udg_o, 100, 100, 100, 0.00 )
call SetUnitInvulnerable( udg_o, false )
set udg_o = null
set udg_t = null
set udg_tl = null
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call DestroyGroup(udg_EG1)
call DestroyGroup(udg_EG2)
set udg_o = GetTriggerUnit()
set udg_t = GetSpellTargetUnit()
set udg_tl = GetUnitLoc(udg_t)
call SelectUnitAdd( udg_o )
call SetUnitVertexColorBJ( udg_o, 100, 100, 100, 0.00 )
call SetUnitInvulnerable( udg_o, false )
endfunction
function InitTrig_omnislash_Copy takes nothing returns nothing
set gg_trg_omnislash_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_omnislash_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_omnislash_Copy, Condition( function Trig_omnislash_Copy_Conditions ) )
call TriggerAddAction( gg_trg_omnislash_Copy, function Trig_omnislash_Copy_Actions )
endfunction

the varibles for the spell have been defined as globals as i am reusing the for other abilities that function perfectly well