Name | Type | is_array | initial_value |
Temp_Boolean | boolean | No | |
Temp_Damage | real | No | |
Temp_Distance_Between | real | Yes | |
Temp_Distance_Between1 | real | Yes | |
Temp_Effect1 | string | No | |
Temp_Effect2 | string | No | |
Temp_Facing1 | real | Yes | |
Temp_Index | integer | Yes | |
Temp_IndexMax | integer | No | |
Temp_IndexSize | integer | No | |
Temp_Int | integer | No | |
Temp_Loc1 | location | No | |
Temp_Loc2 | location | No | |
Temp_Loc3 | location | No | |
Temp_Loop | integer | No | |
Temp_Real1 | real | Yes | |
Temp_Targetloc | location | Yes | |
Temp_Targetloc1 | location | Yes | |
Temp_Unit1 | unit | Yes | |
Temp_Unit2 | unit | Yes | |
Temp_Unit3 | unit | Yes |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Things_Actions takes nothing returns nothing
call MeleeStartingVisibility()
call FogEnableOff( )
call FogMaskEnableOff( )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "|cffffcc00Thank you for testing this skill :)|r" )
call TriggerSleepAction( 2.50 )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "Damage of the skill is set to 0 (default)" )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "Type |cffffcc00-kill tree|r to make your skill kill trees or |cffffcc00-no kill tree|r to make your skill stop killing trees" )
set udg_Temp_Damage = 0
call TriggerSleepAction( 4.00 )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "Type -damage[amount of damage you want] to make your skill deal that damage" )
call TriggerSleepAction( 11.00 )
call DisplayTextToForce( bj_FORCE_PLAYER[0], "By the way, i have to thank Hanky for his indexing system... It helped me a lot" )
endfunction
//===========================================================================
function InitTrig_Things takes nothing returns nothing
set gg_trg_Things = CreateTrigger( )
call TriggerAddAction( gg_trg_Things, function Trig_Things_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Set_Damage_Conditions takes nothing returns boolean
if ( not ( S2I( SubStringBJ( GetEventPlayerChatString(), 8, 14 ) ) >= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Set_Damage_Actions takes nothing returns nothing
set udg_Temp_Damage = S2I( SubStringBJ( GetEventPlayerChatString(), 8, 14 ) )
call DisplayTextToForce( bj_FORCE_PLAYER[0], " Damage of the skill was set to " + I2S( S2I( SubStringBJ( GetEventPlayerChatString(), 8, 14 ) ) ) )
endfunction
//===========================================================================
function InitTrig_Set_Damage takes nothing returns nothing
set gg_trg_Set_Damage = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Damage, Player(0), "-damage ", false )
call TriggerAddCondition( gg_trg_Set_Damage, Condition( function Trig_Set_Damage_Conditions ) )
call TriggerAddAction( gg_trg_Set_Damage, function Trig_Set_Damage_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Set_Boolean_Actions takes nothing returns nothing
set udg_Temp_Boolean = true
call DisplayTextToForce( bj_FORCE_PLAYER[0], "Skill now kills trees" )
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Set_Boolean_no )
endfunction
//===========================================================================
function InitTrig_Set_Boolean takes nothing returns nothing
set gg_trg_Set_Boolean = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Boolean, Player(0), "-kill tree", true )
call TriggerAddAction( gg_trg_Set_Boolean, function Trig_Set_Boolean_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Set_Boolean_no_Actions takes nothing returns nothing
set udg_Temp_Boolean = false
call DisplayTextToForce( bj_FORCE_PLAYER[0], "Skill no longer kills trees" )
call EnableTrigger( gg_trg_Set_Boolean )
call DisableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Set_Boolean_no takes nothing returns nothing
set gg_trg_Set_Boolean_no = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Set_Boolean_no, Player(0), "-no kill tree", true )
call TriggerAddAction( gg_trg_Set_Boolean_no, function Trig_Set_Boolean_no_Actions )
endfunction
//TESH.scrollpos=30
//TESH.alwaysfold=0
// unit1 = caster
// unit2 = target
// unit3 = dummy
function Trig_UD_cast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction
function Trig_UD_cast_Func000A takes nothing returns boolean
if ( not ( udg_Temp_IndexSize == 0 ) ) then
return false
endif
return true
endfunction
function Trig_UD_cast_Func001A takes nothing returns boolean
if ( not ( udg_Temp_IndexSize > udg_Temp_IndexMax ) ) then
return false
endif
return true
endfunction
function Trig_UD_cast_Actions takes nothing returns nothing
if ( Trig_UD_cast_Func000A() ) then
call EnableTrigger( gg_trg_UD_loop )
else
endif
set udg_Temp_IndexSize = ( udg_Temp_IndexSize + 1 )
if ( Trig_UD_cast_Func001A() ) then
set udg_Temp_Index[udg_Temp_IndexSize] = udg_Temp_IndexSize
set udg_Temp_IndexMax = udg_Temp_IndexSize
else
endif
set udg_Temp_Int = udg_Temp_Index[udg_Temp_IndexSize]
set udg_Temp_Unit1[udg_Temp_Int] = GetTriggerUnit()
set udg_Temp_Unit2[udg_Temp_Int] = GetSpellTargetUnit()
set udg_Temp_Loc1 = GetUnitLoc( udg_Temp_Unit1[udg_Temp_Int] )
set udg_Temp_Loc2 = GetUnitLoc( udg_Temp_Unit2[udg_Temp_Int] )
set udg_Temp_Facing1[udg_Temp_Int] = AngleBetweenPoints( udg_Temp_Loc1, udg_Temp_Loc2 )
set udg_Temp_Real1[udg_Temp_Int] = DistanceBetweenPoints( udg_Temp_Loc1, udg_Temp_Loc2 )
call CreateNUnitsAtLoc( 1, 'h001', GetOwningPlayer( udg_Temp_Unit1[udg_Temp_Int] ), PolarProjectionBJ( udg_Temp_Loc1, 70.00, GetUnitFacing( udg_Temp_Unit1[udg_Temp_Int] ) ), GetUnitFacing( udg_Temp_Unit1[udg_Temp_Int] ) )
set udg_Temp_Unit3[udg_Temp_Int] = GetLastCreatedUnit()
call SetUnitVertexColorBJ( udg_Temp_Unit3[udg_Temp_Int], 66.00, 66.00, 66.00, 50.00 )
set udg_Temp_Loc3 = GetUnitLoc( udg_Temp_Unit3[udg_Temp_Int] )
set udg_Temp_Effect1 = "Abilities\\Spells\\Undead\\Possession\\PossessionMissile.mdl"
set udg_Temp_Effect2 = "Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl"
call SetUnitPathing( udg_Temp_Unit3[udg_Temp_Int], false )
call PauseUnitBJ( true, udg_Temp_Unit3[udg_Temp_Int] )
set udg_Temp_Targetloc1[udg_Temp_Int] = PolarProjectionBJ( GetUnitLoc( udg_Temp_Unit2[udg_Temp_Int] ), udg_Temp_Real1[udg_Temp_Int], udg_Temp_Facing1[udg_Temp_Int] )
call RemoveLocation( udg_Temp_Loc1 )
call RemoveLocation( udg_Temp_Loc2 )
call RemoveLocation( udg_Temp_Loc3 )
endfunction
//===========================================================================
function InitTrig_UD_cast takes nothing returns nothing
set gg_trg_UD_cast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_UD_cast, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_UD_cast, Condition( function Trig_UD_cast_Conditions ) )
call TriggerAddAction( gg_trg_UD_cast, function Trig_UD_cast_Actions )
endfunction
//TESH.scrollpos=66
//TESH.alwaysfold=0
function Trig_UD_loop_Func005A takes nothing returns boolean
if ( not ( udg_Temp_Boolean == true ) ) then
return false
endif
return true
endfunction
function Trig_UD_loop_Func001A takes nothing returns boolean
if ( not ( udg_Temp_Unit1[udg_Temp_Int] != null ) ) then
return false
endif
return true
endfunction
function Trig_UD_loop_Func002A takes nothing returns boolean
if ( not ( udg_Temp_IndexSize == 0 ) ) then
return false
endif
return true
endfunction
function Trig_UD_loop_Func003A takes nothing returns boolean
if ( not ( IsUnitInGroup( udg_Temp_Unit3[udg_Temp_Int], GetUnitsInRangeOfLocAll( 70.00, udg_Temp_Targetloc[udg_Temp_Int] ) ) == true ) ) then
return false
endif
return true
endfunction
function Trig_UD_loop_Func004A takes nothing returns boolean
if ( not ( IsUnitInGroup( udg_Temp_Unit2[udg_Temp_Int], GetUnitsInRangeOfLocAll( 70.00, udg_Temp_Targetloc1[udg_Temp_Int] ) ) == true ) ) then
return false
endif
return true
endfunction
function Trig_UD_loop_Func006A takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_UD_loop_Actions takes nothing returns nothing
set udg_Temp_Loop = 1
loop
exitwhen udg_Temp_Loop > udg_Temp_IndexSize
set udg_Temp_Int = udg_Temp_Index[udg_Temp_Loop]
if ( Trig_UD_loop_Func001A() ) then
set udg_Temp_Targetloc[udg_Temp_Int] = GetUnitLoc( udg_Temp_Unit2[udg_Temp_Int] )
set udg_Temp_Loc2 = GetUnitLoc( udg_Temp_Unit2[udg_Temp_Int] )
set udg_Temp_Loc3 = GetUnitLoc( udg_Temp_Unit3[udg_Temp_Int] )
set udg_Temp_Distance_Between[udg_Temp_Int] = DistanceBetweenPoints( udg_Temp_Loc2, udg_Temp_Loc3 )
call SetUnitPositionLoc( udg_Temp_Unit3[udg_Temp_Int], PolarProjectionBJ( udg_Temp_Loc3, 35.00, AngleBetweenPoints( udg_Temp_Loc3, udg_Temp_Loc2 ) ) )
call RemoveLocation( udg_Temp_Loc2 )
call RemoveLocation( udg_Temp_Loc3 )
else
endif
if ( Trig_UD_loop_Func003A() ) then
if ( Trig_UD_loop_Func005A() ) then
call EnumDestructablesInCircleBJ( 150.00, GetUnitLoc( udg_Temp_Unit2[udg_Temp_Int] ), function Trig_UD_loop_Func006A )
else
endif
call SetUnitVertexColorBJ( udg_Temp_Unit3[udg_Temp_Int], 0.00, 0.00, 0.00, 100.00 )
call AddSpecialEffectTargetUnitBJ( "head", udg_Temp_Unit2[udg_Temp_Int], udg_Temp_Effect1 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call PauseUnitBJ( true, udg_Temp_Unit2[udg_Temp_Int] )
call SetUnitPathing( udg_Temp_Unit2[udg_Temp_Int], false )
set udg_Temp_Loc2 = GetUnitLoc( udg_Temp_Unit2[udg_Temp_Int] )
set udg_Temp_Distance_Between1[udg_Temp_Int] = DistanceBetweenPoints( udg_Temp_Loc2, udg_Temp_Targetloc1[udg_Temp_Int] )
call SetUnitPositionLoc( udg_Temp_Unit2[udg_Temp_Int], PolarProjectionBJ( udg_Temp_Loc2, 25.00, udg_Temp_Facing1[udg_Temp_Int] ) )
call AddSpecialEffectLocBJ( udg_Temp_Loc2, udg_Temp_Effect2 )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation( udg_Temp_Loc2 )
else
endif
if ( Trig_UD_loop_Func004A() ) then
call UnitDamageTargetBJ( udg_Temp_Unit1[udg_Temp_Int], udg_Temp_Unit2[udg_Temp_Int], udg_Temp_Damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call RemoveUnit( udg_Temp_Unit3[udg_Temp_Int] )
call RemoveLocation( udg_Temp_Targetloc1[udg_Temp_Int] )
call PauseUnitBJ( false, udg_Temp_Unit2[udg_Temp_Int] )
call SetUnitPathing( udg_Temp_Unit2[udg_Temp_Int], true )
set udg_Temp_Index[udg_Temp_Loop] = udg_Temp_Index[udg_Temp_IndexSize]
set udg_Temp_Index[udg_Temp_IndexSize] = udg_Temp_Int
set udg_Temp_IndexSize = ( udg_Temp_IndexSize - 1 )
set udg_Temp_Loop = ( udg_Temp_Loop - 1 )
if ( Trig_UD_loop_Func002A() ) then
call DisableTrigger( GetTriggeringTrigger() )
return
else
endif
else
endif
set udg_Temp_Loop = ( udg_Temp_Loop + 1 )
endloop
endfunction
//===========================================================================
function InitTrig_UD_loop takes nothing returns nothing
set gg_trg_UD_loop = CreateTrigger( )
call DisableTrigger( gg_trg_UD_loop )
call TriggerRegisterTimerEventPeriodic( gg_trg_UD_loop, 0.03 )
call TriggerAddAction( gg_trg_UD_loop, function Trig_UD_loop_Actions )
endfunction