function In_Unit_Group takes nothing returns boolean
return IsUnitInGroup(GetFilterUnit(), udg_unit_group)
endfunction
//-------------------------------------
function explode_function takes nothing returns nothing
local real x2
local real y2
local real r2
local real dx
local real dy
local real dr
local real dx2
local real dy2
local real dz2
local unit u2 = GetEnumUnit()
if (IsUnitAlly(u2, udg_explode_player) == false) then
set x2 = GetUnitX(u2)
set y2 = GetUnitY(u2)
set r2 = LoadRealBJ(0, GetHandleIdBJ(u2), udg_radius)
set dx = x2 - udg_explode_x
set dy = y2 - udg_explode_y
set dr = SquareRoot( Pow(dx,2) + Pow(dy,2) )
//if ( dr < (udg_explode_r + r2) ) then // collision
// if (udg_explode_sound == 1) then
//call PlaySoundOnUnitBJ( gg_snd_MetalHeavyChopFlesh1, 100, u2 )
// elseif (udg_explode_sound == 2) then
//call PlaySoundOnUnitBJ( gg_snd_MetalHeavyBashFlesh3, 100, u2 )
// endif
call UnitDamageTargetBJ( udg_hero[GetConvertedPlayerId(udg_explode_player)], u2, udg_explode_damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SaveRealBJ( x2, 0, GetHandleIdBJ(u2), udg_xpos )
call SaveRealBJ( y2, 0, GetHandleIdBJ(u2), udg_ypos )
set dx2 = LoadRealBJ(0, GetHandleIdBJ(u2), udg_xrate)
set dy2 = LoadRealBJ(0, GetHandleIdBJ(u2), udg_yrate)
set dz2 = LoadRealBJ(0, GetHandleIdBJ(u2), udg_zrate)
call SaveRealBJ( dx2 + (dx*udg_explode_power/dr), 0, GetHandleIdBJ(u2), udg_xrate )
call SaveRealBJ( dy2 + (dy*udg_explode_power/dr), 0, GetHandleIdBJ(u2), udg_yrate )
call SaveRealBJ( dz2 + udg_explode_z_power, 0, GetHandleIdBJ(u2), udg_zrate )
call SaveIntegerBJ( GetConvertedPlayerId(udg_explode_player), 0, GetHandleIdBJ(u2), udg_moved_by )
//call DisplayTextToForce( GetPlayersAll(), R2S(LoadRealBJ(0, GetHandleIdBJ(u2), udg_xrate)) )
//call DisplayTextToForce( GetPlayersAll(), R2S(LoadRealBJ(0, GetHandleIdBJ(u2), udg_yrate)) )
//endif
endif
set u2 = null
endfunction
function explode_args takes real x, real y, real r, player p, real damage, real power, real z_power, integer s returns nothing
local location loc = Location(x, y)
set udg_explode_x = x
set udg_explode_y = y
set udg_explode_r = r
set udg_explode_player = p
set udg_explode_damage = damage
set udg_explode_power = power
set udg_explode_z_power = z_power
set udg_explode_sound = s
call ForGroupBJ( GetUnitsInRangeOfLocMatching(r, loc, Condition(function In_Unit_Group)), function explode_function )
call RemoveLocation(loc)
set loc = null
//call ForGroupBJ( udg_unit_group, function explode_function )
endfunction
function cleanup_obj takes unit u returns nothing
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_accel )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_radius )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_xpos )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_ypos )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_zpos )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_xrate )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_yrate )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_zrate )
endfunction
function cleanup_unit takes unit u returns nothing
call cleanup_obj(u)
call GroupRemoveUnitSimple( u, udg_unit_group )
endfunction
function cleanup_missile takes unit u returns nothing
call cleanup_obj(u)
call GroupRemoveUnitSimple( u, udg_missile_group )
call KillUnit(u)
endfunction
function init_obj takes unit u, real a, real r, real speed, real z, real dz returns nothing
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local real ang = GetUnitFacing(u)
call UnitAddAbilityBJ( 'Arav', u )
call UnitRemoveAbilityBJ( 'Arav', u )
call SaveRealBJ( a, 0, GetHandleIdBJ(u), udg_accel )
call SaveRealBJ( r, 0, GetHandleIdBJ(u), udg_radius )
call SaveRealBJ( x, 0, GetHandleIdBJ(u), udg_xpos )
call SaveRealBJ( y, 0, GetHandleIdBJ(u), udg_ypos )
call SaveRealBJ( z, 0, GetHandleIdBJ(u), udg_zpos )
call SaveRealBJ( Cos(Deg2Rad(ang))*speed, 0, GetHandleIdBJ(u), udg_xrate )
call SaveRealBJ( Sin(Deg2Rad(ang))*speed, 0, GetHandleIdBJ(u), udg_yrate )
call SaveRealBJ( dz, 0, GetHandleIdBJ(u), udg_zrate )
endfunction
function init_unit takes unit u, real a, real r, real speed, real z, real dz returns nothing
call init_obj( u, a, r, speed, z, dz )
call GroupAddUnitSimple( u, udg_unit_group )
endfunction
function init_missile takes unit u, real a, real r, real speed, real z, real dz returns nothing
call init_obj( u, a, r, speed, z, dz )
call GroupAddUnitSimple( u, udg_missile_group )
endfunction
// ---- orbit ----
function orbit takes unit orbiter, unit center, real r, real dr, real ddr, real a, real da, real dda returns nothing
call SaveUnitHandleBJ( center, 0, GetHandleIdBJ(orbiter), udg_orb_center )
call SaveRealBJ( r, 0, GetHandleIdBJ(orbiter), udg_orb_r )
call SaveRealBJ( dr, 0, GetHandleIdBJ(orbiter), udg_orb_dr )
call SaveRealBJ( ddr, 0, GetHandleIdBJ(orbiter), udg_orb_ddr )
call SaveRealBJ( a, 0, GetHandleIdBJ(orbiter), udg_orb_a )
call SaveRealBJ( da, 0, GetHandleIdBJ(orbiter), udg_orb_da )
call SaveRealBJ( dda, 0, GetHandleIdBJ(orbiter), udg_orb_dda )
call GroupAddUnitSimple( orbiter, udg_orbit_group )
endfunction
function cleanup_orbit takes unit u returns nothing
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_center )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_r )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_dr )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_ddr )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_a )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_da )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_orb_dda )
call GroupRemoveUnitSimple( u, udg_orbit_group )
endfunction
// ---- follow ----
function follow takes unit follower, unit leader, real dr, real ddr, real a, real da, real dda returns nothing
call SaveUnitHandleBJ( leader, 0, GetHandleIdBJ(follower), udg_fol_leader )
call SaveRealBJ( dr, 0, GetHandleIdBJ(follower), udg_fol_dr )
call SaveRealBJ( ddr, 0, GetHandleIdBJ(follower), udg_fol_ddr )
call SaveRealBJ( a, 0, GetHandleIdBJ(follower), udg_fol_a )
call SaveRealBJ( da, 0, GetHandleIdBJ(follower), udg_fol_da )
call SaveRealBJ( dda, 0, GetHandleIdBJ(follower), udg_fol_dda )
call GroupAddUnitSimple( follower, udg_follow_group )
endfunction
function cleanup_follow takes unit u returns nothing
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_fol_leader )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_fol_dr )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_fol_ddr )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_fol_a )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_fol_da )
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_fol_dda )
call GroupRemoveUnitSimple( u, udg_follow_group )
endfunction
// ---- hitman ----
function hitman_create_initial_circle takes nothing returns nothing
local integer rand1
local integer rand2
local integer temp
local boolean is_circle = false
local integer i = 0
local integer orig
local integer count
local integer current
loop
exitwhen (is_circle)
set rand1 = GetRandomInt(1, 12)
set rand2 = GetRandomInt(1, 12)
loop
exitwhen (udg_hm_circle[rand1] > 0)
set rand1 = GetRandomInt(1, 12)
endloop
loop
exitwhen (udg_hm_circle[rand2] > 0 and rand1 != rand2)
set rand2 = GetRandomInt(1, 12)
endloop
set temp = udg_hm_circle[rand1]
set udg_hm_circle[rand1] = udg_hm_circle[rand2]
set udg_hm_circle[rand2] = temp
if (i > 30) then
set orig = 1
set count = 1
set current = udg_hm_circle[orig]
loop
exitwhen (orig == current)
set current = udg_hm_circle[current]
set count = count + 1
endloop
if (count == udg_numPlayers) then
set is_circle = true
endif
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen (i > 12)
// PRINT to player(i) "NEXT TARGET: player(udg_hm_circle[dies])"
if (udg_isPlaying[i]) then
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( "|cffccccccFIRST TARGET:|r " + udg_playerColor[udg_hm_circle[i]] + GetPlayerName(ConvertedPlayer(udg_hm_circle[i])) ) )
// UPDATE LEADERBOARD TITLE FOR I
call LeaderboardSetLabel( udg_hm_target_leaderboard[i], "|cffffff99Target:|r " + udg_playerColor[udg_hm_circle[i]] + GetPlayerName(ConvertedPlayer(udg_hm_circle[i])) )
endif
set i = i + 1
endloop
endfunction
function hitman_update_targets takes integer dies, integer kills, boolean leaver returns nothing
local integer winner = 0
local integer i = 1
if (udg_hm_circle[dies] > 0) then
loop
exitwhen (i > 12)
if (udg_hm_circle[i] == dies) then
set udg_hm_circle[i] = udg_hm_circle[dies]
// UPDATE LEADERBOARD TITLE FOR I
call LeaderboardSetLabel( udg_hm_target_leaderboard[i], "|cffffff99Target:|r " + udg_playerColor[udg_hm_circle[i]] + GetPlayerName(ConvertedPlayer(udg_hm_circle[i])) )
if (i == udg_hm_circle[i]) then
set winner = i
else
if (i == kills) then
// PRINT to player(i) "NEXT TARGET: player(udg_hm_circle[dies])"
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( "|cffccccccNEXT TARGET:|r " + udg_playerColor[udg_hm_circle[dies]] + GetPlayerName(ConvertedPlayer(udg_hm_circle[dies])) ) )
// PLAY TARGET KILLED SOUND FOR I
call StartSoundForPlayerBJ ( ConvertedPlayer(i), gg_snd_GoodJob )
else
// PRINT to player(i) "YOUR TARGET HAS BEEN REASSIGNED: player(udg_hm_circle[dies])"
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( "|cffccccccYOUR TARGET HAS BEEN REASSIGNED:|r " + udg_playerColor[udg_hm_circle[dies]] + GetPlayerName(ConvertedPlayer(udg_hm_circle[dies])) ) )
endif
endif
endif
set i = i + 1
endloop
set udg_hm_circle[dies] = 0
// REMOVE DIES MARKER ON THE MULTIBOARD
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, dies+udg_multiboard_offset[dies], "ReplaceableTextures\\CommandButtons\\BTNNeutralManaShieldOff.blp" ) //ReplaceableTextures\\WorldEditUI\\Editor-Ally-NoPriority
if (not(leaver)) then
if (udg_hm_last_dies > 0) then
set udg_hm_string[udg_hm_last_dies] = dies
// PRINT to player(udg_hm_last_dies) "NEW TARGET: player(dies)"
call DisplayTimedTextToPlayer( ConvertedPlayer(udg_hm_last_dies) , 0 , 0 , 20 , ( "|cffccccccNEW TARGET:|r " + udg_playerColor[dies] + GetPlayerName(ConvertedPlayer(dies)) ) )
// UPDATE LEADERBOARD TITLE FOR LAST DIES
call LeaderboardSetLabel( udg_hm_target_leaderboard[udg_hm_last_dies], "|cffffff99Target:|r " + udg_playerColor[dies] + GetPlayerName(ConvertedPlayer(dies)) )
else
set udg_hm_first = dies
endif
set udg_hm_string[dies] = 13 // no target
// PRINT to player(dies) "YOU WILL RECEIVE A NEW TARGET SHORTLY"
call DisplayTimedTextToPlayer( ConvertedPlayer(dies) , 0 , 0 , 20 , "|cffccccccYOU WILL RECEIVE A NEW TARGET SHORTLY" )
// UPDATE LEADERBOARD TITLE FOR DIES
call LeaderboardSetLabel( udg_hm_target_leaderboard[dies], "|cffffff99Target:|r |cff999999None|r" )
endif
if (winner > 0) then
// PRINT to all players "PLAYER winner HAS WON ROUND udg_hm_round AND WAS AWARDED 500 GOLD AND 20 AP!"
call AdjustPlayerStateBJ( 500, ConvertedPlayer(winner), PLAYER_STATE_RESOURCE_GOLD )
call AdjustPlayerStateBJ( 20, ConvertedPlayer(winner), PLAYER_STATE_RESOURCE_LUMBER )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Other\\Transmute\\PileofGold.mdl", udg_hero[winner], "origin" ))
set i = 1
loop
exitwhen (i > 12)
if (udg_isPlaying[i]) then
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( udg_playerColor[winner] + GetPlayerName(ConvertedPlayer(winner)) + "|r |cffccccccHAS WON ROUND " + I2S(udg_hm_round) + " FOR 500 GOLD AND 20 AP!") )
// PLAY ROUND COMPLETE SOUND FOR ALL
call StartSoundForPlayerBJ ( ConvertedPlayer(i), gg_snd_ArrangedTeamInvitation )
endif
set i = i + 1
endloop
set udg_hm_string[winner] = udg_hm_first
// PRINT to player(winner) "NEW TARGET: player(udg_hm_first)"
call DisplayTimedTextToPlayer( ConvertedPlayer(winner) , 0 , 0 , 20 , ( "|cffccccccNEW TARGET:|r " + udg_playerColor[udg_hm_first] + GetPlayerName(ConvertedPlayer(udg_hm_first)) ) )
// UPDATE LEADERBOARD TITLE FOR WINNER
call LeaderboardSetLabel( udg_hm_target_leaderboard[winner], "|cffffff99Target:|r " + udg_playerColor[udg_hm_first] + GetPlayerName(ConvertedPlayer(udg_hm_first)) )
if (not(leaver)) then
set udg_hm_string[dies] = winner
// PRINT to player(dies) "NEW TARGET: player(winner)"
call DisplayTimedTextToPlayer( ConvertedPlayer(dies) , 0 , 0 , 20 , ( "|cffccccccNEW TARGET:|r " + udg_playerColor[winner] + GetPlayerName(ConvertedPlayer(winner)) ) )
// UPDATE LEADERBOARD TITLE FOR DIES
call LeaderboardSetLabel( udg_hm_target_leaderboard[dies], "|cffffff99Target:|r " + udg_playerColor[winner] + GetPlayerName(ConvertedPlayer(winner)) )
else
set udg_hm_string[udg_hm_last_dies] = winner
// PRINT to player(udg_hm_last_dies) "NEW TARGET: player(winner)"
call DisplayTimedTextToPlayer( ConvertedPlayer(udg_hm_last_dies) , 0 , 0 , 20 , ( "|cffccccccNEW TARGET:|r " + udg_playerColor[winner] + GetPlayerName(ConvertedPlayer(winner)) ) )
// UPDATE LEADERBOARD TITLE FOR udg_hm_last_dies
call LeaderboardSetLabel( udg_hm_target_leaderboard[udg_hm_last_dies], "|cffffff99Target:|r " + udg_playerColor[winner] + GetPlayerName(ConvertedPlayer(winner)) )
endif
set udg_hm_round = udg_hm_round + 1
set i = 1
loop
exitwhen (i > 12)
if (udg_isPlaying[i]) then
set udg_hm_circle[i] = udg_hm_string[i]
set udg_hm_string[i] = 0
if (udg_hm_circle[i] > 0) then
// PRINT to all players "STARTING ROUND udg_hm_round!"
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( "|cffccccccSTARTING ROUND " + I2S(udg_hm_round) + "!") )
// ADD I MARKER ON THE MULTIBOARD
call MultiboardSetItemIconBJ( GetLastCreatedMultiboard(), 3, i+udg_multiboard_offset[i], "ReplaceableTextures\\CommandButtons\\BTNNeutralManaShield.blp" )
endif
endif
set i = i + 1
endloop
set udg_hm_last_dies = 0
set udg_hm_first = 0
endif
elseif (udg_hm_string[dies] > 0) then
if (dies != udg_hm_last_dies) then
if (dies == udg_hm_first) then
set udg_hm_first = udg_hm_string[dies]
endif
loop
exitwhen (i > 12)
if (udg_hm_string[i] == dies) then
set udg_hm_string[i] = udg_hm_string[dies]
if (i == kills) then
// PRINT to player(i) "NEXT TARGET: player(udg_hm_string[dies])"
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( "|cffccccccNEXT TARGET:|r " + udg_playerColor[udg_hm_string[dies]] + GetPlayerName(ConvertedPlayer(udg_hm_string[dies])) ) )
// PLAY TARGET KILLED SOUND FOR I
call StartSoundForPlayerBJ ( ConvertedPlayer(i), gg_snd_GoodJob )
else
// PRINT to player(i) "YOUR TARGET HAS BEEN REASSIGNED: player(udg_hm_string[dies])"
call DisplayTimedTextToPlayer( ConvertedPlayer(i) , 0 , 0 , 20 , ( "|cffccccccYOUR TARGET HAS BEEN REASSIGNED:|r " + udg_playerColor[udg_hm_string[dies]] + GetPlayerName(ConvertedPlayer(udg_hm_string[dies])) ) )
endif
endif
set i = i + 1
endloop
if (not(leaver)) then
set udg_hm_string[udg_hm_last_dies] = dies
// PRINT to player(udg_hm_last_dies) "NEW TARGET: player(dies)"
call DisplayTimedTextToPlayer( ConvertedPlayer(udg_hm_last_dies) , 0 , 0 , 20 , ( "|cffccccccNEW TARGET:|r " + udg_playerColor[dies] + GetPlayerName(ConvertedPlayer(dies)) ) )
// UPDATE LEADERBOARD TITLE FOR LAST DIES
call LeaderboardSetLabel( udg_hm_target_leaderboard[udg_hm_last_dies], "|cffffff99Target:|r " + udg_playerColor[dies] + GetPlayerName(ConvertedPlayer(dies)) )
set udg_hm_string[dies] = 13 // no target
// PRINT to player(dies) "YOU WILL RECEIVE A NEW TARGET SHORTLY"
call DisplayTimedTextToPlayer( ConvertedPlayer(dies) , 0 , 0 , 20 , "|cffccccccYOU WILL RECEIVE A NEW TARGET SHORTLY" )
// UPDATE LEADERBOARD TITLE FOR DIES
call LeaderboardSetLabel( udg_hm_target_leaderboard[dies], "|cffffff99Target:|r |cff999999None|r" )
else
set udg_hm_string[dies] = 0 // removed from game
endif
endif
endif
if (winner == 0 and not(leaver)) then
set udg_hm_last_dies = dies
endif
endfunction
function hitman_ping_targets takes nothing returns nothing
local integer i = 1
local location l
local integer temp
loop
exitwhen (i > 12)
set temp = 0
if (udg_hm_circle[i] > 0) then
set temp = udg_hm_circle[i]
elseif (udg_hm_string[i] < 13) then
set temp = udg_hm_string[i]
endif
if (temp > 0) then
if (IsHeroUnitId(GetUnitTypeId(udg_hero[temp]))) then
set l = GetUnitLoc(udg_hero[temp])
else
set l = GetUnitLoc(udg_temp_hero[temp])
endif
call PingMinimapLocForForceEx( udg_player[i], l, 5, bj_MINIMAPPINGSTYLE_FLASHY, 20, 20, 100 )
call RemoveLocation(l)
endif
set i = i + 1
endloop
set l = null
endfunction
Name | Type | is_array | initial_value |
accel | hashtable | No | |
AI_flee_point | location | Yes | |
AI_flee_regions | rect | Yes | |
AI_name | string | Yes | Ninja |
AI_rival | unit | Yes | |
AI_spell_path_1 | abilcode | Yes | |
AI_spell_path_2 | abilcode | Yes | |
AI_spell_path_3 | abilcode | Yes | |
AI_spell_path_index | integer | Yes | |
AI_state | string | Yes | idle |
AI_target_point | location | Yes | |
AI_tech_level | integer | Yes | 1 |
angleofattack | real | Yes | |
backstab_damage | real | No | |
backup_camera_angle_of_attack | real | Yes | -27.00 |
backup_camera_distance | real | Yes | 1200.00 |
bees | hashtable | No | |
bees_count | hashtable | No | |
bees_group | group | No | |
book1_spells | integer | Yes | 0 |
book2_spells | integer | Yes | |
book3_spells | integer | Yes | |
book4_spells | integer | Yes | |
book_effect | string | No | Objects\Spawnmodels\Other\ToonBoom\ToonBoom.mdl |
cameradistance | real | Yes | |
cham_group | group | No | |
cicada_caster | unit | No | |
cloudburst_caster | unit | No | |
cloudburst_clouds | group | No | |
cloudburst_point | location | No | |
cloudburst_targets | group | No | |
concentration | unit | Yes | |
concentration_delay | timer | Yes | |
creep_level | integer | No | |
creep_spawn_count | integer | Yes | |
creep_spawn_interval | integer | No | 12 |
creep_spawn_region | rect | Yes | |
creep_spawn_timer | integer | Yes | 0 |
creep_spawn_type | unitcode | Yes | |
diabolic_group | group | No | |
double_damage_timer | timer | No | |
explode_damage | real | No | |
explode_player | player | No | |
explode_power | real | No | |
explode_r | real | No | |
explode_sound | integer | No | |
explode_x | real | No | |
explode_y | real | No | |
explode_z_power | real | No | |
extra_rows | integer | No | 1 |
first_person_mode | boolean | No | false |
flag_location | location | Yes | |
flag_secured | boolean | Yes | true |
fol_a | hashtable | No | |
fol_da | hashtable | No | |
fol_dda | hashtable | No | |
fol_ddr | hashtable | No | |
fol_dr | hashtable | No | |
fol_leader | hashtable | No | |
follow_group | group | No | |
fracture_angle | real | No | |
fracture_caster | unit | No | |
fracture_group | group | No | |
fracture_max | integer | No | |
fracture_speed | real | Yes | |
fracture_units | unit | Yes | |
game_mode_corrected | boolean | No | false |
gold_awarded | integer | No | |
gravity | real | No | 3.00 |
has_pressed_esc | boolean | Yes | |
hero | unit | Yes | |
hero_levels | integer | Yes | 1 |
hero_res_point | location | Yes | |
hero_type | unitcode | Yes | |
hm_circle | integer | Yes | |
hm_first | integer | No | |
hm_last_dies | integer | No | |
hm_round | integer | No | 1 |
hm_string | integer | Yes | |
hm_target_leaderboard | leaderboard | Yes | |
hs_back | hashtable | No | |
hs_damage | real | Yes | |
hs_distance | hashtable | No | |
hs_group | group | No | |
hs_hook | hashtable | No | |
hs_rope | hashtable | No | |
hs_target | hashtable | No | |
icon_path | string | Yes | |
Immo_Caster | unit | No | |
Immo_Group | group | No | |
Immo_Level | integer | Yes | |
Immo_Loc | location | No | |
Immolation_Group | group | No | |
isBurrowed | boolean | Yes | |
isComputer | boolean | Yes | |
isPlaying | boolean | Yes | |
jobPoints | integer | Yes | |
K_exp | real | No | 150.00 |
K_exp_AI | real | No | 240.00 |
level_sum | integer | No | |
minds_eye_caster | unit | No | |
minds_eye_lvl | integer | No | |
missile_group | group | No | |
mode_limit | integer | No | 15 |
mode_name | string | No | |
mode_selected | boolean | No | |
moved_by | hashtable | No | |
multiboard_offset | integer | Yes | 1 |
multiboard_offset_temp | integer | No | 1 |
multikill_count | integer | Yes | |
multikill_timer | timer | Yes | |
num_hero_types | integer | No | 20 |
numDeaths | integer | Yes | |
numKills | integer | Yes | |
numPlayers | integer | No | |
omni_caster | unit | No | |
omni_spell1 | abilcode | No | |
omni_spell2 | abilcode | No | |
omni_target | unit | No | |
orb_a | hashtable | No | |
orb_center | hashtable | No | |
orb_da | hashtable | No | |
orb_dda | hashtable | No | |
orb_ddr | hashtable | No | |
orb_dr | hashtable | No | |
orb_r | hashtable | No | |
orbit_group | group | No | |
overtake_caster | unit | No | |
overtake_orig | location | No | |
Passive_Abilities | abilcode | Yes | |
per_unit | unit | No | |
periodic | integer | No | |
player | force | Yes | |
player_has_picked | boolean | Yes | |
player_total | integer | No | 12 |
playerColor | string | Yes | |
players_left | integer | No | |
radius | hashtable | No | |
repel_charges | hashtable | No | |
repel_cooldown | hashtable | No | |
repel_group | group | No | |
res_delay | timer | Yes | |
res_delay_window | timerdialog | Yes | |
res_region | rect | Yes | |
ressed_hero_int | integer | No | |
row | integer | No | |
sandtrap_group | group | No | |
scat_angle | real | No | |
scat_bullet | unit | No | |
scat_bullets | unit | Yes | |
scat_caster | unit | No | |
scat_distance | real | No | |
scat_distance_explode | real | No | 700.00 |
scat_distance_limit | real | No | 3000.00 |
scat_has_exploded | boolean | No | |
scat_speed | real | No | 30.00 |
score_2x_kills | integer | Yes | |
score_3x_kills | integer | Yes | |
score_4x_kills | integer | Yes | |
score_5x_kills | integer | Yes | |
score_attack_count | integer | Yes | |
score_award_offset | integer | Yes | |
score_damage_dealt | real | Yes | |
score_damage_taken | real | Yes | |
score_first_blood | integer | No | |
score_least_AP | integer | No | |
score_least_attacks | integer | No | |
score_least_deaths | integer | No | |
score_least_dmg_gvn | real | No | |
score_least_dmg_tkn | real | No | |
score_least_gold | integer | No | |
score_least_kills | integer | No | |
score_least_orders | integer | No | |
score_least_potions | integer | No | |
score_least_spells | integer | No | |
score_most_AP | integer | No | |
score_most_attacks | integer | No | |
score_most_deaths | integer | No | |
score_most_dmg_gvn | real | No | |
score_most_dmg_tkn | real | No | |
score_most_gold | integer | No | |
score_most_kills | integer | No | |
score_most_orders | integer | No | |
score_most_potions | integer | No | |
score_most_spells | integer | No | |
score_order_count | integer | Yes | |
score_potion_usage | integer | Yes | |
score_spell_count | integer | Yes | |
shopShown | boolean | Yes | |
skillShop1 | unit | Yes | |
skillShop2 | unit | Yes | |
skillShop3 | unit | Yes | |
skillShop4 | unit | Yes | |
skillShopAngle1 | real | No | 90.00 |
skillShopAngle2 | real | No | 210.00 |
skillShopAngle3 | real | No | 270.00 |
skillShopAngle4 | real | No | 150.00 |
skillShopDistance1 | real | No | 150.00 |
skillShopDistance2 | real | No | 150.00 |
skillShopDistance3 | real | No | 150.00 |
skillShopDistance4 | real | No | 150.00 |
spark_caster | unit | No | |
spark_dummy | unit | No | |
spark_target | unit | No | |
summon_spell | abilcode | Yes | |
team1score | integer | No | |
team2score | integer | No | |
team3score | integer | No | |
tech_1 | techcode | Yes | |
tech_2 | techcode | Yes | |
tech_4 | techcode | Yes | |
temp | integer | Yes | |
temp_force | force | No | |
temp_hero | unit | Yes | |
temp_int | integer | No | |
temp_int1 | integer | No | |
temp_item_charges | integer | No | |
temp_item_count | integer | No | |
temp_item_type | itemcode | No | |
temp_loc | location | No | |
temp_loc1 | location | No | |
temp_loc2 | location | No | |
temp_loc3 | location | No | |
temp_loc4 | location | No | |
temp_region | rect | No | |
temp_unit | unit | No | |
temp_unit1 | unit | No | |
tet_back | hashtable | No | |
tet_damage | real | Yes | 5.00 |
tet_group | group | No | |
tet_hook | hashtable | No | |
tet_init_damage | real | Yes | |
tet_rope | hashtable | No | |
tet_target | hashtable | No | |
unit_group | group | No | |
victory_message | string | No | |
volley_caster | unit | No | |
warclub_count | integer | Yes | |
weather_current | integer | No | 6 |
weather_effects | weathereffect | Yes | |
xpos | hashtable | No | |
xrate | hashtable | No | |
ypos | hashtable | No | |
yrate | hashtable | No | |
zone_damage | real | Yes | 0.00 |
zpos | hashtable | No | |
zrate | hashtable | No |
function Trig_Variable_Setup_JASS_Actions takes nothing returns nothing
set udg_repel_charges = InitHashtable()
set udg_repel_cooldown = InitHashtable()
set udg_bees = InitHashtable()
set udg_bees_count = InitHashtable()
set udg_hs_hook = InitHashtable()
set udg_hs_target = InitHashtable()
set udg_hs_rope = InitHashtable()
set udg_hs_back = InitHashtable()
set udg_hs_distance = InitHashtable()
set udg_tet_hook = InitHashtable()
set udg_tet_target = InitHashtable()
set udg_tet_rope = InitHashtable()
set udg_tet_back = InitHashtable()
set udg_accel = InitHashtable()
set udg_moved_by = InitHashtable()
set udg_radius = InitHashtable()
set udg_xpos = InitHashtable()
set udg_xrate = InitHashtable()
set udg_ypos = InitHashtable()
set udg_yrate = InitHashtable()
set udg_zpos = InitHashtable()
set udg_zrate = InitHashtable()
set udg_fol_leader = InitHashtable()
set udg_fol_dr = InitHashtable()
set udg_fol_ddr = InitHashtable()
set udg_fol_a = InitHashtable()
set udg_fol_da = InitHashtable()
set udg_fol_dda = InitHashtable()
set udg_orb_center = InitHashtable()
set udg_orb_r = InitHashtable()
set udg_orb_dr = InitHashtable()
set udg_orb_ddr = InitHashtable()
set udg_orb_a = InitHashtable()
set udg_orb_da = InitHashtable()
set udg_orb_dda = InitHashtable()
endfunction
//===========================================================================
function InitTrig_Variable_Setup_JASS takes nothing returns nothing
set gg_trg_Variable_Setup_JASS = CreateTrigger( )
call TriggerAddAction( gg_trg_Variable_Setup_JASS, function Trig_Variable_Setup_JASS_Actions )
endfunction
function handle_collision takes unit u1, unit u2 returns nothing
local integer level
// local real speed
if (GetUnitTypeId(u1) == 'u00W') then // fireball
set level = GetPlayerTechCountSimple('R010', GetOwningPlayer(u1))
call explode_args(GetUnitX(u1), GetUnitY(u1), 150 + (50 * I2R(level)), GetOwningPlayer(u1), 30 + (60 * I2R(level)), 27 + (3 * I2R(level)), 0, 0)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", GetUnitX(u1), GetUnitY(u1)))
call cleanup_missile(u1)
elseif (GetUnitTypeId(u1) == 'u00X') then // magnetic link
call SaveUnitHandleBJ( u2, 0, GetHandleIdBJ(udg_hero[GetConvertedPlayerId(GetOwningPlayer(u1))]), udg_hs_target )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl", u2, "origin" ))
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl", udg_hero[GetConvertedPlayerId(GetOwningPlayer(u1))], "origin" ))
call PauseUnit(u1, true)
call SetUnitPathing(udg_hero[GetConvertedPlayerId(GetOwningPlayer(u1))], false)
call cleanup_obj(u1)
call GroupRemoveUnitSimple( u1, udg_missile_group )
elseif (GetUnitTypeId(u1) == 'u003') then // tetsubishi
call SaveUnitHandleBJ( u2, 0, GetHandleIdBJ(udg_hero[GetConvertedPlayerId(GetOwningPlayer(u1))]), udg_tet_target )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", u2, "chest" ))
if (IsUnitAlly(u2, GetOwningPlayer(u1)) == false) then
call UnitDamageTargetBJ( udg_hero[GetConvertedPlayerId(GetOwningPlayer(u1))], u2, udg_tet_init_damage[GetPlayerTechCountSimple('R009', GetOwningPlayer(u1))], ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endif
call PauseUnit(u1, true)
call SetUnitPathing(u2, false)
call cleanup_obj(u1)
call GroupRemoveUnitSimple( u1, udg_missile_group )
elseif (GetUnitTypeId(u1) == 'u00Y') then // nest of bees
call explode_args(GetUnitX(u1), GetUnitY(u1), 120, GetOwningPlayer(u1), 20, 10, 0, 0)
//call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl", GetUnitX(u1), GetUnitY(u1)))
call cleanup_missile(u1)
elseif (GetUnitTypeId(u1) == 'u00Z') then // tempest
call explode_args(GetUnitX(u1), GetUnitY(u1), 150, GetOwningPlayer(u1), 10 + (GetPlayerTechCountSimple('R015', GetOwningPlayer(u1)) * 10), 20, 0, 0)
elseif (GetUnitAbilityLevelSwapped('A01X', u1) > 0 or GetUnitAbilityLevelSwapped('A01Y', u1) > 0) then
call SaveIntegerBJ( 15, 0, GetHandleIdBJ(u1), udg_repel_cooldown )
endif
// if (GetUnitTypeId(u1) == 'u003') then
// set speed = SquareRoot(Pow(LoadRealBJ(0, GetHandleIdBJ(u1), udg_xrate), 2) + Pow(LoadRealBJ(0, GetHandleIdBJ(u1), udg_yrate), 2))
// call explode_args(GetUnitX(u1), GetUnitY(u1), 200, GetOwningPlayer(u1), 2*speed, 40, 45, 0)
// call DisplayTextToForce( GetPlayersAll(), R2S(2*speed) )
// call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", GetUnitX(u1), GetUnitY(u1)))
// call cleanup_missile(u1)
// endif
// if (GetUnitTypeId(u1) == 'u004') then
// call explode_args(GetUnitX(u1), GetUnitY(u1), 80, GetOwningPlayer(u1), 250, 40, 40, 0)
// call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl", u2, "chest" ))
// call cleanup_missile(u1)
// endif
// if (GetUnitTypeId(u1) == 'u005') then
// call explode_args(GetUnitX(u1), GetUnitY(u1), 300, GetOwningPlayer(u1), 250, 50, 45, 0)
// call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", GetUnitX(u1), GetUnitY(u1)))
// call cleanup_missile(u1)
// endif
// if (GetUnitTypeId(u1) == 'o000' and LoadRealBJ(0, GetHandleIdBJ(u1), udg_accel) > 1) then
// set speed = SquareRoot(Pow(LoadRealBJ(0, GetHandleIdBJ(u1), udg_xrate), 2) + Pow(LoadRealBJ(0, GetHandleIdBJ(u1), udg_yrate), 2))
// call explode_args(GetUnitX(u1), GetUnitY(u1), 6*speed, GetOwningPlayer(u1), 150, speed, 45, 0)
// call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl", GetUnitX(u1), GetUnitY(u1)))
// call SetUnitTimeScalePercent( u1, 100.00 )
// call init_unit(u1, 0.93, 48, 0, 0, 0)
// endif
// if (GetUnitTypeId(u1) == 'u007') then
// call explode_args(GetUnitX(u1), GetUnitY(u1), 25, GetOwningPlayer(u1), 250, 8, 8, 0)
// call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", GetUnitX(u1), GetUnitY(u1)))
// call cleanup_missile(u1)
// endif
endfunction
// function collided takes unit u1, unit u2 returns boolean
// local boolean did_collide = false
// local real x1
// local real y1
// local real z1
// local real x2
// local real y2
// local real z2
// local real r1
// local real r2
// if (GetOwningPlayer(u1) != GetOwningPlayer(u2)) then
// set x1 = GetUnitX(u1)
// set y1 = GetUnitY(u1)
// set x2 = GetUnitX(u2)
// set y2 = GetUnitY(u2)
// set z1 = LoadRealBJ(0, GetHandleIdBJ(u1), udg_zpos)
// set z2 = LoadRealBJ(0, GetHandleIdBJ(u2), udg_zpos)
// set r1 = LoadRealBJ(0, GetHandleIdBJ(u1), udg_radius)
// set r2 = LoadRealBJ(0, GetHandleIdBJ(u2), udg_radius)
// if ( (SquareRoot(Pow(x1-x2,2)+Pow(y1-y2,2)+Pow(z1-z2,2))) < (r1+r2) ) then
// set did_collide = true
// endif
// endif
// return did_collide
// endfunction
function periodic_collision_function takes nothing returns nothing
local unit u1 = udg_per_unit
local unit u2 = GetEnumUnit()
//if (collided(u1, u2) == true) then
if (GetOwningPlayer(u1) != GetOwningPlayer(u2)) then
call handle_collision(u1, u2)
endif
set u1 = null
set u2 = null
endfunction
function periodic_missile_function takes nothing returns nothing
local real x
local real y
local real z
local real dx
local real dy
local real dz
local real a
local real r
local unit u = GetEnumUnit()
local location loc = GetUnitLoc(u)
set x = LoadRealBJ(0, GetHandleIdBJ(u), udg_xpos)
set y = LoadRealBJ(0, GetHandleIdBJ(u), udg_ypos)
set z = LoadRealBJ(0, GetHandleIdBJ(u), udg_zpos)
set dx = LoadRealBJ(0, GetHandleIdBJ(u), udg_xrate)
set dy = LoadRealBJ(0, GetHandleIdBJ(u), udg_yrate)
set dz = LoadRealBJ(0, GetHandleIdBJ(u), udg_zrate)
set a = LoadRealBJ(0, GetHandleIdBJ(u), udg_accel)
set r = LoadRealBJ(0, GetHandleIdBJ(u), udg_radius)
set dz = dz-udg_gravity
set z = z+dz
if (z < 0) then
set dx = dx*a
set dy = dy*a
set z = 0
set dz = 0
endif
call SetUnitFlyHeight(u, z, 0)
call SaveRealBJ(dz, 0, GetHandleIdBJ(u), udg_zrate)
call SaveRealBJ(z, 0, GetHandleIdBJ(u), udg_zpos)
if (dx != 0 and dy != 0) then
set x = x+dx
set y = y+dy
call SetUnitPosition(u, x, y)
call SaveRealBJ(x, 0, GetHandleIdBJ(u), udg_xpos)
call SaveRealBJ(y, 0, GetHandleIdBJ(u), udg_ypos)
call SaveRealBJ(dx, 0, GetHandleIdBJ(u), udg_xrate)
call SaveRealBJ(dy, 0, GetHandleIdBJ(u), udg_yrate)
endif
if (IsUnitDeadBJ(u)) then
call GroupRemoveUnitSimple( u, udg_missile_group )
endif
set udg_per_unit = u
call ForGroupBJ( GetUnitsInRangeOfLocMatching(r, loc, Condition(function In_Unit_Group)), function periodic_collision_function )
//call ForGroupBJ( udg_unit_group, function periodic_collision_function )
set u = null
call RemoveLocation(loc)
set loc = null
endfunction
function periodic_unit_function takes nothing returns nothing
local real actual_x
local real actual_y
local real x
local real y
local real z
local real dx
local real dy
local real dz
local real a
local real r
local real dr
local integer mb
local unit u = GetEnumUnit()
set x = LoadRealBJ(0, GetHandleIdBJ(u), udg_xpos)
set y = LoadRealBJ(0, GetHandleIdBJ(u), udg_ypos)
set z = LoadRealBJ(0, GetHandleIdBJ(u), udg_zpos)
set dx = LoadRealBJ(0, GetHandleIdBJ(u), udg_xrate)
set dy = LoadRealBJ(0, GetHandleIdBJ(u), udg_yrate)
set dz = LoadRealBJ(0, GetHandleIdBJ(u), udg_zrate)
set a = LoadRealBJ(0, GetHandleIdBJ(u), udg_accel)
set r = LoadRealBJ(0, GetHandleIdBJ(u), udg_radius)
set mb = LoadIntegerBJ(0, GetHandleIdBJ(u), udg_moved_by)
set dz = dz-udg_gravity
set z = z+dz
if (z < 0) then
set dx = dx * 0.93
set dy = dy * 0.93
set z = 0
set dz = 0
endif
set dr = SquareRoot( Pow(dx,2) + Pow(dy,2) )
if (dr > 4) then // if moving
set actual_x = GetUnitX(u)
set actual_y = GetUnitY(u)
if ((actual_x + 2 < x) or (actual_x - 2 > x) or (actual_y + 2 < y) or (actual_y - 2 > y)) then // movement is disturbed
if (GetOwningPlayer(u) != Player(mb)) then
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl", x, y))
call UnitDamageTargetBJ( udg_hero[mb], u, dr * 3, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call DisplayTextToForce( GetPlayersAll(), R2S(dr * 2) )
endif
set dx = 0
set dy = 0
//set dz = 35
endif
set x = x+dx
set y = y+dy
call SetUnitPosition(u, x, y)
call SaveRealBJ(x, 0, GetHandleIdBJ(u), udg_xpos)
call SaveRealBJ(y, 0, GetHandleIdBJ(u), udg_ypos)
call SaveRealBJ(dx, 0, GetHandleIdBJ(u), udg_xrate)
call SaveRealBJ(dy, 0, GetHandleIdBJ(u), udg_yrate)
if (z == 0) then // if on ground
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", x, y))
call SetUnitPathing(u, true)
else
call SetUnitPathing(u, false)
endif
else
call SaveRealBJ(0, 0, GetHandleIdBJ(u), udg_xrate)
call SaveRealBJ(0, 0, GetHandleIdBJ(u), udg_yrate)
if (z == 0 and dz == 0 and IsUnitDeadBJ(u)) then
call GroupRemoveUnitSimple( u, udg_unit_group )
endif
endif
call SetUnitFlyHeight(u, z, 0)
call SaveRealBJ(dz, 0, GetHandleIdBJ(u), udg_zrate)
call SaveRealBJ(z, 0, GetHandleIdBJ(u), udg_zpos)
set u = null
endfunction
function periodic_hs_function takes nothing returns nothing
local unit caster = GetEnumUnit()
local lightning l
local unit target
local unit hook
local boolean back
local real distance
local location loc
local location loc1
local location loc2
local real angle
set l = LoadLightningHandleBJ( 0, GetHandleIdBJ(caster), udg_hs_rope )
set target = LoadUnitHandleBJ( 0, GetHandleIdBJ(caster), udg_hs_target )
set hook = LoadUnitHandleBJ( 0, GetHandleIdBJ(caster), udg_hs_hook )
set back = LoadBooleanBJ( 0, GetHandleIdBJ(caster), udg_hs_back )
set distance = LoadRealBJ( 0, GetHandleIdBJ(caster), udg_hs_distance )
call MoveLightning(l, true, GetUnitX(caster), GetUnitY(caster), GetUnitX(hook), GetUnitY(hook))
if (target != null) then
set loc = GetUnitLoc(caster)
set loc1 = GetUnitLoc(target)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", GetUnitX(caster), GetUnitY(caster)))
call SetUnitPositionLoc(hook, loc1)
set angle = AngleBetweenPoints(loc, loc1)
set loc2 = PolarProjectionBJ(loc, 20.00, angle)
call SetUnitPositionLoc(caster, loc2)
call SaveRealBJ( 20 + distance, 0, GetHandleIdBJ(caster), udg_hs_distance)
if (DistanceBetweenPoints(loc, loc1) < 128) then
call DestroyLightning(l)
call cleanup_missile(hook)
//call UnitDamageTargetBJ( caster, target, (distance + 20) / 4, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl", caster, "origin" ))
call explode_args(GetUnitX(caster), GetUnitY(caster), 250, GetOwningPlayer(caster), udg_hs_damage[GetPlayerTechCountSimple('R011', GetOwningPlayer(caster))] * (distance+20), 50, 0, 0)
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_target )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_hook )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_rope )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_back )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_distance )
call GroupRemoveUnitSimple( caster, udg_hs_group )
call SetUnitPathing(caster, true)
endif
elseif (back == true) then
//call DisplayTextToForce( GetPlayersAll(), "Don't worry about it" )
set loc = GetUnitLoc(caster)
set loc1 = GetUnitLoc(hook)
set angle = AngleBetweenPoints(loc1, loc)
set loc2 = PolarProjectionBJ(loc1, 120.00, angle)
call SetUnitPositionLoc(hook, loc2)
if (DistanceBetweenPoints(loc, loc1) < 128) then
call DestroyLightning(l)
call cleanup_missile(hook)
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_target )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_hook )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_rope )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_back )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_hs_distance )
call GroupRemoveUnitSimple( caster, udg_hs_group )
endif
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc = null
set loc1 = null
set loc2 = null
set l = null
set hook = null
set target = null
set caster = null
endfunction
function periodic_tet_function takes nothing returns nothing
local unit caster = GetEnumUnit()
local lightning l
local unit target
local unit hook
local boolean back
local real distance
local location loc
local location loc1
local location loc2
local real angle
set l = LoadLightningHandleBJ( 0, GetHandleIdBJ(caster), udg_tet_rope )
set target = LoadUnitHandleBJ( 0, GetHandleIdBJ(caster), udg_tet_target )
set hook = LoadUnitHandleBJ( 0, GetHandleIdBJ(caster), udg_tet_hook )
set back = LoadBooleanBJ( 0, GetHandleIdBJ(caster), udg_tet_back )
call MoveLightning(l, true, GetUnitX(caster), GetUnitY(caster), GetUnitX(hook), GetUnitY(hook))
if (target != null) then
set loc = GetUnitLoc(caster)
set loc1 = GetUnitLoc(target)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\FlakCannons\\FlakTarget.mdl", GetUnitX(target), GetUnitY(target)))
call SetUnitPositionLoc(hook, loc1)
set angle = AngleBetweenPoints(loc1, loc)
set loc2 = PolarProjectionBJ(loc1, 45.00, angle)
call SetUnitPositionLoc(target, loc2)
if (IsUnitAlly(target, GetOwningPlayer(hook)) == false) then
call UnitDamageTargetBJ( caster, target, udg_tet_damage[GetPlayerTechCountSimple('R009', GetOwningPlayer(caster))], ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endif
if (DistanceBetweenPoints(loc, loc1) < 128) then
call DestroyLightning(l)
call cleanup_missile(hook)
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_target )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_hook )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_rope )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_back )
call GroupRemoveUnitSimple( caster, udg_tet_group )
call SetUnitPathing(target, true)
endif
elseif (back == true) then
//call DisplayTextToForce( GetPlayersAll(), "Don't worry about it" )
set loc = GetUnitLoc(caster)
set loc1 = GetUnitLoc(hook)
set angle = AngleBetweenPoints(loc1, loc)
set loc2 = PolarProjectionBJ(loc1, 45.00, angle)
call SetUnitPositionLoc(hook, loc2)
if (DistanceBetweenPoints(loc, loc1) < 200) then
call DestroyLightning(l)
call cleanup_missile(hook)
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_target )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_hook )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_rope )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_tet_back )
call GroupRemoveUnitSimple( caster, udg_tet_group )
endif
endif
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc = null
set loc1 = null
set loc2 = null
set l = null
set hook = null
set target = null
set caster = null
endfunction
function periodic_repel_function takes nothing returns nothing
local unit caster = GetEnumUnit()
local real lvl = GetPlayerTechCountSimple('R016', GetOwningPlayer(caster))
local integer cooldown = LoadIntegerBJ(0, GetHandleIdBJ(caster), udg_repel_cooldown)
local integer charges = LoadIntegerBJ(0, GetHandleIdBJ(caster), udg_repel_charges)
local location loc
if (cooldown > 0) then
call SaveIntegerBJ( cooldown-1, 0, GetHandleIdBJ(caster), udg_repel_cooldown )
else
set udg_per_unit = caster
set loc = GetUnitLoc(caster)
call ForGroupBJ( GetUnitsInRangeOfLocMatching(200, loc, Condition(function In_Unit_Group)), function periodic_collision_function )
call RemoveLocation(loc)
if (LoadIntegerBJ(0, GetHandleIdBJ(caster), udg_repel_cooldown) > 0) then
call explode_args(GetUnitX(caster), GetUnitY(caster), 400, GetOwningPlayer(caster), 0, 15 + (5 * lvl), 0, 0)
call DestroyEffect(AddSpecialEffect( "Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl", GetUnitX(caster), GetUnitY(caster)))
if (charges == 1) then
call GroupRemoveUnitSimple( caster, udg_repel_group )
else
call SaveIntegerBJ( charges-1, 0, GetHandleIdBJ(caster), udg_repel_charges )
endif
endif
endif
set loc = null
set caster = null
//Abilities\Spells\Human\Defend\DefendCaster.mdl
endfunction
function periodic_orbit_function takes nothing returns nothing
local unit orbiter = GetEnumUnit()
local unit center = LoadUnitHandleBJ( 0, GetHandleIdBJ(orbiter), udg_orb_center )
local real r = LoadRealBJ( 0, GetHandleIdBJ(orbiter), udg_orb_r )
local real dr = LoadRealBJ( 0, GetHandleIdBJ(orbiter), udg_orb_dr )
local real ddr = LoadRealBJ( 0, GetHandleIdBJ(orbiter), udg_orb_ddr )
local real a = LoadRealBJ( 0, GetHandleIdBJ(orbiter), udg_orb_a )
local real da = LoadRealBJ( 0, GetHandleIdBJ(orbiter), udg_orb_da )
local real dda = LoadRealBJ( 0, GetHandleIdBJ(orbiter), udg_orb_dda )
local location loc = GetUnitLoc(center)
local location loc1
set dr = dr * ddr
set r = r + dr
set da = da * dda
set a = a + da
set loc1 = PolarProjectionBJ(loc, r, a)
call SetUnitPositionLoc(orbiter, loc1)
call SetUnitFacing(orbiter, a + 90)
call SaveRealBJ( r, 0, GetHandleIdBJ(orbiter), udg_orb_r )
call SaveRealBJ( dr, 0, GetHandleIdBJ(orbiter), udg_orb_dr )
call SaveRealBJ( ddr, 0, GetHandleIdBJ(orbiter), udg_orb_ddr )
call SaveRealBJ( a, 0, GetHandleIdBJ(orbiter), udg_orb_a )
call SaveRealBJ( da, 0, GetHandleIdBJ(orbiter), udg_orb_da )
call SaveRealBJ( dda, 0, GetHandleIdBJ(orbiter), udg_orb_dda )
call RemoveLocation(loc)
call RemoveLocation(loc1)
set loc = null
set loc1 = null
set center = null
set orbiter = null
endfunction
function periodic_follow_function takes nothing returns nothing
local unit follower = GetEnumUnit()
local unit leader = LoadUnitHandleBJ( 0, GetHandleIdBJ(follower), udg_fol_leader )
local real dr = LoadRealBJ( 0, GetHandleIdBJ(follower), udg_fol_dr )
local real ddr = LoadRealBJ( 0, GetHandleIdBJ(follower), udg_fol_ddr )
local real a = LoadRealBJ( 0, GetHandleIdBJ(follower), udg_fol_a )
local real da = LoadRealBJ( 0, GetHandleIdBJ(follower), udg_fol_da )
local real dda = LoadRealBJ( 0, GetHandleIdBJ(follower), udg_fol_dda )
local location loc = GetUnitLoc(follower)
local location loc1 = GetUnitLoc(leader)
local location loc2
local boolean minus
local real angle
set angle = AngleBetweenPoints(loc, loc1)
if (angle > 180) then
set minus = (a > angle or a < angle - 180)
else
set minus = (a > angle and a < angle + 180)
endif
set dr = dr * ddr
set da = da * dda
if (minus) then
set a = a - da
set a = ModuloReal(a, 360)
if (a < angle) then
set a = angle
endif
else
set a = a + da
set a = ModuloReal(a, 360)
if (a > angle) then
set a = angle
endif
endif
set loc2 = PolarProjectionBJ(loc, dr, a)
call SetUnitPositionLoc(follower, loc2)
call SetUnitFacing(follower, a)
call SaveRealBJ( dr, 0, GetHandleIdBJ(follower), udg_fol_dr )
call SaveRealBJ( ddr, 0, GetHandleIdBJ(follower), udg_fol_ddr )
call SaveRealBJ( a, 0, GetHandleIdBJ(follower), udg_fol_a )
call SaveRealBJ( da, 0, GetHandleIdBJ(follower), udg_fol_da )
call SaveRealBJ( dda, 0, GetHandleIdBJ(follower), udg_fol_dda )
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc = null
set loc1 = null
set loc2 = null
set leader = null
set follower = null
endfunction
function periodic_bees_function takes nothing returns nothing
local unit caster = GetEnumUnit()
local integer lvl = GetPlayerTechCountSimple('R012', GetOwningPlayer(caster))
local integer wave = LoadIntegerBJ(0, GetHandleIdBJ(caster), udg_bees_count)
local integer i = 1
local unit ball
local location loc = GetUnitLoc(caster)
local real angle = GetUnitFacing(caster)
local location loc1 = PolarProjectionBJ(loc, 50.00, angle)
set wave = wave - i
loop
exitwhen (i == 0)
set i = i - 1
call CreateNUnitsAtLoc( 1, 'u00Y', GetOwningPlayer(caster), loc1, angle + GetRandomReal(-12, 12) )
set ball = GetLastCreatedUnit()
call PlaySoundOnUnitBJ( gg_snd_TinkerMissileLaunch1, 100, ball )
call UnitApplyTimedLifeBJ( 1, 'BTLF', ball )
call init_missile(ball, 1.05, 100, 25, 0, 0)
call SaveUnitHandleBJ(ball, wave + i, GetHandleIdBJ(caster), udg_bees)
endloop
if (wave <= 0) then
call GroupRemoveUnitSimple( caster, udg_bees_group )
endif
call SaveIntegerBJ(wave, 0, GetHandleIdBJ(caster), udg_bees_count)
call RemoveLocation(loc)
call RemoveLocation(loc1)
set loc = null
set loc1 = null
set ball = null
set caster = null
endfunction
function periodic takes nothing returns nothing
call ForGroupBJ( udg_missile_group, function periodic_missile_function )
call ForGroupBJ( udg_unit_group, function periodic_unit_function )
call ForGroupBJ( udg_hs_group, function periodic_hs_function )
call ForGroupBJ( udg_tet_group, function periodic_tet_function )
call ForGroupBJ( udg_repel_group, function periodic_repel_function )
call ForGroupBJ( udg_orbit_group, function periodic_orbit_function )
call ForGroupBJ( udg_follow_group, function periodic_follow_function )
if (ModuloInteger(udg_periodic, 2) == 0) then
call ForGroupBJ( udg_bees_group, function periodic_bees_function )
endif
set udg_periodic = udg_periodic + 1
if (udg_periodic == 12) then
set udg_periodic = 0
endif
endfunction
function physics takes nothing returns nothing
local timer t
set t = CreateTimer()
call TimerStart(t, 0.03, true, function periodic)
endfunction
function Trig_API_Actions takes nothing returns nothing
call physics()
endfunction
//===========================================================================
function InitTrig_Physics takes nothing returns nothing
set gg_trg_Physics = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Physics, 0.00 )
call TriggerAddAction( gg_trg_Physics, function Trig_API_Actions )
endfunction
function Trig_Unstuck_Actions takes nothing returns nothing
local unit u = udg_hero[GetConvertedPlayerId(GetTriggerPlayer())]
set udg_temp_force = GetForceOfPlayer(GetTriggerPlayer())
call DisplayTextToForce( udg_temp_force, "TRIGSTR_3572" )
call DestroyForce(udg_temp_force)
call PauseUnitBJ( true, u )
call TriggerSleepAction( 30.00 )
call PauseUnitBJ( false, u )
call ShowUnitShow( u )
set udg_temp_loc = GetRandomLocInRect(udg_res_region[GetRandomInt(1, udg_player_total)])
call SetUnitPositionLoc( u, udg_temp_loc )
call RemoveLocation(udg_temp_loc)
set u = null
endfunction
//===========================================================================
function InitTrig_Unstuck takes nothing returns nothing
set gg_trg_Unstuck = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(0), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(1), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(2), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(3), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(4), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(5), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(6), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(7), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(8), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(9), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(10), "-unstuck", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Unstuck, Player(11), "-unstuck", true )
call TriggerAddAction( gg_trg_Unstuck, function Trig_Unstuck_Actions )
endfunction
function Trig_Caltrops_Conditions takes nothing returns boolean
return (( GetSpellAbilityId() == 'A00M' ) or ( GetSpellAbilityId() == 'A01A' ))
endfunction
function Trig_Caltrops_Actions takes nothing returns nothing
local integer i = GetConvertedPlayerId(GetOwningPlayer(GetSpellAbilityUnit()))
local location loc
set loc = GetUnitLoc(udg_hero[i])
call CreateNUnitsAtLoc( 1, 'u004', ConvertedPlayer(i), loc, 0 )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "stasistrap", loc )
call RemoveLocation(loc)
call TriggerSleepAction( 1.50 )
set loc = GetUnitLoc(udg_hero[i])
call CreateNUnitsAtLoc( 1, 'u004', ConvertedPlayer(i), loc, 0 )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "stasistrap", loc )
call RemoveLocation(loc)
call TriggerSleepAction( 1.50 )
set loc = GetUnitLoc(udg_hero[i])
call CreateNUnitsAtLoc( 1, 'u004', ConvertedPlayer(i), loc, 0 )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "stasistrap", loc )
call RemoveLocation(loc)
endfunction
//===========================================================================
function InitTrig_Caltrops takes nothing returns nothing
set gg_trg_Caltrops = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Caltrops, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
call TriggerAddCondition( gg_trg_Caltrops, Condition( function Trig_Caltrops_Conditions ) )
call TriggerAddAction( gg_trg_Caltrops, function Trig_Caltrops_Actions )
endfunction
function Trig_Fireball_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A01N' or GetSpellAbilityId() == 'A01U')
endfunction
function Trig_Fireball_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit ball
local location loc = GetUnitLoc(caster)
local location loc1 = GetSpellTargetLoc()
local real angle = AngleBetweenPoints(loc, loc1)
local location loc2 = PolarProjectionBJ(loc, 50.00, angle)
call CreateNUnitsAtLoc( 1, 'u00W', GetOwningPlayer(caster), loc2, angle )
set ball = GetLastCreatedUnit()
call PlaySoundOnUnitBJ( gg_snd_RainOfFireTarget1, 100, ball )
call init_missile(ball, 1, 70, 25, 0, 0)
call TriggerSleepAction( 0.1375 * (7 + I2R(GetPlayerTechCountSimple('R010', GetOwningPlayer(caster)))) )
call cleanup_missile(ball)
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set caster = null
set ball = null
set loc = null
set loc1 = null
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Fireball takes nothing returns nothing
set gg_trg_Fireball = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fireball, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fireball, Condition( function Trig_Fireball_Conditions ) )
call TriggerAddAction( gg_trg_Fireball, function Trig_Fireball_Actions )
endfunction
function Trig_MagneticLink_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A01V' or GetSpellAbilityId() == 'A01W')
endfunction
function Trig_MagneticLink_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit hook
local location loc = GetUnitLoc(caster)
local location loc1 = GetSpellTargetLoc()
local real angle = AngleBetweenPoints(loc, loc1)
local location loc2 = PolarProjectionBJ(loc, 50.00, angle)
local lightning l = AddLightning ("CHIM", true, GetUnitX(caster), GetUnitY(caster), GetLocationX(loc2), GetLocationY(loc2))
// "CHIM" - lightning attack
// "FORK" - forked lightning
// "CLPB" - chain lightning primary
// "CLSB" - chain lightning secondary
call CreateNUnitsAtLoc( 1, 'u00X', GetOwningPlayer(caster), loc2, angle )
set hook = GetLastCreatedUnit()
call SaveUnitHandleBJ( hook, 0, GetHandleIdBJ(caster), udg_hs_hook )
call SaveLightningHandleBJ( l, 0, GetHandleIdBJ(caster), udg_hs_rope )
call SaveBooleanBJ( false, 0, GetHandleIdBJ(caster), udg_hs_back )
call SaveRealBJ( 0, 0, GetHandleIdBJ(caster), udg_hs_distance )
call GroupAddUnitSimple( caster, udg_hs_group )
call init_missile(hook, 1, 120, 60, 0, 0)
call TriggerSleepAction( 1 )
call SaveBooleanBJ( true, 0, GetHandleIdBJ(caster), udg_hs_back )
call cleanup_obj(hook)
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set hook = null
set caster = null
set loc = null
set loc1 = null
set loc2 = null
endfunction
//===========================================================================
function InitTrig_MagneticLink takes nothing returns nothing
set gg_trg_MagneticLink = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_MagneticLink, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_MagneticLink, Condition( function Trig_MagneticLink_Conditions ) )
call TriggerAddAction( gg_trg_MagneticLink, function Trig_MagneticLink_Actions )
endfunction
function Trig_Tetsubishi_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A011' or GetSpellAbilityId() == 'A012')
endfunction
function Trig_Tetsubishi_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit hook
local location loc = GetUnitLoc(caster)
local location loc1 = GetSpellTargetLoc()
local real angle = AngleBetweenPoints(loc, loc1)
local location loc2 = PolarProjectionBJ(loc, 50.00, angle)
local lightning l = AddLightning ("DRAM", true, GetUnitX(caster), GetUnitY(caster), GetLocationX(loc2), GetLocationY(loc2))
call CreateNUnitsAtLoc( 1, 'u003', GetOwningPlayer(caster), loc2, angle )
set hook = GetLastCreatedUnit()
call SaveUnitHandleBJ( hook, 0, GetHandleIdBJ(caster), udg_tet_hook )
call SaveLightningHandleBJ( l, 0, GetHandleIdBJ(caster), udg_tet_rope )
call SaveBooleanBJ( false, 0, GetHandleIdBJ(caster), udg_tet_back )
call GroupAddUnitSimple( caster, udg_tet_group )
call init_missile(hook, 1, 120, 45, 0, 0)
call TriggerSleepAction( 2 )
call cleanup_obj(hook)
call SaveBooleanBJ( true, 0, GetHandleIdBJ(caster), udg_tet_back )
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set hook = null
set caster = null
set loc = null
set loc1 = null
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Tetsubishi takes nothing returns nothing
set gg_trg_Tetsubishi = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tetsubishi, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Tetsubishi, Condition( function Trig_Tetsubishi_Conditions ) )
call TriggerAddAction( gg_trg_Tetsubishi, function Trig_Tetsubishi_Actions )
endfunction
function Trig_Repel_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A01X' or GetSpellAbilityId() == 'A01Y')
endfunction
function Trig_Repel_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local integer level = GetPlayerTechCountSimple('R016', GetOwningPlayer(caster))
local effect e = AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\Voodoo\\VoodooAura.mdl", caster, "origin" )
call GroupAddUnitSimple( caster, udg_repel_group )
call SaveIntegerBJ(2+level, 0, GetHandleIdBJ(caster), udg_repel_charges)
call SaveIntegerBJ(0, 0, GetHandleIdBJ(caster), udg_repel_cooldown)
call TriggerSleepAction( 10 )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_repel_charges )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_repel_cooldown )
call GroupRemoveUnitSimple( caster, udg_repel_group )
call DestroyEffect(e)
set e = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Repel takes nothing returns nothing
set gg_trg_Repel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Repel, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Repel, Condition( function Trig_Repel_Conditions ) )
call TriggerAddAction( gg_trg_Repel, function Trig_Repel_Actions )
endfunction
function Trig_NestOfBees_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A01Z' or GetSpellAbilityId() == 'A020')
endfunction
function Trig_NestOfBees_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local integer lvl = GetPlayerTechCountSimple('R012', GetOwningPlayer(caster))
local integer max = 5 * (lvl + 1)
local integer i = 0
call GroupAddUnitSimple( caster, udg_bees_group )
call SaveIntegerBJ(max, 0, GetHandleIdBJ(caster), udg_bees_count)
call TriggerSleepAction( 8 )
loop
exitwhen (i == max)
call cleanup_missile(LoadUnitHandleBJ(i, GetHandleIdBJ(caster), udg_bees))
set i = i + 1
endloop
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_bees )
call FlushChildHashtableBJ( GetHandleIdBJ(caster), udg_bees_count )
set caster = null
endfunction
//===========================================================================
function InitTrig_NestOfBees takes nothing returns nothing
set gg_trg_NestOfBees = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NestOfBees, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_NestOfBees, Condition( function Trig_NestOfBees_Conditions ) )
call TriggerAddAction( gg_trg_NestOfBees, function Trig_NestOfBees_Actions )
endfunction
function Trig_Leap_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A021' or GetSpellAbilityId() == 'A052')
endfunction
function Trig_Leap_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local real level = GetPlayerTechCountSimple('R013', GetOwningPlayer(caster))
//local location loc = GetUnitLoc(caster)
//local location loc1 = GetSpellTargetLoc()
//local real distance = DistanceBetweenPoints(loc, loc1)
//local real angle = AngleBetweenPoints(loc, loc1)
local effect e1 = AddSpecialEffectTarget( "Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl", caster, "foot, left" )
local effect e2 = AddSpecialEffectTarget( "Abilities\\Weapons\\AvengerMissile\\AvengerMissile.mdl", caster, "foot, right" )
//local effect e3 = AddSpecialEffectTarget( "Abilities\\Weapons\\Mortar\\MortarMissile.mdl", caster, "chest" )
//local effect e4 = AddSpecialEffectTarget( "Abilities\\Weapons\\Mortar\\MortarMissile.mdl", caster, "origin" )
//call SetUnitPositionLocFacingBJ( caster, loc, angle )
//call RemoveLocation(loc)
//call RemoveLocation(loc1)
call init_unit(caster, 0.93, 32, 12 + (level * 3), 0, 50)
//call PlaySoundOnUnitBJ( gg_snd_TinkerMissileLaunch1, 100, caster )
call TriggerSleepAction( 0.85 )
call explode_args(GetUnitX(caster), GetUnitY(caster), 300, GetOwningPlayer(caster), 75 + (level * 25), 20 + (level * 5), 0, 0)
call DestroyEffect(e1)
call DestroyEffect(e2)
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl", caster, "origin" ))
//call DestroyEffect(e3)
//call DestroyEffect(e4)
set e1 = null
set e2 = null
//set e3 = null
//set e4 = null
set caster = null
//set loc = null
//set loc1 = null
endfunction
//===========================================================================
function InitTrig_Leap takes nothing returns nothing
set gg_trg_Leap = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Leap, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Leap, Condition( function Trig_Leap_Conditions ) )
call TriggerAddAction( gg_trg_Leap, function Trig_Leap_Actions )
endfunction
function Trig_Buckshot_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A04E' or GetSpellAbilityId() == 'A04G')
endfunction
function Trig_Buckshot_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location loc = GetUnitLoc(caster)
local location loc1 = PolarProjectionBJ(loc, 100.00, GetUnitFacing(caster))
local real level = GetPlayerTechCountSimple('R014', GetOwningPlayer(caster))
call TriggerSleepAction( 0.15 )
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", GetLocationX(loc1), GetLocationY(loc1)))
call explode_args(GetLocationX(loc1), GetLocationY(loc1), 200, GetOwningPlayer(caster), 75 + (level * 25), 65 + (level * 5), 0, 0)
call RemoveLocation(loc1)
call RemoveLocation(loc)
set caster = null
set loc1 = null
set loc = null
endfunction
//===========================================================================
function InitTrig_Buckshot takes nothing returns nothing
set gg_trg_Buckshot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Buckshot, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Buckshot, Condition( function Trig_Buckshot_Conditions ) )
call TriggerAddAction( gg_trg_Buckshot, function Trig_Buckshot_Actions )
endfunction
function Trig_Tempest_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A04C' or GetSpellAbilityId() == 'A053')
endfunction
function Trig_Tempest_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit wave
local real level = GetPlayerTechCountSimple('R015', GetOwningPlayer(caster))
local location loc = GetUnitLoc(caster)
local location loc1 = GetSpellTargetLoc()
local real angle = AngleBetweenPoints(loc, loc1)
local location loc2 = PolarProjectionBJ(loc, 100.00, angle)
call CreateNUnitsAtLoc( 1, 'u00Z', GetOwningPlayer(caster), loc2, angle )
set wave = GetLastCreatedUnit()
call init_missile(wave, 0.93, 150, 70, 0, 0)
call TriggerSleepAction( 0.6 )
call cleanup_missile(wave)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Tornado\\Tornado_Target.mdl", GetUnitX(wave), GetUnitY(wave)))
call RemoveUnit(wave)
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set caster = null
set wave = null
set loc = null
set loc1 = null
set loc2 = null
endfunction
//===========================================================================
function InitTrig_Tempest takes nothing returns nothing
set gg_trg_Tempest = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tempest, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Tempest, Condition( function Trig_Tempest_Conditions ) )
call TriggerAddAction( gg_trg_Tempest, function Trig_Tempest_Actions )
endfunction
function Trig_Grenade_Conditions takes nothing returns boolean
return (GetSpellAbilityId() == 'A04F' or GetSpellAbilityId() == 'A050')
endfunction
function Trig_Grenade_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit grenade
local real level = GetPlayerTechCountSimple('R017', GetOwningPlayer(caster))
local location loc = GetUnitLoc(caster)
local location loc1 = GetSpellTargetLoc()
local real distance = DistanceBetweenPoints(loc, loc1)
local real angle = AngleBetweenPoints(loc, loc1)
local location loc2 = PolarProjectionBJ(loc, 100.00, angle)
call CreateNUnitsAtLoc( 1, 'u010', GetOwningPlayer(caster), loc2, angle )
set grenade = GetLastCreatedUnit()
call init_missile(grenade, 0.60, 1, distance/32, 30, 50)
call RemoveLocation(loc)
call RemoveLocation(loc1)
call RemoveLocation(loc2)
set loc = null
set loc1 = null
set loc2 = null
call TriggerSleepAction( 0.87 )
call init_missile(grenade, 0, 1, 0, 0, 0)
call SetUnitTimeScalePercent(grenade, 0.01)
call TriggerSleepAction( 3.5 - (level * 0.5) )
set loc1 = GetUnitLoc(grenade)
call explode_args(GetLocationX(loc1), GetLocationY(loc1), 300, GetOwningPlayer(caster), 150 + (level * 50), 50, 0, 0)
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl", GetLocationX(loc1), GetLocationY(loc1)))
call cleanup_missile(grenade)
call RemoveLocation(loc1)
set caster = null
set grenade = null
set loc1 = null
endfunction
//===========================================================================
function InitTrig_Grenade takes nothing returns nothing
set gg_trg_Grenade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Grenade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Grenade, Condition( function Trig_Grenade_Conditions ) )
call TriggerAddAction( gg_trg_Grenade, function Trig_Grenade_Actions )
endfunction
function Trig_Volley_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A003' )
endfunction
function Trig_Volley_Func takes nothing returns boolean
if ( not (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_scat_caster)) == true) ) then
return false
endif
if ( not (IsUnitAliveBJ(GetFilterUnit()) == true) ) then
return false
endif
if ( not (IsUnitType(GetFilterUnit(), UNIT_TYPE_ATTACKS_GROUND) == true) ) then
return false
endif
return true
endfunction
function Volley_Timer takes nothing returns nothing
local group ugroup = GetUnitsInRangeOfLocMatching(700.00, GetUnitLoc(udg_volley_caster), Condition(function Trig_Volley_Func))
local location loc = GetUnitLoc(udg_volley_caster)
call CreateNUnitsAtLoc( 1, 'u002', GetOwningPlayer(udg_volley_caster), loc, 0 )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", GroupPickRandomUnit(ugroup) )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call DestroyGroup(ugroup)
call RemoveLocation(loc)
endfunction
function Trig_Volley_Actions takes nothing returns nothing
local timer t
set udg_volley_caster = GetSpellAbilityUnit()
set t = CreateTimer()
call TimerStart(t,0.05,true,function Volley_Timer)
call TriggerSleepAction(2.00)
call DestroyTimer(t)
set t = null
endfunction
//===========================================================================
function InitTrig_Volley takes nothing returns nothing
set gg_trg_Volley = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Volley, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Volley, Condition( function Trig_Volley_Conditions ) )
call TriggerAddAction( gg_trg_Volley, function Trig_Volley_Actions )
endfunction
function Trig_Untitled_Trigger_001_Func006A takes nothing returns nothing
local location loc = GetUnitLoc(udg_scat_bullet)
call UnitDamageTargetBJ( udg_scat_caster, GetEnumUnit(), 300.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call AddSpecialEffectLocBJ( loc, "Abilities\\Weapons\\FragDriller\\FragDriller.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveUnit(udg_scat_bullet)
if (udg_scat_has_exploded == false) then
set udg_scat_has_exploded = true
set udg_scat_distance = udg_scat_distance_limit + 1
else
endif
call RemoveLocation(loc)
endfunction
function Trig_Scattershot_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A00H' )
endfunction
function Trig_Scattershot_Func takes nothing returns boolean
if ( not (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_scat_caster)) == true) ) then
return false
endif
if ( not (IsUnitAliveBJ(GetFilterUnit()) == true) ) then
return false
endif
if ( not (IsUnitType(GetFilterUnit(), UNIT_TYPE_ATTACKS_GROUND) == true) ) then
return false
endif
return true
endfunction
function Scattershot_Periodic takes nothing returns nothing
local integer i
local location loc
local location locs
local group ugroup
set i = 0
if (udg_scat_has_exploded) then
loop
exitwhen (i > 4)
set loc = GetUnitLoc(udg_scat_bullets[i])
set locs = PolarProjectionBJ(loc, udg_scat_speed, udg_scat_angle + 5.00 * (I2R(i)-2.00))
set udg_scat_bullet = udg_scat_bullets[i]
set ugroup = GetUnitsInRangeOfLocMatching(120.00, locs, Condition(function Trig_Scattershot_Func))
call SetUnitPositionLoc( udg_scat_bullets[i], locs )
call ForGroupBJ( ugroup, function Trig_Untitled_Trigger_001_Func006A )
call DestroyGroup(ugroup)
call RemoveLocation(locs)
call RemoveLocation(loc)
set i = i + 1
endloop
else
set loc = GetUnitLoc(udg_scat_bullet)
set locs = PolarProjectionBJ(loc, udg_scat_speed, udg_scat_angle)
set ugroup = GetUnitsInRangeOfLocMatching(120.00, locs, Condition(function Trig_Scattershot_Func))
call SetUnitPositionLoc( udg_scat_bullet, locs )
call ForGroupBJ( ugroup, function Trig_Untitled_Trigger_001_Func006A )
call DestroyGroup(ugroup)
call RemoveLocation(locs)
call RemoveLocation(loc)
endif
set udg_scat_distance = udg_scat_distance + udg_scat_speed
endfunction
function Trig_Scattershot_Actions takes nothing returns nothing
local timer t
local integer i
local location loc
set udg_scat_has_exploded = false
set udg_scat_distance = 0
set udg_scat_caster = GetSpellAbilityUnit()
set udg_scat_angle = GetUnitFacing(udg_scat_caster)
set loc = GetUnitLoc(udg_scat_caster)
call CreateNUnitsAtLoc( 1, 'u00A', GetOwningPlayer(udg_scat_caster), loc, udg_scat_angle )
call RemoveLocation(loc)
set udg_scat_bullet = GetLastCreatedUnit()
set t = CreateTimer()
call TimerStart(t,0.02,true,function Scattershot_Periodic)
loop
exitwhen udg_scat_has_exploded
call TriggerSleepAction(0.01)
if (udg_scat_distance > udg_scat_distance_explode) then
set udg_scat_has_exploded = true
else
endif
endloop
set loc = GetUnitLoc(udg_scat_bullet)
call AddSpecialEffectLocBJ( loc, "Abilities\\Weapons\\GyroCopter\\GyroCopterImpact.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set i = 0
loop
exitwhen (i > 4)
call CreateNUnitsAtLoc( 1, 'u00A', GetOwningPlayer(udg_scat_bullet), loc, udg_scat_angle )
set udg_scat_bullets[i] = GetLastCreatedUnit()
set i = i + 1
endloop
call RemoveLocation(loc)
call RemoveUnit( udg_scat_bullet )
loop
exitwhen (udg_scat_distance > udg_scat_distance_limit)
call TriggerSleepAction(0.01)
endloop
set i = 0
loop
exitwhen (i > 4)
call RemoveUnit( udg_scat_bullets[i] )
set udg_scat_bullets[i] = null
set i = i + 1
endloop
set udg_scat_bullet = null
call DestroyTimer(t)
set t = null
endfunction
//===========================================================================
function InitTrig_Scattershot takes nothing returns nothing
set gg_trg_Scattershot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Scattershot, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Scattershot, Condition( function Trig_Scattershot_Conditions ) )
call TriggerAddAction( gg_trg_Scattershot, function Trig_Scattershot_Actions )
endfunction
function Trig_Bladestorm_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A02A'
endfunction
function Trig_Bladestorm_Actions takes nothing returns nothing
local unit caster
local location loc
local effect e
set caster = GetSpellAbilityUnit()
call AddSpecialEffectTargetUnitBJ( "weapon", GetTriggerUnit(), "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set e = GetLastCreatedEffectBJ()
call UnitAddAbilityBJ( 'Amrf', caster )
call SetUnitFlyHeightBJ( caster, 600.00, 100.00 )
call UnitRemoveAbilityBJ( 'Amrf', caster )
call SetUnitPathing( caster, false )
call TriggerSleepAction( 3.00 )
call SetUnitAnimation( caster, "attack slam" )
call SetUnitFlyHeightBJ( caster, 0.00, 1200.00 )
call SetUnitPathing( caster, true )
call TriggerSleepAction( 0.35 )
set loc = GetUnitLoc(caster)
call CreateNUnitsAtLoc( 1, 'u00J', GetOwningPlayer(caster), loc, 0.00 )
call UnitAddAbilityBJ( 'A04Y', GetLastCreatedUnit() )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "thunderclap" )
call AddSpecialEffectLocBJ( loc, "Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call DestroyEffectBJ( e )
call RemoveLocation(loc)
set e = null
set caster = null
endfunction
//===========================================================================
function InitTrig_Bladestrike takes nothing returns nothing
set gg_trg_Bladestrike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bladestrike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Bladestrike, Condition( function Trig_Bladestorm_Conditions ) )
call TriggerAddAction( gg_trg_Bladestrike, function Trig_Bladestorm_Actions )
endfunction
function Trig_Cloudburst_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A038' ) ) then
return false
endif
return true
endfunction
function Trig_Cloudburst_Func007001003001001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_cloudburst_caster)) == true )
endfunction
function Trig_Cloudburst_Func007001003001002 takes nothing returns boolean
return ( GetUnitAbilityLevelSwapped('Avul', GetFilterUnit()) != 1 )
endfunction
function Trig_Cloudburst_Func007001003001 takes nothing returns boolean
return GetBooleanAnd( Trig_Cloudburst_Func007001003001001(), Trig_Cloudburst_Func007001003001002() )
endfunction
function Trig_Cloudburst_Func007001003002 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Cloudburst_Func007001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Cloudburst_Func007001003001(), Trig_Cloudburst_Func007001003002() )
endfunction
function Trig_Cloudburst_Func007002 takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cloudburst_targets )
endfunction
function Trig_Cloudburst_Func008A takes nothing returns nothing
call IssueTargetOrderBJ( GetEnumUnit(), "thunderbolt", GroupPickRandomUnit(udg_cloudburst_targets) )
endfunction
function Trig_Cloudburst_Actions takes nothing returns nothing
set udg_cloudburst_caster = GetSpellAbilityUnit()
set udg_cloudburst_point = GetSpellTargetLoc()
call GroupClear( udg_cloudburst_clouds )
call GroupClear( udg_cloudburst_targets )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 20
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call CreateNUnitsAtLoc( 1, 'u00I', GetOwningPlayer(udg_cloudburst_caster), PolarProjectionBJ(udg_cloudburst_point, GetRandomReal(200.00, 600.00), GetRandomDirectionDeg()), GetRandomDirectionDeg() )
call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_cloudburst_clouds )
call AddSpecialEffectLocBJ( GetUnitLoc(GetLastCreatedUnit()), "Abilities\\Spells\\Human\\FlameStrike\\FlameStrikeTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 1.50 )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(600.00, udg_cloudburst_point, Condition(function Trig_Cloudburst_Func007001003)), function Trig_Cloudburst_Func007002 )
call ForGroupBJ( udg_cloudburst_clouds, function Trig_Cloudburst_Func008A )
endfunction
//===========================================================================
function InitTrig_Cloudburst takes nothing returns nothing
set gg_trg_Cloudburst = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cloudburst, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cloudburst, Condition( function Trig_Cloudburst_Conditions ) )
call TriggerAddAction( gg_trg_Cloudburst, function Trig_Cloudburst_Actions )
endfunction
function Trig_Overtake_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03A' ) ) then
return false
endif
return true
endfunction
function Trig_Overtake_Actions takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location orig = GetUnitLoc(caster)
local location dest = GetSpellTargetLoc()
call TriggerSleepAction( 0.00 )
call SetUnitPositionLoc( caster, dest )
call CreateNUnitsAtLoc( 1, 'u00K', GetOwningPlayer(caster), dest, 0.00 )
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call TriggerSleepAction( 4.00 )
call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitPositionLoc( caster, orig )
call AddSpecialEffectTargetUnitBJ( "origin", caster, "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call RemoveLocation(orig)
call RemoveLocation(dest)
set caster = null
endfunction
//===========================================================================
function InitTrig_Flicker takes nothing returns nothing
set gg_trg_Flicker = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flicker, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flicker, Condition( function Trig_Overtake_Conditions ) )
call TriggerAddAction( gg_trg_Flicker, function Trig_Overtake_Actions )
endfunction
function Trig_Diabolic_Net_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A043'
endfunction
function Trig_Diabolic_Match takes nothing returns boolean
if ( not (IsUnitAliveBJ(GetFilterUnit()) == true) ) then
return false
endif
if ( not (IsUnitType(GetFilterUnit(), UNIT_TYPE_ATTACKS_GROUND) == true) ) then
return false
endif
return true
endfunction
function Trig_Diabolic_Net_Actions takes nothing returns nothing
local unit cast = GetTriggerUnit()
local unit dumb
local unit u
local location loc = GetSpellTargetLoc()
local location loca
local group g = GetUnitsInRangeOfLocMatching(500.00, loc, Condition(function Trig_Diabolic_Match))
local group g1 = GetUnitsInRangeOfLocMatching(500.00, loc, Condition(function Trig_Diabolic_Match))
local group g2 = GetUnitsInRangeOfLocMatching(500.00, loc, Condition(function Trig_Diabolic_Match))
local group g3 = GetUnitsInRangeOfLocMatching(500.00, loc, Condition(function Trig_Diabolic_Match))
call GroupAddUnitSimple( cast, g )
loop
set u = FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
set dumb = CreateUnitAtLoc(GetOwningPlayer(cast), 'u00N', loc, 0.00)
call IssueTargetOrderBJ(dumb, "spiritlink", u)
call UnitApplyTimedLifeBJ (1.50, 'BTLF', dumb)
set dumb = null
endloop
call DestroyGroup(g)
call TriggerSleepAction( 2.00 )
call AddSpecialEffectTargetUnitBJ( "origin", cast, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
loop
set u = FirstOfGroup(g1)
exitwhen u==null
set loca = GetUnitLoc(cast)
call GroupRemoveUnit(g1,u)
call SetUnitPositionLoc( u, loca )
if ( IsUnitEnemy(u, GetOwningPlayer(cast))==true ) then
call UnitDamageTargetBJ( cast, u, 80.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
call RemoveLocation(loca)
endloop
call DestroyGroup(g1)
call TriggerSleepAction( 2.00 )
call AddSpecialEffectTargetUnitBJ( "origin", cast, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
loop
set u = FirstOfGroup(g2)
exitwhen u==null
set loca = GetUnitLoc(cast)
call GroupRemoveUnit(g2,u)
call SetUnitPositionLoc( u, loca )
if ( IsUnitEnemy(u, GetOwningPlayer(cast))==true ) then
call UnitDamageTargetBJ( cast, u, 100.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
call RemoveLocation(loca)
endloop
call DestroyGroup(g2)
call TriggerSleepAction( 2.00 )
call AddSpecialEffectTargetUnitBJ( "origin", cast, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
loop
set u = FirstOfGroup(g3)
exitwhen u==null
set loca = GetUnitLoc(cast)
call GroupRemoveUnit(g3,u)
call SetUnitPositionLoc( u, loca )
if ( IsUnitEnemy(u, GetOwningPlayer(cast))==true ) then
call UnitDamageTargetBJ( cast, u, 120.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
endif
call RemoveLocation(loca)
endloop
call DestroyGroup(g3)
call RemoveLocation(loc)
set g = null
set g1 = null
set g2 = null
set g3 = null
set u = null
set cast = null
set loc = null
set loca = null
endfunction
//===========================================================================
function InitTrig_Diabolic_Leash takes nothing returns nothing
set gg_trg_Diabolic_Leash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Diabolic_Leash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Diabolic_Leash, Condition( function Trig_Diabolic_Net_Conditions ) )
call TriggerAddAction( gg_trg_Diabolic_Leash, function Trig_Diabolic_Net_Actions )
endfunction
function Fracture_Periodic takes nothing returns nothing
local integer i
local location loc
local location locs
set i = 0
loop
exitwhen (i >= udg_fracture_max)
set loc = GetUnitLoc(udg_fracture_units[i])
set locs = PolarProjectionBJ(loc, udg_fracture_speed[i], udg_fracture_angle)
call SetUnitPositionLoc(udg_fracture_units[i], locs)
call RemoveLocation(locs)
call RemoveLocation(loc)
set i = i + 1
endloop
endfunction
function Trig_Fracture_Actions takes nothing returns nothing
local timer t
local integer i
set t = CreateTimer()
call TimerStart(t,0.03,true,function Fracture_Periodic)
call TriggerSleepAction(1.2)
call DestroyTimer(t)
set i = 0
loop
exitwhen (i >= udg_fracture_max)
call SetUnitPathing( udg_fracture_units[i], true )
set udg_fracture_units[i] = null
set udg_fracture_speed[i] = 0
set i = i + 1
endloop
set udg_fracture_max = 0
set t = null
endfunction
//===========================================================================
function InitTrig_Fracture takes nothing returns nothing
set gg_trg_Fracture = CreateTrigger( )
call TriggerAddAction( gg_trg_Fracture, function Trig_Fracture_Actions )
endfunction
function Trig_Air_Strike_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A04U'
endfunction
function Trig_Air_Strike_Actions takes nothing returns nothing
local unit caster
local unit array planes
local location caster_loc
local location center
local location loc
local location loc1
local integer i
local integer j
local real angle
set caster = GetSpellAbilityUnit()
set caster_loc = GetUnitLoc(caster)
set center = GetSpellTargetLoc()
set i = 0
set angle = AngleBetweenPoints(caster_loc, center)
set loc = PolarProjectionBJ(center, -700, angle)
call TriggerSleepAction( 2 )
loop
exitwhen (i > 4)
set loc1 = PolarProjectionBJ(loc, 150 * I2R(i - 2), angle + 90)
call CreateNUnitsAtLoc( 1, 'h009', GetOwningPlayer(caster), loc1, angle )
set planes[i] = GetLastCreatedUnit()
call UnitApplyTimedLifeBJ( 25, 'BTLF', planes[i] )
call RemoveLocation(loc1)
set i = i + 1
endloop
set i = 2
set loc = GetUnitLoc(planes[i])
set loc1 = PolarProjectionBJ(loc, 1400, angle)
call IssuePointOrderLocBJ( planes[i], "patrol", loc1 )
call RemoveLocation(loc1)
call RemoveLocation(loc)
call SetUnitFlyHeightBJ( planes[i], 300.00, 1000.00 )
call TriggerSleepAction( 0.01 )
set i = 1
set loc = GetUnitLoc(planes[i])
set loc1 = PolarProjectionBJ(loc, 1400, angle)
call IssuePointOrderLocBJ( planes[i], "patrol", loc1 )
call RemoveLocation(loc1)
call RemoveLocation(loc)
call SetUnitFlyHeightBJ( planes[i], 300.00, 1000.00 )
set i = 3
set loc = GetUnitLoc(planes[i])
set loc1 = PolarProjectionBJ(loc, 1400, angle)
call IssuePointOrderLocBJ( planes[i], "patrol", loc1 )
call RemoveLocation(loc1)
call RemoveLocation(loc)
call SetUnitFlyHeightBJ( planes[i], 300.00, 1000.00 )
call TriggerSleepAction( 0.01 )
set i = 0
set loc = GetUnitLoc(planes[i])
set loc1 = PolarProjectionBJ(loc, 1400, angle)
call IssuePointOrderLocBJ( planes[i], "patrol", loc1 )
call RemoveLocation(loc1)
call RemoveLocation(loc)
call SetUnitFlyHeightBJ( planes[i], 300.00, 1000.00 )
set i = 4
set loc = GetUnitLoc(planes[i])
set loc1 = PolarProjectionBJ(loc, 1400, angle)
call IssuePointOrderLocBJ( planes[i], "patrol", loc1 )
call RemoveLocation(loc1)
call RemoveLocation(loc)
call SetUnitFlyHeightBJ( planes[i], 300.00, 1000.00 )
set i = 0
loop
exitwhen (i > 30)
set j = 0
loop
exitwhen (j > 4)
set loc = GetUnitLoc(planes[j])
set loc1 = PolarProjectionBJ(loc, 300, GetUnitFacing(planes[j]))
call CreateNUnitsAtLoc( 1, 'h00A', GetOwningPlayer(caster), loc, GetUnitFacing(planes[j]) )
call UnitApplyTimedLifeBJ( 1, 'BTLF', GetLastCreatedUnit() )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "attackground", loc1 )
call UnitDamagePointLoc( caster, 1, 250, loc1, 15, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call RemoveLocation(loc1)
call RemoveLocation(loc)
set j = j + 1
endloop
call TriggerSleepAction( 0.01 )
set i = i + 1
endloop
set i = 0
loop
exitwhen (i > 4)
call SetUnitFlyHeightBJ( planes[i], 1000.00, 1000.00 )
set i = i + 1
endloop
call TriggerSleepAction( 1 )
// clean up
call RemoveLocation(caster_loc)
call RemoveLocation(center)
call RemoveLocation(loc)
call RemoveLocation(loc1)
set caster = null
set i = 0
loop
exitwhen (i > 4)
call RemoveUnit(planes[i])
set planes[i] = null
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Air_Strike takes nothing returns nothing
set gg_trg_Air_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Air_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Air_Strike, Condition( function Trig_Air_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Air_Strike, function Trig_Air_Strike_Actions )
endfunction
function Trig_Unit_Dies_Actions takes nothing returns nothing
local unit u = GetDyingUnit()
call TriggerSleepAction( 2 )
call GroupRemoveUnitSimple( u, udg_unit_group )
set u = null
endfunction
//===========================================================================
function InitTrig_Unit_Dies takes nothing returns nothing
set gg_trg_Unit_Dies = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Unit_Dies, Player(PLAYER_NEUTRAL_AGGRESSIVE), EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Unit_Dies, function Trig_Unit_Dies_Actions )
endfunction