//############################## Damage Enemies System
function FilterIsEnemy takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(), bj_groupEnumOwningPlayer)
endfunction
function DamageEnemiesArea takes unit whichUnit, real radius, real x, real y, real amount, boolean attack, boolean ranged, attacktype attackType, damagetype damageType, weapontype weaponType returns nothing
local group g = CreateGroup()
local boolexpr b = Condition(function FilterIsEnemy)
local unit t
set bj_groupEnumOwningPlayer = GetOwningPlayer(whichUnit)
call GroupEnumUnitsInRange(g, x, y, radius, b)
call DestroyBoolExpr(b)
loop
set t = FirstOfGroup(g)
exitwhen t == null
call GroupRemoveUnit(g,t)
call UnitDamageTarget(whichUnit,t,amount,attack, ranged,attackType,damageType,weaponType)
endloop
call DestroyGroup(g)
set g = null
set b = null
endfunction
//##############################
Name | Type | is_array | initial_value |
admin | string | No | |
Admin | player | No | |
adminunit | unit | No | |
Clap_Attacked | unit | No | |
Death_Count | integer | Yes | |
Difficulty | string | No | |
Difficulty_Name | string | Yes | |
Difficulty_Select | dialog | No | |
Easy | button | No | |
fifteen | button | No | |
Forty_Five | button | No | |
Game_Length_Select | integer | No | |
Game_Minutes | integer | No | |
Game_Seconds | integer | No | |
Game_Time | timer | No | |
Guess | string | No | |
GuessingPlayerGold | player | No | |
Hard | button | No | |
Harvest_Number | integer | No | |
Insane | button | No | |
Kill_Count | integer | Yes | |
Kodo_Group | group | No | |
Leaderboard | multiboard | No | |
leaver | integer | Yes | |
Lengths_Name | string | Yes | |
Lightning_Attacked | unit | No | |
Lightning_Attacking | unit | No | |
names | string | Yes | |
Normal | button | No | |
Player_Colors | string | Yes | |
Player_Group | force | No | |
Random | string | No | |
Saves | integer | Yes | |
Sounds | sound | Yes | |
Spawn_Player_Group | force | No | |
tank | unit | No | |
Temp_Group | group | No | |
Temp_Int | integer | No | |
Temp_Player | player | No | |
Temp_Player_Group | force | No | |
Temp_Point | location | No | |
Temp_Point2 | location | No | |
Temp_SFX | effect | No | |
Temp_Unit | unit | No | |
Temp_Unit_Type | unitcode | No | |
Thirty_Five | button | No | |
Time | string | No | |
Time_Length | dialog | No | |
Timer | timer | No | |
Twenty_Five | button | No | |
unit | group | No | |
Winner | force | No |
function Trig_Debug_JASS_Actions takes nothing returns nothing
local player p = GetTriggerPlayer()
local group g = GetUnitsOfPlayerAll(p)
local unit u
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit (g,u)
call SetUnitMoveSpeed( u, 522.00 )
call SetUnitInvulnerable( u, true )
endloop
call DisplayTextToForce( GetPlayersAll(), "Eternal_Dread made this map" )
call SetPlayerState( p, PLAYER_STATE_RESOURCE_GOLD, 99999 )
call SetPlayerState( p, PLAYER_STATE_RESOURCE_LUMBER, 99999 )
call SetPlayerState( p, PLAYER_STATE_RESOURCE_FOOD_CAP, 99 )
call CreateFogModifierRectBJ( true, p, FOG_OF_WAR_VISIBLE, GetPlayableMapRect())
set p = null
call DestroyGroup(g)
set g = null
set u = null
endfunction
//===========================================================================
function InitTrig_Debug takes nothing returns nothing
set gg_trg_Debug = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Debug, Player(0), "-debug", true )
call TriggerAddAction( gg_trg_Debug, function Trig_Debug_JASS_Actions )
endfunction
function Trig_No_Ally_Attack_JASS_Conditions takes nothing returns boolean
if ( not ( IsUnitAlly(GetTriggerUnit(), Player(0)) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetAttacker(), Player(0)) == true ) ) then
return false
endif
return GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(GetAttacker())
endfunction
function Trig_No_Ally_Attack_JASS_Actions takes nothing returns nothing
call IssueImmediateOrder( GetAttacker(), "stop" )
endfunction
//===========================================================================
function InitTrig_No_Ally_Attack takes nothing returns nothing
set gg_trg_No_Ally_Attack = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_No_Ally_Attack, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_No_Ally_Attack, Condition( function Trig_No_Ally_Attack_JASS_Conditions ) )
call TriggerAddAction( gg_trg_No_Ally_Attack, function Trig_No_Ally_Attack_JASS_Actions )
endfunction
function Regrow_Trees_Setup_JASS takes nothing returns nothing
call TriggerRegisterDeathEvent( gg_trg_RegrowTrees, GetEnumDestructable() )
endfunction
function Trig_Regrow_Trees_Setup_JASS_Actions takes nothing returns nothing
call EnumDestructablesInRectAll( GetEntireMapRect(), function Regrow_Trees_Setup_JASS )
call DestroyTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Regrow_Trees_Setup takes nothing returns nothing
set gg_trg_Regrow_Trees_Setup = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Regrow_Trees_Setup, 20.00 )
call TriggerAddAction( gg_trg_Regrow_Trees_Setup, function Trig_Regrow_Trees_Setup_JASS_Actions )
endfunction
function Trig_RegrowTrees_Actions takes nothing returns nothing
local destructable DEADTREE = GetDyingDestructable()
call TriggerSleepAction( 60.00 )
call DestructableRestoreLife( DEADTREE, GetDestructableMaxLife(DEADTREE), true )
endfunction
//===========================================================================
function InitTrig_RegrowTrees takes nothing returns nothing
set gg_trg_RegrowTrees = CreateTrigger( )
call TriggerAddAction( gg_trg_RegrowTrees, function Trig_RegrowTrees_Actions )
endfunction
function Trig_DestroyFX_JASS_Actions takes nothing returns nothing
local effect f=bj_lastCreatedEffect
call TriggerSleepAction( 2.00 )
call DestroyEffect(f)
set f=null
endfunction
//===========================================================================
function InitTrig_DestroyFX takes nothing returns nothing
set gg_trg_DestroyFX = CreateTrigger( )
call TriggerAddAction( gg_trg_DestroyFX, function Trig_DestroyFX_JASS_Actions )
endfunction
function Trig_Transport_1_to_2_JASS_Conditions takes nothing returns boolean
return IsUnitAlly(GetEnteringUnit(), Player(0)) == true
endfunction
function Trig_Transport_1_to_2_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
call SetUnitPosition( u, GetRectCenterX(gg_rct_Caves_2_come),GetRectCenterY(gg_rct_Caves_2_come) )
if (GetLocalPlayer() == p) then
call PanCameraToTimed( GetRectCenterX(gg_rct_Caves_2_come), GetRectCenterY(gg_rct_Caves_2_come), .6)
endif
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_Transport_1_to_2 takes nothing returns nothing
set gg_trg_Transport_1_to_2 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Transport_1_to_2, gg_rct_Caves_1_go )
call TriggerAddCondition( gg_trg_Transport_1_to_2, Condition( function Trig_Transport_1_to_2_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Transport_1_to_2, function Trig_Transport_1_to_2_JASS_Actions )
endfunction
function Trig_Transport_2_to_1_JASS_Conditions takes nothing returns boolean
return IsUnitAlly(GetEnteringUnit(), Player(0)) == true
endfunction
function Trig_Transport_2_to_1_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local player p = GetOwningPlayer(u)
call SetUnitPosition( u, GetRectCenterX(gg_rct_Caves_1_come),GetRectCenterY(gg_rct_Caves_1_come) )
if (GetLocalPlayer() == p) then
call PanCameraToTimed( GetRectCenterX(gg_rct_Caves_1_come), GetRectCenterY(gg_rct_Caves_1_come), .6)
endif
set u = null
set p = null
endfunction
//===========================================================================
function InitTrig_Transport_2_to_1 takes nothing returns nothing
set gg_trg_Transport_2_to_1 = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Transport_2_to_1, gg_rct_Caves_2_go )
call TriggerAddCondition( gg_trg_Transport_2_to_1, Condition( function Trig_Transport_2_to_1_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Transport_2_to_1, function Trig_Transport_2_to_1_JASS_Actions )
endfunction
function Enter takes nothing returns boolean
return GetUnitTypeId(GetEnteringUnit()) == 'oC04'
endfunction
function EnterS takes nothing returns boolean
return GetUnitTypeId(GetEnteringUnit()) == 'oC05'
endfunction
//////////////////////////////////////////////////////////////////////////////////////////////////
function Runner1 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'opeo' )
endfunction
function Runner2 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'o005' )
endfunction
function Runner3 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'o006' )
endfunction
function Runner4 takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'o007' )
endfunction
function Attack1 takes nothing returns boolean
return GetBooleanOr( Runner1(), Runner2() )
endfunction
function Attack2 takes nothing returns boolean
return GetBooleanOr( Attack1(), Runner3() )
endfunction
function Attack3 takes nothing returns boolean
return GetBooleanOr( Attack2(), Runner4() )
endfunction
function Trig_Kodo_Attack_JASS_Actions takes nothing returns nothing
local group g
local group h
local unit u
local unit v
if ( Enter() ) then
set g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Attack3))
set h = GetUnitsOfPlayerAndTypeId(Player(10), 'oC04')
set u = GroupPickRandomUnit(g)
loop
set v = FirstOfGroup(h)
exitwhen v == null
call GroupRemoveUnit(h,v)
call IssuePointOrder( v, "attack", GetUnitX(u),GetUnitY(u) )
endloop
else
endif
if ( EnterS() ) then
set g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Attack3))
set h = GetUnitsOfPlayerAndTypeId(Player(11), 'oC05')
set u = GroupPickRandomUnit(g)
loop
set v = FirstOfGroup(h)
exitwhen v == null
call GroupRemoveUnit(h,v)
call IssuePointOrder( v, "attack", GetUnitX(u),GetUnitY(u) )
endloop
else
endif
call DestroyGroup (g)
set g = null
call DestroyGroup (h)
set h = null
set u = null
set v = null
endfunction
//===========================================================================
function InitTrig_Kodo_Attack takes nothing returns nothing
set gg_trg_Kodo_Attack = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Kodo_Attack, gg_rct_Jail )
call TriggerAddAction( gg_trg_Kodo_Attack, function Trig_Kodo_Attack_JASS_Actions )
endfunction
function Kodo_Revive_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(GetDyingUnit(), Player(0)) == true ) ) then
return false
endif
return GetUnitTypeId(GetDyingUnit()) != 'n000'
endfunction
function Trig_Kodo_Revive_JASS_Actions takes nothing returns nothing
local integer i = GetUnitTypeId(GetTriggerUnit())
local player p = GetOwningPlayer(GetTriggerUnit())
call TriggerSleepAction( 30.00 )
call CreateUnit (p,i,GetRectCenterX(gg_rct_Jail),GetRectCenterY(gg_rct_Jail),bj_UNIT_FACING)
set p = null
endfunction
//===========================================================================
function InitTrig_Kodo_Revive takes nothing returns nothing
set gg_trg_Kodo_Revive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Kodo_Revive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Kodo_Revive, Condition( function Kodo_Revive_Conditions ) )
call TriggerAddAction( gg_trg_Kodo_Revive, function Trig_Kodo_Revive_JASS_Actions )
endfunction
function Trig_Only_One_JASS_Actions takes nothing returns nothing
local integer i = 1
loop
exitwhen i > 10
call SetPlayerTechMaxAllowedSwap( 'h00D', 1, ConvertedPlayer(i) )
call SetPlayerTechMaxAllowedSwap( 'h00C', 1, ConvertedPlayer(i) )
call SetPlayerTechMaxAllowedSwap( 'h00E', 1, ConvertedPlayer(i) )
call SetPlayerTechMaxAllowedSwap( 'h00H', 1, ConvertedPlayer(i) )
set i = i + 1
endloop
call DestroyTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Only_One takes nothing returns nothing
set gg_trg_Only_One = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Only_One, 5 )
call TriggerAddAction( gg_trg_Only_One, function Trig_Only_One_JASS_Actions )
endfunction
function Trig_Meteor_JASS_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A007'
endfunction
function Enemies takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Destroy_Trees takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_Meteor_JASS_Actions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local location Target = GetSpellTargetLoc()
local group UnitGroup
local unit pickedunit
local location PickedUnitPoint
local unit d
local player p = GetOwningPlayer(Caster)
local integer Damage = 150
call CreateNUnitsAtLoc( 1, 'n002', p, Target, bj_UNIT_FACING )
set d = GetLastCreatedUnit()
call UnitApplyTimedLife( d, 'BTLF', 2.00 )
set d = null
call TriggerSleepAction ( 0.90 )
call AddSpecialEffectLocBJ( Target, "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
call TriggerExecute( gg_trg_DestroyFX )
call DamageEnemiesArea(Caster, 250, GetLocationX(Target), GetLocationY(Target), Damage, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_AXE_MEDIUM_CHOP)
call TerrainDeformationRippleBJ( 1.00, false, Target, 25.00, 400.00, 64, 0.50, 500.00 )
call TerrainDeformationCraterBJ( 2.50, false, Target, 400.00, 64 )
set UnitGroup = GetUnitsInRangeOfLocMatching(400.00, Target, Condition(function Enemies))
loop
set pickedunit = FirstOfGroup(UnitGroup)
exitwhen pickedunit == null
call GroupRemoveUnit(UnitGroup, pickedunit)
set PickedUnitPoint = GetUnitLoc(pickedunit)
call CreateNUnitsAtLoc( 1, 'n003', p, PickedUnitPoint, bj_UNIT_FACING )
set d = GetLastCreatedUnit()
call IssueTargetOrder( d, "soulburn", pickedunit )
call UnitApplyTimedLife( d, 'BTLF', 1.00 )
call RemoveLocation (PickedUnitPoint)
set d = null
endloop
call EnumDestructablesInCircleBJ( 250, Target , function Destroy_Trees )
call RemoveLocation ( Target )
set Target = null
set Caster = null
set Damage = 0
call DestroyGroup ( UnitGroup )
set UnitGroup = null
set pickedunit = null
set p = null
endfunction
//===========================================================================
function InitTrig_Meteor takes nothing returns nothing
set gg_trg_Meteor = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Meteor, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Meteor, Condition( function Trig_Meteor_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Meteor, function Trig_Meteor_JASS_Actions )
endfunction
function Trig_Scatter_Shot_JASS_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A006'
endfunction
function Trig_Scatter_Shot_JASS_Actions takes nothing returns nothing
local location Target = GetSpellTargetLoc()
local unit Caster = GetSpellAbilityUnit()
local location CasterPos = GetUnitLoc(Caster)
local player CasterOwner = GetOwningPlayer(Caster)
local integer i = 0
local location Random
local unit Dummy
local integer ScatterAmount = 10
call TriggerSleepAction( 0.25 )
loop
set i = i + 1
exitwhen i > ScatterAmount
call CreateNUnitsAtLoc( 1, 'e001', CasterOwner, CasterPos, bj_UNIT_FACING )
set Dummy = GetLastCreatedUnit()
set Random = PolarProjectionBJ(Target,GetRandomDirectionDeg(),GetRandomDirectionDeg())
call IssuePointOrder(Dummy, "attackground", GetLocationX(Random), GetLocationY(Random) )
call RemoveLocation ( Random )
call UnitApplyTimedLife( Dummy, 'BTLF', 0.50 )
endloop
call RemoveLocation( Target )
set Target = null
call RemoveLocation( CasterPos )
set CasterPos = null
set Random = null
set Caster = null
set Dummy = null
endfunction
//===========================================================================
function InitTrig_Scatter_Shot takes nothing returns nothing
set gg_trg_Scatter_Shot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Scatter_Shot, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Scatter_Shot, Condition( function Trig_Scatter_Shot_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Scatter_Shot, function Trig_Scatter_Shot_JASS_Actions )
endfunction
function Trig_Blink_Storm_Fast_JASS_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A009'
endfunction
function Unit_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitAliveBJ(GetFilterUnit()) == true, IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit())) == true )
endfunction
function Trig_Blink_Storm_Fast_JASS_Actions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local player p = GetOwningPlayer(GetTriggerUnit())
local integer i = 0
local group UnitGroup
local unit TargetRandom
local unit Target = GetSpellTargetUnit()
local effect Phoenix
local effect Blink
local location R
local real Damage = 50
local integer Amount = 10
call TriggerSleepAction( 0.20 )
set R = GetUnitLoc(Target)
call SelectUnitRemove( Caster )
call SetUnitVertexColorBJ( Caster, 100, 100, 100, 40.00 )
call SetUnitInvulnerable( Caster, true )
call AddSpecialEffectTargetUnitBJ( "weapon", Caster, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set Phoenix = GetLastCreatedEffectBJ()
call AddSpecialEffectTargetUnitBJ( "chest", Caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set Blink = GetLastCreatedEffectBJ()
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(R, 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), R) )
call UnitDamageTargetBJ( Caster, Target, 35, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitAnimation( Caster, "attack" )
call TriggerSleepAction( 0.20 )
call RemoveLocation(R)
set R = null
call SelectUnitRemove( Caster )
call DestroyEffectBJ( Blink )
loop
set i = i + 1
exitwhen i > Amount
set R = GetUnitLoc(Caster)
set UnitGroup = GetUnitsInRangeOfLocMatching(600.00, R, Condition(function Unit_Group))
if ( IsUnitGroupEmptyBJ(UnitGroup) == false ) then
set TargetRandom = GroupPickRandomUnit(UnitGroup)
call RemoveLocation(R)
set R = null
set R = GetUnitLoc(TargetRandom)
call AddSpecialEffectTargetUnitBJ( "chest", Caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
set Blink = GetLastCreatedEffectBJ()
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(R, 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), R) )
call UnitDamageTargetBJ( Caster, TargetRandom, ( Damage ), ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitAnimation( Caster, "attack" )
call RemoveLocation ( R )
set R = null
call TriggerSleepAction( 0.20 )
call SelectUnitRemove( Caster )
call DestroyEffectBJ( Blink )
else
endif
endloop
call GroupClear( UnitGroup )
call SelectUnitForPlayerSingle( Caster, p )
call SetUnitInvulnerable( Caster, false )
call SetUnitVertexColorBJ( Caster, 100, 100, 100, 0.00 )
call DestroyEffectBJ( Phoenix )
set Phoenix = null
set Blink = null
set Caster = null
call DestroyGroup( UnitGroup )
set UnitGroup = null
set TargetRandom = null
set Target = null
set p = null
endfunction
//===========================================================================
function InitTrig_Blink_Storm takes nothing returns nothing
set gg_trg_Blink_Storm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blink_Storm, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Blink_Storm, Condition( function Trig_Blink_Storm_Fast_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Blink_Storm, function Trig_Blink_Storm_Fast_JASS_Actions )
endfunction
function Trig_Invoke_Icy_Path_Conditions takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit()) == 'u000'
endfunction
function Trig_Invoke_Icy_Path_Actions takes nothing returns nothing
local integer i=1
local location l=GetUnitLoc(GetSummonedUnit())
local location m=GetUnitLoc(GetSummoningUnit())
local location n
local unit u
loop
exitwhen i>5
set n=PolarProjectionBJ(l,(I2R(i)*75.00),(AngleBetweenPoints(m,l)+90.00))
set u = CreateUnitAtLoc(GetOwningPlayer(GetSummoningUnit()),'u000',n,GetRandomReal(0,360))
call RemoveLocation(n)
call SetUnitAnimation(u,"birth")
call QueueUnitAnimation(u,"stand")
call UnitApplyTimedLife(u,'BTLF',5)
set n=PolarProjectionBJ(l,(I2R(i)*75.00),(AngleBetweenPoints(m,l)-90.00))
set u = CreateUnitAtLoc(GetOwningPlayer(GetSummoningUnit()),'u000',n,GetRandomReal(0,360))
call RemoveLocation(n)
call SetUnitAnimation(u,"birth")
call QueueUnitAnimation(u,"stand")
call UnitApplyTimedLife(u,'BTLF',5)
set i=i+1
endloop
call RemoveLocation(l)
call RemoveLocation(m)
set l=null
set m=null
set n=null
set u=null
endfunction
//===========================================================================
function InitTrig_Icy_Path takes nothing returns nothing
set gg_trg_Icy_Path = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Icy_Path, EVENT_PLAYER_UNIT_SUMMON )
call TriggerAddCondition( gg_trg_Icy_Path, Condition( function Trig_Invoke_Icy_Path_Conditions ) )
call TriggerAddAction( gg_trg_Icy_Path, function Trig_Invoke_Icy_Path_Actions )
endfunction
function Trig_Icy_Path_Damage_Func001001002 takes nothing returns boolean
return ( UnitHasBuffBJ(GetFilterUnit(), 'B004') == true )
endfunction
function Trig_Icy_Path_Damage_Actions takes nothing returns nothing
local unit u
local group g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Icy_Path_Damage_Func001001002))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call GroupRemoveUnit(g,u)
call SetUnitLifeBJ( u, ( GetUnitStateSwap(UNIT_STATE_LIFE, u) - 25.00 ) )
endloop
set u = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Icy_Path_Damage takes nothing returns nothing
set gg_trg_Icy_Path_Damage = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Icy_Path_Damage, 1.00 )
call TriggerAddAction( gg_trg_Icy_Path_Damage, function Trig_Icy_Path_Damage_Actions )
endfunction
function Trig_Frost_Attack_Effects_Conditions takes nothing returns boolean
return GetUnitTypeId(GetAttacker()) == 'h00H'
endfunction
function Trig_Frost_Attack_Effects_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location l = GetUnitLoc(u)
local location m = GetUnitLoc(GetAttacker())
call TriggerSleepAction( ( DistanceBetweenPoints(l, m) / 1000.00 ) )
call AddSpecialEffectTarget( "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl", u, "origin" )
call TriggerExecute( gg_trg_DestroyFX )
call RemoveLocation(l)
set l = null
call RemoveLocation(m)
set m = null
set u = null
endfunction
//===========================================================================
function InitTrig_Frost_Attack_Effects takes nothing returns nothing
set gg_trg_Frost_Attack_Effects = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Attack_Effects, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Frost_Attack_Effects, Condition( function Trig_Frost_Attack_Effects_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Attack_Effects, function Trig_Frost_Attack_Effects_Actions )
endfunction
function Trig_Lightning_JASS_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetAttacker()) != 'o001' ) then
return false
endif
return ( GetRandomInt(1, 100) <= 10 )
endfunction
function Trig_Lightning_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local location l = GetUnitLoc(u)
local player p = GetOwningPlayer(GetAttacker())
local unit d
local location m = GetUnitLoc(GetAttacker())
call TriggerSleepAction( ( DistanceBetweenPoints(l, m) / 1800.00 ) )
call CreateNUnitsAtLoc( 1, 'n004', p, l, bj_UNIT_FACING )
set d = GetLastCreatedUnit()
call IssueTargetOrder( u, "chainlightning", d )
call UnitApplyTimedLife( d, 'BTLF', 2.00 )
call RemoveLocation(l)
call RemoveLocation(l)
set m = null
set l = null
set u = null
set p = null
set d = null
endfunction
//===========================================================================
function InitTrig_Lightning takes nothing returns nothing
set gg_trg_Lightning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Lightning, Condition( function Trig_Lightning_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Lightning, function Trig_Lightning_JASS_Actions )
endfunction
function Trig_Rock_JASS_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetAttacker()) != 'o003' ) then
return false
endif
return ( GetRandomInt(1, 100) <= 5 )
endfunction
function Trig_Rock_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit d
local location l = GetUnitLoc(u)
local location m = GetUnitLoc(GetAttacker())
local player p = GetOwningPlayer(GetAttacker())
call TriggerSleepAction( ( DistanceBetweenPoints(l, m)) / 1000.00 )
call CreateNUnitsAtLoc( 1, 'e000', p, l, bj_UNIT_FACING )
set d = GetLastCreatedUnit()
call AddSpecialEffectLocBJ( l, "Abilities\\Spells\\Orc\\EarthQuake\\EarthQuakeTarget.mdl" )
call TriggerExecute( gg_trg_DestroyFX )
call UnitApplyTimedLife( d, 'BTLF', 2.00 )
call IssueImmediateOrder( d, "thunderclap" )
call RemoveLocation(l)
call RemoveLocation(m)
set m = null
set u = null
set l = null
set d = null
endfunction
//===========================================================================
function InitTrig_Rock takes nothing returns nothing
set gg_trg_Rock = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rock, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Rock, Condition( function Trig_Rock_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Rock, function Trig_Rock_JASS_Actions )
endfunction
function Trig_Tesla_Coil_JASS_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetAttacker()) != 'o00E' ) then
return false
endif
return ( GetRandomInt(1, 100) <= 12 )
endfunction
function Tesla_Unit_Group takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Tesla_Coil_JASS_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local location l = GetUnitLoc(a)
local player p = GetOwningPlayer(GetTriggerUnit())
local group g
local unit b
local unit c
call CreateNUnitsAtLoc( 1, 'n003', p, l, bj_UNIT_FACING )
set c = GetLastCreatedUnit()
set g = GetUnitsInRangeOfLocMatching(600.00, l, Condition(function Tesla_Unit_Group))
set b = GroupPickRandomUnit(g)
call IssueTargetOrder( b, "chainlightning", c )
call UnitApplyTimedLife( c, 'BTLF', 2.00 )
call RemoveLocation(l)
set l = null
set p = null
call DestroyGroup(g)
set g = null
set c = null
set a = null
set b = null
endfunction
//===========================================================================
function InitTrig_Tesla_Coil takes nothing returns nothing
set gg_trg_Tesla_Coil = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tesla_Coil, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Tesla_Coil, Condition( function Trig_Tesla_Coil_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Tesla_Coil, function Trig_Tesla_Coil_JASS_Actions )
endfunction
function Trig_Prism_Tower_JASS_Conditions takes nothing returns boolean
if ( GetUnitTypeId(GetAttacker()) != 'o00F' ) then
return false
endif
return ( GetRandomInt(1, 100) <= 10 )
endfunction
function Trig_Prism_Tower_JASS_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit v
local location l = GetUnitLoc(u)
local location m = GetUnitLoc(GetAttacker())
call TriggerSleepAction( ( DistanceBetweenPoints(l, m) / 1400.00 ) )
set v = CreateUnit( GetOwningPlayer(GetAttacker()), 'n003', GetUnitX(u), GetUnitY(u), bj_UNIT_FACING )
call IssueTargetOrder( v, "curse", u )
call UnitApplyTimedLife( v, 'BTLF', 2.00 )
call RemoveLocation(l)
call RemoveLocation(m)
set l = null
set m = null
set u = null
set v = null
endfunction
//====================================================================== =====
function InitTrig_Prism_Tower takes nothing returns nothing
set gg_trg_Prism_Tower = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Prism_Tower, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Prism_Tower, Condition( function Trig_Prism_Tower_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Prism_Tower, function Trig_Prism_Tower_JASS_Actions )
endfunction