//TESH.scrollpos=55
//TESH.alwaysfold=0
//////////////////////////////////////////////////////////////////////////////////
// Configurable globals
//////////////////////////////////////////////////////////////////////////////////
function InitGlobalVariables takes nothing returns nothing
// Put here the correct ability IDs
set udg_PDD_DAMAGE_TYPE_DETECTOR = 'A06L'
set udg_PDD_SET_MAX_LIFE = 'A06M'
// Here you can configure some stuff, read the documentation for further info
set udg_PDD_SPELL_DMG_REDUCTION_ITEM = 'I00R'
set udg_PDD_SPELL_RESIST_AUTO_DETECT = false
set udg_PDD_ETHEREAL_DAMAGE_FACTOR = 1.5
set udg_PDD_BRACERS_SPELL_DMG_RED = 0.3
set udg_PDD_TRIGGER_CLEANUP_PERIOD = 60.0
endfunction
//////////////////////////////////////////////////////////////////////////////////
// End of configurable globals
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
// User functions
//////////////////////////////////////////////////////////////////////////////////
function AddDamageHandler takes code func returns nothing
local integer id = GetHandleId(Condition(func))
local integer index = 0
// Loop to manage equal damage handlers
loop
exitwhen ( LoadTriggerConditionHandle(udg_PDD_h, id, index) == null )
set index = index + 1
endloop
// Store the desired damage handler function
call SaveTriggerConditionHandle(udg_PDD_h, id, index, TriggerAddCondition(udg_PDD_damageHandler, Filter(func)))
endfunction
function RemoveDamageHandler takes code func returns nothing
local integer id = GetHandleId(Condition(func))
local integer index = 0
// Loop through all equal damage handlers
loop
exitwhen ( LoadTriggerConditionHandle(udg_PDD_h, id, index) == null )
call TriggerRemoveCondition(udg_PDD_damageHandler, LoadTriggerConditionHandle(udg_PDD_h, id, index))
set index = index + 1
endloop
// Clean things up
call FlushChildHashtable(udg_PDD_h, id)
endfunction
function GetUnitLife takes unit u returns real
local boolean duringModification
local integer uId = GetHandleId(u)
local real health
local real storedHealth = LoadReal(udg_PDD_h, uId, 2)
local real storedDamage = LoadReal(udg_PDD_h, uId, 1)
// Check if the unit is being rescued from damage
set duringModification = GetUnitAbilityLevel(u, udg_PDD_SET_MAX_LIFE) > 0
if duringModification then
call UnitRemoveAbility(u, udg_PDD_SET_MAX_LIFE)
endif
// Get the correct health value of the unit
if storedHealth != 0.0 then
set health = storedHealth - storedDamage
else
set health = GetWidgetLife(u) - storedDamage
endif
// Restore the rescue ability and return
if duringModification then
call UnitAddAbility(u, udg_PDD_SET_MAX_LIFE)
endif
return health
endfunction
function GetUnitMaxLife takes unit u returns real
local real maxHealth
// Check if the unit is being rescued from damage
if GetUnitAbilityLevel(u, udg_PDD_SET_MAX_LIFE) > 0 then
call UnitRemoveAbility(u, udg_PDD_SET_MAX_LIFE)
set maxHealth = GetUnitState(u, UNIT_STATE_MAX_LIFE)
call UnitAddAbility(u, udg_PDD_SET_MAX_LIFE)
return maxHealth
endif
// If the unit isn't being rescued, use the standard native
return GetUnitState(u, UNIT_STATE_MAX_LIFE)
endfunction
function GetUnitPercentLife takes unit u returns real
local real value = GetUnitLife(u)
local real maxValue = GetUnitMaxLife(u)
// Return 0 for null units.
if (u == null) or (maxValue == 0) then
return 0.0
endif
return value / maxValue * 100.0
endfunction
function SetUnitLife takes unit u, real newLife returns nothing
local integer targetId
local integer oldTimerId
local real oldHealth
// Check if the unit is being rescued from damage
if GetUnitAbilityLevel(u, udg_PDD_SET_MAX_LIFE) > 0 then
call UnitRemoveAbility(u, udg_PDD_SET_MAX_LIFE)
call SetWidgetLife(u, newLife)
call UnitAddAbility(u, udg_PDD_SET_MAX_LIFE)
// Get the unit specific timer information
set targetId = GetHandleId(u)
set oldHealth = LoadReal(udg_PDD_h, targetId, 0)
// Update the unit specific timer information
if oldHealth != 0.0 then
set oldTimerId = LoadInteger(udg_PDD_h, targetId, 3)
call SaveReal(udg_PDD_h, targetId, 2, newLife)
call SaveReal(udg_PDD_h, targetId, 0, newLife)
call SaveReal(udg_PDD_h, oldTimerId, 4, newLife)
endif
return
endif
// If the unit isn't being rescued, use the standard native
call SetWidgetLife(u, newLife)
endfunction
function SetUnitPercentLife takes unit u, real r returns nothing
local real rmax
if r > 0 then
set rmax = r
else
set rmax = 0
endif
call SetUnitLife(u, GetUnitMaxLife(u) * rmax * 0.01)
endfunction
function UnitDamageTargetEx takes unit localSource, unit localTarget, real localAmount, boolean attack, boolean ranged, attacktype localAttackType, damagetype localDamageType, weapontype localWeaponType returns boolean
// Avoid infinite loop due to recursion
if udg_PDD_damageType == udg_PDD_CODE then
return false
endif
// Avoid allocating attacks on units that are about to be killed
if ( localTarget == udg_PDD_target and GetUnitLife(localTarget) - udg_PDD_amount < udg_PDD_UNIT_MIN_LIFE ) then
return false
endif
// Store all damage parameters determined by the user
set udg_PDD_allocatedAttacks = udg_PDD_allocatedAttacks + 1
call SaveUnitHandle(udg_PDD_h, udg_PDD_allocatedAttacks, 0, localSource)
call SaveUnitHandle(udg_PDD_h, udg_PDD_allocatedAttacks, 1, localTarget)
call SaveReal(udg_PDD_h, udg_PDD_allocatedAttacks, 2, localAmount)
call SaveBoolean(udg_PDD_h, udg_PDD_allocatedAttacks, 3, attack)
call SaveBoolean(udg_PDD_h, udg_PDD_allocatedAttacks, 4, ranged)
call SaveInteger(udg_PDD_h, udg_PDD_allocatedAttacks, 5, GetHandleId(localAttackType))
call SaveInteger(udg_PDD_h, udg_PDD_allocatedAttacks, 6, GetHandleId(localDamageType))
call SaveInteger(udg_PDD_h, udg_PDD_allocatedAttacks, 7, GetHandleId(localWeaponType))
// Return true if the damage was allocated
return true
endfunction
//// ui by emiki
function UnitDamageTargetPDD takes unit source, unit target, real amount, integer DT returns nothing
if DT == 1 then
//returns physical damage
call UnitDamageTargetEx ( source, target, amount, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, null )
elseif DT == 2 then
//returns magical damage
call UnitDamageTargetEx ( source, target, amount, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, null )
else
// 0 returns true damage
// why is it halved?
call UnitDamageTargetEx ( source, target, amount, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL, null )
endif
endfunction
//// emiki end
////////////////////////////
// Some globals
/////////////////////////////
function FadingText takes string msg, unit c, real size, real red, real green, real blue, real trans returns nothing
local texttag t
call CreateTextTagUnitBJ( msg, c, 0, size, red, green, blue, 0)
set t = GetLastCreatedTextTag()
call SetTextTagVelocityBJ( t, 64, 90 )
call SetTextTagFadepoint( t, 1.00 )
call SetTextTagLifespan( t, 5.00 )
call SetTextTagPermanent( t, false )
endfunction
function Daytime takes nothing returns boolean
// returns true if it is daytime
return ((GetFloatGameState(GAME_STATE_TIME_OF_DAY) >= 6.00) and ( GetFloatGameState(GAME_STATE_TIME_OF_DAY) < 18.00 ))
endfunction
function GetUnitMissingMana takes unit u returns real
// returns missing mana
return GetUnitState(u, UNIT_STATE_MAX_MANA) - GetUnitState(u, UNIT_STATE_MANA)
endfunction
function GetUnitMaxMana takes unit u returns integer
// returns max mana as integer
return R2I(GetUnitState(u, UNIT_STATE_MAX_MANA))
endfunction
function GetUnitMissingLife takes unit u returns real
// returns missing life
return GetUnitMaxLife(u) - GetUnitLife(u)
endfunction
function GetUnitMissingPercentLife takes unit u returns real
local real missinglife = GetUnitMaxLife(u) - GetUnitLife(u)
// returns a value from 0 to 100
return missinglife/GetUnitMaxLife(u)* 100
endfunction
function GetUnitMissingPercentMana takes unit u returns real
local real missingmana = GetUnitState(u, UNIT_STATE_MAX_MANA) - GetUnitState(u, UNIT_STATE_MANA)
// returns a value from 0 to 100
return missingmana/GetUnitState(u, UNIT_STATE_MAX_MANA)* 100
endfunction
function IsTarget takes nothing returns boolean
// target is alive and not a structure
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false
local boolean b = GetUnitLife(GetFilterUnit()) > 0
return (a and b)
endfunction
function GetHeroBonusInt takes unit hero returns integer
return (GetHeroInt(hero,true) - GetHeroInt(hero, false))
endfunction
function PayForItem takes player p, integer gold returns nothing
call AdjustPlayerStateBJ( -gold, p, PLAYER_STATE_RESOURCE_GOLD )
endfunction
function DummyCastPoint takes unit caster, location casterloc, location targetloc, integer abilcode, integer i, string order returns nothing
local location pc = casterloc
local location pu = targetloc
local unit c = caster
local unit d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01S', pc , bj_UNIT_FACING )
call UnitAddAbility(d, abilcode)
call SetUnitAbilityLevel( d, abilcode, i )
call IssuePointOrderLoc( d, order, pu )
set c = null
set d = null
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
/////////////////////////////
// Hero Ability Functions //
/////////////////////////////
function Backstab takes unit caster, unit target returns boolean
//i think only alif uses this
local location pc = GetUnitLoc(caster)
local location pu = GetUnitLoc(target)
local real r = AngleBetweenPoints(pc,pu)
//local boolean a = GetUnitAbilityLevel(target, 'B023') > 0
local boolean b = (RAbsBJ(r - GetUnitFacing(target)) < 75)
call RemoveLocation (pc)
call RemoveLocation (pu)
return b
endfunction
function UnitFloral takes unit c, unit u, integer inc returns nothing
local unit d
local location p = GetUnitLoc(u)
local integer i = GetUnitAbilityLevel(u, 'A08R')
if i == 0 then
call UnitAddAbility(u, 'A08R')
endif
if GetUnitAbilityLevel(u, 'B02R') == 0 then
call SetUnitAbilityLevel(u, 'A08R', 1)
set i = 0
endif
set i = i + inc
if i > 100 then
set i = 100
endif
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01K', p, bj_UNIT_FACING )
call UnitAddAbility(d, 'A08N')
call SetUnitAbilityLevel( d, 'A08N', i)
call SetUnitAbilityLevel( u, 'A08R', i)
call IssueTargetOrder( d, "acidbomb", u )
set d = null
call RemoveLocation (p)
endfunction
function HexDO takes unit c, unit u returns nothing
local unit d
local location p = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A08S')
call SetUnitAbilityLevel(d, 'A08S', GetHeroLevel(c))
call IssueTargetOrder( d, "soulburn", u )
set d = null
call RemoveLocation (p)
endfunction
function IsCharge takes nothing returns boolean
local boolean a = GetUnitTypeId(GetFilterUnit()) == 'h021'
return (a)
endfunction
function UnitCharge takes unit c, integer inc returns nothing
local unit d
local unit s
local real dur = 10.0 + 0.56 * GetHeroLevel(c)
local location p = GetUnitLoc(c)
local integer i = 1
loop
exitwhen i > inc
set s = CreateUnitAtLoc(GetOwningPlayer(c), 'h021', p,0)
set udg_EM_stacks = udg_EM_stacks + 1
call SetUnitLife(s, dur)
set i = i + 1
endloop
//call DisplayTextToForce( GetPlayersAll(), I2S(udg_EM_stacks) )
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility(d, 'A064')
call SetUnitAbilityLevel( d, 'A064', udg_EM_stacks)
call IssueTargetOrder( d, "innerfire", c )
set d = null
call RemoveLocation (p)
endfunction
function Moonbeam takes unit c, location p, real amp returns nothing
local unit d
local location pc = GetUnitLoc(c)
local integer ult = GetUnitAbilityLevel(c, 'B01S') * (12 + 12*GetUnitAbilityLevel(c, 'A086'))
local integer i = R2I((1.2 * GetHeroAgi(c, true) + 2.1 * GetHeroInt(c, true) + ult) * amp)
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01Y', pc, bj_UNIT_FACING )
call UnitAddAbility( d, 'A084')
call SetUnitUserData( d, i )
call IssuePointOrderLoc( d, "carrionswarm", p )
//call DisplayTextToForce( GetPlayersAll(), I2S(i) )
set d = null
call RemoveLocation (pc)
endfunction
function CrimsonStat takes unit c returns real
local integer str = GetHeroStr(c,true)
local integer int = GetHeroInt(c,true)
local real r = str * 0.8 + int * 1.2
return r
endfunction
function ForkTarget takes unit c, unit u, integer v returns nothing
local unit d
local location pc = GetUnitLoc(c)
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01Y', pc, bj_UNIT_FACING )
call UnitAddAbility( d, 'A09G')
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "forkedlightning", u )
set d = null
call RemoveLocation (pc)
endfunction
Name | Type | is_array | initial_value |
Aaron | unit | No | |
Abilities1 | abilcode | Yes | |
Abilities2 | abilcode | Yes | |
Abilities3 | abilcode | Yes | |
Abilities4 | abilcode | Yes | |
Abilities5 | abilcode | Yes | |
AF_caster | unit | No | |
AF_point1 | location | No | |
AF_point2 | location | No | |
AH_caster | unit | No | |
AH_duration | real | No | |
AH_point | location | No | |
AH_timer | timer | No | |
AI_Actionfire | real | No | |
AI_advantage | real | Yes | |
AI_allyint | integer | Yes | |
AI_allyug | group | Yes | |
AI_Controller | force | No | |
AI_count | integer | No | |
AI_enemyint | integer | Yes | |
AI_enemyug | group | Yes | |
AI_farmdest | location | Yes | |
AI_farmint | integer | Yes | |
AI_farmug | group | Yes | |
AI_FightState | group | No | |
AI_FightTarget | unit | Yes | |
AI_Hero | unit | Yes | |
AI_int | integer | No | |
AI_KiteState | group | No | |
AI_retreatangle | real | Yes | |
AI_RetreatState | group | No | |
AI_Teamfight | boolean | No | |
AI_TunnelState | group | No | |
AI_Unit_Group | group | No | |
AI_wander_int | integer | No | |
AI_WanderState | group | No | |
Andrew | unit | No | |
AP_int | integer | No | |
Arcane_real | real | No | |
AS_caster | unit | No | |
AS_dummy | unit | No | |
AS_duration | real | No | |
Bark_point | location | No | |
Bark_point2 | location | No | |
BF_caster | unit | No | |
BF_Group | group | No | |
BF_int | integer | No | |
Blackblood_bool | boolean | No | true |
BM_boolean | boolean | No | |
BO_onhit | integer | No | |
BO_stacks | integer | No | |
BP_caster | unit | No | |
BP_duration | real | No | |
BP_lightning | lightning | No | |
BP_target | unit | No | |
BV_caster | unit | No | |
BV_duration | real | No | |
Calypse | unit | No | |
Calypse_boolean | boolean | No | |
CB_angle | real | No | |
CB_caster | unit | No | |
CB_int | integer | No | |
CB_target | unit | No | |
CD_int | integer | No | |
CL_caster | unit | No | |
CL_casterpoint | location | No | |
CL_int | integer | No | |
CL_targetpoint | location | No | |
Clock_120 | integer | No | |
Clock_240 | integer | No | |
Clock_40 | integer | No | |
Clock_60 | integer | No | |
Clock_minute | integer | No | |
CM_caster | unit | No | |
CM_indicator | unit | Yes | |
CM_int | integer | No | |
CM_point | location | No | |
Creeps_int | integer | No | 1 |
Cryo_caster | unit | No | |
Cryo_dummy | unit | No | |
CS_caster | unit | No | |
CS_int | integer | No | |
CS_target | unit | No | |
CT_caster | unit | No | |
CT_lightning | lightning | No | |
CT_target | unit | No | |
CU_caster | unit | No | |
CU_fx | unit | Yes | |
CU_real | real | No | |
Cynthia | unit | No | |
Dark_target | unit | No | |
Darkknight | unit | No | |
DC_caster | unit | No | |
DC_dummy | unit | No | |
DC_duration | real | No | |
DC_target | unit | No | |
DD_caster | unit | No | |
DD_point | location | No | |
DD_timer | timer | No | |
debug_group | group | No | |
Delphine | unit | No | |
DL_caster | unit | No | |
DL_int | integer | No | |
DO_angle | real | No | |
DO_caster | unit | No | |
DO_dummy | unit | No | |
DO_duration | real | No | |
DO_point | location | No | |
Dog | unit | No | |
DS_caster | unit | No | |
DS_duration | real | No | |
DS_lightning | lightning | No | |
DS_target | unit | No | |
DV_caster | unit | No | |
DV_dummy | unit | No | |
DV_int | integer | No | |
DV_real | real | No | |
DX_caster | unit | No | |
DX_int | integer | No | |
DY_caster | unit | No | |
DY_dummy | unit | No | |
EB_caster | unit | No | |
EB_point | location | No | |
ED_attribute | integer | Yes | |
ED_caster | unit | No | |
ED_int | integer | No | |
ED_target | unit | No | |
EM_stacks | integer | No | |
Emperor | unit | No | |
Execute_int | integer | No | |
expint_level | integer | No | |
FA_angle | real | No | |
FA_caster | unit | No | |
FA_height | real | No | |
FA_int | integer | No | |
FA_point | location | No | |
FB_Group | group | No | |
FB_int | integer | No | |
FB_unitarray | unit | Yes | |
FC_caster | unit | No | |
FC_real | real | No | |
FC_target | unit | No | |
FG_boolean | boolean | No | true |
FI_caster | unit | No | |
FI_dummy | unit | No | |
FK_caster | unit | No | |
FK_point | location | No | |
FL_caster | unit | No | |
FL_count | integer | No | |
FL_duration | real | No | |
FL_off | real | No | |
FL_target | unit | No | |
FMD_multi | real | No | |
FR_angle | real | No | |
FR_caster | unit | No | |
FR_dummy | unit | No | |
FR_int | integer | No | |
Frostedtargets | group | No | |
FY_caster | unit | No | |
GB_angle | real | No | |
GB_caster | unit | No | |
GB_int | integer | No | |
GF_caster | unit | No | |
GF_timer | integer | No | |
GN_caster | unit | No | |
GN_duration | real | No | |
HA_angle | real | No | |
HA_bool | boolean | No | |
HA_caster | unit | No | |
HA_int | integer | No | |
HA_target | unit | No | |
Hail_caster | unit | No | |
Hail_int | integer | No | |
Hail_point | location | No | |
Hero_Death | integer | Yes | |
Hero_Kills | integer | Yes | |
Hero_Streak | integer | Yes | |
HeroType | unitcode | Yes | |
hfb_dummy | unit | Yes | |
hfb_targetpoint | location | Yes | |
HS_caster | unit | No | |
HS_point | location | No | |
IBeam_caster | unit | No | |
IBeam_dummygroup | group | No | |
IBeam_point | location | No | |
IBeam_unit | unit | No | |
IBT_caster | unit | No | |
IBT_int | integer | No | |
Ice_count | integer | No | |
ICharge_caster | unit | No | |
Icy | unit | No | |
IF_caster | unit | No | |
IF_dummy | unit | No | |
IF_duration | real | No | |
IF_int | integer | No | |
IF_str | integer | No | |
IN_caster | unit | No | |
IN_dummy | unit | Yes | |
IN_duration | real | No | |
IN_target | unit | No | |
integer_hero | integer | No | |
IP_caster | unit | No | |
IP_int | integer | No | |
IR_count | integer | No | |
Item_Carry | itemcode | Yes | |
Item_Core | itemcode | Yes | |
Item_integer | integer | No | |
Item_Mage | itemcode | Yes | |
Item_Tank | itemcode | Yes | |
ItemHero | unit | No | |
Ivy | unit | No | |
IW_caster | unit | No | |
IW_int | integer | No | |
KD_caster | unit | No | |
KD_dummy | unit | No | |
KD_real | real | No | |
KD_target | unit | No | |
KV_caster | unit | No | |
KV_dummy | unit | No | |
KV_duration | real | No | |
KV_target | unit | No | |
LC_group | group | No | |
LC_int | integer | No | |
LC_point | location | No | |
LC_targets | unit | Yes | |
LC_units | unit | Yes | |
LD_caster | unit | No | |
LD_group | group | No | |
LD_int | integer | No | |
LD_point | location | No | |
Lightning_dummy | unit | No | |
Lightning_Group | group | Yes | |
Lightning_int | integer | No | |
Lightning_target | unit | No | |
Lightning_Unit | unit | Yes | |
Lightningcentre | unit | No | |
Lightningpoint2 | location | No | |
LS_bool | boolean | No | |
LS_caster | unit | No | |
LS_count | integer | No | |
LT_caster | unit | No | |
LT_duration | real | No | |
LT_lightning | lightning | No | |
LT_target | unit | No | |
MB_caster | unit | No | |
MB_int | integer | No | |
MC_caster | unit | No | |
MC_int | integer | No | |
MC_point | location | No | |
MF_real | real | No | |
MK_caster | unit | No | |
MK_point | location | No | |
Moon_target | unit | No | |
MP_point | location | No | |
MS_duration | real | No | |
MY_caster | unit | No | |
MY_fx | unit | Yes | |
MY_point | location | No | |
MY_real | real | No | |
Neutral | unitcode | Yes | |
Novacaster | unit | No | |
Oblifire_angle | real | No | |
Oblifire_caster | unit | No | |
Oblifire_int | integer | No | |
Oblifire_point | location | No | |
Oblinature_caster | unit | No | |
Oblinature_int | integer | No | |
Oblinature_point | location | No | |
Oblinature_trees | destructable | Yes | |
OF_caster | unit | No | |
OF_duration | real | No | |
OF_point | location | No | |
OF_timer | timer | No | |
OS_caster | unit | No | |
OS_duration | real | No | |
OS_point | location | No | |
OS_timer | timer | No | |
PA_caster | unit | No | |
PA_int | integer | No | |
PA_point | location | No | |
Paraglaive | unit | No | |
PDD_allocatedAttacks | integer | No | |
PDD_allocCounter | integer | No | |
PDD_amount | real | No | |
PDD_ATTACK_TYPE_UNIVERSAL | attacktype | No | |
PDD_BRACERS_SPELL_DMG_RED | real | No | |
PDD_CODE | integer | No | |
PDD_DAMAGE_TYPE_DETECTOR | integer | No | |
PDD_damageEvent | trigger | No | |
PDD_damageEventTrigger | real | No | |
PDD_damageHandler | trigger | No | |
PDD_damageType | integer | No | |
PDD_ETHEREAL_DAMAGE_FACTOR | real | No | |
PDD_h | hashtable | No | |
PDD_PHYSICAL | integer | No | |
PDD_pureAmount | real | No | |
PDD_runAllocatedAttacks | trigger | No | |
PDD_SET_MAX_LIFE | integer | No | |
PDD_source | unit | No | |
PDD_SPELL | integer | No | |
PDD_SPELL_DMG_REDUCTION_ITEM | integer | No | |
PDD_SPELL_RESIST_AUTO_DETECT | boolean | No | |
PDD_target | unit | No | |
PDD_totalAllocs | integer | No | |
PDD_TRIGGER_CLEANUP_PERIOD | real | No | |
PDD_UNIT_MIN_LIFE | real | No | |
Pest | unit | No | |
PF_caster | unit | No | |
PF_group | group | No | |
PG_caster | unit | No | |
Players | player | Yes | |
PN_angle | real | No | |
PN_caster | unit | No | |
PN_dummy | unit | No | |
PN_duration | real | No | |
PR_caster | unit | No | |
PR_duration | integer | No | |
PR_point | location | No | |
PS_int | integer | No | |
PS_point | location | Yes | |
PS_Unit | unit | Yes | |
QI_caster | unit | No | |
Raging_int | integer | No | |
RB_combat | real | No | |
RB_rage | real | No | |
RE_caster | unit | No | |
RE_duration | real | No | |
RF_caster | unit | No | |
RF_duration | real | No | |
RK_dummy | unit | Yes | |
RK_int | integer | No | |
RK_target | unit | No | |
Royal_group | group | No | |
RS_caster | unit | No | |
RS_int | integer | No | |
RS_target | unit | No | |
SB_caster | unit | No | |
SB_duration | real | No | |
SB_indi | unit | Yes | |
SB_lightning | lightning | No | |
SB_soul | unit | No | |
SC_buff | buffcode | Yes | |
SE_caster | unit | No | |
SE_int | integer | No | |
SE_real | real | No | |
SF_caster | unit | No | |
sf_dummy | unit | No | |
SF_frequency | integer | No | |
SF_int | integer | No | |
SF_point | location | No | |
sf_point | location | Yes | |
SG_timer | real | No | |
SM_caster | unit | No | |
SM_real | real | No | |
SM_target | unit | No | |
Sota | unit | No | |
SP_damagegroup | group | No | |
sparkangle | real | No | |
sparkint | integer | No | |
sparktarget | unit | No | |
SR_angle | real | No | |
SR_caster | unit | No | |
SR_dummy | unit | No | |
SR_group | group | No | |
SR_int | integer | No | |
SS_angle | real | No | |
SS_caster | unit | No | |
SS_int | integer | No | |
Starcaster | unit | No | |
Starcount | integer | No | |
Starcount2 | integer | No | |
Starpoint | location | No | |
Starpoint2 | location | No | |
SZ_caster | unit | No | |
SZ_duration | real | No | |
SZ_group | group | No | |
Tag_caster | unit | No | |
Tag_dummy | unit | No | |
Tag_duration | real | No | |
Tag_target | unit | No | |
TD_agility | integer | No | |
TD_caster | unit | No | |
TD_elapsed | integer | No | |
TD_origin | location | No | |
TD_slowgroup | group | Yes | |
TD_unit | unit | No | |
TH_caster | unit | No | |
TH_dummy | unit | No | |
TH_duration | real | No | |
TM_int | integer | No | |
TO_angle | real | No | |
TO_caster | unit | No | |
TO_distance | real | No | |
TO_target | unit | No | |
TO_timer | real | No | |
Tornado | unit | No | |
TS_group | group | No | |
TS_target | unit | No | |
UDex | integer | No | |
UDexGen | integer | No | |
UDexNext | integer | Yes | |
UDexPrev | integer | Yes | |
UDexRecycle | integer | No | |
UDexUnits | unit | Yes | |
UDexWasted | integer | No | |
UE_caster | unit | No | |
UnitIndexerEnabled | boolean | No | |
UnitIndexEvent | real | No | |
UnitSpeedX | real | Yes | |
VM_caster | unit | No | |
VM_target | unit | No | |
WD_angle | real | No | |
WD_caster | unit | No | |
WD_duration | real | No | |
WD_int | integer | No | |
WI_angle | real | No | |
WI_caster | unit | No | |
WI_dummy | unit | No | |
WI_duration | real | No | |
WI_group | group | No | |
Wotw | unit | No | |
WP_angle | real | No | |
WP_caster | unit | No | |
WP_dummy | unit | No | |
WP_int | integer | No | |
XM_caster | unit | No | |
XM_target | unit | No | |
XP_caster | unit | No | |
XP_duration | real | No | |
XP_int | integer | No | |
Yiting | unit | No | |
ZP_caster | unit | No | |
ZP_duration | real | No | |
ZP_point | location | No |
//TESH.scrollpos=75
//TESH.alwaysfold=0
///////////////////////////////////////////////////////////////////////////////////////////
MY CHILD IS BACK OMG I WAS SO SAD DURING THIS ONE MONTH (20/10/21 - 23/11/21)
///////////////////////////////////////////////////////////////////////////////////////////
anyway
vfx effects are currently broken sadge
stat gain balance across all heroes, now total stat gain varies from 10-12
item adjustments
revitalizing scroll renamed to revitalizing parchment
talisman of evasion evasion from 30 to 25
aqa r pulse fx decreased
bo e reworked to equilibrium
bo r reworked, attacks now spend mana and defense gains mana, ui improvements
bt p tentacles no longer gain aspd per level
dc cleanup
dc q no longer scales with strength, vfx fixed
dc w manacost decreased
dc r damage decreased
em p hp regen moved to stacks, recoded with endurance aura
em r damage decreased
em r reworked, now requires auto weaving
fmd rework
fmd p no longer costs mana, no longer has primary attack, bullets scale with agi
fmd q no longer slows
fmd new w supersonic shift blink clap
fmd r adjusted to work with passive
fs r scaling decreased
gs q damage decreased early
gw rework
gw q now only shoots one volley
gw w combined into e
new gw w - arcane sentry, creates a tower
gw e reworked into metallic flare
gw r reworked into crushing upheaval
hq p cd smoothen
hq q damage increased late, range modified
hq e now hits nonheroes
in p no longer displays text against creeps
lm abilities no longer scale with bonus int, compensation buffed
lm q2 moved to lm p
lm e max shield increased
ma rework
ma p - mark of the archfiend (from e) renamed to baleful warning
ma qw numbers changed in general
ma e new ability umbral veil, invulnerability
ma r damage changed in general
ma t demonic portal from p
mf e aoe increased
nr q damage decreased early
os p to sh p, new p sewalls vengeance
os qwer damage lower early
os q aoe increased
os w aoe decreased
os r cannot move himself anymore
pp p now has a 0.3 fade time
rb update
rb p cleaned up rage system, added qol stuff like decaying out of combat
rb w renamed to regenerative tissue
rb e now deals two instances of damage
rb r added to rb p, new ability infernal rage, short steroid
sh p deathly presence - os p
sr cooldowns and numbers changed in general
wa p recoded, now scales with hero level (also buffed hehheh)
wa w now amplifies damage instead of firing another beam
wa r now fires beams in fixed angles instead
//TESH.scrollpos=101
//TESH.alwaysfold=0
////////////////////////////////////////////////////////////////////////////////////
//
// Physical Damage Detection Engine GUI v 1.3.0.0
// ----------------------------------------------
// By looking_for_help aka eey
//
// This system is able to detect, modify and deal damage. It can differentiate
// between physical and spell damage, as well as block, reduce or increase the
// applied damage to a desired value. You can also allocate damage events from
// running damage events.
//
// This is the GUI version of the system, meaning that you can use this with the
// standard editor and basically without any knowledge of JASS.
//
////////////////////////////////////////////////////////////////////////////////////
//
// Implementation
// --------------
// 1. Create all variables that this system uses (compare the variable editor).
// You don't have to set them to specific values, they get initialized
// automatically by the system so just create them.
// 2. Copy this trigger to your map. You can then add damage handlers by using
// the event "value of real variable becomes equal to 1" with the variable
// udg_PDD_damageEventTrigger. Compare the OnDamage trigger for an example usage.
// 3. Copy the two custom abilities to your map and make sure they have the
// correct ID. You can specify the ID in the function InitGlobalVariables
// above.
// 4. Go to the locust swarm ability and invert its damage return portion
// from (default) 0.75 to -0.75.
// 5. Remove the spell damage reduction ability from the spell damage reduction
// items you use (runed bracers). You can configure the resistance of this
// item in the InitGlobalVariables function, modifying the global variable
// udg_PDD_BRACERS_SPELL_DMG_RED.
//
////////////////////////////////////////////////////////////////////////////////////
//
// Important Notes
// ---------------
// 1. Life Drain does not work with this system, so you should use a triggered
// version of this spell if you want to use it.
// 2. Same for Finger of Death, if you want to use this spell bug free with this
// system, you should use a triggered version of it.
// 3. If you use damage modifiers by setting the damage amount variable, you have
// to use GetUnitLife, GetUnitMaxLife and SetUnitLife instead of GetWidgetLife,
// GetUnitState for UNIT_STATE_MAX_LIFE and SetWidgetLife in your whole map to
// ensure there occure no bugs.
// 4. The boolean udg_PDD_SPELL_RESIST_AUTO_DETECT is only neccessary set to true
// if you want to use a customized damage table with spell damage resistance
// above 100%. If this is not the case, it should be set to false, as the
// system is faster then and still works correct.
// 5. As already mentioned you can't use the spell reduction ability when using this
// system (runed bracers and elunes grace). If you want to use them, you can
// trigger them by using the damage modifiers. Runed bracers is already considered
// in this system, so you don't have to code it.
//
////////////////////////////////////////////////////////////////////////////////////
//
// System API
// ----------
// real damageEventTrigger
// - Use the event "value of real variable becomes equal to 1" to detect a damage
// event. In this event you can use the following API. Compare the OnDamage
// trigger for an example usage.
//
// unit target
// - In this global unit variable, the damaged unit is saved. Don't write any-
// thing into this variable, use it as readonly.
//
// unit source
// - In this global unit variable, the damage source is saved. Don't write any-
// thing into this variable, use it as readonly.
//
// real amount
// - In this global real variable, the amount of damage is saved. This amount
// can be modified by simply setting it to the desired amount that should be
// applied to the target. Set the amount to 0.0 to block the damage completely.
// Negative values will result in heal.
//
// integer damageType
// - In this global integer variable, the damage type of the current damage is
// saved. Use it to differentiate between physical, spell and code damage. The
// variable can takes the values PHYSICAL == 0, SPELL == 1 and CODE == 2. Don't
// write anything into this variable, use it as readonly.
//
// function GetUnitLife takes unit u returns real
// - Use this function instead of the GetWidgetLife native. It ensures that you
// get the correct health value, even when damage modifiers are applied. If
// you don't use damage modifiers at all, you don't need this function.
//
// function GetUnitMaxLife takes unit u returns real
// - Use this function instead of the GetUnitState(u, UNIT_STATE_MAX_LIFE) native.
// It will return the correct value, even when damage modifiers are applied. If
// you don't use damage modifiers at all, you don't need this function.
//
// function SetUnitLife takes unit u, real newLife returns nothing
// - Use this function instead of the SetWidgetLife(u, newLife) native if you use
// damage modifiers in your map. Same rules as for the GetUnitMaxLife and the
// GetUnitMaxLife functions.
//
// function UnitDamageTargetEx takes unit localSource, unit localTarget, real localAmount, boolean attack, boolean ranged, attacktype localAttackType, damagetype localDamageType, weapontype localWeaponType returns boolean
// - Use this function to deal damage from a running damage event. It works exactly
// the same as the native UnitDamageTarget but is recursion safe so that you can
// realize damage reflection for example with this. Don't ever use this function
// outside of an onDamage event.
//
// function AddDamageHandler takes code damageHandler returns nothing
// - Allows you to add a damage handler function to the system. This is not
// required for GUI users, only for vanilla JASS users. GUI users should
// use the real variable damageEventTrigger to add damage handlers to this
// system as explained above.
//
// function RemoveDamageHandler takes code damageHandler returns nothing
// - Allows you to remove a damage handler function from the system dynamic-
// ally. If you added the same handler function multiple times to the sys-
// tem, this function will remove all of these equal functions. This is not
// required for GUI users, only for vanilla JASS users.
//
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
// Sub functions
////////////////////////////////////////////////////////////////////////////////////
function DealFixDamage takes unit source, unit target, real pureAmount returns nothing
local real MAX_DAMAGE = 1000000.0
local real beforeHitpoints
local real newHitpoints
// Ensure the amount is positive
if pureAmount < 0 then
set pureAmount = -pureAmount
endif
// Save the targets hitpoints
set beforeHitpoints = GetWidgetLife(target)
set newHitpoints = beforeHitpoints - pureAmount
// Apply the desired, fixed amount
if newHitpoints >= udg_PDD_UNIT_MIN_LIFE then
call SetUnitState(target, UNIT_STATE_LIFE, newHitpoints)
else
if ( IsUnitType(target, UNIT_TYPE_ETHEREAL) == false ) then
call SetWidgetLife(target, 1.0)
call UnitDamageTarget(source, target, MAX_DAMAGE, true, false, udg_PDD_ATTACK_TYPE_UNIVERSAL, DAMAGE_TYPE_UNIVERSAL, null)
call SetWidgetLife(target, 0.0)
else
call UnitRemoveAbility(target, udg_PDD_DAMAGE_TYPE_DETECTOR)
call SetWidgetLife(target, 1.0)
call UnitDamageTarget(source, target, MAX_DAMAGE, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, null)
call SetWidgetLife(target, 0.0)
endif
endif
endfunction
function GetUnitSpellResistance takes unit u returns real
local real originalHP
local real beforeHP
local real afterHP
local real resistance
local real DUMMY_DAMAGE = 100
local real DUMMY_FACTOR = 0.01
// Deal spell damage in order to get the units resistance
call UnitRemoveAbility(udg_PDD_target, udg_PDD_DAMAGE_TYPE_DETECTOR)
set originalHP = GetWidgetLife(udg_PDD_target)
call UnitAddAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
call SetWidgetLife(udg_PDD_target, 20000.0)
set beforeHP = GetWidgetLife(udg_PDD_target)
call DisableTrigger(udg_PDD_damageEvent)
call UnitDamageTarget(udg_PDD_source, udg_PDD_target, DUMMY_DAMAGE, true, false, null, DAMAGE_TYPE_UNIVERSAL, null)
call EnableTrigger(udg_PDD_damageEvent)
set afterHP = GetWidgetLife(udg_PDD_target)
call UnitRemoveAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
call SetWidgetLife(udg_PDD_target, originalHP)
call UnitAddAbility(udg_PDD_target, udg_PDD_DAMAGE_TYPE_DETECTOR)
call UnitMakeAbilityPermanent(udg_PDD_target, true, udg_PDD_DAMAGE_TYPE_DETECTOR)
// Calculate this resistance
set resistance = DUMMY_FACTOR*(beforeHP - afterHP)
// If the resistance was greater than 100%, return it
if resistance > 1.0 then
return resistance
else
return 1.0
endif
endfunction
function UnitHasItemOfType takes unit u, integer itemId returns integer
local integer index = 0
local item indexItem
// Check if the target has a spell damage reducing item
loop
set indexItem = UnitItemInSlot(u, index)
if ( indexItem != null ) and ( GetItemTypeId(indexItem) == itemId ) then
set indexItem = null
return index + 1
endif
set index = index + 1
exitwhen index >= bj_MAX_INVENTORY
endloop
set indexItem = null
return 0
endfunction
////////////////////////////////////////////////////////////////////////////////////
// Damage Engine
////////////////////////////////////////////////////////////////////////////////////
function AfterDamage takes nothing returns nothing
local timer time = GetExpiredTimer()
local integer id = GetHandleId(time)
local unit localSource = LoadUnitHandle(udg_PDD_h, id, 0)
local unit localTarget = LoadUnitHandle(udg_PDD_h, id, 1)
local real pureAmount = LoadReal(udg_PDD_h, id, 2)
local real amount = LoadReal(udg_PDD_h, id, 3)
local real originalHealth = LoadReal(udg_PDD_h, id, 4)
// If the damage was modified, restore units health
if originalHealth != 0.0 then
call UnitRemoveAbility(localTarget, udg_PDD_SET_MAX_LIFE)
call SetWidgetLife(localTarget, originalHealth)
endif
// Apply the desired amount of damage
if amount > 0.0 then
call DisableTrigger(udg_PDD_damageEvent)
call DealFixDamage(localSource, localTarget, amount)
call EnableTrigger(udg_PDD_damageEvent)
else
call SetWidgetLife(localTarget, originalHealth - amount)
endif
// Clean things up
call FlushChildHashtable(udg_PDD_h, id)
call FlushChildHashtable(udg_PDD_h, GetHandleId(localTarget))
call DestroyTimer(time)
set time = null
set localSource = null
set localTarget = null
endfunction
function DamageEngine takes nothing returns nothing
local timer time
local integer id
local real health
local real rawAmount
local real originalHealth
local integer targetId
local integer oldTimerId
local real oldHealth
local real oldOriginalHealth
local real oldAmount
set rawAmount = GetEventDamage()
if rawAmount == 0.0 then
return
endif
set udg_PDD_source = GetEventDamageSource()
set udg_PDD_target = GetTriggerUnit()
// Determine the damage type
if rawAmount > 0.0 then
if udg_PDD_damageType != udg_PDD_CODE then
set udg_PDD_damageType = udg_PDD_PHYSICAL
endif
set udg_PDD_amount = rawAmount
else
if udg_PDD_damageType != udg_PDD_CODE then
set udg_PDD_damageType = udg_PDD_SPELL
endif
set udg_PDD_amount = -rawAmount
endif
// Register spell reduction above 100%
if udg_PDD_SPELL_RESIST_AUTO_DETECT then
set udg_PDD_amount = GetUnitSpellResistance(udg_PDD_target)*udg_PDD_amount
else
if ( IsUnitType(udg_PDD_target, UNIT_TYPE_ETHEREAL) and IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) and rawAmount < 0.0 ) then
set udg_PDD_amount = udg_PDD_ETHEREAL_DAMAGE_FACTOR*udg_PDD_amount
endif
endif
// Register spell damage reducing items like runed bracers
if ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) and UnitHasItemOfType(udg_PDD_target, udg_PDD_SPELL_DMG_REDUCTION_ITEM) > 0 ) and rawAmount < 0.0 then
set udg_PDD_amount = (1 - udg_PDD_BRACERS_SPELL_DMG_RED)*udg_PDD_amount
endif
// Save health and damage variables
if udg_PDD_damageType != udg_PDD_CODE then
call UnitRemoveAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
endif
set udg_PDD_pureAmount = udg_PDD_amount
set originalHealth = GetWidgetLife(udg_PDD_target)
set oldTimerId = 0
// Call damage handlers
set udg_PDD_damageEventTrigger = 0.0
set udg_PDD_damageEventTrigger = 1.0
set udg_PDD_damageEventTrigger = 0.0
// If the damage was modified, apply the rescue ability
if udg_PDD_amount != udg_PDD_pureAmount then
call UnitAddAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
call SetWidgetLife(udg_PDD_target, GetWidgetLife(udg_PDD_target) + udg_PDD_pureAmount)
endif
// Check if a previous timer didn't yet expire
set targetId = GetHandleId(udg_PDD_target)
set oldHealth = LoadReal(udg_PDD_h, targetId, 0)
// If this is the case, update the timer information
if oldHealth != 0.0 then
set oldTimerId = LoadInteger(udg_PDD_h, targetId, 3)
set oldOriginalHealth = LoadReal(udg_PDD_h, targetId, 2)
set oldAmount = LoadReal(udg_PDD_h, targetId, 1)
set originalHealth = oldOriginalHealth - oldAmount
call SaveReal(udg_PDD_h, oldTimerId, 4, oldOriginalHealth)
endif
// Call after damage event if damage was spell, modified, code or parallel
if ( rawAmount < 0.0 or udg_PDD_pureAmount != udg_PDD_amount or oldTimerId != 0 or udg_PDD_allocatedAttacks > 0 ) then
set time = CreateTimer()
set id = GetHandleId(time)
// Save handles for after damage event
call SaveUnitHandle(udg_PDD_h, id, 0, udg_PDD_source)
call SaveUnitHandle(udg_PDD_h, id, 1, udg_PDD_target)
call SaveReal(udg_PDD_h, id, 2, udg_PDD_pureAmount)
call SaveReal(udg_PDD_h, id, 3, udg_PDD_amount)
call SaveReal(udg_PDD_h, id, 4, originalHealth)
// Save this extra to manage parallel damage instances
call SaveReal(udg_PDD_h, targetId, 0, GetWidgetLife(udg_PDD_target))
call SaveReal(udg_PDD_h, targetId, 1, udg_PDD_amount)
call SaveReal(udg_PDD_h, targetId, 2, originalHealth)
call SaveInteger(udg_PDD_h, targetId, 3, id)
// Avoid healing of negative spell damage
if rawAmount < 0.0 then
call DisableTrigger(udg_PDD_damageEvent)
call DealFixDamage(udg_PDD_source, udg_PDD_target, -rawAmount)
if ( originalHealth - udg_PDD_amount < udg_PDD_UNIT_MIN_LIFE ) then
call UnitRemoveAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
call DealFixDamage(udg_PDD_source, udg_PDD_target, udg_PDD_amount)
endif
call EnableTrigger(udg_PDD_damageEvent)
endif
// Guarantee unit exploding
if originalHealth - udg_PDD_amount < udg_PDD_UNIT_MIN_LIFE then
if rawAmount > 0.0 then
call UnitRemoveAbility(udg_PDD_target, udg_PDD_SET_MAX_LIFE)
call SetWidgetLife(udg_PDD_target, udg_PDD_UNIT_MIN_LIFE)
endif
endif
// Start the after damage event
call TimerStart(time, 0.0, false, function AfterDamage)
endif
// Handle allocated attacks from UnitDamageTargetEx
if udg_PDD_totalAllocs == 0 then
set udg_PDD_totalAllocs = udg_PDD_allocatedAttacks
endif
if udg_PDD_allocatedAttacks > 0 then
set udg_PDD_allocatedAttacks = udg_PDD_allocatedAttacks - 1
set udg_PDD_allocCounter = udg_PDD_allocCounter + 1
call TriggerEvaluate(udg_PDD_runAllocatedAttacks)
endif
// Reset all required variables
set udg_PDD_damageType = -1
set udg_PDD_totalAllocs = 0
set udg_PDD_allocCounter = -1
endfunction
////////////////////////////////////////////////////////////////////////////////////
// Initialization
////////////////////////////////////////////////////////////////////////////////////
function RestoreTriggers takes nothing returns nothing
local unit enumUnit = GetEnumUnit()
// Re-register units that are alive
if GetUnitTypeId(enumUnit) != 0 then
call TriggerRegisterUnitEvent(udg_PDD_damageEvent, enumUnit, EVENT_UNIT_DAMAGED)
endif
set enumUnit = null
endfunction
function ClearMemory_Actions takes nothing returns nothing
local group g = CreateGroup()
local code c = function DamageEngine
// Reset the damage event
call GroupEnumUnitsInRect(g, GetWorldBounds(), null)
call ResetTrigger(udg_PDD_damageEvent)
call DestroyTrigger(udg_PDD_damageEvent)
set udg_PDD_damageEvent = null
// Rebuild it then
set udg_PDD_damageEvent = CreateTrigger()
call TriggerAddCondition(udg_PDD_damageEvent, Filter(c))
call ForGroup(g, function RestoreTriggers)
// Clean things up
call DestroyGroup(g)
set g = null
set c = null
endfunction
function MapInit takes nothing returns nothing
local unit enumUnit = GetEnumUnit()
// Register units on map initialization
call UnitAddAbility(enumUnit, udg_PDD_DAMAGE_TYPE_DETECTOR)
call UnitMakeAbilityPermanent(enumUnit, true, udg_PDD_DAMAGE_TYPE_DETECTOR)
call TriggerRegisterUnitEvent(udg_PDD_damageEvent, enumUnit, EVENT_UNIT_DAMAGED)
set enumUnit = null
endfunction
function UnitEntersMap takes nothing returns nothing
local unit triggerUnit = GetTriggerUnit()
// Register units that enter the map
if ( GetUnitAbilityLevel(triggerUnit, udg_PDD_DAMAGE_TYPE_DETECTOR) < 1 ) then
call UnitAddAbility(triggerUnit, udg_PDD_DAMAGE_TYPE_DETECTOR)
call UnitMakeAbilityPermanent(triggerUnit, true, udg_PDD_DAMAGE_TYPE_DETECTOR)
call TriggerRegisterUnitEvent(udg_PDD_damageEvent, triggerUnit, EVENT_UNIT_DAMAGED)
endif
set triggerUnit = null
endfunction
function RunAllocatedAttacks takes nothing returns nothing
local integer localAllocAttacks = udg_PDD_allocatedAttacks + 1
// Calculate the correct sequence of allocated attacks
set localAllocAttacks = localAllocAttacks - udg_PDD_totalAllocs + 1 + 2*udg_PDD_allocCounter
// Deal code damage if the unit isn't exploding
set udg_PDD_damageType = udg_PDD_CODE
if GetUnitLife(LoadUnitHandle(udg_PDD_h, localAllocAttacks, 1)) >= udg_PDD_UNIT_MIN_LIFE then
call UnitDamageTarget(LoadUnitHandle(udg_PDD_h, localAllocAttacks, 0), LoadUnitHandle(udg_PDD_h, localAllocAttacks, 1), LoadReal(udg_PDD_h, localAllocAttacks, 2), LoadBoolean(udg_PDD_h, localAllocAttacks, 3), LoadBoolean(udg_PDD_h, localAllocAttacks, 4), ConvertAttackType(LoadInteger(udg_PDD_h, localAllocAttacks, 5)), ConvertDamageType(LoadInteger(udg_PDD_h, localAllocAttacks, 6)), ConvertWeaponType(LoadInteger(udg_PDD_h, localAllocAttacks, 7)))
else
call FlushChildHashtable(udg_PDD_h, localAllocAttacks - 1)
endif
// Clean things up
call FlushChildHashtable(udg_PDD_h, localAllocAttacks)
endfunction
function InitTrig_DamageEvent takes nothing returns nothing
local group g = CreateGroup()
local region r = CreateRegion()
local trigger UnitEnters = CreateTrigger()
local trigger ClearMemory = CreateTrigger()
local code cDamageEngine = function DamageEngine
local code cUnitEnters = function UnitEntersMap
local code cClearMemory = function ClearMemory_Actions
local code cRunAllocatedAttacks = function RunAllocatedAttacks
// Initialize global variables
set udg_PDD_h = InitHashtable()
set udg_PDD_damageEvent = CreateTrigger()
set udg_PDD_damageHandler = CreateTrigger()
set udg_PDD_damageType = -1
set udg_PDD_allocatedAttacks = 0
set udg_PDD_runAllocatedAttacks = CreateTrigger()
// Initialize global configurable constants
call InitGlobalVariables()
// Initialize global fixed constants
set udg_PDD_PHYSICAL = 0
set udg_PDD_SPELL = 1
set udg_PDD_CODE = 2
set udg_PDD_UNIT_MIN_LIFE = 0.406
set udg_PDD_ATTACK_TYPE_UNIVERSAL = ConvertAttackType(7)
set udg_PDD_totalAllocs = 0
set udg_PDD_allocCounter = -1
set udg_PDD_damageEventTrigger = 0.0
// Register units on map initialization
call TriggerRegisterVariableEvent(udg_PDD_damageHandler, "udg_PDD_damageEventTrigger", EQUAL, 1.0)
call TriggerAddCondition(udg_PDD_damageEvent, Filter(cDamageEngine))
call GroupEnumUnitsInRect(g, GetWorldBounds(), null)
call ForGroup(g, function MapInit)
// Register units that enter the map
call RegionAddRect(r, GetWorldBounds())
call TriggerRegisterEnterRegion(UnitEnters, r, null)
call TriggerAddCondition(UnitEnters, Filter(cUnitEnters))
// Register trigger for allocated attacks
call TriggerAddCondition(udg_PDD_runAllocatedAttacks, Filter(cRunAllocatedAttacks))
// Clear memory leaks
call TriggerRegisterTimerEvent(ClearMemory, udg_PDD_TRIGGER_CLEANUP_PERIOD, true)
call TriggerAddCondition(ClearMemory, Filter(cClearMemory))
// Clean things up
call DestroyGroup(g)
set UnitEnters = null
set ClearMemory = null
set cDamageEngine = null
set cUnitEnters = null
set cClearMemory = null
set cRunAllocatedAttacks = null
set g = null
set r = null
endfunction
//TESH.scrollpos=1057
//TESH.alwaysfold=0
function Trig_SpellDummy_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_SPELL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'h01S' ) ) then
return false
endif
if ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO ) ) then
return false
endif
return true
endfunction
function Trig_SpellDummy_PDD_Actions takes nothing returns nothing
set udg_PDD_amount = udg_PDD_amount * 0.75
endfunction
function Trig_SpellAmp_PDD_Conditions takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(udg_PDD_source, 'A07O') > 0
local boolean b = not IsUnitType(udg_PDD_target,UNIT_TYPE_STRUCTURE)
return a and b
endfunction
function Trig_SpellAmp_PDD_Actions takes nothing returns nothing
if IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) then
set udg_PDD_amount = udg_PDD_amount * 0.01 * GetUnitUserData(udg_PDD_source)
if (GetUnitAbilityLevel(udg_PDD_target, 'A0DA') > 0) then
set udg_PDD_amount = udg_PDD_amount * 0.75
endif
else
set udg_PDD_amount = 0
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_PDD_amount) )
endfunction
function Trig_SpellComp_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'h02A' ) ) then
return false
endif
if ( IsUnitType (udg_PDD_target,UNIT_TYPE_STRUCTURE) ) then
return false
endif
return true
endfunction
function Trig_SpellComp_PDD_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(udg_PDD_target)
local real x
local real r
local string s
//aquaforce avatar - whirlpool strike
if GetUnitAbilityLevel(udg_PDD_source, 'A02C') > 0 then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h01Y', p , 0 )
call UnitAddAbility( d, 'A040' )
call SetUnitUserData(d, GetUnitUserData(udg_PDD_source) )
call IssueImmediateOrder( d, "thunderclap" )
endif
//dark ninja - dark spear
if GetUnitAbilityLevel(udg_PDD_source, 'A04O') > 0 then
set x = 0.005 * (180.00 - GetUnitPercentLife(udg_PDD_target))
set r = x * GetUnitUserData(udg_PDD_source) * 0.01
set udg_PDD_amount = udg_PDD_amount * r
//call FadingText( ( I2S(R2I(udg_PDD_amount)) + s ), udg_PDD_target, 10, 40, 40, 40, 0 )
endif
//goddess of the seas - curse
if GetUnitAbilityLevel(udg_PDD_source, 'A0C5') > 0 then
set x = 0.016 + 0.0005 * GetUnitUserData(udg_PDD_source)
set r = x * GetUnitMissingLife(udg_PDD_target)
set udg_PDD_amount = udg_PDD_amount + r
call FadingText( ( I2S(R2I(r)) + "!" ), udg_PDD_target, 11, 80, 84, 84, 0 )
endif
//malicious archfiend - quietus
if GetUnitAbilityLevel(udg_PDD_source, 'A0CJ') > 0 then
set r = GetUnitUserData(udg_PDD_source)*0.01
set d = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source),'h000', p, 0)
call UnitAddAbility(d, 'A0AM')
set udg_PDD_amount = udg_PDD_amount * r
//call UnitDamageTargetPDD( udg_PDD_source, udg_PDD_target, r, 1 )
call IssueTargetOrder(d, "soulburn", udg_PDD_target)
endif
//pyrotactician - shrapnel
if GetUnitAbilityLevel(udg_PDD_source, 'A022') > 0 then
set r = GetUnitUserData(udg_PDD_source)*0.01
set d = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source),'h000', p, 0)
call UnitAddAbility(d, 'A00I')
set udg_PDD_amount = udg_PDD_amount * r
//call UnitDamageTargetPDD( udg_PDD_source, udg_PDD_target, r, 1 )
call IssueTargetOrder(d, "slow", udg_PDD_target)
endif
//relucent hunter - paralyzing chain
if GetUnitAbilityLevel(udg_PDD_source, 'A06I') > 0 then
set r = GetUnitUserData(udg_PDD_source)
set d = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source),'h000', p, 0)
call UnitAddAbility(d, 'A05E')
call UnitDamageTargetPDD( udg_PDD_source, udg_PDD_target, r, 1 )
call IssueTargetOrder(d, "firebolt", udg_PDD_target)
endif
set d = null
call RemoveLocation (p)
endfunction
function Trig_PDD_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_PDD_source))
local boolean b = GetFilterUnit() != udg_PDD_target
return (a and b and IsTarget())
endfunction
function Trig_AA_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00C' ) ) then
return false
endif
return true
endfunction
function Trig_AA_PDD_Actions takes nothing returns nothing
local unit c = udg_PDD_source
local unit d
local location p = GetUnitLoc(udg_PDD_target)
local integer i = GetUnitLevel(c)
local real r = 0.3 * GetHeroAgi(udg_PDD_source, true) + 0.6 * GetHeroInt(udg_PDD_source, true)
local texttag t
if ( GetUnitAbilityLevel( c, 'A06G' ) == 4 )then
set udg_PDD_amount = ( udg_PDD_amount + r )
call FadingText( ( I2S(R2I(udg_PDD_amount)) + "!" ), udg_PDD_target, 15, 60, 80, 80, 0 )
call SetUnitAbilityLevel( c, 'A06G', 1 )
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A09C')
call SetUnitAbilityLevel(d, 'A09C', i)
call IssueTargetOrder( d, "bloodlust", c )
else
call IncUnitAbilityLevel( c, 'A06G' )
endif
set c = null
set d = null
call RemoveLocation (p)
endfunction
function Trig_AD_PDD_Conditions takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(udg_PDD_target, 'B03R') > 0
local boolean b = IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source))
local boolean c = GetUnitTypeId(udg_PDD_target) == 'N00H'
//local boolean d = IsUnitType(udg_PDD_source, UNIT_TYPE_RANGED_ATTACKER)
return ( a and b and c )
endfunction
function Trig_AD_PDD_Actions takes nothing returns nothing
local real rt = 0.08 * GetUnitAbilityLevel(udg_PDD_target, 'A0D7')
local real r = (0.1 + rt + 0.001 * GetHeroStr(udg_PDD_target, true))* udg_PDD_amount
set udg_PDD_amount = udg_PDD_amount - r
if udg_PDD_amount > 5 then
call FadingText( "-" + ( I2S(R2I(r)) ), udg_PDD_target, 10.00, 80.00, 80.00, 80, 0 )
endif
endfunction
function Trig_AR_PDD_Conditions takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(udg_PDD_target, 'B02D') > 0
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N006' ) ) then
return false
endif
if ( not ( GetRandomReal(0,100) < 21 or a ) ) then
return false
endif
return true
endfunction
function Trig_AR_PDD_Actions takes nothing returns nothing
local unit d
local unit u
local location p = GetUnitLoc(udg_PDD_target)
local group g = GetUnitsInRangeOfLocMatching(400, p, Condition(function Trig_PDD_Filter))
local real rq = 0.4 * GetHeroAgi(udg_PDD_source, true) + 40 * GetUnitAbilityLevel(udg_PDD_source, 'A07G')
local real xe = 0.6 + (0.2 * GetUnitAbilityLevel(udg_PDD_source, 'A07X'))
local real r = (xe * GetHeroAgi(udg_PDD_source, true))
if GetUnitAbilityLevel(udg_PDD_target, 'B02D') > 0 then
set r = r + rq + GetHeroInt(udg_PDD_source, true)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h026', p, 0 )
loop
set u = FirstOfGroup(g)
exitwhen u == null
if GetUnitAbilityLevel( u , 'B02D' ) > 0 then
call UnitDamageTargetPDD( udg_PDD_source, u, 0.4 * r, 1 )
endif
call GroupRemoveUnit( g, u )
endloop
call UnitRemoveBuffBJ( 'B02D', udg_PDD_target )
endif
set udg_PDD_amount = ( udg_PDD_amount + r )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h00C', p, 0 )
call FadingText( ( I2S(R2I(udg_PDD_amount)) + "!" ), udg_PDD_target, 12.00, 60.00, 60.00, 100, 0 )
call RemoveLocation (p)
endfunction
function Trig_BM_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N015' ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( ( IsUnitIllusion(udg_PDD_source) ) ) then
return false
endif
return udg_BM_boolean
endfunction
function Trig_BM_PDD_Actions takes nothing returns nothing
local integer i = 20 + R2I(GetHeroInt(udg_PDD_source, true) * 0.28)
local location pc = GetUnitLoc(udg_PDD_source)
local location pu = GetUnitLoc(udg_PDD_target)
local real angle = AngleBetweenPoints(pc,pu)
local location pt = PolarProjectionBJ(pu, 100, angle)
local unit c = udg_PDD_source
local unit d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01Y', pc, bj_UNIT_FACING )
call UnitAddAbility(d, 'A071')
call SetUnitUserData( d, i )
call IssuePointOrderLoc( d, "carrionswarm", pu )
call FadingText( I2S((i * 4)) + "!", udg_PDD_source, 14.00, 80, 28, 28, 0 )
set udg_BM_boolean = false
set c = null
set d = null
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
function Trig_BO_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N010' ) ) then
return false
endif
return true
endfunction
function Trig_BO_PDD_Actions takes nothing returns nothing
local unit c = udg_PDD_source
local unit d
local unit s
local real dur = 6 + 0.08 * GetHeroLevel(udg_PDD_source)
local location p = GetUnitLoc(udg_PDD_target)
//local integer i = 1
local group g
local real r = 0
local real rq = 0.08 * GetUnitMaxLife(udg_PDD_target) + 70 * GetUnitAbilityLevel(udg_PDD_source, 'A09J')
local real rw = 0.22 + 0.07 * GetUnitAbilityLevel(udg_PDD_source, 'A0BN')
local real rr = (20 + 56 * GetUnitAbilityLevel(udg_PDD_source, 'A0BM')) + 2 * GetHeroLevel(udg_PDD_source)
local boolean ra = GetUnitManaPercent(udg_PDD_source) > 7.5
local boolean rb = GetUnitAbilityLevel(udg_PDD_source, 'A0BM') > 0
//passive
set s = CreateUnitAtLoc(GetOwningPlayer(c), 'h01O', p,0)
call SetUnitLife(s, dur)
set udg_BO_stacks = udg_BO_stacks + 1
if udg_BO_stacks > 8 then
call SetUnitAbilityLevel(c, 'A07D', 8)
else
call SetUnitAbilityLevel(c, 'A07D', udg_BO_stacks)
endif
// r onhit
if udg_Blackblood_bool and rb then
set r = r + rr
//call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) - 0.7 * r)
call SetUnitManaBJ(udg_PDD_source, GetUnitState(udg_PDD_source, UNIT_STATE_MANA) - 0.7 * r )
call FadingText( "+" + I2S(R2I(r)), udg_PDD_target, 15.00, 70, 70, 70, 0 )
endif
// q bash
if GetUnitAbilityLevel(udg_PDD_target, 'B038') > 0 then
set r = r + rq
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h004', p, 0 )
call UnitAddAbility( d, 'A05E' )
call IssueTargetOrder( d, "firebolt", udg_PDD_target )
call UnitRemoveAbility( udg_PDD_target, 'B038' )
set d = null
endif
set udg_PDD_amount = udg_PDD_amount + r
// w lifesteal
if GetUnitAbilityLevel(udg_PDD_target, 'B054') > 0 then
call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) + rw * udg_PDD_amount)
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(dur) )
call RemoveLocation (p)
endfunction
function Trig_BO_PDD_2_Conditions takes nothing returns boolean
local boolean a = not(udg_Blackblood_bool)
local boolean b = IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source))
local boolean c = GetUnitTypeId(udg_PDD_target) == 'N010'
local boolean d = GetUnitManaPercent(udg_PDD_target) < 92.5
local boolean e = GetUnitAbilityLevel(udg_PDD_target, 'A0BM') > 0
return (a and b and c and d and e)
endfunction
function Trig_BO_PDD_2_Actions takes nothing returns nothing
//local location p = GetUnitLoc(udg_PDD_target)
local real r = udg_PDD_amount * (0.15 + 0.15 * GetUnitAbilityLevel(udg_PDD_target, 'A0BM'))
call SetUnitManaBJ( udg_PDD_target, ( GetUnitState(udg_PDD_target, UNIT_STATE_MANA) + 0.7 * r ))
call FadingText( "-" +(I2S(R2I(r)) ), udg_PDD_target, 10.00, 80, 80, 80, 0 )
set udg_PDD_amount = udg_PDD_amount - r
//call RemoveLocation(p)
endfunction
function Trig_BT_PDD_Conditions takes nothing returns boolean
local real d = 27 * GetUnitAbilityLevel(udg_PDD_target,'B03P')
local boolean a = GetRandomReal(0,100) < (0.9*GetHeroLevel(udg_PDD_source) + 27 + d )
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00K' ) ) then
return false
endif
if ( not ( udg_PDD_damageType != udg_PDD_CODE) ) then
return false
endif
return a
endfunction
function Trig_BT_PDD_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_PDD_target)
call CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source),'h00K',p,0)
call RemoveLocation(p)
endfunction
function Trig_CS_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N01A' ) ) then
return false
endif
if ( not ( GetUnitPercentLife(udg_PDD_target) < 60 ) ) then
return false
endif
return true
endfunction
function Trig_CS_PDD_Actions takes nothing returns nothing
local integer i = GetHeroLevel(udg_PDD_source)
local unit d
local location pu = GetUnitLoc(udg_PDD_target)
set d = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility(d, 'A0AV')
call SetUnitAbilityLevel( d, 'A0AV', i)
call IssueTargetOrder( d, "soulburn", udg_PDD_target )
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h002', pu, bj_UNIT_FACING )
call RemoveLocation (pu)
endfunction
function Trig_CS_PDD_2_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_target) == 'N01A' ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_SPELL ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(udg_PDD_target, 'B04K') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_CS_PDD_2_Actions takes nothing returns nothing
local texttag t
local real r = (0.1 + 0.1 * I2R(GetUnitAbilityLevel(udg_PDD_target, 'A0AW')))* udg_PDD_amount
set udg_PDD_amount = udg_PDD_amount - r
call FadingText( "-" +(I2S(R2I(r)) ), udg_PDD_target, 10.00, 100, 90, 90, 0 )
endfunction
function Trig_DN_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00A' ) ) then
return false
endif
return true
endfunction
function Trig_DN_PDD_Actions takes nothing returns nothing
local boolean back1 = GetUnitAbilityLevel(udg_PDD_source, 'A01S') > 0
local boolean back2 = Backstab(udg_PDD_source, udg_PDD_target) //check angle
local boolean back = back1 and back2
local location pc = GetUnitLoc(udg_PDD_source)
local location pu
local unit d
local real tm = UnitInventoryCount(udg_PDD_source) * 20
local real base = GetRandomReal(0,8) + tm + 2 * GetHeroLevel(udg_PDD_source) + GetHeroAgi(udg_PDD_source,true)
local real xe = 0.08 * GetUnitAbilityLevel(udg_PDD_source, 'A01S')
local real x = 1
local real r
local unit u
local string s = "!"
set udg_PDD_amount = 0
//setting target
if udg_Tag_target != null then
set u = udg_Tag_target
else
set u = udg_PDD_target
endif
//if target is shadow melted or tagged, it is backstabbed if dante has skilled it
if GetUnitAbilityLevel(u, 'B023') > 0 or u == udg_Tag_target then
set back = GetUnitAbilityLevel(udg_PDD_source, 'A01S') > 0
endif
if back then
set x = x + xe
set s = "!!"
endif
set r = 0.8 * base * x
call UnitDamageTargetPDD (udg_PDD_source, u, r, 0)
call FadingText( I2S(R2I(r)) + s, u, 13.00, 64, 80, 64, 0 )
set d = null
set u = null
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
function Trig_DC_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N003' ) ) then
return false
endif
return true
endfunction
function Trig_DC_PDD_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_PDD_target)
local unit fx
local real r
local real r1 = GetUnitLife(udg_PDD_source) - GetUnitLife(udg_PDD_target)
local real m = 0.09
local real xw = 0.3 + 0.2 * GetUnitAbilityLevel(udg_PDD_source, 'A0AN')
if r1 > 3000 then
set r1 = 3000
endif
if r1 < 0 then
set r1 = 0
endif
if (GetUnitAbilityLevel(udg_PDD_target, 'B02L') > 0) then
set m = m * 1.3
endif
set r = m * r1
set udg_PDD_amount = udg_PDD_amount + r
if (GetUnitAbilityLevel(udg_PDD_source, 'B04F') > 0) then
call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) + xw * r)
endif
if r > 0 then
call FadingText( "+" + I2S(R2I(r)), udg_PDD_source, 13.00, 63, 63, 50, 0 )
//else
//call FadingText( "+" + I2S(R2I(r)), udg_PDD_source, 11.00, 37, 37, 50, 0 )
endif
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h002', p, bj_UNIT_FACING )
set fx = null
call RemoveLocation (p)
endfunction
function Trig_DC_PDD_2_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel( udg_PDD_target, 'A0A2') > 0 ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_target) == 'N003' ) ) then
return false
endif
return true
endfunction
function Trig_DC_PDD_2_Actions takes nothing returns nothing
local real r = 18 * I2R(GetUnitAbilityLevel(udg_PDD_target,'A0A2')) + 2 * GetUnitLevel(udg_PDD_target) - 10
if r < udg_PDD_amount then
call FadingText( "-" +(I2S(R2I(r)) ), udg_PDD_target, 10.00, 100, 100, 100, 0 )
set udg_PDD_amount = udg_PDD_amount - r
else
call FadingText( "-" +(I2S(R2I(udg_PDD_amount)) ), udg_PDD_target, 10.00, 100, 100, 100, 0 )
set udg_PDD_amount = 0
endif
endfunction
function Trig_EM_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00J' ) ) then
return false
endif
return true
endfunction
function Trig_EM_PDD_Actions takes nothing returns nothing
local unit c = udg_PDD_source
call UnitCharge(c, 1)
set udg_LS_bool = true
endfunction
function Trig_FS_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_SPELL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N01G' ) ) then
return false
endif
return true
endfunction
function Trig_FS_PDD_Actions takes nothing returns nothing
local unit u = udg_PDD_target
local real r = (0.15 + GetUnitAbilityLevel(u, 'A08R')* 0.015) * GetHeroInt(udg_PDD_source, true)
local location p = GetUnitLoc(u)
local unit d
local texttag t
//local integer i = 5
call UnitFloral(udg_PDD_source,u,5)
if ( GetUnitAbilityLevel(u, 'A08R') > 15 ) then
set udg_PDD_amount = udg_PDD_amount + r
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h017', p, 0 )
call FadingText( I2S(R2I(udg_PDD_amount))+ "!", u, 15.00, 10.00, 100.00, 50.00, 0 )
endif
//call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,I2S(stack))
call RemoveLocation (p)
set u = null
set d = null
endfunction
function Trig_FMD_PDD_Conditions takes nothing returns boolean
//local integer i = GetHeroLevel(udg_PDD_source)
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00O' ) ) then
return false
endif
return true
endfunction
function Trig_FMD_PDD_Actions takes nothing returns nothing
//local unit c = udg_PDD_source
//local real r = 6 + GetHeroLevel(udg_PDD_source)*0.72
//local boolean a = ((udg_PDD_amount)* 0.15 > r)
local real v = 0.4 * GetUnitAbilityLevel(udg_PDD_source, 'A060')
local real rr = 1 + GetUnitAbilityLevel(udg_PDD_source, 'B01D') * v
local real tm = UnitInventoryCount(udg_PDD_source) * 7
local real v1 = 5 + GetHeroLevel(udg_PDD_source)
local real v2 = 90 + GetHeroAgi(udg_PDD_source, true)
//local real rx = 0.18 * (2 + GetUnitAbilityLevel(udg_PDD_source, 'A060'))
//
set udg_SF_caster = udg_PDD_source
//set udg_FMD_multi = 7 + (24 * udg_SF_int)/(70 - 2 * udg_SF_int)
//call DisplayTextToForce( GetPlayersAll(), "aspd scaling: " + R2S(udg_FMD_multi) )
set udg_SF_int = 12
set udg_SF_point = GetUnitLoc(udg_PDD_target)
if IsTriggerEnabled(gg_trg_SF_2) == false then // GetUnitManaPercent(udg_PDD_source) > 30 then
call EnableTrigger( gg_trg_SF_2 )
endif
//set udg_FMD_multi = (0.003 * udg_FMD_multi * (90 + GetHeroAgi(udg_PDD_source, true))) + tm
set udg_FMD_multi = (0.01 * rr * v1 * v2) + tm
//call DisplayTextToForce( GetPlayersAll(), "total damage: " + R2S(udg_FMD_multi) )
set udg_PDD_amount = 0
endfunction
function Trig_FMD_PDD_2_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'h01N' ) ) then
return false
endif
return true
endfunction
function Trig_FMD_PDD_2_Actions takes nothing returns nothing
local real x = 0.075
local real r = udg_PDD_amount
if IsUnitType (udg_PDD_target, UNIT_TYPE_HERO) then
set x = 0.1
endif
set r = r * x * udg_FMD_multi
///call UnitDamageTargetPDD (udg_SF_caster, udg_PDD_target, r, 0)
set udg_PDD_amount = r
call RemoveUnit (udg_PDD_source)
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_PDD_amount) )
endfunction
function Trig_GS_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N018' ) ) then
return false
endif
return true
endfunction
function Trig_GS_PDD_Actions takes nothing returns nothing
local real r = 0.5 + 0.01 * GetHeroLevel(udg_PDD_source)
local boolean b = GetUnitAbilityLevel(udg_PDD_source, 'B05H') > 0
local integer vw = 1 + GetUnitAbilityLevel(udg_PDD_source, 'A0C8') * 5 + GetHeroLevel(udg_PDD_source)
local unit d
local location pu = GetUnitLoc(udg_PDD_target)
local real xw = 0.05 + 0.001 * GetHeroAgi(udg_PDD_source, true)
if IsTriggerEnabled(gg_trg_MS_2) then
//if multishot is active do this
set udg_PDD_amount = ( udg_PDD_amount * r )
endif
if (b) then
//if cooling orb is active do this
set d = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility(d, 'A0C9')
call SetUnitAbilityLevel( d, 'A0C9', vw)
call IssueTargetOrder( d, "slow", udg_PDD_target )
call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) + (xw * udg_PDD_amount))
endif
call RemoveLocation(pu)
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_PDD_amount) )
endfunction
function Trig_GW_PDD_Conditions takes nothing returns boolean
local boolean a = udg_PDD_damageType == udg_PDD_SPELL
local boolean b = GetUnitAbilityLevel(udg_PDD_target, 'B03I') > 0
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source))) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_target) == 'N017' ) ) then
return false
endif
return (a or b)
endfunction
function Trig_GW_PDD_Actions takes nothing returns nothing
local real x = 0
local real r = 0
if udg_PDD_damageType == udg_PDD_SPELL then
set x = x + 0.01 * (10 + GetHeroLevel(udg_PDD_target))
endif
if ( GetUnitAbilityLevel(udg_PDD_target, 'B03I') > 0 ) then
set x = x + 0.07 * GetUnitAbilityLevel(udg_PDD_target, 'A08C')
endif
//
set r = x * udg_PDD_amount
if udg_MF_real < r and GetUnitAbilityLevel(udg_PDD_target, 'B03I') > 0 then
set r = udg_MF_real
set udg_MF_real = 0
call UnitRemoveAbility(udg_PDD_target, 'B03I')
endif
if r > 5 then
call FadingText( I2S(R2I(udg_MF_real)) + "(-" + I2S(R2I(r)) + ")", udg_PDD_target, 11.00, 70, 70, 70, 0 )
endif
set udg_PDD_amount = udg_PDD_amount - r
endfunction
function Trig_HO_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_SPELL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00I' ) ) then
return false
endif
return true
endfunction
function Trig_HO_PDD_Actions takes nothing returns nothing
local real r = 0.4 + 0.01 * GetHeroInt(udg_PDD_source, true)
//local real r2 = 1 + GetUnitMissingPercentLife(udg_PDD_target)/200
set udg_PDD_amount = ( udg_PDD_amount * r )
endfunction
function Trig_HV_PDD_Conditions takes nothing returns boolean
local integer i = GetHeroAgi(udg_PDD_target, true)
local boolean a = GetRandomInt(1,700) < i
local boolean b = IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source))
local boolean c = GetUnitTypeId(udg_PDD_target) == 'N002'
return (a and b and c)
endfunction
function Trig_HV_PDD_Actions takes nothing returns nothing
//local location p = GetUnitLoc(udg_PDD_target)
local real r = udg_PDD_amount
if r > 100 then
call FadingText( "!", udg_PDD_target, 13.00, 98.00, 98.00, 0.00, 0 )
endif
set udg_PDD_amount = 0
//call RemoveLocation(p)
endfunction
function Trig_HQ_PDD_Conditions takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(udg_PDD_target,'B01P') > 0
local boolean b = GetUnitAbilityLevel(udg_PDD_target,'B01X') > 0
local boolean c = GetUnitAbilityLevel(udg_PDD_target,'B039') > 0
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N019' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(udg_PDD_source,'A06F') > 0 ) ) then
return false
endif
if ( not ( a or b or c ) ) then
return false
endif
return true
endfunction
function Trig_HQ_PDD_Actions takes nothing returns nothing
local unit u = udg_PDD_target
local unit c = udg_PDD_source
local unit d
local location p = GetUnitLoc(u)
local integer i
set i = GetUnitAbilityLevel(c,'A06F')
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A06E' )
call SetUnitAbilityLevel( d, 'A06E', i )
call IssueTargetOrder( d, "acidbomb", u )
set u = null
set c = null
set d = null
call RemoveLocation (p)
endfunction
function Trig_IN_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00N' ) ) then
return false
endif
return true
endfunction
function Trig_IN_PDD_Actions takes nothing returns nothing
local unit u
local unit d
local boolean b = GetUnitAbilityLevel(udg_PDD_source,'B022') > 0
local location p = GetUnitLoc(udg_PDD_target)
//local group g = GetUnitsInRangeOfLocMatching(240, p, Condition(function Trig_PDD_Filter))
//local real r = (GetHeroLevel(udg_PDD_source) * 1 + GetHeroAgi(udg_PDD_source,true))
local real xp = 1
local real day = 1.05 + 0.03 * GetHeroLevel(udg_PDD_source)
local real rr = 0
local real vq = 0.12 * GetUnitAbilityLevel(udg_PDD_source, 'A04F')
local real vr = 0.12 + 0.12 * GetUnitAbilityLevel(udg_PDD_source, 'A023')
local real dz = 0.5 + 0.02 * GetHeroLevel(udg_PDD_source)
local real z = 9
local string s = "?"
local real colour = 99
if Daytime() or b then
set xp = day + vq
set s = "!"
set z = 12
set colour = 90
endif
if b then
set s = "!!"
set rr = vr * GetHeroAgi(udg_PDD_source, true)
set colour = 72
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h01V', p, 0 )
call SetUnitScale( d, dz, dz, dz )
call RemoveLocation (p)
set d = null
endif
set udg_PDD_amount = (udg_PDD_amount + rr) * xp
if IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) then
call FadingText( I2S(R2I(udg_PDD_amount)) + s, udg_PDD_target, z + udg_PDD_amount * 0.001, 99, colour, colour, 0 )
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
endfunction
function Trig_LM_PDD_Conditions takes nothing returns boolean
//local boolean a = GetUnitManaPercent(udg_PDD_target) > 22
local boolean b = IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source))
local boolean c = GetUnitTypeId(udg_PDD_target) == 'N005'
local boolean d = GetUnitAbilityLevel(udg_PDD_target,'A0AZ') > 0
return (d and b and c)
endfunction
function Trig_LM_PDD_Actions takes nothing returns nothing
//local location p = GetUnitLoc(udg_PDD_target)
local real x = 2.2 - 0.2 * GetUnitAbilityLevel(udg_PDD_target,'A0AZ')
local real n = GetUnitManaPercent(udg_PDD_target) * 0.01
local real r = (0.3 + 0.1 * GetUnitAbilityLevel(udg_PDD_target,'A0AZ')) * n * udg_PDD_amount
call SetUnitManaBJ( udg_PDD_target, ( GetUnitState(udg_PDD_target, UNIT_STATE_MANA) - r * x ))
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_PDD_amount/2.2) )
set udg_PDD_amount = udg_PDD_amount - r
if udg_PDD_amount > 5 then
call FadingText( "-" + ( I2S(R2I(r)) ), udg_PDD_target, 10.00, 80.00, 80.00, 80, 0 )
endif
//call RemoveLocation(p)
endfunction
function Trig_MA_PDD_Conditions takes nothing returns boolean
local boolean b = udg_PDD_damageType == udg_PDD_SPELL
local boolean c = udg_PDD_damageType == udg_PDD_PHYSICAL
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( b or c ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N01E' ) ) then
return false
endif
return true
endfunction
function Trig_MA_PDD_Actions takes nothing returns nothing
local boolean hero = IsUnitType(udg_PDD_target, UNIT_TYPE_HERO)
local unit d
local location p = GetUnitLoc(udg_PDD_target)
local real rp = (0.105 + 0.005 * GetHeroLevel(udg_PDD_source)) * GetUnitMaxLife(udg_PDD_target)
local real ri = 0.25 + 0.03 * GetHeroLevel(udg_PDD_source) * GetHeroInt(udg_PDD_source, true)
local real vi = 2 * GetHeroInt(udg_PDD_source,true) + GetHeroBonusInt(udg_PDD_source)
local real rq = 0.05 + 0.03 * GetUnitAbilityLevel(udg_PDD_source, 'A0CL')
local real rw = 0.05 * GetUnitAbilityLevel(udg_PDD_source, 'A0CT')
local real re = 0.25 + 0.05 * GetUnitAbilityLevel(udg_PDD_source, 'A01B')
local real r = 0
local real rx = 1
local real z = 11
if udg_PDD_damageType == udg_PDD_PHYSICAL then
//talons of malice
if ( GetUnitAbilityLevel(udg_PDD_source, 'B05P') > 0 ) then
//call DisplayTextToForce( GetPlayersAll(), "talons empower!" )
set r = r + rq * vi
set z = z + 2
call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) + rq*vi)
if udg_TM_int > 1 then
set udg_TM_int = udg_TM_int - 1
else
call UnitRemoveAbility(udg_PDD_source, 'B05P')
endif
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h02D', p, bj_UNIT_FACING )
endif
//target is marked
if ( GetUnitAbilityLevel(udg_PDD_target, 'B05Q') > 0 ) then
//call DisplayTextToForce( GetPlayersAll(), "mark empower!" )
set rx = 1 + rw
set z = z + 1
endif
else
//baleful warning
if (GetUnitAbilityLevel(udg_PDD_target, 'B05Q') == 0 and hero) then
//cast ff on target
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A0CM' )
//call SetUnitAbilityLevel( d, 'A06E', i )
call IssueTargetOrder( d, "faeriefire", udg_PDD_target )
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h004', p, bj_UNIT_FACING )
//call DisplayTextToForce( GetPlayersAll(), "passive empower!" )
set r = r + rp + ri
set z = z + 2
endif
endif
//umbral veil
if GetUnitAbilityLevel(udg_PDD_source, 'B046') > 0 then
call UnitRemoveAbility(udg_PDD_source, 'B046')
//call DisplayTextToForce( GetPlayersAll(), "umbral veil empower!" )
set r = r + re * vi
set z = z + 1
endif
if r > 0 or rx > 1 then
set udg_PDD_amount = (udg_PDD_amount + r) * rx
call FadingText( I2S(R2I(udg_PDD_amount)) + "!!" , udg_PDD_target, z, 50, 70, 50, 0 )
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_PDD_amount) )
call RemoveLocation (p)
endfunction
function Trig_NP_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00M' ) ) then
return false
endif
if ( IsUnitType(udg_PDD_target, UNIT_TYPE_STRUCTURE) ) then
return false
endif
return true
endfunction
function Trig_NP_PDD_Actions takes nothing returns nothing
local real r = 0.09 * GetHeroAgi(udg_PDD_source,true)
local real r2 = (25 + GetHeroLevel(udg_PDD_source))* 0.005
local real rc = 0.15 + 0.05 * GetUnitAbilityLevel(udg_PDD_source, 'A007')
local real re = 1 + 0.3 * GetUnitAbilityLevel(udg_PDD_source, 'A03S')
if rc > GetRandomReal(0,1) and GetUnitAbilityLevel(udg_PDD_source, 'A007') > 0 then
set udg_PDD_amount = (udg_PDD_amount + r ) * re
call FadingText( I2S(R2I(udg_PDD_amount)) + "!!" , udg_PDD_target, 13.00, 90, 13, 13, 0 )
else
set udg_PDD_amount = udg_PDD_amount + r
endif
if IsTriggerEnabled(gg_trg_DO_3) then
set r2 = r2 * 2
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(r2) )
call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) + (r2 * udg_PDD_amount))
//call FadingText( "+" + I2S(R2I(r2 * udg_PDD_amount)), udg_PDD_source, 13.00, 90, 65, 65, 0 )
endfunction
function Trig_PS_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
//if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
// return false
//endif
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00W' ) ) then
return false
endif
if ( IsUnitType(udg_PDD_target, UNIT_TYPE_STRUCTURE) ) then
return false
endif
return true
endfunction
function Trig_PS_PDD_Actions takes nothing returns nothing
local location pu = GetUnitLoc(udg_PDD_target)
local location pt = GetUnitLoc(udg_PDD_source)
local integer i = GetUnitAbilityLevel(udg_PDD_source, 'A04Q')
local real amp = 1
local real r
local real x = DistanceBetweenPoints(pu, pt) * 0.00003
local real v = 6 + (GetHeroLevel(udg_PDD_source))
local texttag t
if (GetUnitAbilityLevel(udg_PDD_target, 'B01N') > 0 ) then
set amp = 1.05 + i * 0.05
endif
set r = v * x * amp + 1
set udg_PDD_amount = ( udg_PDD_amount * r )
call FadingText(( I2S(R2I(udg_PDD_amount)) + "!!" ), udg_PDD_target, 13.00 + x, 0, 100, 0, 0 )
call RemoveLocation (pu)
call RemoveLocation (pt)
endfunction
function Trig_PT_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType != udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N009' ) ) then
return false
endif
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(udg_PDD_target, 'B04G') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_PT_PDD_Actions takes nothing returns nothing
local unit fx
local location p = GetUnitLoc(udg_PDD_target)
local real r2 = 1.2 * GetHeroInt(udg_PDD_source, true) + GetHeroLevel(udg_PDD_source)*9
local real r = ( 120.00 - GetUnitPercentLife(udg_PDD_target) ) * r2 * 0.01
set udg_PDD_amount = ( udg_PDD_amount + r )
call UnitRemoveAbility(udg_PDD_target, 'B04G')
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source),'h01A', p, 0)
call FadingText( ( "+" + I2S(R2I(r)) + "!"), udg_PDD_target, 18.00, 100, 60, 0, 0 )
call RemoveLocation (p)
endfunction
function Trig_RB_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'H00M' ) ) then
return false
endif
if ( not ( udg_RB_rage > 0 ) ) then
return false
endif
return true
endfunction
function Trig_RB_PDD_Actions takes nothing returns nothing
local unit fx
local location p = GetUnitLoc(udg_PDD_target)
local real rv = GetUnitAbilityLevel(udg_PDD_source, 'A02I')
local real rx = 1 + GetUnitAbilityLevel(udg_PDD_source, 'B063') * (0.1 + 0.2 * rv)
local real rp = 0.04 + 0.002 * GetHeroLevel(udg_PDD_source)
local real r = udg_RB_rage * rp * rx
local real z = rp * 20
set udg_PDD_amount = udg_PDD_amount + r
if rx > 1 then
call FadingText( ( "+" + I2S(R2I(r)) ), udg_PDD_source, 13 + 40 * rp, 80.00, 0, 0, 0 )
else
call FadingText( ( "+" + I2S(R2I(r)) ), udg_PDD_source, 13 + 20 * rp, 90.00, 0, 0, 0 )
endif
//set udg_RB_rage = udg_RB_rage * 0.5
set udg_RB_combat = 5
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h002', p, bj_UNIT_FACING )
call RemoveLocation (p)
endfunction
function Trig_RB_PDD_2_Conditions takes nothing returns boolean
return (GetUnitTypeId(udg_PDD_target) == 'H00M') and udg_PDD_amount > 0
endfunction
function Trig_RB_PDD_2_Actions takes nothing returns nothing
//local real r = 0.2 * udg_PDD_amount
//local real rv = 0.5 // + 0.01 * GetHeroLevel(udg_PDD_target)
//set r = rv * udg_PDD_amount
//set udg_PDD_amount = udg_PDD_amount + r
//if r > 5 then
// call FadingText( ( "+" + I2S(R2I(r)) ), udg_PDD_target, 10, 90.00, 0, 0, 0 )
//endif
set udg_RB_combat = 5
if udg_RB_rage < GetUnitMaxLife(udg_PDD_target) then
set udg_RB_rage = udg_RB_rage + udg_PDD_amount
else
set udg_RB_rage = GetUnitMaxLife(udg_PDD_target)
endif
set udg_Aaron = udg_PDD_target
if ( not IsTriggerEnabled(gg_trg_Rage_Decay) ) then
call EnableTrigger( gg_trg_Rage_Decay )
endif
endfunction
function Trig_RH_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
//if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL) ) then
// return false
//endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00V' ) ) then
return false
endif
return true
endfunction
function Trig_RH_PDD_Filter takes nothing returns boolean
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
//if ( not (GetUnitAbilityLevel(udg_PDD_source,'A08D') > 0 ) ) then
// return false
//endif
return true
endfunction
function Trig_RH_PDD_Actions takes nothing returns nothing
local real r = 0.2 * GetHeroInt(udg_PDD_source, true) + 0.3 * GetHeroBonusInt(udg_PDD_source)
//if ( Trig_RH_PDD_Filter() ) then
// set udg_PDD_amount = ( 0.67 * udg_PDD_amount + r )
// call FadingText( "+" + I2S(R2I(r)), udg_PDD_target, 12.00, 80, 80, 40, 0 )
//else
// set udg_PDD_amount = ( 0.67 * udg_PDD_amount)
//endif
local real v = ( r + GetHeroLevel(udg_PDD_source) ) * 0.01
if ( Trig_RH_PDD_Filter() ) then
set udg_PDD_amount = ( ( 0.75 + v ) * udg_PDD_amount )
else
set udg_PDD_amount = ( 0.5 * udg_PDD_amount + r)
endif
endfunction
function Trig_RP_PDD_Conditions takes nothing returns boolean
local boolean a = udg_PDD_damageType == udg_PDD_SPELL
local boolean b = udg_PDD_damageType == udg_PDD_PHYSICAL
local boolean c = GetRandomReal(0,100) < 12
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( a or (b and c) ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'H001' ) ) then
return false
endif
return true
endfunction
function Trig_RP_PDD_Filter takes nothing returns boolean
local boolean a = GetUnitTypeId(GetFilterUnit()) == 'h00A'
local boolean b = IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_PDD_source))
return ( a and b )
endfunction
function Trig_RP_PDD_Actions takes nothing returns nothing
local unit c = udg_PDD_source
local real rh = 0.11 * GetUnitMaxLife(c)
local real rc = 0.11 * GetUnitMaxLife(udg_PDD_target)
local real rd = 0.11 * GetUnitState(c, UNIT_STATE_MAX_MANA)
local location p = GetUnitLoc(udg_PDD_source)
// rh is the heal amount
local integer i = GetRandomInt(1,4)
local group g = GetUnitsInRangeOfLocMatching(1100, p, Condition(function Trig_RP_PDD_Filter))
local unit d
local unit u
if ( i == 1 ) then
// draw trigger
call SetUnitState(c, UNIT_STATE_MANA, GetUnitState(c, UNIT_STATE_MANA) + rd )
call FadingText( "DRAW" , c, 17, 100.00, 60.00, 40.00, 0 )
elseif ( i == 2 ) then
// stand trigger
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h00A', p, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 23, 'BTLF', d )
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h00A', p, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 23, 'BTLF', d )
call FadingText( "STAND" , c, 17, 20.00, 20.00, 100.00, 0 )
elseif ( i == 3 ) then
// crit trigger
set udg_PDD_amount = udg_PDD_amount + rc
call FadingText ( "CRIT" , c, 17, 80.00, 80.00, 20.00, 0 )
elseif ( i == 4 ) then
// heal trigger
call SetUnitLife(c, (GetUnitLife(c)+rh))
call FadingText( "HEAL" , c, 17, 20.00, 100.00, 20.00, 0 )
endif
loop
set u = FirstOfGroup (g)
exitwhen u == null
call IncUnitAbilityLevel(u, 'A06A')
call GroupRemoveUnit(g,u)
endloop
set c = null
set g = null
endfunction
function Trig_SR_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N011' ) ) then
return false
endif
return true
endfunction
function Trig_SR_PDD_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_PDD_target)
local location pc = GetUnitLoc(udg_PDD_source)
local real x = GetUnitMissingPercentLife(udg_PDD_target) * 0.19
local integer v = GetUnitAbilityLevel(udg_PDD_source, 'A05W')
local real rv = 0.2 + 0.01 * GetHeroLevel(udg_PDD_source)
local integer i = GetRandomInt(1,9)
if v > i then
//damage
set x = 0.003 * (19 + i) * (19 + x) //(1.14 to 3.19)
set udg_PDD_amount = udg_PDD_amount * x
call FadingText(I2S(R2I(udg_PDD_amount)) + "!", udg_PDD_target, 9 + x, 90, 90, 90, 0 )
call SetUnitLife(udg_PDD_source, GetUnitLife(udg_PDD_source) + x * rv * udg_PDD_amount)
//create lifesteal fx
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h02N', pc, bj_UNIT_FACING )
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h002', p, bj_UNIT_FACING )
set v = v - i
else
set v = v + 3
endif
call SetUnitAbilityLevel(udg_PDD_source, 'A05W', v )
//call DisplayTextToForce( GetPlayersAll(), I2S(v) )
call RemoveLocation(pc)
call RemoveLocation(p)
endfunction
function Trig_SQA_PDD_Conditions takes nothing returns boolean
local real r = 45 + 3 * GetHeroLevel(udg_PDD_source)
local boolean a = udg_PDD_damageType == udg_PDD_SPELL
local boolean b = udg_PDD_damageType == udg_PDD_PHYSICAL
local boolean c = GetUnitAbilityLevel(udg_PDD_source, 'B03A') > 0
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( a or (b and c) ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00D' ) ) then
return false
endif
if ( not ( GetRandomReal(0,400) <= r) ) then
return false
endif
return true
endfunction
function Trig_SQA_PDD_Actions takes nothing returns nothing
local unit d
local real xe = 0.12 * GetUnitAbilityLevel(udg_PDD_source, 'A03R')
local real int = GetHeroInt(udg_PDD_source, true)*0.004 + GetHeroBonusInt(udg_PDD_source)*0.009
local real r = GetRandomReal(1.2,1.4) + int + xe
local integer i = GetUnitAbilityLevel(udg_PDD_source,'A03R')
local location p = GetUnitLoc(udg_PDD_source)
if GetUnitAbilityLevel(udg_PDD_source, 'A03R') > 0 then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A032')
call SetUnitAbilityLevel( d, 'A032', i)
call IssueTargetOrder( d, "innerfire", udg_PDD_source )
set d = null
endif
set udg_PDD_amount = ( udg_PDD_amount * r )
call FadingText( ( I2S(R2I(udg_PDD_amount)) + "!!" ), udg_PDD_target, 12.00, 100.00, 100, 30, 0 )
call RemoveLocation(p)
endfunction
function Trig_TC_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N00U' ) ) then
return false
endif
if ( IsUnitType (udg_PDD_target,UNIT_TYPE_STRUCTURE) ) then
return false
endif
return true
endfunction
function Trig_TC_PDD_Actions takes nothing returns nothing
local unit d
local location pu = GetUnitLoc(udg_PDD_target)
local real r = 0.02 * GetHeroInt(udg_PDD_source, true) + 0.08 * GetHeroBonusInt(udg_PDD_source)
local integer i = GetUnitAbilityLevel(udg_PDD_source, 'A02Y')
if (i > 0) then
set d = CreateUnitAtLoc(GetOwningPlayer(udg_PDD_source), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility(d, 'A066')
call SetUnitAbilityLevel( d, 'A066', R2I(r) + 3 + i*5)
call IssueTargetOrder( d, "slow", udg_PDD_target )
endif
//call DisplayTextToForce( GetPlayersAll(), "slow level = " + R2S(R2I(r) + i*8) )
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) ) ) then
set r = r * 0.125
endif
if (udg_PDD_damageType == udg_PDD_SPELL) then
set r = r*2.8
endif
set udg_PDD_amount = ( udg_PDD_amount + 5.6*r )
call SetUnitPercentLife(udg_PDD_source, GetUnitPercentLife(udg_PDD_source) + 0.08*r)
//call DisplayTextToForce( GetPlayersAll(), "damage inc = " + R2S(2.8*r) )
//call DisplayTextToForce( GetPlayersAll(), "%hp heal = " + R2S(0.08*r) )
set d = null
call RemoveLocation (pu)
endfunction
function Trig_TI_PDD_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_PDD_target))
return (a and IsTarget())
endfunction
function Trig_TI_PDD_Conditions takes nothing returns boolean
local boolean a = GetUnitTypeId(udg_PDD_target) == 'N01F'
local boolean b = udg_PDD_amount > 0
return a and b
endfunction
function Trig_TI_PDD_Actions takes nothing returns nothing
local unit u
local location p = GetUnitLoc(udg_PDD_target)
local group g = GetUnitsInRangeOfLocMatching( 900, p, function Trig_TI_PDD_Filter )
local real rv = (8 + 0.4 * I2R(GetHeroLevel(udg_PDD_target)))
local real rt = 4 * GetUnitAbilityLevel(udg_PDD_target, 'A09Z')
local real r = 0.01 * (rv + rt) * udg_PDD_amount
set udg_PDD_amount = udg_PDD_amount - r
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetPDD( udg_PDD_target, u, r, 0 )
call GroupRemoveUnit(g, u)
endloop
set u = null
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
call RemoveLocation (p)
call DestroyGroup (g)
endfunction
function Trig_UW_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N016' ) ) then
return false
endif
return true
endfunction
function Trig_UW_PDD_Actions takes nothing returns nothing
local texttag t
local real r
local integer level = 8 + GetUnitAbilityLevel(udg_PDD_source,'A051') * 4
local boolean a = GetUnitAbilityLevel(udg_PDD_source,'A051') > 0
local boolean b = GetRandomInt(0,100) < level
local location p = GetUnitLoc(udg_PDD_source)
local unit d
if (IsUnitIllusion(udg_PDD_source)) then
if ( GetRandomReal(0, 200.00) <= (31 + I2R(GetUnitLevel(udg_PDD_source))) ) then
set r = ( GetUnitMaxLife(udg_PDD_target) * 0.08 )
set udg_PDD_amount = r
call FadingText( ( I2S(R2I(r)) + "!" ), udg_PDD_target, 10.50, 100.00, 0, 60, 0 )
else
set udg_PDD_amount = 0
endif
else
if IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) then
set udg_PDD_amount = 0.8 * udg_PDD_amount
endif
if (a and b) then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility( d,'A04W' )
call IssueTargetOrderById(d,852274,udg_PDD_source)
set d = null
endif
endif
call RemoveLocation (p)
set d = null
endfunction
function Trig_WA_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source))) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'N01B' ) ) then
return false
endif
return true
endfunction
function Trig_WA_PDD_Actions takes nothing returns nothing
local unit ug
local location pc = GetUnitLoc(udg_PDD_source)
local location pu = GetUnitLoc(udg_PDD_target)
local location pw
local real angle
local location pr1
local location pr2
//local group gp = GetUnitsInRangeOfLocMatching(480, pu, Condition(function Trig_WA_PDD_Filter))
//local group g = GetRandomSubGroup(3, gp)
local boolean a = udg_Moon_target == udg_PDD_target
local boolean b = GetUnitAbilityLevel(udg_Moon_target,'B05D') > 0
local real base = 0.3 + 0.012 * GetHeroLevel(udg_PDD_source)
if a and b then
set base = base * 1.2
endif
call Moonbeam(udg_PDD_source, pu, base)
//call DisplayTextToForce( GetPlayersAll(), R2S(base) )
if (GetUnitAbilityLevel(udg_PDD_source, 'B01S') == 1) then
set angle = AngleBetweenPoints(pc, pu)
set pr1 = PolarProjectionBJ(pc, 600, angle + 21)
set pr2 = PolarProjectionBJ(pc, 600, angle - 21)
call Moonbeam (udg_PDD_source, pr1, 0.5*base)
call Moonbeam (udg_PDD_source, pr2, 0.5*base)
call RemoveLocation (pr1)
call RemoveLocation (pr2)
endif
set udg_PDD_amount = 0
call RemoveLocation (pc)
call RemoveLocation (pu)
//call DestroyGroup (gp)
//call DestroyGroup (g)
endfunction
function Trig_WW_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'E002' ) ) then
return false
endif
return true
endfunction
function Trig_WW_PDD_Actions takes nothing returns nothing
local unit u = udg_PDD_target
local unit c = udg_PDD_source
local real r = (GetUnitManaPercent(udg_PDD_source) * 0.9 + 90)/100
set udg_PDD_amount = udg_PDD_amount * r
call SetUnitManaBJ( c, ( GetUnitState(c, UNIT_STATE_MANA) * 0.82 ) )
call FadingText( ( I2S(R2I(udg_PDD_amount)) + "!" ), u, 14.00, 80.00, 80.00, 100, 0 )
set c = null
set u = null
endfunction
function Trig_Global_PDD_Actions takes nothing returns nothing
//spell dummy
if Trig_SpellDummy_PDD_Conditions() then
call Trig_SpellDummy_PDD_Actions()
elseif Trig_SpellAmp_PDD_Conditions() then
call Trig_SpellAmp_PDD_Actions()
elseif Trig_SpellComp_PDD_Conditions() then
call Trig_SpellComp_PDD_Actions()
//hero modified attacks/special dummy mod attack
elseif Trig_AA_PDD_Conditions() then
call Trig_AA_PDD_Actions()
elseif Trig_AR_PDD_Conditions() then
call Trig_AR_PDD_Actions()
elseif Trig_BM_PDD_Conditions() then
call Trig_BM_PDD_Actions()
elseif Trig_BO_PDD_Conditions() then
call Trig_BO_PDD_Actions()
elseif Trig_BT_PDD_Conditions() then
call Trig_BT_PDD_Actions()
elseif Trig_CS_PDD_Conditions() then
call Trig_CS_PDD_Actions()
elseif Trig_DN_PDD_Conditions() then
call Trig_DN_PDD_Actions()
elseif Trig_DC_PDD_Conditions() then
call Trig_DC_PDD_Actions()
elseif Trig_EM_PDD_Conditions() then
call Trig_EM_PDD_Actions()
elseif Trig_FS_PDD_Conditions() then
call Trig_FS_PDD_Actions()
elseif Trig_FMD_PDD_Conditions() then
call Trig_FMD_PDD_Actions()
elseif Trig_FMD_PDD_2_Conditions() then
call Trig_FMD_PDD_2_Actions()
elseif Trig_GS_PDD_Conditions() then
call Trig_GS_PDD_Actions()
elseif Trig_HO_PDD_Conditions() then
call Trig_HO_PDD_Actions()
elseif Trig_HQ_PDD_Conditions() then
call Trig_HQ_PDD_Actions()
elseif Trig_IN_PDD_Conditions() then
call Trig_IN_PDD_Actions()
elseif Trig_MA_PDD_Conditions() then
call Trig_MA_PDD_Actions()
elseif Trig_NP_PDD_Conditions() then
call Trig_NP_PDD_Actions()
elseif Trig_PS_PDD_Conditions() then
call Trig_PS_PDD_Actions()
elseif Trig_PT_PDD_Conditions() then
call Trig_PT_PDD_Actions()
elseif Trig_RB_PDD_Conditions() then
call Trig_RB_PDD_Actions()
elseif Trig_RH_PDD_Conditions() then
call Trig_RH_PDD_Actions()
elseif Trig_RP_PDD_Conditions() then
call Trig_RP_PDD_Actions()
elseif Trig_SR_PDD_Conditions() then
call Trig_SR_PDD_Actions()
elseif Trig_SQA_PDD_Conditions() then
call Trig_SQA_PDD_Actions()
elseif Trig_TC_PDD_Conditions() then
call Trig_TC_PDD_Actions()
elseif Trig_UW_PDD_Conditions() then
call Trig_UW_PDD_Actions()
elseif Trig_WA_PDD_Conditions() then
call Trig_WA_PDD_Actions()
elseif Trig_WW_PDD_Conditions() then
call Trig_WW_PDD_Actions()
endif
//defensive pdd
if Trig_AD_PDD_Conditions() then
call Trig_AD_PDD_Actions()
elseif Trig_BO_PDD_2_Conditions() then
call Trig_BO_PDD_2_Actions()
elseif Trig_CS_PDD_2_Conditions() then
call Trig_CS_PDD_2_Actions()
elseif Trig_DC_PDD_2_Conditions() then
call Trig_DC_PDD_2_Actions()
elseif Trig_GW_PDD_Conditions() then
call Trig_GW_PDD_Actions()
elseif Trig_HV_PDD_Conditions() then
call Trig_HV_PDD_Actions()
elseif Trig_LM_PDD_Conditions() then
call Trig_LM_PDD_Actions()
elseif Trig_RB_PDD_2_Conditions() then
call Trig_RB_PDD_2_Actions()
elseif Trig_TI_PDD_Conditions() then
call Trig_TI_PDD_Actions()
endif
//damage modifiers
//if Trig_DamageMod_PDD_Conditions() then
// call Trig_DamageMod_PDD_Actions()
//endif
endfunction
//===========================================================================
function InitTrig_Global_PDD takes nothing returns nothing
set gg_trg_Global_PDD = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_Global_PDD, "udg_PDD_damageEventTrigger", EQUAL, 1.00 )
call TriggerAddAction( gg_trg_Global_PDD, function Trig_Global_PDD_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_SpawnCreeps_Actions takes nothing returns nothing
local location spawn1
local location spawn2
local location spawn3
local location spawn4
//local location p1
//local location p2
//local location p3
//local location p4
local integer i
set spawn1 = GetRectCenter(gg_rct_Radiant_Creeps_1)
set spawn2 = GetRectCenter(gg_rct_Radiant_Creeps_2)
set spawn3 = GetRectCenter(gg_rct_Shadow_Creeps_1)
set spawn4 = GetRectCenter(gg_rct_Shadow_Creeps_2)
//set p1 = GetUnitLoc(gg_unit_e003_0034)
//set p2 = GetUnitLoc(gg_unit_e003_0035)
//set p3 = GetUnitLoc(gg_unit_e003_0036)
//set p4 = GetUnitLoc(gg_unit_e003_0037)
set i = udg_Creeps_int
call CreateNUnitsAtLoc( i+2, 'h02I', Player(4), spawn1, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+2, 'h02I', Player(4), spawn2, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+2, 'h02I', Player(9), spawn3, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+2, 'h02I', Player(9), spawn4, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+3, 'h02H', Player(4), spawn1, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+3, 'h02H', Player(4), spawn2, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+3, 'h02H', Player(9), spawn3, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+3, 'h02H', Player(9), spawn4, GetRandomReal(0,360) )
//call SetTerrainTypeBJ( p1, 'Lgrd', -1, 12, 0 )
//call SetTerrainTypeBJ( p2, 'Lgrd', -1, 12, 0 )
//call SetTerrainTypeBJ( p3, 'Lgrd', -1, 12, 0 )
//call SetTerrainTypeBJ( p4, 'Lgrd', -1, 12, 0 )
call RemoveLocation (spawn1)
call RemoveLocation (spawn2)
call RemoveLocation (spawn3)
call RemoveLocation (spawn4)
//call RemoveLocation (p1)
//call RemoveLocation (p2)
//call RemoveLocation (p3)
//call RemoveLocation (p4)
endfunction
//===========================================================================
function InitTrig_SpawnCreeps takes nothing returns nothing
set gg_trg_SpawnCreeps = CreateTrigger( )
call TriggerAddAction( gg_trg_SpawnCreeps, function Trig_SpawnCreeps_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Spawn_more_mobs_easy_Actions takes nothing returns nothing
local location spawn1
local location spawn2
local location spawn3
local location spawn4
local integer i = udg_Creeps_int
local integer v = udg_Clock_minute
if v > 10 then
set v = 10
endif
set spawn1 = GetRandomLocInRect(gg_rct_Small_Camp_1)
set spawn2 = GetRandomLocInRect(gg_rct_Small_Camp_2)
set spawn3 = GetRandomLocInRect(gg_rct_Small_Camp_3)
set spawn4 = GetRandomLocInRect(gg_rct_Small_Camp_4)
call CreateNUnitsAtLoc( 2 + i, udg_Neutral[GetRandomInt(v+5, v+10)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn1, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 3 + i, udg_Neutral[GetRandomInt(v, v+10)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn2, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 3 + i, udg_Neutral[GetRandomInt(v, v+10)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn3, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 2 + i, udg_Neutral[GetRandomInt(v+5, v+10)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn4, GetRandomReal(0,360) )
call RemoveLocation (spawn1)
call RemoveLocation (spawn2)
call RemoveLocation (spawn3)
call RemoveLocation (spawn4)
endfunction
//===========================================================================
function InitTrig_Spawn_more_mobs_easy takes nothing returns nothing
set gg_trg_Spawn_more_mobs_easy = CreateTrigger( )
call TriggerAddAction( gg_trg_Spawn_more_mobs_easy, function Trig_Spawn_more_mobs_easy_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Spawn_more_mobs_hard_Actions takes nothing returns nothing
local location spawn1
local location spawn2
local location spawn3
local location spawn4
local location spawn5
local location spawn6
local location spawn7
local location spawn8
local integer i = udg_Creeps_int
local integer v = udg_Clock_minute
local integer vmax = v + 25
if v > 10 then
set v = 10
endif
if vmax > 40 then
set vmax = 40
endif
set spawn1 = GetRandomLocInRect(gg_rct_Medium_Camp_1)
set spawn2 = GetRandomLocInRect(gg_rct_Medium_Camp_2)
set spawn3 = GetRandomLocInRect(gg_rct_Medium_Camp_3)
set spawn4 = GetRandomLocInRect(gg_rct_Medium_Camp_4)
set spawn5 = GetRandomLocInRect(gg_rct_Hard_Camp_1)
set spawn6 = GetRandomLocInRect(gg_rct_Hard_Camp_2)
set spawn7 = GetRandomLocInRect(gg_rct_Hard_Camp_3)
set spawn8 = GetRandomLocInRect(gg_rct_Hard_Camp_4)
//
call CreateNUnitsAtLoc( i+1, udg_Neutral[GetRandomInt(v+12, v+20)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn1, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+1, udg_Neutral[GetRandomInt(v+12, v+20)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn2, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+1, udg_Neutral[GetRandomInt(v+12, v+20)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn3, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( i+1, udg_Neutral[GetRandomInt(v+12, v+20)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn4, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 2, udg_Neutral[GetRandomInt(v+16, vmax)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn5, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 2, udg_Neutral[GetRandomInt(v+16, vmax)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn6, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 2, udg_Neutral[GetRandomInt(v+16, vmax)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn7, GetRandomReal(0,360) )
call CreateNUnitsAtLoc( 2, udg_Neutral[GetRandomInt(v+16, vmax)], Player(PLAYER_NEUTRAL_AGGRESSIVE), spawn8, GetRandomReal(0,360) )
call RemoveLocation (spawn1)
call RemoveLocation (spawn2)
call RemoveLocation (spawn3)
call RemoveLocation (spawn4)
call RemoveLocation (spawn5)
call RemoveLocation (spawn6)
call RemoveLocation (spawn7)
call RemoveLocation (spawn8)
endfunction
//===========================================================================
function InitTrig_Spawn_more_mobs_hard takes nothing returns nothing
set gg_trg_Spawn_more_mobs_hard = CreateTrigger( )
call TriggerAddAction( gg_trg_Spawn_more_mobs_hard, function Trig_Spawn_more_mobs_hard_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Damage_buildings_Conditions takes nothing returns boolean
local boolean a = IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
local boolean b = GetUnitTypeId(GetTriggerUnit()) == 'etrp'
if ( not ( a or b ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(GetKillingUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Damage_buildings_Actions takes nothing returns nothing
local integer i = GetUnitLevel(GetKillingUnit())
local real r = 400.00 + i * (8 + 0.8*i)
if ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) then
if ( IsUnitAlly(GetTriggerUnit(), Player(4)) == true ) then
call UnitDamageTargetBJ( gg_unit_e001_0026, gg_unit_e000_0025, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
else
call UnitDamageTargetBJ( gg_unit_e000_0025, gg_unit_e001_0026, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
endif
else
if ( IsUnitAlly(GetTriggerUnit(), Player(4)) == true ) then
call UnitDamageTargetBJ( gg_unit_e001_0026, gg_unit_e000_0025, 2000, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
else
call UnitDamageTargetBJ( gg_unit_e000_0025, gg_unit_e001_0026, 2000, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
endif
endif
endfunction
//===========================================================================
function InitTrig_Damage_buildings takes nothing returns nothing
set gg_trg_Damage_buildings = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Damage_buildings, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Damage_buildings, Condition( function Trig_Damage_buildings_Conditions ) )
call TriggerAddAction( gg_trg_Damage_buildings, function Trig_Damage_buildings_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Hero_Kill_Jass_Conditions takes nothing returns boolean
return ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Hero_Kill_Jass_IsHero takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) and not(IsUnitIllusion(GetFilterUnit())))
endfunction
function Trig_Hero_Kill_Jass_KillFilter takes nothing returns boolean
if ( not ( GetOwningPlayer(GetTriggerUnit()) != GetOwningPlayer(GetKillingUnit()) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetKillingUnit()) != Player(4) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetKillingUnit()) != Player(9) ) ) then
return false
endif
if ( not ( GetOwningPlayer(GetKillingUnit()) != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Kill_Jass_ExecuteFilter takes nothing returns boolean
if ( ( GetUnitTypeId(GetKillingUnit()) == 'h02H' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetKillingUnit()) == 'h02I' ) ) then
return true
endif
if ( ( GetOwningPlayer(GetKillingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return true
endif
if ( ( GetUnitTypeId(GetKillingUnit()) == 'e000' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetKillingUnit()) == 'e001' ) ) then
return true
endif
if ( ( GetUnitTypeId(GetKillingUnit()) == 'e003' ) ) then
return true
endif
return false
endfunction
function Trig_Hero_Kill_Jass_DenyFilter takes nothing returns boolean
return ( (GetKillingUnit() == null) or (GetOwningPlayer(GetTriggerUnit()) == GetOwningPlayer(GetKillingUnit())) )
endfunction
function Trig_Hero_Kill_Jass_Func005002002001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Hero_Kill_Jass_Func005002002002 takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(GetKillingUnit())) == true )
endfunction
function Trig_Hero_Kill_Jass_Func005002002 takes nothing returns boolean
return GetBooleanAnd( Trig_Hero_Kill_Jass_Func005002002001(), Trig_Hero_Kill_Jass_Func005002002002() )
endfunction
function Trig_Hero_Kill_Jass_Actions takes nothing returns nothing
local multiboard m = GetLastCreatedMultiboard()
local player yd = GetOwningPlayer(GetTriggerUnit())
local player yk = GetOwningPlayer(GetKillingUnit())
local integer id = GetConvertedPlayerId(yd)
local integer ik = GetConvertedPlayerId(yk)
local group g
local unit u
local unit k = GroupPickRandomUnit(GetUnitsOfPlayerMatching(yk, Condition(function Trig_Hero_Kill_Jass_IsHero)))
local real r = 300.00 + 20 * udg_Clock_minute + GetUnitLevel(k) * (5 + GetUnitLevel(k))
//call MultiboardSetItemValueBJ( m, 3, id, I2S(0) )
call MultiboardSetItemValueBJ( m, 3, id, I2S(udg_Hero_Death[id]) )
if ( Trig_Hero_Kill_Jass_KillFilter() ) then
set udg_Hero_Streak[ik] = ( udg_Hero_Streak[ik] + 1 )
set udg_Hero_Kills[ik] = ( udg_Hero_Kills[ik] + 1 )
call MultiboardSetItemValueBJ( m, 2, ik, I2S(udg_Hero_Kills[ik]) )
//call MultiboardSetItemValueBJ( m, 3, ik, I2S(udg_Hero_Streak[ik]) )
call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(yk) + "'s " + GetUnitName(k) + " just killed " + GetPlayerName(yd) + "'s " + GetUnitName(GetTriggerUnit()) + " for a kill streak of " + I2S(udg_Hero_Streak[ik]) ) )
call AddHeroXP( k, 15 * GetUnitLevel(GetTriggerUnit()), true )
call AdjustPlayerStateBJ( ( udg_Hero_Streak[id] * 50 + GetUnitLevel(GetTriggerUnit()) * 4 + 200 ), yk, PLAYER_STATE_RESOURCE_GOLD )
else
if ( Trig_Hero_Kill_Jass_DenyFilter() ) then
call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(yd) + "'s " + GetUnitName(GetTriggerUnit()) + " just denied himself!" ) )
else
if ( Trig_Hero_Kill_Jass_ExecuteFilter() ) then
call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(yd) + "'s " + GetUnitName(GetTriggerUnit()) + " just died!" ) )
endif
endif
endif
set g = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Hero_Kill_Jass_Func005002002))
loop
set u = FirstOfGroup (g)
exitwhen u == null
call AddHeroXP(u, 10 * GetUnitLevel(GetTriggerUnit()), true )
call AdjustPlayerStateBJ( ( udg_Hero_Streak[id] * 20 + GetUnitLevel(GetTriggerUnit()) * 2 + 25 ), GetOwningPlayer(u), PLAYER_STATE_RESOURCE_GOLD )
call GroupRemoveUnit(g,u)
endloop
if ( ( IsUnitInGroup(k, udg_AI_Unit_Group) == true ) ) then
call AddHeroXP( k, 150, true )
call AdjustPlayerStateBJ( ( GetHeroLevel(GetTriggerUnit()) * 5 ), yk, PLAYER_STATE_RESOURCE_GOLD )
endif
set udg_Hero_Streak[id] = 0
set udg_Hero_Death[id] = ( udg_Hero_Death[id] + 1 )
//damage palace
if ( IsUnitAlly(GetTriggerUnit(), Player(4)) == true ) then
call UnitDamageTargetBJ( gg_unit_e001_0026, gg_unit_e000_0025, 4 * r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
else
call UnitDamageTargetBJ( gg_unit_e000_0025, gg_unit_e001_0026, 4 * r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
endif
set k = null
endfunction
//===========================================================================
function InitTrig_Hero_Kill_Jass takes nothing returns nothing
set gg_trg_Hero_Kill_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Kill_Jass, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Hero_Kill_Jass, Condition( function Trig_Hero_Kill_Jass_Conditions ) )
call TriggerAddAction( gg_trg_Hero_Kill_Jass, function Trig_Hero_Kill_Jass_Actions )
endfunction
//TESH.scrollpos=111
//TESH.alwaysfold=0
function Trig_Buy_Item_Core_Hybrid_IsUnitAI takes nothing returns boolean
return ( IsUnitInGroup(GetFilterUnit(), udg_AI_Unit_Group) == true )
endfunction
function Trig_Buy_Item_Core_Hybrid_IsItemRedundantTank takes nothing returns boolean
return ( UnitHasItemOfTypeBJ(udg_ItemHero, udg_Item_Tank[udg_Item_integer]) == false or udg_Item_integer == 1)
endfunction
function Trig_Buy_Item_Core_Hybrid_IsItemRedundantMage takes nothing returns boolean
return ( UnitHasItemOfTypeBJ(udg_ItemHero, udg_Item_Mage[udg_Item_integer]) == false or udg_Item_integer == 1)
endfunction
function Trig_Buy_Item_Core_Hybrid_IsItemRedundantCarry takes nothing returns boolean
return ( UnitHasItemOfTypeBJ(udg_ItemHero, udg_Item_Carry[udg_Item_integer]) == false or udg_Item_integer == 1)
endfunction
function Trig_Buy_Item_Core_Hybrid_ItemTankorMage takes nothing returns boolean
return ( GetRandomInt(101, 110) >= GetUnitPointValue(udg_ItemHero) )
endfunction
function Trig_Buy_Item_Core_Hybrid_ItemMageorCarry takes nothing returns boolean
return ( GetRandomInt(111, 120) >= GetUnitPointValue(udg_ItemHero) )
endfunction
function Trig_Buy_Item_Core_Hybrid_ItemCarryorTank takes nothing returns boolean
return ( GetRandomInt(121, 130) >= GetUnitPointValue(udg_ItemHero) )
endfunction
function Trig_Buy_Item_Core_Hybrid_IsHeroTankMage takes nothing returns boolean
return ( GetUnitPointValue(udg_ItemHero) > 100 and GetUnitPointValue(udg_ItemHero) <= 110 )
endfunction
function Trig_Buy_Item_Core_Hybrid_IsHeroMageCarry takes nothing returns boolean
return ( GetUnitPointValue(udg_ItemHero) > 110 and GetUnitPointValue(udg_ItemHero) <= 120 )
endfunction
function Trig_Buy_Item_Core_Hybrid_IsHeroCarryTank takes nothing returns boolean
return ( GetUnitPointValue(udg_ItemHero) > 120 and GetUnitPointValue(udg_ItemHero) <= 130 )
endfunction
function Trig_Buy_Item_Core_Hybrid_Eligible takes nothing returns boolean
// check if the hero can accept any item
local boolean a = udg_ItemHero != null
local boolean b = GetUnitLife(udg_ItemHero) > 200.00
local boolean c = GetPlayerState(GetOwningPlayer(udg_ItemHero), PLAYER_STATE_RESOURCE_GOLD) >= 1500
local boolean d = IsPlayerInForce(GetOwningPlayer(udg_ItemHero), udg_AI_Controller)
local boolean e = UnitInventoryCount(udg_ItemHero) < 6
return (a and b and c and d and e)
endfunction
function Trig_Buy_Item_Core_Hybrid_Actions takes nothing returns nothing
local integer i = 1
local integer h = 0
local group g
loop
if (i == 5 or i == 10) then
set i = i + 1
endif
exitwhen i > 12
set g = GetUnitsOfPlayerMatching(udg_Players[i], Condition(function Trig_Buy_Item_Core_Hybrid_IsUnitAI))
set udg_ItemHero = FirstOfGroup(g)
set udg_Item_integer = GetRandomInt(1, 6)
if ( Trig_Buy_Item_Core_Hybrid_Eligible() ) then
loop
set h = h + 1
exitwhen GetUnitTypeId(udg_ItemHero) == udg_HeroType[h] or h > 47
endloop
//call DisplayTextToForce( GetPlayersAll(), I2S(h) )
if ( UnitHasItemOfTypeBJ(udg_ItemHero, udg_Item_Core[h]) == false and UnitInventoryCount(udg_ItemHero) > 1 ) then
// if the hero doesnt have his core item then give it to him as a second item
call UnitAddItemById( udg_ItemHero, udg_Item_Core[h] )
call PayForItem( udg_Players[i], 1500 )
else
if ( Trig_Buy_Item_Core_Hybrid_IsHeroTankMage() ) then
// tanks to mages
if ( Trig_Buy_Item_Core_Hybrid_ItemTankorMage() ) then
if ( Trig_Buy_Item_Core_Hybrid_IsItemRedundantTank() ) then
call UnitAddItemById( udg_ItemHero, udg_Item_Tank[udg_Item_integer])
call PayForItem( udg_Players[i], 1500 )
endif
else
if ( Trig_Buy_Item_Core_Hybrid_IsItemRedundantMage() ) then
call UnitAddItemById( udg_ItemHero, udg_Item_Mage[udg_Item_integer])
call PayForItem( udg_Players[i], 1500 )
endif
endif
elseif ( Trig_Buy_Item_Core_Hybrid_IsHeroMageCarry() ) then
// mages to carries
if ( Trig_Buy_Item_Core_Hybrid_ItemMageorCarry() ) then
if ( Trig_Buy_Item_Core_Hybrid_IsItemRedundantMage() ) then
call UnitAddItemById( udg_ItemHero, udg_Item_Mage[udg_Item_integer])
call PayForItem( udg_Players[i], 1500 )
endif
else
if ( Trig_Buy_Item_Core_Hybrid_IsItemRedundantCarry() ) then
call UnitAddItemById( udg_ItemHero, udg_Item_Carry[udg_Item_integer])
call PayForItem( udg_Players[i], 1500 )
endif
endif
elseif ( Trig_Buy_Item_Core_Hybrid_IsHeroCarryTank() ) then
// carries to tanks
if ( Trig_Buy_Item_Core_Hybrid_ItemCarryorTank() ) then
if ( Trig_Buy_Item_Core_Hybrid_IsItemRedundantCarry() ) then
call UnitAddItemById( udg_ItemHero, udg_Item_Carry[udg_Item_integer])
call PayForItem( udg_Players[i], 1500 )
endif
else
if ( Trig_Buy_Item_Core_Hybrid_IsItemRedundantTank() ) then
call UnitAddItemById( udg_ItemHero, udg_Item_Tank[udg_Item_integer])
call PayForItem( udg_Players[i], 1500 )
endif
endif
endif
endif
endif
set i = i + 1
set h = 0
endloop
endfunction
//===========================================================================
function InitTrig_Buy_Item_Core_Hybrid takes nothing returns nothing
set gg_trg_Buy_Item_Core_Hybrid = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Buy_Item_Core_Hybrid, 2.00 )
call TriggerAddAction( gg_trg_Buy_Item_Core_Hybrid, function Trig_Buy_Item_Core_Hybrid_Actions )
endfunction
//TESH.scrollpos=47
//TESH.alwaysfold=0
function Trig_AI_Pick_Func001B takes nothing returns nothing
local integer i = 1
local unit u
loop
exitwhen i > 12
set u = udg_AI_Hero[i]
if u == null then
set i = i + 1
set u = udg_AI_Hero[i]
endif
call SetPlayerUnitAvailableBJ( GetUnitTypeId(u), false, GetEnumPlayer() )
set i = i + 1
endloop
endfunction
function Trig_AI_Pick_Func001Func001C takes nothing returns boolean
if ( not ( GetConvertedPlayerId(GetEnumPlayer()) != 5 ) ) then
return false
endif
if ( not ( GetConvertedPlayerId(GetEnumPlayer()) != 10 ) ) then
return false
endif
if ( not ( GetPlayerState(GetEnumPlayer(), PLAYER_STATE_RESOURCE_FOOD_USED) == 0 ) ) then
return false
endif
return true
endfunction
function IsBanned takes integer i returns boolean
if i == 1 then
return true
endif
return false
endfunction
function Trig_AI_Pick_Func001A takes nothing returns nothing
local unit d
local location p = GetRandomLocInRect(gg_rct_Start_Loc)
local force f = bj_FORCE_ALL_PLAYERS
local player user
if ( Trig_AI_Pick_Func001Func001C() ) then
loop
set udg_integer_hero = GetRandomInt(1, udg_AI_count)
exitwhen (IsBanned(udg_integer_hero) == false)
endloop
set d = CreateUnitAtLoc( GetEnumPlayer(), udg_HeroType[udg_integer_hero], p, 270.00 )
set udg_AI_Hero[GetConvertedPlayerId(GetEnumPlayer())] = d
call GroupAddUnit( udg_AI_Unit_Group, d)
call GroupAddUnit( udg_AI_WanderState, d )
call DisplayTimedTextToForce( GetPlayersAll(), 30.00, ( GetUnitName(d) + ( " has been picked by " + ( GetPlayerName(GetEnumPlayer()) + "!!" ) ) ) )
call MultiboardSetItemValueBJ( GetLastCreatedMultiboard(), 1, GetConvertedPlayerId(GetOwningPlayer(d)), GetUnitName(d) )
set udg_HeroType[udg_integer_hero] = udg_HeroType[udg_AI_count]
set udg_AI_count = ( udg_AI_count - 1 )
endif
endfunction
function Trig_AI_Pick_Actions takes nothing returns nothing
call ForForce( udg_AI_Controller, function Trig_AI_Pick_Func001A )
call ForForce( GetPlayersAll(), function Trig_AI_Pick_Func001B )
call TriggerExecute( gg_trg_Set_Hero_Number )
endfunction
//===========================================================================
function InitTrig_AI_Pick takes nothing returns nothing
set gg_trg_AI_Pick = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_AI_Pick, 6.00 )
call TriggerAddAction( gg_trg_AI_Pick, function Trig_AI_Pick_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_State_check_Actions takes nothing returns nothing
local unit u = FirstOfGroup(GetUnitsSelectedAll(GetTriggerPlayer()))
if ( ( IsUnitInGroup(u, udg_AI_WanderState) == true ) ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "Wandering" )
endif
if ( ( IsUnitInGroup(u, udg_AI_FightState) == true ) ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "Fighting" )
endif
if ( ( IsUnitInGroup(u, udg_AI_RetreatState) == true ) ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "Retreating" )
endif
endfunction
//===========================================================================
function InitTrig_State_check takes nothing returns nothing
set gg_trg_State_check = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_State_check, Player(0), "check", true )
call TriggerAddAction( gg_trg_State_check, function Trig_State_check_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_psycho_2_Actions takes nothing returns nothing
local unit u = FirstOfGroup(GetUnitsSelectedAll(Player(0)))
call DisplayTextToForce( GetPlayersAll(), GetUnitName(u) + ": " + R2S(udg_AI_advantage[GetPlayerId(GetOwningPlayer(u)) + 1]) )
if ( ( IsUnitInGroup(u, udg_AI_RetreatState) == true ) ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "Retreating" )
elseif( ( IsUnitInGroup(u, udg_AI_FightState) == true ) ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "Fighting" )
elseif ( ( IsUnitInGroup(u, udg_AI_WanderState) == true ) ) then
call DisplayTimedTextToForce( bj_FORCE_PLAYER[0], 10.00, "Wandering" )
endif
endfunction
//===========================================================================
function InitTrig_psycho_2 takes nothing returns nothing
set gg_trg_psycho_2 = CreateTrigger( )
call DisableTrigger( gg_trg_psycho_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_psycho_2, 1.00 )
call TriggerAddAction( gg_trg_psycho_2, function Trig_psycho_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ms_Actions takes nothing returns nothing
local unit u = FirstOfGroup(GetUnitsSelectedAll(GetTriggerPlayer()))
call DisplayTextToForce( GetPlayersAll(), "This unit has a movespeed of " + I2S(R2I(GetUnitMoveSpeedX( u ))))
set u = null
endfunction
//===========================================================================
function InitTrig_ms takes nothing returns nothing
set gg_trg_ms = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_ms, Player(0), "-ms", true )
call TriggerAddAction( gg_trg_ms, function Trig_ms_Actions )
endfunction
//TESH.scrollpos=109
//TESH.alwaysfold=0
//AI FSM
function Trig_Ally_Enemy_Judgment_FilterHero takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Ally_Enemy_Judgment_FilterAlive takes nothing returns boolean
return ( GetUnitLife(GetFilterUnit()) > 0 )
endfunction
function Trig_Ally_Enemy_Judgment_FilterEnemy takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), udg_Players[udg_AI_int]) == true )
endfunction
function Trig_Ally_Enemy_Judgment_FilterAlly takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), udg_Players[udg_AI_int]) == true )
endfunction
function Trig_Ally_Enemy_Judgment_IsTower takes nothing returns boolean
return ( GetUnitTypeId(GetFilterUnit()) == 'e003' )
endfunction
function Trig_Ally_Enemy_Judgment_FilterAlliedHeroes takes nothing returns boolean
if ( not ( Trig_Ally_Enemy_Judgment_FilterAlly() ) ) then
return false
endif
if ( not ( Trig_Ally_Enemy_Judgment_FilterHero() ) ) then
return false
endif
if ( not ( Trig_Ally_Enemy_Judgment_FilterAlive() ) ) then
return false
endif
return true
endfunction
function Trig_Ally_Enemy_Judgment_FilterEnemyHeroes takes nothing returns boolean
if ( not ( Trig_Ally_Enemy_Judgment_FilterEnemy() ) ) then
return false
endif
if ( not ( Trig_Ally_Enemy_Judgment_FilterHero() ) ) then
return false
endif
if ( not ( Trig_Ally_Enemy_Judgment_FilterAlive() ) ) then
return false
endif
return true
endfunction
function Trig_Ally_Enemy_Judgment_FilterEnemyTowers takes nothing returns boolean
if ( not ( Trig_Ally_Enemy_Judgment_FilterEnemy() ) ) then
return false
endif
if ( not ( Trig_Ally_Enemy_Judgment_IsTower() ) ) then
return false
endif
return true
endfunction
function Trig_Ally_Enemy_Judgment_FilterFarm takes nothing returns boolean
local boolean a = GetOwningPlayer(GetFilterUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE)
local boolean b = Trig_Ally_Enemy_Judgment_FilterEnemy() and GetUnitTypeId(GetFilterUnit()) == 'h02H'
local boolean c = Trig_Ally_Enemy_Judgment_FilterEnemy() and GetUnitTypeId(GetFilterUnit()) == 'h02I'
if ( not ( a or b or c ) ) then
return false
endif
if ( not ( Trig_Ally_Enemy_Judgment_FilterAlive()) ) then
return false
endif
return true
endfunction
function AllyAdv takes unit c, unit u returns real
local real a = GetHeroLevel(u)/GetHeroLevel(c)
local real b = (GetUnitPercentLife(u)+50)/150
local location pc = GetUnitLoc(c)
local location pu = GetUnitLoc(u)
//local real dx = 1 - (0.0002 * DistanceBetweenPoints(pc, pu))
call RemoveLocation (pc)
call RemoveLocation (pu)
//call DisplayTextToForce( GetPlayersAll(), R2S(dx) )
return (a*b + 0.25)
endfunction
function EnemyAdv takes unit c, unit u returns real
local real a = GetHeroLevel(u)/GetHeroLevel(c)
local real b = (GetUnitPercentLife(u)+50)/150
local location pc = GetUnitLoc(c)
local location pu = GetUnitLoc(u)
local real dx = 1.5 - (0.0005 * DistanceBetweenPoints(pc, pu))
call RemoveLocation (pc)
call RemoveLocation (pu)
//call DisplayTextToForce( GetPlayersAll(), R2S(dx) )
return (a*b*dx + 0.25)
endfunction
function Trig_AI_FSM_Periodic_Actions takes nothing returns nothing
local location p
local group g1
local unit u1
local group g2
local unit u2
local group g3
local unit u3
local integer i = 1
local unit target
//local real range = 750 + 20 * GetHeroLevel(udg_AI_Hero[udg_AI_int])
set p = GetUnitLoc(udg_AI_Hero[udg_AI_int])
if udg_AI_farmdest[udg_AI_int] == null then
set udg_AI_farmdest[udg_AI_int] = GetRectCenter(gg_rct_Teamfight_Centre)
endif
set udg_AI_allyug[udg_AI_int] = GetUnitsInRangeOfLocMatching(1500, p, Condition(function Trig_Ally_Enemy_Judgment_FilterAlliedHeroes))
set udg_AI_allyint[udg_AI_int] = CountUnitsInGroup(udg_AI_allyug[udg_AI_int])
set udg_AI_enemyug[udg_AI_int] = GetUnitsInRangeOfLocMatching(1000, p, Condition(function Trig_Ally_Enemy_Judgment_FilterEnemyHeroes))
set udg_AI_enemyint[udg_AI_int] = CountUnitsInGroup(udg_AI_enemyug[udg_AI_int])
set udg_AI_farmug[udg_AI_int] = GetUnitsInRangeOfLocMatching(1000, udg_AI_farmdest[udg_AI_int], Condition(function Trig_Ally_Enemy_Judgment_FilterFarm))
set udg_AI_farmint[udg_AI_int] = CountUnitsInGroup(udg_AI_farmug[udg_AI_int])
set g1 = udg_AI_allyug[udg_AI_int]
set g2 = udg_AI_enemyug[udg_AI_int]
set g3 = GetUnitsInRangeOfLocMatching(1500.00, p, Condition(function Trig_Ally_Enemy_Judgment_FilterEnemyTowers))
set udg_AI_advantage[udg_AI_int] = (GetUnitPercentLife(udg_AI_Hero[udg_AI_int])-60) * 0.05
loop
set u1 = FirstOfGroup(g1)
exitwhen u1 == null
set udg_AI_advantage[udg_AI_int] = udg_AI_advantage[udg_AI_int] + AllyAdv(udg_AI_Hero[udg_AI_int],u1)
call GroupRemoveUnit(g1,u1)
endloop
set target = FirstOfGroup(g2)
loop
set u2 = FirstOfGroup(g2)
exitwhen u2 == null
set udg_AI_advantage[udg_AI_int] = udg_AI_advantage[udg_AI_int] - EnemyAdv(udg_AI_Hero[udg_AI_int],u2)
call GroupRemoveUnit(g2,u2)
endloop
loop
set u3 = FirstOfGroup(g3)
exitwhen u3 == null
set udg_AI_advantage[udg_AI_int] = udg_AI_advantage[udg_AI_int] - (30 - GetHeroLevel(udg_AI_Hero[udg_AI_int]))*0.1
call GroupRemoveUnit(g3,u3)
endloop
//recreating group to determine target
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_AI_advantage[udg_AI_int]) )
/// now the AI states are set here too
//set udg_AI_allyug[udg_AI_int] = GetUnitsInRangeOfLocMatching(1000, p, Condition(function Trig_Ally_Enemy_Judgment_FilterAlliedHeroes))
//set udg_AI_allyint[udg_AI_int] = CountUnitsInGroup(udg_AI_allyug[udg_AI_int])
//set udg_AI_enemyug[udg_AI_int] = GetUnitsInRangeOfLocMatching(1000, p, Condition(function Trig_Ally_Enemy_Judgment_FilterEnemyHeroes))
//set udg_AI_enemyint[udg_AI_int] = CountUnitsInGroup(udg_AI_enemyug[udg_AI_int])
//call DisplayTextToForce( GetPlayersAll(), "Player " + I2S(udg_AI_int) + " has " + I2S(udg_AI_enemyint[udg_AI_int]) + " nearby enemies!" )
//
// if a hero shouldnt be fighting and is, remove it
if (IsUnitInGroup(udg_AI_Hero[udg_AI_int], udg_AI_FightState)) then
if udg_AI_enemyint[udg_AI_int] == 0 then
call GroupRemoveUnit(udg_AI_FightState, udg_AI_Hero[udg_AI_int])
set udg_AI_FightTarget[udg_AI_int] = null
endif
// if a hero should be fighting but isnt, add it
else
if udg_AI_enemyint[udg_AI_int] > 0 then
call GroupAddUnit(udg_AI_FightState, udg_AI_Hero[udg_AI_int])
if target == null then
set udg_AI_FightTarget[udg_AI_int] = target
endif
endif
endif
// if a hero shouldnt be retreating and is, remove it
if (IsUnitInGroup(udg_AI_Hero[udg_AI_int], udg_AI_RetreatState)) then
if (udg_AI_advantage[udg_AI_int] >= 0 and GetUnitPercentLife(udg_AI_Hero[udg_AI_int]) > 30) then
call GroupRemoveUnit(udg_AI_RetreatState, udg_AI_Hero[udg_AI_int])
endif
// if a hero should be retreating but isnt, add it
else
if (udg_AI_advantage[udg_AI_int] < 0 or GetUnitPercentLife(udg_AI_Hero[udg_AI_int]) < 30) then
call GroupAddUnit(udg_AI_RetreatState, udg_AI_Hero[udg_AI_int])
endif
endif
//
// reset
//
if ( udg_AI_int < 12 ) then
set udg_AI_int = ( udg_AI_int + 1 )
else
set udg_AI_Actionfire = 1
set udg_AI_Actionfire = 0
set udg_AI_int = 1
endif
if ( udg_AI_int == 5 or udg_AI_int == 10 ) then
set udg_AI_int = ( udg_AI_int + 1 )
endif
set target = null
call RemoveLocation (p)
call DestroyGroup (g1)
call DestroyGroup (g2)
call DestroyGroup (g3)
endfunction
//===========================================================================
function InitTrig_AI_FSM_Periodic takes nothing returns nothing
set gg_trg_AI_FSM_Periodic = CreateTrigger( )
call DisableTrigger( gg_trg_AI_FSM_Periodic )
call TriggerRegisterTimerEventPeriodic( gg_trg_AI_FSM_Periodic, 0.05 )
call TriggerAddAction( gg_trg_AI_FSM_Periodic, function Trig_AI_FSM_Periodic_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function IsChanneling takes integer n returns boolean
local boolean a = GetUnitCurrentOrder(udg_AI_Hero[n]) != OrderId("magicleash")
local boolean b = GetUnitCurrentOrder(udg_AI_Hero[n]) != OrderId("deathanddecay")
return a and b
endfunction
function Trig_AI_FSM_Actions_Actions takes nothing returns nothing
local integer n = 1
local location p
local location p1 = GetRandomLocInRect(gg_rct_Radiant_Creeps_1)
local location p2 = GetRandomLocInRect(gg_rct_Radiant_Creeps_2)
local location p3 = GetRandomLocInRect(gg_rct_Radiant_Midspawn)
local location p4 = GetRandomLocInRect(gg_rct_Shadow_Creeps_1)
local location p5 = GetRandomLocInRect(gg_rct_Shadow_Creeps_2)
local location p6 = GetRandomLocInRect(gg_rct_Shadow_Midspawn)
local location p7 = GetRandomLocInRect(gg_rct_Teamfight_Centre)
local integer i
local boolean exist
local boolean aihero
local boolean fight
local boolean retreat
loop
exitwhen n > 12
set exist = udg_AI_Hero[n] != null
set aihero = IsUnitInGroup(udg_AI_Hero[n], udg_AI_Unit_Group)
//set some state which cannot be interrupted?
set fight = IsUnitInGroup(udg_AI_Hero[n], udg_AI_FightState)
set retreat = IsUnitInGroup(udg_AI_Hero[n], udg_AI_RetreatState)
//
if ( exist and aihero ) then
set p = GetUnitLoc(udg_AI_Hero[n])
//check if ai should retreat, overriding
if ( retreat ) then
if ( n <= 6 ) then
call IssuePointOrder( udg_AI_Hero[n], "move", -3600, -3600 )
else
call IssuePointOrder( udg_AI_Hero[n], "move", 3600, 3600 )
endif
else
//if leashing then dont move
if ( IsChanneling(n) ) then
if ( fight ) then
call IssueTargetOrder( udg_AI_Hero[n], "attack", udg_AI_FightTarget[n] )
else
// if theres something to farm then continue if not find new loc
if ( udg_AI_farmint[n] == 0 and ( DistanceBetweenPoints( p, udg_AI_farmdest[n]) < 500 ) ) then
set i = GetRandomInt(1,5)
if ( i == 1 and n >= 7 ) then
set udg_AI_farmdest[n] = p1
elseif ( i == 2 and n >= 7 ) then
set udg_AI_farmdest[n] = p2
elseif ( i == 3 and n >= 7 ) then
set udg_AI_farmdest[n] = p3
elseif ( i == 1 and n < 7 ) then
set udg_AI_farmdest[n] = p4
elseif ( i == 2 and n < 7 ) then
set udg_AI_farmdest[n] = p5
elseif ( i == 3 and n < 7 ) then
set udg_AI_farmdest[n] = p6
elseif ( i >= 4 ) then
set udg_AI_farmdest[n] = p7
endif
endif
call IssuePointOrderLoc( udg_AI_Hero[n], "attack", udg_AI_farmdest[n] )
endif
endif
endif
else
endif
set n = n + 1
if n == 5 or n == 10 then
set n = n + 1
endif
endloop
call RemoveLocation (p)
//call RemoveLocation (p1)
//call RemoveLocation (p2)
//call RemoveLocation (p3)
//call RemoveLocation (p4)
//call RemoveLocation (p5)
//call RemoveLocation (p6)
//call RemoveLocation (p7)
endfunction
//===========================================================================
function InitTrig_AI_FSM_Actions takes nothing returns nothing
set gg_trg_AI_FSM_Actions = CreateTrigger( )
call DisableTrigger( gg_trg_AI_FSM_Actions )
call TriggerRegisterVariableEvent( gg_trg_AI_FSM_Actions, "udg_AI_Actionfire", EQUAL, 1.00 )
call TriggerAddAction( gg_trg_AI_FSM_Actions, function Trig_AI_FSM_Actions_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Tyrant_Force_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00H' ) ) then
return false
endif
return true
endfunction
function Trig_Tyrant_Force_Actions takes nothing returns nothing
local real r = 1.15 + 0.01 * (GetHeroLevel(GetTriggerUnit()))
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
local integer i = GetHeroLevel(GetTriggerUnit())
call SetUnitScale( GetTriggerUnit(), r, r, r )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A01Q')
call SetUnitAbilityLevel(d, 'A01Q', i)
call IssueTargetOrder( d, "innerfire", GetTriggerUnit() )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Tyrant_Force takes nothing returns nothing
set gg_trg_Tyrant_Force = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tyrant_Force, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Tyrant_Force, Condition( function Trig_Tyrant_Force_Conditions ) )
call TriggerAddAction( gg_trg_Tyrant_Force, function Trig_Tyrant_Force_Actions )
endfunction
//TESH.scrollpos=14
//TESH.alwaysfold=0
function Trig_Volcano_Breath_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'N00H' ) ) then
return false
endif
return GetUnitAbilityLevel(GetAttacker(), 'B01T') > 0
endfunction
function Trig_Volcano_Breath_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetAttacker()))
local location p1 = GetUnitLoc(GetFilterUnit())
local location p2 = GetUnitLoc(GetAttacker())
local boolean b = DistanceBetweenPoints(p1, p2) < 800
call RemoveLocation (p1)
call RemoveLocation (p2)
return (a and b and IsTarget())
endfunction
function Trig_Volcano_Breath_Actions takes nothing returns nothing
local unit c = GetAttacker()
local integer i = 1
local unit d
local unit u
local location pc = GetUnitLoc(c)
local location pu = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(400.00, pu, Condition(function Trig_Volcano_Breath_Filter))
local integer v = 40 * GetUnitAbilityLevel(c, 'A0CP') + GetHeroStr(c, true)
call UnitRemoveAbility( c, 'B01T' )
loop
set u = FirstOfGroup(g)
exitwhen u == null or i > 8
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h02F', pc, bj_UNIT_FACING )
call SetUnitUserData( d, v )
call SetUnitScale( d, 2, 2, 2 )
call IssueTargetOrder( d, "attack", u )
set d = null
set i = i + 1
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Volcano_Breath takes nothing returns nothing
set gg_trg_Volcano_Breath = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Volcano_Breath, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Volcano_Breath, Condition( function Trig_Volcano_Breath_Conditions ) )
call TriggerAddAction( gg_trg_Volcano_Breath, function Trig_Volcano_Breath_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Ruthless_Slam_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08F' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00H' ) ) then
return false
endif
return true
endfunction
function Trig_Ruthless_Slam_Filter takes nothing returns boolean
local boolean a = IsTarget()
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and b)
endfunction
function Trig_Ruthless_Slam_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(400.00, p, Condition(function Trig_Ruthless_Slam_Filter))
local unit u
local real r = 0.2 * GetUnitAbilityLevel(GetTriggerUnit(), 'A08F') * GetHeroStr(GetTriggerUnit(), true)
loop
set u = FirstOfGroup(g)
exitwhen u == null
// set pu = GetUnitLoc(u)
// set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pu, bj_UNIT_FACING )
// call UnitAddAbility( d, 'A05H' )
// call SetUnitAbilityLevel( d, 'A05H', GetUnitAbilityLevel(GetTriggerUnit(), 'A05G' ) )
// call IssueTargetOrder( d, "firebolt", u )
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Ruthless_Slam takes nothing returns nothing
set gg_trg_Ruthless_Slam = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ruthless_Slam, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ruthless_Slam, Condition( function Trig_Ruthless_Slam_Conditions ) )
call TriggerAddAction( gg_trg_Ruthless_Slam, function Trig_Ruthless_Slam_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_WD_2_Actions takes nothing returns nothing
local location p1 = GetUnitLoc(udg_WD_caster)
local location p = PolarProjectionBJ(p1, 80.00, udg_WD_angle)
local unit d
local unit fx
local integer i = 80 * GetUnitAbilityLevel(GetTriggerUnit(), 'A01L') + GetHeroStr(GetTriggerUnit(), true)
if ( udg_WD_duration > 0 ) then
if udg_WD_int > 4 then
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_WD_caster), 'h00J', p , bj_UNIT_FACING )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_WD_caster),'h02A', p, 0)
call UnitAddAbility( d, 'A0CN' )
call SetUnitUserData (d, i)
call IssueImmediateOrder( d, "thunderclap" )
set udg_WD_int = 1
else
set udg_WD_int = udg_WD_int + 1
endif
call SetUnitPositionLoc( udg_WD_caster, p )
else
call DisableTrigger( gg_trg_WD_2 )
call SetUnitPathing( udg_WD_caster, true )
//call ResetUnitAnimation( udg_WD_caster )
set udg_WD_caster = null
endif
set udg_WD_duration = udg_WD_duration - 0.03
call RemoveLocation (p)
call RemoveLocation (p1)
set d = null
endfunction
//===========================================================================
function InitTrig_WD_2 takes nothing returns nothing
set gg_trg_WD_2 = CreateTrigger( )
call DisableTrigger( gg_trg_WD_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_WD_2, 0.03 )
call TriggerAddAction( gg_trg_WD_2, function Trig_WD_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Dragonbreath_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01I' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00H' ) ) then
return false
endif
return true
endfunction
function Trig_Dragonbreath_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(GetSpellTargetUnit())
local location pd
local location p2
local integer i = 1
local integer v = 8 * GetUnitAbilityLevel(GetTriggerUnit(), 'A01I') + 2 * GetHeroLevel(GetTriggerUnit())
loop
exitwhen i > 8
set pd = PolarProjectionBJ(p, 200.00, i*45-180)
set p2 = PolarProjectionBJ(p, 200.00, i*45)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pd, 0.00 )
call UnitAddAbility( d,'A071' )
call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "carrionswarm", p2 )
set i = i + 1
endloop
call RemoveLocation(p)
call RemoveLocation(p2)
call RemoveLocation(pd)
endfunction
//===========================================================================
function InitTrig_Dragonbreath takes nothing returns nothing
set gg_trg_Dragonbreath = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dragonbreath, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dragonbreath, Condition( function Trig_Dragonbreath_Conditions ) )
call TriggerAddAction( gg_trg_Dragonbreath, function Trig_Dragonbreath_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Mystic_Cloud_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0AC' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00C' ) ) then
return false
endif
return true
endfunction
function Trig_Mystic_Cloud_Actions takes nothing returns nothing
local unit d
set udg_MC_caster = GetTriggerUnit()
set udg_MC_point = GetSpellTargetLoc()
set udg_MC_int = 5 + 1 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0AC')
set d = CreateUnitAtLoc( GetOwningPlayer(udg_MC_caster), 'h01Q', udg_MC_point , bj_UNIT_FACING )
call EnableTrigger( gg_trg_MC_2 )
set d = null
endfunction
//===========================================================================
function InitTrig_Mystic_Cloud takes nothing returns nothing
set gg_trg_Mystic_Cloud = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Mystic_Cloud, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Mystic_Cloud, Condition( function Trig_Mystic_Cloud_Conditions ) )
call TriggerAddAction( gg_trg_Mystic_Cloud, function Trig_Mystic_Cloud_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_MC_2_Actions takes nothing returns nothing
local unit d
if udg_MC_int > 0 then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_MC_caster), 'h000', udg_MC_point , bj_UNIT_FACING )
call UnitAddAbility( d, 'A0A1' )
call SetUnitAbilityLevel(d, 'A0A1', GetUnitAbilityLevel(udg_MC_caster, 'A0AC'))
call IssuePointOrderLoc( d, "silence", udg_MC_point )
set d = null
set udg_MC_int = udg_MC_int - 1
else
call DisableTrigger( gg_trg_MC_2 )
set udg_MC_caster = null
call RemoveLocation (udg_MC_point)
endif
endfunction
//===========================================================================
function InitTrig_MC_2 takes nothing returns nothing
set gg_trg_MC_2 = CreateTrigger( )
call DisableTrigger( gg_trg_MC_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_MC_2, 0.5 )
call TriggerAddAction( gg_trg_MC_2, function Trig_MC_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Maelstrom_Strike_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A030' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00C' ) ) then
return false
endif
return true
endfunction
function Trig_Maelstrom_Strike_Actions takes nothing returns nothing
local unit d
local unit u = GetSpellTargetUnit()
local integer v = 75 * GetUnitAbilityLevel(GetTriggerUnit(), 'A030') + GetHeroInt(GetTriggerUnit(), true)
local location p = GetUnitLoc(GetTriggerUnit())
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h02A', p , bj_UNIT_FACING )
call UnitAddAbility( d, 'A02C' )
call SetUnitUserData( d, v )
call IssueTargetOrder(d, "thunderbolt", u)
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Maelstrom_Strike takes nothing returns nothing
set gg_trg_Maelstrom_Strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Maelstrom_Strike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Maelstrom_Strike, Condition( function Trig_Maelstrom_Strike_Conditions ) )
call TriggerAddAction( gg_trg_Maelstrom_Strike, function Trig_Maelstrom_Strike_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_PA_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_PA_caster)
local location p2
local location pd
local unit d
local integer i2 = R2I(GetHeroBonusInt(udg_PA_caster)*0.45) + GetUnitAbilityLevel(udg_PA_caster,'A0A9')*30
local integer i = 1
if ( udg_PA_int > 0 )then
loop
exitwhen i > 15
set pd = PolarProjectionBJ(p, 100.00, i*24)
set p2 = PolarProjectionBJ(p, 900.00, i*24)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PA_caster), 'h01Y', pd, 0.00 )
call UnitAddAbility( d,'A0AA' )
call SetUnitUserData( d, i2 )
call IssuePointOrderLoc( d, "carrionswarm", p2 )
set i = i + 1
endloop
else
call DisableTrigger( gg_trg_PA_2 )
call EnableTrigger( gg_trg_Pulse_of_the_Abyss )
call RemoveLocation( udg_PA_point )
set udg_PA_caster = null
endif
set udg_PA_int = udg_PA_int - 1
set d = null
call RemoveLocation(p)
call RemoveLocation(p2)
call RemoveLocation(pd)
endfunction
//===========================================================================
function InitTrig_PA_2 takes nothing returns nothing
set gg_trg_PA_2 = CreateTrigger( )
call DisableTrigger( gg_trg_PA_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_PA_2, 0.9 )
call TriggerAddAction( gg_trg_PA_2, function Trig_PA_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Arctic_Chill_Conditions takes nothing returns boolean
local boolean a = GetSpellAbilityId() == 'A016'
local boolean b = GetSpellAbilityId() == 'A013'
local boolean c = GetUnitAbilityLevel(GetSpellTargetUnit(), 'B01J') > 0
local boolean d = GetUnitAbilityLevel(GetSpellTargetUnit(), 'B007') > 0
return (a) and (c or d)
endfunction
function Trig_Arctic_Chill_Actions takes nothing returns nothing
local real r = 0.1 * GetUnitMaxLife(GetSpellTargetUnit())
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call FadingText( ( "+" + I2S(R2I((r))) ), GetSpellTargetUnit(), 13.50, 70.00, 70.00, 100, 0 )
endfunction
//===========================================================================
function InitTrig_Arctic_Chill takes nothing returns nothing
set gg_trg_Arctic_Chill = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arctic_Chill, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arctic_Chill, Condition( function Trig_Arctic_Chill_Conditions ) )
call TriggerAddAction( gg_trg_Arctic_Chill, function Trig_Arctic_Chill_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Frost_Nova_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00B' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A0D8' ) ) then
return false
endif
return true
endfunction
function Trig_Frost_Nova_Actions takes nothing returns nothing
local unit d
local unit fx
local integer v = GetHeroLevel(GetTriggerUnit()) * 5 + GetUnitAbilityLevel(GetTriggerUnit(), 'A0D8') * 40 + 75
local location p = GetUnitLoc(GetSpellTargetUnit())
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00C', p, bj_UNIT_FACING )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p, bj_UNIT_FACING )
call UnitAddAbility(d, 'A016')
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "frostnova", GetSpellTargetUnit() )
set d = null
set fx = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Frost_Nova takes nothing returns nothing
set gg_trg_Frost_Nova = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Nova, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Nova, Condition( function Trig_Frost_Nova_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Nova, function Trig_Frost_Nova_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Ice_Wall_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05F' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00B' ) ) then
return false
endif
return true
endfunction
function Trig_Ice_Wall_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetSpellTargetLoc()
local location pd
local real r = AngleBetweenPoints(pc,pu) + 90
local location pt = PolarProjectionBJ (pu, 4 * 140, 180 + r)
local unit d
local unit d2
local integer i = 1
loop
exitwhen i > 7
set pd = PolarProjectionBJ (pt, i * 140, r)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00V', pd, bj_UNIT_FACING )
//call SetUnitScale( d, 0.5, 0.5, 0.5 )
call SetUnitLife( d, GetUnitAbilityLevel(GetTriggerUnit(), 'A05F') + 2 )
set d = null
call RemoveLocation (pd)
set i = i + 1
endloop
call RemoveLocation (pc)
call RemoveLocation (pu)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Ice_Wall takes nothing returns nothing
set gg_trg_Ice_Wall = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Wall, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ice_Wall, Condition( function Trig_Ice_Wall_Conditions ) )
call TriggerAddAction( gg_trg_Ice_Wall, function Trig_Ice_Wall_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Ice_Shatter_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'N00B' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetTriggerUnit(), 'B01K') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Ice_Shatter_Actions takes nothing returns nothing
local unit c = GetAttacker()
local unit u = GetTriggerUnit()
local unit d
local location p = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h00C', p, bj_UNIT_FACING )
call SetUnitAbilityLevel( d, 'A016', GetHeroLevel(c) )
call IssueTargetOrder( d, "frostnova", u )
set u = null
set c = null
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Ice_Shatter takes nothing returns nothing
set gg_trg_Ice_Shatter = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Shatter, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Ice_Shatter, Condition( function Trig_Ice_Shatter_Conditions ) )
call TriggerAddAction( gg_trg_Ice_Shatter, function Trig_Ice_Shatter_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Frost_Blow_MUI_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A015' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00B' ) ) then
return false
endif
return true
endfunction
function Trig_Frost_Blow_Filter takes nothing returns boolean
return IsTarget() and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
endfunction
function Trig_Frost_Blow_MUI_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit u
local unit d
local unit fx
local location p = GetUnitLoc(c)
local location p2
local integer v = GetHeroLevel(c) * 2 + GetUnitAbilityLevel(c, 'A015') * 20 + 35
local group gg = GetUnitsInRangeOfLocMatching(700.00, p, Condition(function Trig_Frost_Blow_Filter))
local group g
if CountUnitsInGroup(gg) > 7 then
set g = GetRandomSubGroup(7,gg)
else
set g = gg
endif
loop
set u = FirstOfGroup(g)
exitwhen u == null
set p2 = GetUnitLoc(u)
set fx = CreateUnitAtLoc( GetOwningPlayer(c), 'h00C', p2, bj_UNIT_FACING )
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01Y', p2, bj_UNIT_FACING )
call UnitAddAbility( d, 'A016' )
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "frostnova", u )
set d = null
set fx = null
call GroupRemoveUnit(g,u)
call RemoveLocation (p2)
endloop
set c = null
call DestroyGroup (g)
call DestroyGroup (gg)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Frost_Blow_MUI takes nothing returns nothing
set gg_trg_Frost_Blow_MUI = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Blow_MUI, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Blow_MUI, Condition( function Trig_Frost_Blow_MUI_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Blow_MUI, function Trig_Frost_Blow_MUI_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_Arctic_Hailstorm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0BX' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00B' ) ) then
return false
endif
return true
endfunction
function Trig_Arctic_Hailstorm_Actions takes nothing returns nothing
local integer i
local integer j
local unit d
local unit d2
local location pc = GetUnitLoc(GetTriggerUnit())
local location pi
local location pj
//local integer amp = R2I(1.2 * GetHeroLevel(GetTriggerUnit()) + 20 * GetUnitAbilityLevel(GetTriggerUnit(), 'A017' ))
set i = 1
set udg_AH_caster = GetTriggerUnit()
set udg_AH_duration = 7
set udg_AH_point = GetUnitLoc(GetTriggerUnit())
call TimerStart( udg_AH_timer, 0.35, false, null )
loop
exitwhen i > 36
set pi = PolarProjectionBJ(pc, 700.00, ( 10.00 * i ))
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00Q', pi, bj_UNIT_FACING )
//set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00V', pi, bj_UNIT_FACING )
set d = null
call RemoveLocation (pi)
set i = i + 1
endloop
set j = 1
loop
exitwhen j > 3
set d2 = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01K', pc, bj_UNIT_FACING )
call UnitAddAbility(d2, 'A03F')
//call SetUnitUserData( d2, 0 )
call IssuePointOrderLoc( d2, "flamestrike", pc )
set d2 = null
set j = j + 1
endloop
//call RemoveLocation (pj)
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Arctic_Hailstorm takes nothing returns nothing
set gg_trg_Arctic_Hailstorm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arctic_Hailstorm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arctic_Hailstorm, Condition( function Trig_Arctic_Hailstorm_Conditions ) )
call TriggerAddAction( gg_trg_Arctic_Hailstorm, function Trig_Arctic_Hailstorm_Actions )
endfunction
//TESH.scrollpos=10
//TESH.alwaysfold=0
function Trig_AH_2_Filter takes nothing returns boolean
return IsTarget() and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_AH_caster))
endfunction
function Trig_AH_2_Actions takes nothing returns nothing
local unit u
local unit d
local group g = GetUnitsInRangeOfLocMatching(700.00, udg_AH_point, Condition(function Trig_AH_2_Filter))
local location p = GetUnitLoc(udg_AH_caster)
local integer v = 2 * GetHeroLevel(udg_AH_caster) + 35 * GetUnitAbilityLevel(udg_AH_caster, 'A0BX' )
local real r = 0.7 * v
local unit fx
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_AH_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
if ( 10 > GetRandomReal(0,70) ) then
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_AH_caster), 'h00C', udg_AH_point, bj_UNIT_FACING )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_AH_caster), 'h01Y', udg_AH_point, bj_UNIT_FACING )
call UnitAddAbility(d, 'A016')
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "frostnova", u )
set d = null
set fx = null
endif
call GroupRemoveUnit(g, u)
endloop
if udg_AH_duration > 0 then
set udg_AH_duration = udg_AH_duration - 0.35
call TimerStart( udg_AH_timer, 0.35, false, null )
else
call RemoveLocation (udg_AH_point)
endif
call RemoveLocation (p)
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_AH_duration) )
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
endfunction
//===========================================================================
function InitTrig_AH_2 takes nothing returns nothing
set gg_trg_AH_2 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_AH_2, udg_AH_timer )
call TriggerAddAction( gg_trg_AH_2, function Trig_AH_2_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_Freeze_Rush_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07E' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N006' ) ) then
return false
endif
return true
endfunction
function Trig_Freeze_Rush_Actions takes nothing returns nothing
local integer i = 10 + 10 * GetUnitAbilityLevel(GetTriggerUnit(), 'A07E')
call SetHeroAgi(GetTriggerUnit(), GetHeroAgi(GetTriggerUnit(),false) + i, true)
call TriggerSleepAction( 1.00 )
loop
exitwhen ( GetUnitAbilityLevel(GetTriggerUnit(),'B02C') == 0 )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call SetHeroAgi(GetTriggerUnit(), GetHeroAgi(GetTriggerUnit(),false) - i, true)
endfunction
//===========================================================================
function InitTrig_Freeze_Rush takes nothing returns nothing
set gg_trg_Freeze_Rush = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Freeze_Rush, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Freeze_Rush, Condition( function Trig_Freeze_Rush_Conditions ) )
call TriggerAddAction( gg_trg_Freeze_Rush, function Trig_Freeze_Rush_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function WI_2_filter takes nothing returns boolean
local boolean a = IsTarget()
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_WI_caster))
local boolean c = IsUnitInGroup(GetFilterUnit(), udg_WI_group )
return (a and b and not c)
endfunction
function Trig_WI_2_Actions takes nothing returns nothing
local unit dd = udg_WI_dummy
local unit d
local location p = GetUnitLoc(dd)
local location pu
local group g
local unit u
local location p2 = PolarProjectionBJ(p, 90.00, GetUnitFacing(dd))
local real s = GetHeroInt(udg_WI_caster, true) + GetHeroAgi(udg_WI_caster, true) * 0.5
local real r = 200 + s * ( GetUnitAbilityLevel(udg_WI_caster,'A0BV') + 2 )
local effect sp
if (udg_WI_duration > 0 ) then
set udg_WI_duration = udg_WI_duration - 1
call SetUnitPositionLoc( dd, p2 )
set g = GetUnitsInRangeOfLocMatching(210.00, p2, Condition(function WI_2_filter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc(GetOwningPlayer(udg_WI_caster), 'h026', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A07W' )
call SetUnitAbilityLevel( d, 'A07W', GetUnitAbilityLevel(udg_WI_caster,'A0BV'))
call IssueTargetOrder(d, "thunderbolt", u)
call UnitDamageTargetBJ( udg_WI_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupAddUnit(udg_WI_group, u)
call GroupRemoveUnit(g,u)
endloop
else
call DisableTrigger( gg_trg_WI_2 )
call RemoveUnit(udg_WI_dummy)
loop
set u = FirstOfGroup(udg_WI_group)
exitwhen u == null
call GroupRemoveUnit(udg_WI_group,u)
endloop
endif
set g = null
set u = null
set d = null
set dd = null
call RemoveLocation (p)
call RemoveLocation (pu)
call RemoveLocation (p2)
endfunction
//===========================================================================
function InitTrig_WI_2 takes nothing returns nothing
set gg_trg_WI_2 = CreateTrigger( )
call DisableTrigger( gg_trg_WI_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_WI_2, 0.03 )
call TriggerAddAction( gg_trg_WI_2, function Trig_WI_2_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_DS_2_Check takes nothing returns boolean
local boolean a = GetUnitLife(udg_DS_caster) > 0
local boolean b = GetUnitLife(udg_DS_target) > 0
local boolean c = GetUnitAbilityLevel(udg_DS_target,'B03Q') > 0
local boolean d = udg_DS_duration > 0
return (a and b and c and d)
endfunction
function Trig_DS_2_Actions takes nothing returns nothing
local unit u = udg_DS_target
local location pc = GetUnitLoc(udg_DS_caster)
local location pu = GetUnitLoc(u)
local location pu2
local real rd = DistanceBetweenPoints(pc, pu)
if ( Trig_DS_2_Check() ) then
if ( rd > 600 ) then
set pu2 = PolarProjectionBJ(GetUnitLoc(u), 18, AngleBetweenPoints(pu, pc))
call SetUnitPositionLoc( u, pu2 )
endif
call MoveLightningLoc( udg_DS_lightning, pc, pu )
else
call DestroyLightning( udg_DS_lightning )
call SetUnitPathing( udg_DS_target, true )
call DisableTrigger( gg_trg_DS_2 )
call EnableTrigger( gg_trg_Death_Shackle )
endif
set udg_DS_duration = udg_DS_duration - 0.04
set u = null
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_DS_2 takes nothing returns nothing
set gg_trg_DS_2 = CreateTrigger( )
call DisableTrigger( gg_trg_DS_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DS_2, 0.04 )
call TriggerAddAction( gg_trg_DS_2, function Trig_DS_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Flame_Charge_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Charge_Actions takes nothing returns nothing
set udg_BM_boolean = true
endfunction
//===========================================================================
function InitTrig_Flame_Charge takes nothing returns nothing
set gg_trg_Flame_Charge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Charge, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flame_Charge, Condition( function Trig_Flame_Charge_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Charge, function Trig_Flame_Charge_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function FR_2_and takes nothing returns boolean
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_FR_caster))
return (b and IsTarget())
endfunction
function Trig_FR_2_Actions takes nothing returns nothing
local unit d = udg_FR_dummy
local unit d2
local unit d3
local location p = GetUnitLoc(d)
local group g
local unit u
local location p2 = PolarProjectionBJ(p, 56.00, GetUnitFacing(d))
local integer i = 8 + 4 * GetUnitAbilityLevel(udg_FR_caster,'A04N') + R2I(GetHeroBonusInt(GetTriggerUnit())/28)
local effect sp
if (udg_FR_int < 14) then
set udg_FR_int = udg_FR_int + 1
call SetUnitPositionLoc( d, p2 )
set g = GetUnitsInRangeOfLocMatching(200.00, p, Condition(function FR_2_and))
set u = FirstOfGroup(g)
if u != null or udg_FR_int == 14 then
set udg_FR_int = 14
set d2 = CreateUnitAtLoc(GetOwningPlayer(udg_FR_caster),'h01Y', p2, 0)
call UnitAddAbility( d2, 'A05M' )
call SetUnitUserData (d2, i)
set d3 = CreateUnitAtLoc(GetOwningPlayer(udg_FR_caster),'h01A', p2, 0)
call IssueImmediateOrder( d2, "thunderclap" )
call SetUnitPositionLoc( udg_FR_caster, p2 )
set d = null
set d2 = null
set d3 = null
endif
else
call DisableTrigger( gg_trg_FR_2 )
call RemoveUnit(udg_FR_dummy)
endif
set g = null
set u = null
set d = null
call RemoveLocation (p)
call RemoveLocation (p2)
endfunction
//===========================================================================
function InitTrig_FR_2 takes nothing returns nothing
set gg_trg_FR_2 = CreateTrigger( )
call DisableTrigger( gg_trg_FR_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_FR_2, 0.03 )
call TriggerAddAction( gg_trg_FR_2, function Trig_FR_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Fire_Wreathe_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A0BS' ) ) then
return false
endif
return true
endfunction
function Trig_Fire_Wreathe_Filter takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and IsTarget())
endfunction
function Trig_Fire_Wreathe_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(280.00, pc, Condition(function Trig_Fire_Wreathe_Filter))
local unit u
local unit d
local real x = 0.04 + 0.02 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0BS')
local real r
call UnitRemoveBuffsBJ( bj_REMOVEBUFFS_NEGATIVE, GetTriggerUnit() )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pc, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 3.00, 'BTLF', d )
call UnitAddAbility( d,'A06J' )
call SetUnitAbilityLevel( d, 'A06J', 2 )
call IssuePointOrderLoc( d, "silence", pc )
loop
set u = FirstOfGroup(g)
exitwhen u == null
set r = GetUnitMissingLife(u) * x + GetHeroInt(GetTriggerUnit(), true)
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call FadingText( ( I2S(R2I(r)) + "!" ), u, 12.00, 100.00, 72.00, 72.00, 0 )
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Fire_Wreathe takes nothing returns nothing
set gg_trg_Fire_Wreathe = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Fire_Wreathe, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Fire_Wreathe, Condition( function Trig_Fire_Wreathe_Conditions ) )
call TriggerAddAction( gg_trg_Fire_Wreathe, function Trig_Fire_Wreathe_Actions )
endfunction
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_Stunning_Flare_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04S' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
return true
endfunction
function Trig_Stunning_Flare_Func001001003001 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Stunning_Flare_Func001001003 takes nothing returns boolean
return GetBooleanAnd( IsTarget(), Trig_Stunning_Flare_Func001001003001() )
endfunction
function Trig_Stunning_Flare_Actions takes nothing returns nothing
local unit u
local unit d
local real r = GetUnitAbilityLevel(GetTriggerUnit(),'A04S')*60 + 2 * GetHeroBonusInt(GetTriggerUnit())
local location p = GetUnitLoc(GetSpellTargetUnit())
local group g = GetUnitsInRangeOfLocMatching(280.00, p, Condition(function Trig_Stunning_Flare_Func001001003))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01A', p, 0.00 )
set d = null
call RemoveLocation(p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Stunning_Flare takes nothing returns nothing
set gg_trg_Stunning_Flare = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Stunning_Flare, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stunning_Flare, Condition( function Trig_Stunning_Flare_Conditions ) )
call TriggerAddAction( gg_trg_Stunning_Flare, function Trig_Stunning_Flare_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Infernal_Replica_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0BI' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
return true
endfunction
function Trig_IW_cleanup takes nothing returns nothing
call UnitRemoveAbilityBJ( 'A04M', udg_FI_caster )
call SetPlayerAbilityAvailableBJ( true, 'A0BI', GetOwningPlayer(udg_FI_caster) )
call DisableTrigger( gg_trg_Infernal_Warp )
call EnableTrigger( gg_trg_Infernal_Replica )
endfunction
function Trig_Infernal_Replica_Actions takes nothing returns nothing
set udg_FI_caster = GetTriggerUnit()
set udg_IR_count = 2
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Infernal_Warp )
call SetPlayerAbilityAvailableBJ( false, 'A0BI', GetOwningPlayer(GetTriggerUnit()) )
call UnitAddAbilityBJ( 'A04M', GetTriggerUnit() )
call TriggerSleepAction( 8 )
if ( IsTriggerEnabled(gg_trg_Infernal_Warp) ) then
call Trig_IW_cleanup()
endif
endfunction
//===========================================================================
function InitTrig_Infernal_Replica takes nothing returns nothing
set gg_trg_Infernal_Replica = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Infernal_Replica, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Infernal_Replica, Condition( function Trig_Infernal_Replica_Conditions ) )
call TriggerAddAction( gg_trg_Infernal_Replica, function Trig_Infernal_Replica_Actions )
endfunction
//TESH.scrollpos=30
//TESH.alwaysfold=0
function Trig_Infernal_Warp_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04M' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
return true
endfunction
function Trig_IW_Filter takes nothing returns boolean
local boolean a = IsUnitAlly(GetFilterUnit(),GetOwningPlayer(udg_FI_caster))
local boolean b = IsUnitIllusion(GetFilterUnit())
local boolean c = GetUnitTypeId(GetFilterUnit()) == 'N015'
return a and b and c
endfunction
function Trig_IW_Filter2 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_FI_caster))
local boolean b = IsTarget()
return a and b
endfunction
function Trig_Infernal_Warp_Actions takes nothing returns nothing
local unit u
local location pc
local location pu
local location pt = GetSpellTargetLoc()
local group g
local group g2
local real r = GetUnitAbilityLevel(udg_FI_caster,'A0BI') * 100 + GetHeroInt(udg_FI_caster, true) - 20
local unit fx
local real range = 100
loop
set range = range + 20
set g = GetUnitsInRangeOfLocMatching( range, pt, Condition(function Trig_IW_Filter) )
set udg_FI_dummy = FirstOfGroup(g)
exitwhen udg_FI_dummy != null or range > 1000
endloop
if udg_FI_dummy != null then
set pu = GetUnitLoc(udg_FI_dummy)
call KillUnit(udg_FI_dummy)
call SetUnitPositionLocFacingBJ( udg_FI_caster, pu, GetUnitFacing(udg_FI_dummy) )
set pc = GetUnitLoc(udg_FI_caster)
set g2 = GetUnitsInRangeOfLocMatching( 280, pc, Condition(function Trig_IW_Filter2) )
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_FI_caster),'h01A', pu, 0)
loop
set u = FirstOfGroup(g2)
exitwhen u == null
call UnitDamageTargetBJ( udg_FI_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g2, u)
endloop
endif
set udg_IR_count = udg_IR_count - 1
if udg_IR_count <= 0 then
call Trig_IW_cleanup()
endif
call RemoveLocation (pt)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Infernal_Warp takes nothing returns nothing
set gg_trg_Infernal_Warp = CreateTrigger( )
call DisableTrigger( gg_trg_Infernal_Warp )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Infernal_Warp, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Infernal_Warp, Condition( function Trig_Infernal_Warp_Conditions ) )
call TriggerAddAction( gg_trg_Infernal_Warp, function Trig_Infernal_Warp_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_IBeam_with_FI_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04N' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
return true
endfunction
function Trig_IBeam_with_FI_Actions takes nothing returns nothing
local integer i = 14 + GetHeroBonusInt(GetTriggerUnit())/8 + GetUnitAbilityLevel(GetTriggerUnit(),'A04N')*8 + GetUnitAbilityLevel(GetTriggerUnit(),'A026')*14
local location p = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local unit d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p , bj_UNIT_FACING )
local unit d2
call UnitAddAbility(d, 'A04O')
call SetUnitAbilityLevel( d, 'A04O', i )
call IssuePointOrderLoc( d, "shockwave", pt )
if ( IsTriggerEnabled(gg_trg_Infernal_Warp) == true ) then
set d2 = GroupPickRandomUnit(GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()), 'h00B'))
call UnitAddAbility(d2, 'A04O')
call SetUnitAbilityLevel( d2, 'A04O', i )
call IssuePointOrderLoc( d2, "shockwave", pt )
endif
set d = null
call RemoveLocation (p)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_IBeam_with_FI takes nothing returns nothing
set gg_trg_IBeam_with_FI = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_IBeam_with_FI, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_IBeam_with_FI, Condition( function Trig_IBeam_with_FI_Conditions ) )
call TriggerAddAction( gg_trg_IBeam_with_FI, function Trig_IBeam_with_FI_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Snapfire_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N015' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A0BK' ) ) then
return false
endif
return true
endfunction
function Trig_Snapfire_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetUnitLoc(GetSpellTargetUnit())
local unit d
call DisableTrigger( GetTriggeringTrigger() )
set udg_LT_caster = GetTriggerUnit()
set udg_LT_target = GetSpellTargetUnit()
set udg_LT_duration = 4.00
set udg_LT_lightning = AddLightningLoc( "LEAS", pc, pu )
call SetLightningColorBJ( udg_LT_lightning, 1, 0.00, 0.00, 1 )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pc, 0.00 )
call UnitAddAbility( d, 'A0BJ')
call SetUnitAbilityLevel(d, 'A0BJ', GetUnitAbilityLevel(GetTriggerUnit(), 'A0BK'))
call IssueTargetOrder( d, "bloodlust", GetTriggerUnit() )
call EnableTrigger( gg_trg_Snapfire_2 )
set d = null
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Snapfire takes nothing returns nothing
set gg_trg_Snapfire = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Snapfire, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Snapfire, Condition( function Trig_Snapfire_Conditions ) )
call TriggerAddAction( gg_trg_Snapfire, function Trig_Snapfire_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_Snapfire_2_boolean takes nothing returns boolean
local location pc = GetUnitLoc(udg_LT_caster)
local location pu = GetUnitLoc(udg_LT_target)
local boolean a = GetUnitLife(udg_LT_caster) > 0
local boolean b = GetUnitLife(udg_LT_target) > 0
call RemoveLocation (pc)
call RemoveLocation (pu)
return (a and b)
endfunction
function Trig_Snapfire_2_Actions takes nothing returns nothing
local location pc = GetUnitLoc(udg_LT_caster)
local location pu = GetUnitLoc(udg_LT_target)
local boolean c = DistanceBetweenPoints(pc, pu) > 550
local unit d
local unit fx
local real r = 120 + 80*(GetUnitAbilityLevel(udg_LT_caster,'A073')) + 2*GetHeroBonusInt(udg_LT_caster)
//normal tether movement
if ( Trig_Snapfire_2_boolean() and udg_LT_duration > 0) then
//if both targets are alive and in range, move the tether
call MoveLightningLoc( udg_LT_lightning, pc, pu )
if (c) then
call UnitDamageTargetBJ( udg_LT_caster, udg_LT_target, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_LT_caster),'h002', pu, 0)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_LT_target), 'h000', pu, 0 )
call UnitAddAbility( d, 'A05E' )
call IssueTargetOrder( d, "firebolt", udg_LT_target )
set d = null
set udg_LT_duration = 0
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
set udg_LT_duration = udg_LT_duration - 0.05
else
call DisableTrigger ( gg_trg_Snapfire_2 )
call DestroyLightning( udg_LT_lightning )
set udg_LT_caster = null
set udg_LT_target = null
call EnableTrigger ( gg_trg_Snapfire )
endif
call RemoveLocation (pc)
call RemoveLocation (pu)
set d = null
endfunction
//===========================================================================
function InitTrig_Snapfire_2 takes nothing returns nothing
set gg_trg_Snapfire_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Snapfire_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Snapfire_2, 0.05 )
call TriggerAddAction( gg_trg_Snapfire_2, function Trig_Snapfire_2_Actions )
endfunction
//TESH.scrollpos=7
//TESH.alwaysfold=0
function Trig_CotL_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A04P' ) ) then
return false
endif
return true
endfunction
function Trig_CotL_Actions takes nothing returns nothing
call DisableTrigger( gg_trg_CotL )
set udg_CL_caster = GetTriggerUnit()
set udg_CL_targetpoint = GetSpellTargetLoc()
set udg_CL_casterpoint = GetUnitLoc(GetTriggerUnit())
set udg_CL_int = 1
call EnableTrigger( gg_trg_CotL_2 )
endfunction
//===========================================================================
function InitTrig_CotL takes nothing returns nothing
set gg_trg_CotL = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_CotL, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_CotL, Condition( function Trig_CotL_Conditions ) )
call TriggerAddAction( gg_trg_CotL, function Trig_CotL_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CotL_2_Actions takes nothing returns nothing
local location p1 = PolarProjectionBJ(udg_CL_casterpoint, 560.00, GetRandomReal(0,360))
local location p2 = PolarProjectionBJ(udg_CL_targetpoint, 140.00, GetRandomReal(0,360))
local unit d
local integer i = GetHeroBonusInt(udg_CL_caster)/14 + GetUnitAbilityLevel(udg_CL_caster,'A04P')*4 + GetUnitAbilityLevel(udg_CL_caster,'A026')*4
if ( udg_CL_int <= 28 )then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_CL_caster), 'h000', p1, 0.00 )
call UnitAddAbility( d,'A04O' )
call SetUnitAbilityLevel( d, 'A04O', i)
call IssuePointOrderLoc( d, "shockwave", p2 )
else
call DisableTrigger( gg_trg_CotL_2 )
call EnableTrigger( gg_trg_CotL )
call RemoveLocation( udg_CL_casterpoint )
call RemoveLocation( udg_CL_targetpoint )
set udg_CL_caster = null
endif
set udg_CL_int = udg_CL_int + 1
set d = null
call RemoveLocation(p1)
call RemoveLocation(p2)
endfunction
//===========================================================================
function InitTrig_CotL_2 takes nothing returns nothing
set gg_trg_CotL_2 = CreateTrigger( )
call DisableTrigger( gg_trg_CotL_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_CotL_2, 0.1 )
call TriggerAddAction( gg_trg_CotL_2, function Trig_CotL_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Corrupted_Earth_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0BN' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N010' ) ) then
return false
endif
return true
endfunction
function Trig_Corrupted_Earth_Actions takes nothing returns nothing
local unit d
local location p = GetSpellTargetLoc()
local real r = 30 + 8 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0BN')
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00Z', p , bj_UNIT_FACING )
call SetUnitLife(d, r)
//call UnitAddAbility( d, 'A0AD' )
//call SetUnitAbilityLevel(d, 'A0AD', GetUnitAbilityLevel(GetTriggerUnit(), 'A0AC'))
//call IssuePointOrderLoc( d, "cloudoffog", p )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Corrupted_Earth takes nothing returns nothing
set gg_trg_Corrupted_Earth = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Corrupted_Earth, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Corrupted_Earth, Condition( function Trig_Corrupted_Earth_Conditions ) )
call TriggerAddAction( gg_trg_Corrupted_Earth, function Trig_Corrupted_Earth_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Souleater_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03L' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N010' ) ) then
return false
endif
return true
endfunction
function Trig_Souleater_Actions takes nothing returns nothing
//local real r = 0.05 + 0.07 * GetUnitAbilityLevel(GetTriggerUnit(),'A03L')
set udg_SE_caster = GetTriggerUnit()
//set udg_SE_real = (GetUnitMissingMana(GetTriggerUnit()) + GetUnitMissingLife(GetTriggerUnit())) * r
set udg_SE_int = 8
//call SetUnitManaBJ(udg_SE_caster, GetUnitState(udg_SE_caster, UNIT_STATE_MANA) - udg_SE_real )
//call FadingText( I2S(R2I(udg_SE_real)) + "!", udg_SE_caster, 15.00, 80, 70, 80, 0 )
call EnableTrigger( gg_trg_SE_2 )
endfunction
//===========================================================================
function InitTrig_Souleater takes nothing returns nothing
set gg_trg_Souleater = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Souleater, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Souleater, Condition( function Trig_Souleater_Conditions ) )
call TriggerAddAction( gg_trg_Souleater, function Trig_Souleater_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_SE_2_Boolean takes nothing returns boolean
if ( not ( udg_SE_int > 0 ) ) then
return false
endif
if ( not ( GetUnitLife(udg_SE_caster) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_SE_2_Actions takes nothing returns nothing
local real rg = 70
local real rb = 70
local real v = 0.05 + 0.07 * GetUnitAbilityLevel(udg_SE_caster,'A03L')
local real v2 = 2 + 0.3 * GetUnitAbilityLevel(udg_SE_caster,'A03L')
local real r
set udg_SE_int = udg_SE_int - 1
if ( Trig_SE_2_Boolean() ) then
if GetUnitManaPercent(udg_SE_caster) >= GetUnitPercentLife(udg_SE_caster) then
set r = 0.125 * GetUnitMissingLife(udg_SE_caster) * v
call SetUnitLife( udg_SE_caster, GetUnitLife(udg_SE_caster) + r )
set rg = 100
else
set r = 0.1 * GetUnitMissingMana(udg_SE_caster) * v
call SetUnitManaBJ( udg_SE_caster, GetUnitState(udg_SE_caster, UNIT_STATE_MANA) + r )
set rb = 100
endif
call FadingText( "+" + I2S(R2I(r)), udg_SE_caster, 10.00, 70, rg, rb, 0 )
call SetUnitMoveSpeed( udg_SE_caster, 300 + v2 * I2R(udg_SE_int * udg_SE_int) )
else
set udg_SE_int = 0
call SetUnitMoveSpeed( udg_SE_caster, 300 )
call DisableTrigger( GetTriggeringTrigger() )
endif
endfunction
//===========================================================================
function InitTrig_SE_2 takes nothing returns nothing
set gg_trg_SE_2 = CreateTrigger( )
call DisableTrigger( gg_trg_SE_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_SE_2, 0.5 )
call TriggerAddAction( gg_trg_SE_2, function Trig_SE_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Crit_hacks_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N010' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A03J' ) ) then
return false
endif
return true
endfunction
function Trig_Crit_hacks_Actions takes nothing returns nothing
local group g = GetUnitsOfPlayerAll(GetOwningPlayer(GetTriggerUnit()))
local integer i = GetHeroAgi(GetTriggerUnit(),true)/8 + GetUnitAbilityLevel(GetTriggerUnit(),'A03J')*10 - 10
local unit u
loop
set u = FirstOfGroup(g)
exitwhen u == null
call SetUnitAbilityLevel( u, 'A03M', i )
call GroupRemoveUnit(g,u)
endloop
call TriggerSleepAction( 10.00 )
set g = GetUnitsOfPlayerAll(GetOwningPlayer(GetTriggerUnit()))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call SetUnitAbilityLevel( u, 'A03M', 1 )
call GroupRemoveUnit(g,u)
endloop
endfunction
//===========================================================================
function InitTrig_Crit_hacks takes nothing returns nothing
set gg_trg_Crit_hacks = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crit_hacks, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Crit_hacks, Condition( function Trig_Crit_hacks_Conditions ) )
call TriggerAddAction( gg_trg_Crit_hacks, function Trig_Crit_hacks_Actions )
endfunction
//TESH.scrollpos=28
//TESH.alwaysfold=0
function Trig_Crimson_Force_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01A' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A075' ) ) then
return false
endif
return true
endfunction
function Trig_Crimson_Force_Func001001003 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))
return a and IsTarget()
endfunction
function Trig_Crimson_Force_Actions takes nothing returns nothing
local location p = GetSpellTargetLoc()
local location pu
local unit u
local real t = GetUnitAbilityLevel(GetTriggerUnit(),'A049') * 0.2 + 0.8
local real r1 = CrimsonStat(GetTriggerUnit()) * t
local real r2 = (240.00 - GetUnitPercentLife(GetTriggerUnit()))* 0.01 * t
local real r3 = 60 * GetUnitAbilityLevel(GetTriggerUnit(), 'A075')
local real debuff = 1
local real m = 0.06
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_Crimson_Force_Func001001003))
if CountUnitsInGroup(g) > 0 then
call SetUnitPercentLife(GetTriggerUnit(), GetUnitPercentLife(GetTriggerUnit())+ 3 * r2)
endif
loop
set u = FirstOfGroup (g)
exitwhen u == null
set pu = GetUnitLoc(u)
if (GetUnitAbilityLevel(u,'B00B') > 0) then
set debuff = 2.4
endif
if IsUnitType(u, UNIT_TYPE_HERO) then
set m = 0.2
endif
call UnitDamageTargetBJ( GetTriggerUnit(), u, debuff * ( r1 + r3 ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitPercentLife(GetTriggerUnit(), GetUnitPercentLife(GetTriggerUnit()) + debuff * m * ( 0.01*r1 + 3*r2 ) )
call CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h002', pu, GetRandomReal(0, 360.00) )
call GroupRemoveUnit(g, u)
endloop
set g = null
call RemoveLocation (p)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Crimson_Force takes nothing returns nothing
set gg_trg_Crimson_Force = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crimson_Force, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Crimson_Force, Condition( function Trig_Crimson_Force_Conditions ) )
call TriggerAddAction( gg_trg_Crimson_Force, function Trig_Crimson_Force_Actions )
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function Trig_Blood_Pact_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01A' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A073' ) ) then
return false
endif
return true
endfunction
function Trig_Blood_Pact_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetUnitLoc(GetSpellTargetUnit())
call DisableTrigger( GetTriggeringTrigger() )
set udg_BP_caster = GetTriggerUnit()
set udg_BP_target = GetSpellTargetUnit()
set udg_BP_duration = 3 + 0.6 * GetUnitAbilityLevel(udg_BP_caster, 'A073')
call AddLightningLoc( "HWPB", pc, pu )
set udg_BP_lightning = GetLastCreatedLightningBJ()
call SetLightningColorBJ( udg_BP_lightning, 1, 0.00, 0.00, 1 )
call EnableTrigger( gg_trg_BP_2 )
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Blood_Pact takes nothing returns nothing
set gg_trg_Blood_Pact = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blood_Pact, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Blood_Pact, Condition( function Trig_Blood_Pact_Conditions ) )
call TriggerAddAction( gg_trg_Blood_Pact, function Trig_Blood_Pact_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_BP_2_boolean takes nothing returns boolean
local location pc = GetUnitLoc(udg_BP_caster)
local location pu = GetUnitLoc(udg_BP_target)
local boolean a = GetUnitLife(udg_BP_caster) > 0
local boolean b = GetUnitLife(udg_BP_target) > 0
local boolean c = DistanceBetweenPoints(pc, pu) < 1200
call RemoveLocation (pc)
call RemoveLocation (pu)
return (a and b and c)
endfunction
function Trig_BP_2_Actions takes nothing returns nothing
local location pc = GetUnitLoc(udg_BP_caster)
local location pu = GetUnitLoc(udg_BP_target)
local unit d = CreateUnitAtLoc( GetOwningPlayer(udg_BP_target), 'h000', pu, 0 )
local real m = (0.6 + 0.1 * udg_BP_duration) * 0.05
local real r = ((24 * (GetUnitAbilityLevel(udg_BP_caster,'A073')) - 12 ) + CrimsonStat(udg_BP_caster)) * m
if ( udg_BP_duration > 0 and Trig_BP_2_boolean() ) then
if (GetUnitAbilityLevel(udg_BP_target,'B00B') > 0) then
call SetUnitLife(udg_BP_caster, GetUnitLife(udg_BP_caster) + r)
//else
//call UnitDamageTargetBJ( d, udg_BP_caster, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endif
call MoveLightningLoc( udg_BP_lightning, pc, pu )
call UnitDamageTargetBJ( udg_BP_caster, udg_BP_target, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
//blood fx
if (GetRandomReal(0,100) < 24) then
call CreateUnitAtLoc(GetOwningPlayer(udg_BP_caster), 'h002', pu, 0 )
endif
set udg_BP_duration = udg_BP_duration - 0.05
else
call DisableTrigger ( gg_trg_BP_2 )
call DestroyLightning( udg_BP_lightning )
set udg_BP_caster = null
set udg_BP_target = null
call EnableTrigger ( gg_trg_Blood_Pact )
endif
call RemoveLocation (pc)
call RemoveLocation (pu)
set d = null
endfunction
//===========================================================================
function InitTrig_BP_2 takes nothing returns nothing
set gg_trg_BP_2 = CreateTrigger( )
call DisableTrigger( gg_trg_BP_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_BP_2, 0.05 )
call TriggerAddAction( gg_trg_BP_2, function Trig_BP_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_BV_2_Actions takes nothing returns nothing
local real r1 = (GetUnitMaxLife(udg_BV_caster))* 0.01
local real r2 = 8 * GetUnitAbilityLevel(udg_BV_caster, 'A0AW')
local real r3 = 0.1 * CrimsonStat(udg_BV_caster)
local real r = r1 + r2 + r3
if ( udg_BV_duration > 0 and GetUnitLife( udg_BV_caster ) > 0) then
call SetUnitLife( udg_BV_caster, GetUnitLife( udg_BV_caster ) + r )
call FadingText( "+" + I2S(R2I(r)), udg_BV_caster, 9.00, 99, 72, 72, 0 )
set udg_BV_duration = ( udg_BV_duration - 0.5 )
else
call DisableTrigger( GetTriggeringTrigger() )
set udg_BV_duration = 0
endif
endfunction
//===========================================================================
function InitTrig_BV_2 takes nothing returns nothing
set gg_trg_BV_2 = CreateTrigger( )
call DisableTrigger( gg_trg_BV_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_BV_2, 0.50 )
call TriggerAddAction( gg_trg_BV_2, function Trig_BV_2_Actions )
endfunction
//TESH.scrollpos=2
//TESH.alwaysfold=0
function Trig_Kiss_of_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01A' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A076' ) ) then
return false
endif
return true
endfunction
function Trig_Kiss_of_Death_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetSpellTargetUnit())
set udg_KD_caster = GetTriggerUnit()
set udg_KD_target = GetSpellTargetUnit()
set udg_KD_real = 1 + I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A076'))
set udg_KD_dummy = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h003', p, bj_UNIT_FACING )
call EnableTrigger( gg_trg_Kiss_of_Death_2 )
call DisableTrigger( gg_trg_Kiss_of_Death )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Kiss_of_Death takes nothing returns nothing
set gg_trg_Kiss_of_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Kiss_of_Death, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Kiss_of_Death, Condition( function Trig_Kiss_of_Death_Conditions ) )
call TriggerAddAction( gg_trg_Kiss_of_Death, function Trig_Kiss_of_Death_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Kiss_of_Death_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_KD_target)
local location pi
local integer i = 0
local real r1 = CrimsonStat(udg_KD_caster)*0.4
local real r2 = 48 * I2R(GetUnitAbilityLevel(udg_KD_caster, 'A076'))
local real r3 = 180.00 - GetUnitPercentLife(udg_KD_target)
local real r = 0.03 * (r1 + r2) * r3
local real debuff = 1.2
local boolean dmg = true
if (GetUnitAbilityLevel(udg_KD_target,'B00B') > 0) then
set r = r * debuff
endif
if ( GetUnitLife(udg_KD_target) < 0 ) then
set udg_KD_real = 0
set dmg = false
endif
if ( udg_KD_real <= 0.00 ) then
// damage him and heal lisa
if dmg then
call UnitDamageTargetBJ( udg_KD_caster, udg_KD_target, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
//set r3 = 120.00 - GetUnitPercentLife(udg_KD_target)
//set r = 0.06 * (r1 + r2) * r3
endif
call SetUnitLife(udg_KD_caster, (GetUnitLife(udg_KD_caster)+0.6*r))
call FadingText((I2S(R2I(r))) + "!!" , udg_KD_target, 18.00, 76.00, 0, 0, 0 )
loop
exitwhen i > 12
set pi = PolarProjectionBJ( p, 240, I2R(i)*30 )
//blood vfx
call CreateUnitAtLoc( GetOwningPlayer(udg_KD_caster), 'h002', pi, bj_UNIT_FACING )
call RemoveLocation (pi)
set i = i + 1
endloop
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Kiss_of_Death )
call RemoveUnit (udg_KD_dummy)
set udg_KD_caster = null
set udg_KD_target = null
else
set udg_KD_real = ( udg_KD_real - 0.05 )
call SetUnitPositionLoc( udg_KD_dummy, p )
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Kiss_of_Death_2 takes nothing returns nothing
set gg_trg_Kiss_of_Death_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Kiss_of_Death_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Kiss_of_Death_2, 0.05 )
call TriggerAddAction( gg_trg_Kiss_of_Death_2, function Trig_Kiss_of_Death_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shadow_Melt_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00A' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A02B' ) ) then
return false
endif
return true
endfunction
function Trig_Shadow_Melt_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit fx
local location pc = GetUnitLoc(udg_XM_caster)
local location pt = GetUnitLoc(udg_XM_target)
local location p = PolarProjectionBJ(pt,100,AngleBetweenPoints(pc,pt))
local integer v = GetUnitAbilityLevel( udg_XM_caster, 'A02B' )
local real r = GetHeroAgi(udg_XM_caster, true) * 0.8 + 80 * v
call SetUnitPositionLoc( udg_XM_caster, p )
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_XM_caster), 'h002', p, 0 )
call UnitDamageTargetBJ( udg_XM_caster, udg_XM_target, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call DisplayTextToForce( GetPlayersAll(), R2S(GetLocationX(p)) )
call PauseTimer(t)
call DestroyTimer(t)
call RemoveLocation (pc)
call RemoveLocation (pt)
call RemoveLocation (p)
set t = null
endfunction
function Trig_Shadow_Melt_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit u = GetSpellTargetUnit()
//local integer i = 0
///local location p
//local integer level = GetUnitAbilityLevel( GetTriggerUnit(), 'A02B' )
//local real r = GetHeroAgi(GetTriggerUnit(), true) * 0.8 + 80.00 * level
///call TriggerSleepAction(0.4)
///set p = GetUnitLoc(u)
///call SetUnitPositionLoc( GetTriggerUnit(), p )
//call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
set udg_XM_caster = GetTriggerUnit()
set udg_XM_target = u
call TimerStart (t, 0.3, false, function Trig_Shadow_Melt_Blink)
set t = null
set u = null
endfunction
//===========================================================================
function InitTrig_Shadow_Melt takes nothing returns nothing
set gg_trg_Shadow_Melt = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Melt, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Melt, Condition( function Trig_Shadow_Melt_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Melt, function Trig_Shadow_Melt_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shadow_Tag_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0B8' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00A' ) ) then
return false
endif
return true
endfunction
function Trig_Shadow_Tag_Actions takes nothing returns nothing
local location pu = GetUnitLoc(GetSpellTargetUnit())
call DisableTrigger( GetTriggeringTrigger() )
set udg_Tag_dummy = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h020', pu, 0 )
set udg_Tag_target = GetSpellTargetUnit()
set udg_Tag_caster = GetTriggerUnit()
set udg_Tag_duration = 4
call EnableTrigger( gg_trg_ST_2 )
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Shadow_Tag takes nothing returns nothing
set gg_trg_Shadow_Tag = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Tag, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Tag, Condition( function Trig_Shadow_Tag_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Tag, function Trig_Shadow_Tag_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ST_2_Actions takes nothing returns nothing
local boolean a = udg_Tag_duration > 0
local boolean b = GetUnitLife(udg_Tag_target) > 0
local location pu = GetUnitLoc( udg_Tag_target )
local location pc = GetUnitLoc( udg_Tag_caster )
local real r = 0.01 * ( 40 * GetUnitAbilityLevel( udg_Tag_caster, 'A0B8' ) + GetHeroAgi( udg_Tag_caster, true ))
if (a and b) then
//call ShowUnit( udg_Tag_dummy, true )
call SetUnitPositionLoc( udg_Tag_dummy, pu )
call UnitDamageTargetBJ( udg_Tag_dummy, udg_Tag_target, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set udg_Tag_duration = udg_Tag_duration - 0.04
else
set udg_Tag_duration = 0
set udg_Tag_target = null
call DisableTrigger( gg_trg_ST_2 )
call EnableTrigger( gg_trg_Shadow_Tag )
call KillUnit( udg_Tag_dummy )
endif
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_ST_2 takes nothing returns nothing
set gg_trg_ST_2 = CreateTrigger( )
call DisableTrigger( gg_trg_ST_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_ST_2, 0.04 )
call TriggerAddAction( gg_trg_ST_2, function Trig_ST_2_Actions )
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function Trig_Shadow_Slash_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A048' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00A' ) ) then
return false
endif
return true
endfunction
function Trig_Shadow_Slash_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and IsTarget())
endfunction
function Trig_Shadow_Slash_Actions takes nothing returns nothing
local unit u
local unit d
local location p = GetUnitLoc(GetSpellTargetUnit())
local integer level = GetUnitAbilityLevel( GetTriggerUnit(), 'A048' )
local real r = GetHeroAgi(GetTriggerUnit(), true) * 1.8 + 100.00 * level
local group g = GetUnitsInRangeOfLocMatching(250.00, p, Condition(function Trig_Shadow_Slash_Filter))
if ( Daytime() ) then
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, 0.6*r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
endif
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01T', p , bj_UNIT_FACING )
set d = null
endfunction
//===========================================================================
function InitTrig_Shadow_Slash takes nothing returns nothing
set gg_trg_Shadow_Slash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Slash, Condition( function Trig_Shadow_Slash_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Slash, function Trig_Shadow_Slash_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Umbral_Edge_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01B' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00A' ) ) then
return false
endif
return true
endfunction
function Trig_Umbral_Edge_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Art_of_Ambush_2 )
call EnableTrigger( gg_trg_Art_of_Ambush_Timer )
call UnitAddAbility( GetTriggerUnit(), 'A02C' )
call SetUnitAbilityLevel( GetTriggerUnit(), 'A02C', GetUnitAbilityLevel(GetTriggerUnit(), 'A01B' ) )
set udg_Aoa_caster = GetTriggerUnit()
endfunction
//===========================================================================
function InitTrig_Umbral_Edge takes nothing returns nothing
set gg_trg_Umbral_Edge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Umbral_Edge, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Umbral_Edge, Condition( function Trig_Umbral_Edge_Conditions ) )
call TriggerAddAction( gg_trg_Umbral_Edge, function Trig_Umbral_Edge_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Dark_Spear_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02L' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00A' ) ) then
return false
endif
return true
endfunction
function Trig_Dark_Spear_Actions takes nothing returns nothing
set udg_DX_caster = GetTriggerUnit()
set udg_DX_int = 12
call EnableTrigger( gg_trg_DX_2 )
call DisableTrigger( gg_trg_Dark_Spear )
endfunction
//===========================================================================
function InitTrig_Dark_Spear takes nothing returns nothing
set gg_trg_Dark_Spear = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dark_Spear, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dark_Spear, Condition( function Trig_Dark_Spear_Conditions ) )
call TriggerAddAction( gg_trg_Dark_Spear, function Trig_Dark_Spear_Actions )
endfunction
//TESH.scrollpos=39
//TESH.alwaysfold=0
function Trig_DX_2_Actions takes nothing returns nothing
local unit c = udg_DX_caster
local location pc = GetUnitLoc(udg_DX_caster)
local location pd
local location pt
local real tm = UnitInventoryCount(udg_DX_caster) * 20
local real base = GetRandomReal(0,8) + GetHeroLevel(udg_DX_caster) * 2 + GetHeroAgi(udg_DX_caster,true) + tm
local integer v = R2I(0.4 * base + GetUnitAbilityLevel(udg_DX_caster,'A02L')*40)
local integer x
local unit d
local integer i = 1
if ( udg_DX_int > 0 and GetUnitLife(udg_DX_caster) > 0) then
set x = ModuloInteger(udg_DX_int,3)
//call DisplayTextToForce( GetPlayersAll(), I2S(x) )
if x == 0 then
// pattern 1
loop
exitwhen i == 10
set pd = PolarProjectionBJ(pc, 80, GetUnitFacing(udg_DX_caster) + i * 36 )
set pt = PolarProjectionBJ(pc, 600, GetUnitFacing(udg_DX_caster) + i * 36 )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_DX_caster), 'h02A', pd, 0 )
call UnitAddAbility( d,'A04O' )
call SetUnitScale( d, 2, 2, 2 )
call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call RemoveLocation (pt)
call RemoveLocation (pd)
set i = i + 1
endloop
elseif x == 2 then
// pattern 2
loop
exitwhen i == 4
set pd = PolarProjectionBJ(pc, 80, GetUnitFacing(udg_DX_caster) + -50 + i * 20)
set pt = PolarProjectionBJ(pc, 600, GetUnitFacing(udg_DX_caster) + -50 + i * 20)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_DX_caster), 'h02A', pd, 0 )
call UnitAddAbility( d,'A04O' )
call SetUnitScale( d, 2, 2, 2 )
call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call RemoveLocation (pt)
call RemoveLocation (pd)
set i = i + 1
endloop
endif
else
call DisableTrigger( gg_trg_DX_2 )
call EnableTrigger( gg_trg_Dark_Spear )
endif
set udg_DX_int = udg_DX_int - 1
//call RemoveLocation(pc)
//call RemoveLocation(pt)
endfunction
//===========================================================================
function InitTrig_DX_2 takes nothing returns nothing
set gg_trg_DX_2 = CreateTrigger( )
call DisableTrigger( gg_trg_DX_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DX_2, 0.5 )
call TriggerAddAction( gg_trg_DX_2, function Trig_DX_2_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Fearless_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_FA_caster))
return (a and IsTarget())
endfunction
function Trig_Fearless_2_Filter2 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_FA_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO )
return (a and b and IsTarget())
endfunction
function Trig_Fearless_2_Actions takes nothing returns nothing
local unit c = udg_FA_caster
local unit fx
local location p = GetUnitLoc(c)
local location p2 = PolarProjectionBJ(p, 50, udg_FA_angle)
local group g = GetUnitsInRangeOfLocMatching(250.00, p, Condition(function Trig_Fearless_2_Filter))
local group g2 = GetUnitsInRangeOfLocMatching(130.00, p, Condition(function Trig_Fearless_2_Filter2))
local unit u
local real r = ( 3 + GetUnitAbilityLevel(c, 'A027') ) * (45.00 + 0.3 * GetHeroAgi(c, true))
if ( udg_FA_int < 16 and FirstOfGroup(g2) == null) then
set udg_FA_int = ( udg_FA_int + 1 )
set udg_FA_height = ( 144.00 - Pow(( 1.50 * ( I2R(udg_FA_int) - 8.00 ) ), 2.00) )
call SetUnitFlyHeight( c, udg_FA_height, 3000 )
call SetUnitPositionLoc( c, p2 )
else
call DisableTrigger( GetTriggeringTrigger() )
call PauseUnit( udg_FA_caster, false )
call SetUnitAnimation( udg_FA_caster, "stand" )
call SetUnitPathing( c, true )
call SetUnitFlyHeight( c, 0, 3000 )
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_FA_caster), 'h00J', p , bj_UNIT_FACING )
set fx = null
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( c, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
call SelectUnitForPlayerSingle( udg_FA_caster, GetOwningPlayer(udg_FA_caster) )
set udg_FA_int = 0
set udg_FA_height = 0
call EnableTrigger( gg_trg_Fearless_1 )
endif
call RemoveLocation(p)
call RemoveLocation(p2)
set c = null
set u = null
set g = null
endfunction
//===============================================
function InitTrig_Fearless_2 takes nothing returns nothing
set gg_trg_Fearless_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Fearless_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Fearless_2, 0.02 )
call TriggerAddAction( gg_trg_Fearless_2, function Trig_Fearless_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Incapacitate_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07V' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N003' ) ) then
return false
endif
return true
endfunction
function Trig_Incapacitate_Actions takes nothing returns nothing
local integer i = 1
local location p = GetUnitLoc(GetSpellTargetUnit())
local location pd
set udg_IN_target = GetSpellTargetUnit()
set udg_IN_caster = GetTriggerUnit()
set udg_IN_duration = 9
loop
exitwhen i > 6
set pd = PolarProjectionBJ(p, 90, 60 * i)
set udg_IN_dummy [i] = CreateUnitAtLoc(GetOwningPlayer(udg_IN_caster), 'h028', pd, 0 )
call SetUnitFacing( udg_IN_dummy [i], 60 * i )
set i = i + 1
endloop
call EnableTrigger( gg_trg_IN_2 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Incapacitate takes nothing returns nothing
set gg_trg_Incapacitate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Incapacitate, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Incapacitate, Condition( function Trig_Incapacitate_Conditions ) )
call TriggerAddAction( gg_trg_Incapacitate, function Trig_Incapacitate_Actions )
endfunction
//TESH.scrollpos=19
//TESH.alwaysfold=0
function Trig_IN_2_Actions takes nothing returns nothing
local integer i = 1
local boolean a = udg_IN_duration > 0
local boolean b = GetUnitLife(udg_IN_target) > 0
local location p = GetUnitLoc( udg_IN_target )
local location pd
local real r = 30 * GetUnitAbilityLevel(udg_IN_caster, 'A07V' ) + 4.5 * GetHeroLevel(udg_IN_caster)
local unit fx
if (a and b) then
loop
exitwhen i > 6
set pd = PolarProjectionBJ(p, 90, 60 * i)
call SetUnitPositionLoc( udg_IN_dummy [i], pd )
call SetUnitFacing( udg_IN_dummy [i], 60 * i )
set i = i + 1
endloop
set udg_IN_duration = udg_IN_duration - 0.04
call UnitDamageTargetBJ( udg_IN_caster, udg_IN_target, 0.04 * r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
if GetRandomReal(0,1) < 0.1 then
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_IN_caster), 'h002', p , bj_UNIT_FACING )
set fx = null
endif
else
set udg_IN_duration = 0
//call FadingText( ( I2S(R2I(r)) + "!" ), u, 12.00, 72.00, 0.00, 72.00, 0 )
call DisableTrigger( gg_trg_IN_2 )
set i = 1
loop
exitwhen i > 6
call RemoveUnit( udg_IN_dummy [i])
set i = i + 1
endloop
set udg_IN_target = null
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_IN_2 takes nothing returns nothing
set gg_trg_IN_2 = CreateTrigger( )
call DisableTrigger( gg_trg_IN_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_IN_2, 0.04 )
call TriggerAddAction( gg_trg_IN_2, function Trig_IN_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Plague_Swarm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00A' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N004' ) ) then
return false
endif
return true
endfunction
function Trig_Plague_Swarm_Actions takes nothing returns nothing
local integer i = GetUnitAbilityLevel(GetTriggerUnit(),'A00A') * 15
local integer v = i + GetHeroLevel(GetTriggerUnit()) * 2 + 15
local location p = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local unit d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p , bj_UNIT_FACING )
local unit d2
call UnitAddAbility(d, 'A0C4')
call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call RemoveLocation (p)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Plague_Swarm takes nothing returns nothing
set gg_trg_Plague_Swarm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Plague_Swarm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Plague_Swarm, Condition( function Trig_Plague_Swarm_Conditions ) )
call TriggerAddAction( gg_trg_Plague_Swarm, function Trig_Plague_Swarm_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Contaminate_Conditions takes nothing returns boolean
local location p1 = GetUnitLoc(GetAttacker())
local location p2 = GetUnitLoc(GetTriggerUnit())
if ( not ( IsUnitType(GetAttacker(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N004' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetTriggerUnit(),'A00C') > 0 ) ) then
return false
endif
if ( not ( DistanceBetweenPoints(p1,p2) < 300 ) ) then
return false
endif
call RemoveLocation (p1)
call RemoveLocation (p2)
return true
endfunction
function Trig_Contaminate_Actions takes nothing returns nothing
local unit u = GetAttacker()
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
local integer i
set i = GetUnitAbilityLevel(GetTriggerUnit(),'A00C')*5 + GetHeroLevel(GetTriggerUnit())
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A09I' )
call SetUnitAbilityLevel( d, 'A09I', i )
call IssueTargetOrder( d, "acidbomb", u )
set u = null
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Contaminate takes nothing returns nothing
set gg_trg_Contaminate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Contaminate, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Contaminate, Condition( function Trig_Contaminate_Conditions ) )
call TriggerAddAction( gg_trg_Contaminate, function Trig_Contaminate_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function Trig_LD_Filter takes nothing returns boolean
return IsTarget() and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_LD_caster))
endfunction
function Trig_LD_2_Actions takes nothing returns nothing
local unit u
local group g = GetUnitsInRangeOfLocMatching(400.00, udg_LD_point, Condition(function Trig_LD_Filter))
local unit d
local location pd
local real r = 60 + 60 * GetUnitAbilityLevel(udg_LD_caster, 'A01U') + 3.50 * GetHeroBonusInt(udg_LD_caster)
set udg_LD_int = udg_LD_int + 1
call SetUnitVertexColor( udg_LD_caster, 255, 255, 255, 255 - (udg_LD_int) * 9 )
if ( udg_LD_int >= 25 ) then
call DisableTrigger( GetTriggeringTrigger() )
call PauseUnit( udg_LD_caster, false )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_LD_caster), 'h00J', udg_LD_point, bj_UNIT_FACING )
call SetUnitScale( d, 2.4, 2.4, 2.4 )
set pd = GetUnitLoc(d)
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', d )
call SetUnitPositionLoc( udg_LD_caster, pd )
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_LD_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
call SetUnitVertexColor( udg_LD_caster, 255, 255, 255, 255 )
set udg_LD_int = 0
call EnableTrigger( gg_trg_LD )
// for ult
set udg_LS_bool = true
endif
set udg_LS_count = udg_LS_count + 1
set d = null
set pd = null
set g = null
endfunction
//===========================================================================
function InitTrig_LD_2 takes nothing returns nothing
set gg_trg_LD_2 = CreateTrigger( )
call DisableTrigger( gg_trg_LD_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_LD_2, 0.04 )
call TriggerAddAction( gg_trg_LD_2, function Trig_LD_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Thunder_Blade_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A008') ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00J' ) ) then
return false
endif
return true
endfunction
function Trig_Thunder_Blade_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
local location p = udg_EB_point
call SetUnitPositionLoc( udg_EB_caster, p )
call PauseTimer(t)
call DestroyTimer(t)
call RemoveLocation (p)
set udg_LS_bool = true
//call DisplayTextToForce( GetPlayersAll(), R2S(GetLocationX(p)) )
set t = null
endfunction
function Trig_Thunder_Blade_Actions takes nothing returns nothing
local unit d
local timer t = CreateTimer()
local location pt = GetUnitLoc(GetTriggerUnit())
local location pu = GetUnitLoc(GetSpellTargetUnit())
local location p = PolarProjectionBJ(pt, ( DistanceBetweenPoints(pt, pu) + 100 ), AngleBetweenPoints(pt, pu))
local real r = (GetHeroAgi(GetTriggerUnit(), true)) + (GetHeroInt(GetTriggerUnit(), true)) * 1.4
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p , bj_UNIT_FACING )
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), r , ATTACK_TYPE_HERO, DAMAGE_TYPE_UNIVERSAL )
set udg_EB_caster = GetTriggerUnit()
set udg_EB_point = p
call TimerStart (t, 0.2, false, function Trig_Thunder_Blade_Blink)
set t = null
set d = null
//call RemoveLocation (p)
call RemoveLocation (pt)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Thunder_Blade takes nothing returns nothing
set gg_trg_Thunder_Blade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Thunder_Blade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Thunder_Blade, Condition( function Trig_Thunder_Blade_Conditions ) )
call TriggerAddAction( gg_trg_Thunder_Blade, function Trig_Thunder_Blade_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Discharge_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00J' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetTriggerUnit(), 'A047') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Discharge_Actions takes nothing returns nothing
//local integer i = 2
call UnitCharge(GetTriggerUnit(), 2)
endfunction
//===========================================================================
function InitTrig_Discharge takes nothing returns nothing
set gg_trg_Discharge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Discharge, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Discharge, Condition( function Trig_Discharge_Conditions ) )
call TriggerAddAction( gg_trg_Discharge, function Trig_Discharge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_LS_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01W' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00J' ) ) then
return false
endif
return true
endfunction
function Trig_LS_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
set udg_LS_count = ( 140 + 40 * GetUnitAbilityLevel(GetTriggerUnit(), 'A01W' ) )
set udg_LS_caster = GetTriggerUnit()
set udg_LS_bool = true
call EnableTrigger( gg_trg_LS_2 )
//call SetUnitAnimation( udg_LS_caster, "attack" )
call SetUnitTimeScalePercent( udg_LS_caster, 200.00 )
endfunction
//===========================================================================
function InitTrig_LS takes nothing returns nothing
set gg_trg_LS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_LS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_LS, Condition( function Trig_LS_Conditions ) )
call TriggerAddAction( gg_trg_LS, function Trig_LS_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_LS_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_LS_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and b and IsTarget())
endfunction
function Trig_LS_2_Actions takes nothing returns nothing
local unit c = udg_LS_caster
local real s = 0.5 * GetHeroAgi(c, true) + GetHeroBonusInt(c)
local real r = s + 20 + 50 * GetUnitAbilityLevel(c, 'A01W')
local location pc = GetUnitLoc(c)
local group g = GetUnitsInRangeOfLocMatching(700.00, pc, Condition(function Trig_LS_2_Filter))
local unit d
local unit u = FirstOfGroup(g)
local location pu
local location p
local effect sp
local integer a = GetUnitAbilityLevel(c, 'A07T')
if ( GetUnitLife(c) > 0 and udg_LS_count > 0 ) then
if ( u != null and udg_LS_bool and IsTriggerEnabled(gg_trg_LD_2) == false ) then
set pu = GetUnitLoc(u)
set p = PolarProjectionBJ(pu, 140, 28*I2R(udg_LS_count))
call SetUnitPositionLoc( c, p )
call UnitDamageTargetBJ( c, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitAnimation( udg_LS_caster, "attack" )
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h00J', pu, bj_UNIT_FACING )
set udg_LS_count = udg_LS_count - 20
call UnitCharge(udg_LS_caster, 1)
set udg_LS_bool = false
else
set udg_LS_count = udg_LS_count - 10
endif
//call DisplayTextToForce( GetPlayersAll(), I2S(udg_LS_count) )
else
call SetUnitTimeScalePercent( udg_LS_caster, 100.00 )
call DisableTrigger( gg_trg_LS_2 )
call EnableTrigger( gg_trg_LS )
set udg_LS_bool = false
endif
set d = null
set c = null
set u = null
call RemoveLocation (pu)
call RemoveLocation (pc)
call RemoveLocation (p)
call DestroyEffect(sp)
endfunction
//===========================================================================
function InitTrig_LS_2 takes nothing returns nothing
set gg_trg_LS_2 = CreateTrigger( )
call DisableTrigger( gg_trg_LS_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_LS_2, 0.35 )
call TriggerAddAction( gg_trg_LS_2, function Trig_LS_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_passive_jass_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_sparktarget)
local unit d
if (udg_sparkint >= 3) then
call SetUnitPositionLoc( udg_sparktarget, PolarProjectionBJ(p, 32.00, udg_sparkangle) )
else
call DisableTrigger( gg_trg_passive_jass )
call SetUnitPathing( udg_sparktarget, true )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_sparktarget), 'h00J', p, bj_UNIT_FACING )
//call EnableTrigger( gg_trg_Discharge )
endif
set udg_sparkint = udg_sparkint - 3
call RemoveLocation (p)
set d = null
endfunction
//===========================================================================
function InitTrig_passive_jass takes nothing returns nothing
set gg_trg_passive_jass = CreateTrigger( )
call DisableTrigger( gg_trg_passive_jass )
call TriggerRegisterTimerEventPeriodic( gg_trg_passive_jass, 0.03 )
call TriggerAddAction( gg_trg_passive_jass, function Trig_passive_jass_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Arrogant_Power_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01H' ) ) then
return false
endif
return true //GetUnitAbilityLevel(GetTriggerUnit(), 'A0CU') > 0
endfunction
function Trig_Arrogant_Power_Actions takes nothing returns nothing
set udg_Emperor = GetTriggerUnit()
set udg_AP_int = 50
if ( not IsTriggerEnabled(gg_trg_AP_2) ) then
call EnableTrigger( gg_trg_AP_2 )
endif
//call DisplayTextToForce( GetPlayersAll(), I2S(udg_AP_int) )
endfunction
//===========================================================================
function InitTrig_Arrogant_Power takes nothing returns nothing
set gg_trg_Arrogant_Power = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arrogant_Power, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arrogant_Power, Condition( function Trig_Arrogant_Power_Conditions ) )
call TriggerAddAction( gg_trg_Arrogant_Power, function Trig_Arrogant_Power_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_AP_2_Actions takes nothing returns nothing
local integer v = GetHeroLevel(udg_Emperor)
local integer str = GetHeroStr(udg_Emperor, true)
local real r = str * (0.5 + 0.02 * v)
if ( udg_AP_int > 0 and GetUnitLife( udg_Emperor ) > 0) then
call SetUnitLife( udg_Emperor, GetUnitLife( udg_Emperor ) + 0.002 * udg_AP_int * r )
call SetUnitManaBJ( udg_Emperor, ( GetUnitState(udg_Emperor, UNIT_STATE_MANA) + 1 ) )
call SetUnitMoveSpeed( udg_Emperor, 250 + (2.5 + 0.1 * GetHeroLevel(udg_Emperor)) * udg_AP_int )
set udg_AP_int = ( udg_AP_int - 1 )
else
call DisableTrigger( GetTriggeringTrigger() )
set udg_AP_int = 0
call SetUnitMoveSpeed( udg_Emperor, 250 )
endif
//call DisplayTextToForce( GetPlayersAll(), I2S(udg_AP_int) )
//call DisplayTextToForce( GetPlayersAll(), R2S(0.001 * udg_AP_int * r) )
endfunction
//===========================================================================
function InitTrig_AP_2 takes nothing returns nothing
set gg_trg_AP_2 = CreateTrigger( )
call DisableTrigger( gg_trg_AP_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_AP_2, 0.1)
call TriggerAddAction( gg_trg_AP_2, function Trig_AP_2_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Pulverize_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09H' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01H' ) ) then
return false
endif
return true
endfunction
function Trig_Pulverize_Actions takes nothing returns nothing
local real r1 = 0.4 * (GetUnitLife(GetSpellTargetUnit()) + GetUnitLife(GetTriggerUnit()))
local real r = ( 0.05 + 0.04 * GetUnitAbilityLevel(GetTriggerUnit(),'A09H') ) * ( r1 + 1000 )
call FadingText( ( I2S(R2I(r)) + "!!" ), GetSpellTargetUnit(), 13.00, 33.00, 33.00, 33.00, 0)
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call UnitDamageTargetBJ( GetTriggerUnit(), GetTriggerUnit(), r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
//===========================================================================
function InitTrig_Pulverize takes nothing returns nothing
set gg_trg_Pulverize = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Pulverize, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Pulverize, Condition( function Trig_Pulverize_Conditions ) )
call TriggerAddAction( gg_trg_Pulverize, function Trig_Pulverize_Actions )
endfunction
//TESH.scrollpos=14
//TESH.alwaysfold=0
function Trig_Rock_Smash_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0CZ' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01H' ) ) then
return false
endif
return true
endfunction
function Trig_Rock_Smash_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local location pd
local real dist = DistanceBetweenPoints(pc,pt)
local real r = AngleBetweenPoints(pc,pt)
local unit d
local unit d2
local integer i = 0
local integer x = GetUnitAbilityLevel(GetTriggerUnit(), 'A0CZ')
local integer v = R2I(100 + 50 * x + 10 * GetHeroLevel(GetTriggerUnit()))
local real z = 0.5
loop
exitwhen i > 1
set pd = PolarProjectionBJ (pc, i * dist, r)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pd, bj_UNIT_FACING )
call UnitAddAbility (d, 'A0D0')
//call SetUnitAbilityLevel(d, 'A0D0', GetUnitAbilityLevel(GetTriggerUnit(), 'A0CZ'))
call SetUnitUserData( d, v )
call IssueImmediateOrder( d, "stomp")
set d2 = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01I', pd , bj_UNIT_FACING )
call SetUnitScale( d2, z, z, z )
set d = null
set d2 = null
call RemoveLocation (pd)
set i = i + 1
endloop
call RemoveLocation (pc)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Rock_Smash takes nothing returns nothing
set gg_trg_Rock_Smash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rock_Smash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rock_Smash, Condition( function Trig_Rock_Smash_Conditions ) )
call TriggerAddAction( gg_trg_Rock_Smash, function Trig_Rock_Smash_Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function Trig_Imperial_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_IP_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and IsTarget())
endfunction
function Trig_IP_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_IP_caster)
local unit d
local unit d2
local unit u
local group g = GetUnitsInRangeOfLocMatching(500.00, p, Condition(function Trig_Imperial_Filter))
local real r = 0.1 * ( 0.6 * GetHeroStr(udg_IP_caster, true) + 50 ) * ( 2 + GetUnitAbilityLevel(udg_IP_caster,'A0D1'))
if udg_IP_int > 0 and GetUnitLife(udg_IP_caster) > 0 then
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_IP_caster, u, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_IP_caster),'h000', p, 0)
call UnitAddAbility(d, 'A0D2')
call SetUnitAbilityLevel(d, 'A0D2', GetUnitAbilityLevel(udg_IP_caster,'A0D1'))
call IssueTargetOrder(d, "soulburn", u)
//call SetUnitLife(udg_AS_caster, GetUnitLife(udg_AS_caster) + 0.09 * r)
call GroupRemoveUnit (g,u)
endloop
set d2 = CreateUnitAtLoc( GetOwningPlayer(udg_IP_caster), 'h02K', p , bj_UNIT_FACING )
//call SetUnitScale( d2, z, z, z )
else
call DisableTrigger( gg_trg_IP_2 )
call EnableTrigger( gg_trg_Imperial_Pulse )
set udg_IP_caster = null
endif
set udg_IP_int = udg_IP_int - 1
set d = null
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_IP_2 takes nothing returns nothing
set gg_trg_IP_2 = CreateTrigger( )
call DisableTrigger( gg_trg_IP_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_IP_2, 1 )
call TriggerAddAction( gg_trg_IP_2, function Trig_IP_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Inner_Focus_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01H' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A0CI' ) ) then
return false
endif
return true
endfunction
function Trig_Inner_Focus_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A0CI')
call DisableTrigger( GetTriggeringTrigger() )
set udg_IF_caster = GetTriggerUnit()
set udg_IF_int = 0
set udg_IF_duration = 0.50 * ( 5 + GetUnitAbilityLevel(GetTriggerUnit(), 'A0CI' ))
set udg_IF_dummy = CreateUnitAtLoc(GetOwningPlayer(udg_IF_caster), 'h02C', p, 0 )
set udg_IF_str = (9 + v) * (5 + v)
call ModifyHeroStat( bj_HEROSTAT_STR, udg_IF_caster, bj_MODIFYMETHOD_ADD, udg_IF_str )
call FadingText( "+" + I2S((9 + v) * (5 + v)), udg_IF_caster, 15.00, 70, 40, 40, 0 )
call EnableTrigger( gg_trg_IF_2 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Inner_Focus takes nothing returns nothing
set gg_trg_Inner_Focus = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Inner_Focus, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Inner_Focus, Condition( function Trig_Inner_Focus_Conditions ) )
call TriggerAddAction( gg_trg_Inner_Focus, function Trig_Inner_Focus_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_IF_2_Actions takes nothing returns nothing
local boolean a = udg_IF_duration > 0
local boolean b = GetUnitLife(udg_IF_caster) > 0
local location p = GetUnitLoc( udg_IF_caster )
local integer v = GetUnitAbilityLevel(udg_IF_caster, 'A0CI')
local integer i = 9 + v
local real r = GetUnitLife(udg_IF_caster)
if (a and b) then
if udg_IF_int > 10 then
call ModifyHeroStat( bj_HEROSTAT_STR, udg_IF_caster, bj_MODIFYMETHOD_SUB, i )
call SetUnitLife(udg_IF_caster, r)
set udg_IF_str = udg_IF_str - i
set udg_IF_int = 1
else
set udg_IF_int = udg_IF_int + 1
endif
call UnitRemoveBuffsExBJ( bj_BUFF_POLARITY_NEGATIVE, bj_BUFF_RESIST_EITHER, udg_IF_caster, false, false )
call SetUnitPositionLoc( udg_IF_dummy, p )
call DisplayTextToForce( GetPlayersAll(), I2S(udg_IF_str) )
set udg_IF_duration = udg_IF_duration - 0.05
else
call ModifyHeroStat( bj_HEROSTAT_STR, udg_IF_caster, bj_MODIFYMETHOD_SUB, udg_IF_str )
call SetUnitLife(udg_IF_caster, r)
call DisableTrigger( gg_trg_IF_2 )
call EnableTrigger( gg_trg_Inner_Focus )
call KillUnit( udg_IF_dummy )
set udg_IF_caster = null
set udg_IF_duration = 0
set udg_IF_int = 0
set udg_IF_str = 0
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_IF_2 takes nothing returns nothing
set gg_trg_IF_2 = CreateTrigger( )
call DisableTrigger( gg_trg_IF_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_IF_2, 0.05 )
call TriggerAddAction( gg_trg_IF_2, function Trig_IF_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Floral_Constrict_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A092' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01G' ) ) then
return false
endif
return true
endfunction
function Trig_Floral_Constrict_Actions takes nothing returns nothing
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A092')
set udg_FC_caster = GetTriggerUnit()
set udg_FC_target = GetSpellTargetUnit()
set udg_FC_real = GetUnitLife(udg_FC_target)
call UnitFloral(GetTriggerUnit(), GetSpellTargetUnit(), 3 * v)
call EnableTrigger( gg_trg_FC_2 )
call TriggerSleepAction( 2.50 + ( 1.50 * v ) )
call DisableTrigger( gg_trg_FC_2 )
endfunction
//===========================================================================
function InitTrig_Floral_Constrict takes nothing returns nothing
set gg_trg_Floral_Constrict = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Floral_Constrict, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Floral_Constrict, Condition( function Trig_Floral_Constrict_Conditions ) )
call TriggerAddAction( gg_trg_Floral_Constrict, function Trig_Floral_Constrict_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_FC_2_Actions takes nothing returns nothing
if ( GetUnitLife(udg_FC_target) > udg_FC_real ) then
call SetUnitLife(udg_FC_target, udg_FC_real)
endif
set udg_FC_real = GetUnitLife(udg_FC_target)
endfunction
//===========================================================================
function InitTrig_FC_2 takes nothing returns nothing
set gg_trg_FC_2 = CreateTrigger( )
call DisableTrigger( gg_trg_FC_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_FC_2, 0.01 )
call TriggerAddAction( gg_trg_FC_2, function Trig_FC_2_Actions )
endfunction
//TESH.scrollpos=2
//TESH.alwaysfold=0
function Trig_Herbal_Rejuv_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09F' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01G' ) ) then
return false
endif
return true
endfunction
function Trig_Herbal_Rejuv_Actions takes nothing returns nothing
local unit d
local unit c = GetTriggerUnit()
local location p = GetUnitLoc(c)
local integer i = GetHeroInt(c, true)/10 + GetUnitAbilityLevel(c,'A09F')*8
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility(d, 'A09E')
call SetUnitAbilityLevel( d, 'A09E', i)
call IssueTargetOrder( d, "rejuvination", c )
set d = null
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_Herbal_Rejuv takes nothing returns nothing
set gg_trg_Herbal_Rejuv = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Herbal_Rejuv, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Herbal_Rejuv, Condition( function Trig_Herbal_Rejuv_Conditions ) )
call TriggerAddAction( gg_trg_Herbal_Rejuv, function Trig_Herbal_Rejuv_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_Flore_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08Q' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01G' ) ) then
return false
endif
return true
endfunction
function Trig_Flore_Filter takes nothing returns boolean
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and b and IsTarget())
endfunction
function Trig_Flore_Actions takes nothing returns nothing
local location p = GetSpellTargetLoc()
local location pd
local unit d
local unit u
local integer i = 1
local real x = 0.055 + 0.015 * GetUnitAbilityLevel(GetTriggerUnit(), 'A08Q')
local integer v = 10 + R2I(x * GetHeroInt(GetTriggerUnit(), true))
local group g = GetUnitsInRangeOfLocMatching(500.00, p, Condition(function Trig_Flore_Filter))
set udg_PF_caster = GetTriggerUnit()
//vfx
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h017', p, 0)
loop
exitwhen i > 5
set pd = PolarProjectionBJ(p, 250.00, ( 72.00 * I2R(i) ))
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h008', pd, 0)
call RemoveLocation (pd)
set d = null
set i = i + 1
endloop
//call DisplayTextToForce( GetPlayersAll(), I2S(v))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitFloral(udg_PF_caster, u, v)
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(u) )
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Flore takes nothing returns nothing
set gg_trg_Flore = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flore, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flore, Condition( function Trig_Flore_Conditions ) )
call TriggerAddAction( gg_trg_Flore, function Trig_Flore_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_SF_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_SF_caster))
return (a and IsTarget())
endfunction
function Trig_SF_2_Actions takes nothing returns nothing
local unit c = udg_SF_caster
local location p = GetUnitLoc(c)
local unit d
local unit u
local group g = GetUnitsInRangeOfLocMatching(200.00, udg_SF_point, Condition(function Trig_SF_2_Filter))
local group g2 = GetRandomSubGroup(1,g)
//local real manacost = 4 + 0.2 * GetHeroLevel(c)
//
set udg_SF_int = udg_SF_int - 1
//call DisplayTextToForce( GetPlayersAll(), "bullets remaining: " + I2S(udg_SF_int) )
if ( udg_SF_int >= 0 and GetUnitLife(c) > 0 ) then //and GetUnitState(c, UNIT_STATE_MANA) > manacost) then
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01N', p, bj_UNIT_FACING )
//call SetUnitManaBJ( c, GetUnitState( c, UNIT_STATE_MANA) - manacost)
set u = FirstOfGroup(g2)
if (u != null) then
call IssueTargetOrder( d, "attack", u )
endif
else
call DisableTrigger( gg_trg_SF_2 )
endif
set c = null
set u = null
set d = null
call DestroyGroup (g)
call DestroyGroup (g2)
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_SF_2 takes nothing returns nothing
set gg_trg_SF_2 = CreateTrigger( )
call DisableTrigger( gg_trg_SF_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_SF_2, 0.15 )
call TriggerAddAction( gg_trg_SF_2, function Trig_SF_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Flash_Cannon_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and IsTarget())
endfunction
function Trig_Flash_Cannon_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00O' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A02E' ) ) then
return false
endif
return true
endfunction
function Trig_Flash_Cannon_Actions takes nothing returns nothing
local unit d
local unit u
local location p = GetSpellTargetLoc()
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A02E')
local real rr = 1 + GetUnitAbilityLevel(GetTriggerUnit(), 'B01D') * (0.4 * GetUnitAbilityLevel(GetTriggerUnit(), 'A060'))
local real r = ( 0.25 + 0.25 * i ) * (GetHeroInt(GetTriggerUnit(),true) + 180)
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_Flash_Cannon_Filter))
loop
set u = FirstOfGroup (g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r * rr, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
set g = null
set u = null
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Flash_Cannon takes nothing returns nothing
set gg_trg_Flash_Cannon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flash_Cannon, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flash_Cannon, Condition( function Trig_Flash_Cannon_Conditions ) )
call TriggerAddAction( gg_trg_Flash_Cannon, function Trig_Flash_Cannon_Actions )
endfunction
//TESH.scrollpos=31
//TESH.alwaysfold=0
function Trig_Metallic_Flicker_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00O' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A0DE' ) ) then
return false
endif
return true
endfunction
function Trig_Metallic_Flicker_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
//local unit d
//local location pc = GetUnitLoc(udg_MK_caster)
local location p = udg_MK_point
//local integer v = 90 + 30 * GetUnitAbilityLevel( udg_MK_caster, 'A0DE' )
//local real r = GetHeroAgi(udg_MK_caster, true) * 0.8 + 80 * v
call SetUnitPositionLoc( udg_MK_caster, p )
//set fx = CreateUnitAtLoc( GetOwningPlayer(udg_MK_caster), 'h002', p, 0 )
call PauseTimer(t)
call DestroyTimer(t)
//call RemoveLocation (pc)
call RemoveLocation (p)
set t = null
endfunction
function Trig_Metallic_Flicker_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit d
local unit fx
//local unit fx2
local integer i = 1
local location p = GetSpellTargetLoc()
//local location pi
local location pc = GetUnitLoc(GetTriggerUnit())
local real rr = 1 + GetUnitAbilityLevel(GetTriggerUnit(), 'B01D') * (0.4 * GetUnitAbilityLevel(GetTriggerUnit(), 'A060'))
local integer v = R2I(rr * 0.3 * (50 + GetHeroInt(GetTriggerUnit(), true)) * (2 + GetUnitAbilityLevel(GetTriggerUnit(), 'A0DE')))
set udg_MK_caster = GetTriggerUnit()
set udg_MK_point = PolarProjectionBJ(pc, 450, AngleBetweenPoints(pc,p))
call TimerStart (t, 0.3, false, function Trig_Metallic_Flicker_Blink)
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_MK_caster), 'h00J', pc, 0 )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_MK_caster), 'h01Y', pc, bj_UNIT_FACING )
call UnitAddAbility ( d, 'A0DF' )
call SetUnitUserData( d, v )
call IssueImmediateOrder( d, "thunderclap" )
set d = null
set t = null
endfunction
//===========================================================================
function InitTrig_Metallic_Flicker takes nothing returns nothing
set gg_trg_Metallic_Flicker = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Metallic_Flicker, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Metallic_Flicker, Condition( function Trig_Metallic_Flicker_Conditions ) )
call TriggerAddAction( gg_trg_Metallic_Flicker, function Trig_Metallic_Flicker_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_gravity_field_2_Actions takes nothing returns nothing
local boolean a = GetUnitLife(udg_GF_caster) > 0
local boolean b = udg_GF_timer > 0
local unit u = udg_GF_caster
local location p = GetUnitLoc(udg_GF_caster)
local unit d
if ( a and b ) then
set d = CreateUnitAtLoc( GetOwningPlayer(u), 'h013', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A061' )
call IssuePointOrderLoc( d, "silence", p )
else
call DisableTrigger( GetTriggeringTrigger() )
set udg_GF_timer = 0
set udg_GF_caster = null
endif
set udg_GF_timer = ( udg_GF_timer - 20 )
set u = null
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_gravity_field_2 takes nothing returns nothing
set gg_trg_gravity_field_2 = CreateTrigger( )
call DisableTrigger( gg_trg_gravity_field_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_gravity_field_2, 0.20 )
call TriggerAddAction( gg_trg_gravity_field_2, function Trig_gravity_field_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Soul_Shatter_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02O' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00U' ) ) then
return false
endif
return true
endfunction
function Trig_Soul_Shatter_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
call SetBlightLoc( GetOwningPlayer(GetTriggerUnit()), p, 800.00, true )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Soul_Shatter takes nothing returns nothing
set gg_trg_Soul_Shatter = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Soul_Shatter, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Soul_Shatter, Condition( function Trig_Soul_Shatter_Conditions ) )
call TriggerAddAction( gg_trg_Soul_Shatter, function Trig_Soul_Shatter_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_HS_Conditions takes nothing returns boolean
if ( not (( GetSpellAbilityId() == 'A02Z' ) or ( GetSpellAbilityId() == 'A07I' ) )) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00U' ) ) then
return false
endif
return true
endfunction
function Trig_HS_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
local location p = udg_HS_point
call SetUnitPositionLoc( udg_HS_caster, p )
call PauseTimer(t)
call DestroyTimer(t)
call RemoveLocation (p)
//call DisplayTextToForce( GetPlayersAll(), R2S(GetLocationX(p)) )
set t = null
endfunction
function Trig_HS_Actions takes nothing returns nothing
local timer t = CreateTimer()
local location p = GetSpellTargetLoc()
local location pc = GetUnitLoc(GetTriggerUnit())
local location pd = PolarProjectionBJ(pc,1150,AngleBetweenPoints(pc,p))
set udg_HS_caster = GetTriggerUnit()
set udg_HS_point = pd
call TimerStart (t, 0.84, false, function Trig_HS_Blink)
set t = null
call RemoveLocation (p)
call RemoveLocation (pc)
//call RemoveLocation (pd)
endfunction
//===========================================================================
function InitTrig_HS takes nothing returns nothing
set gg_trg_HS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_HS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_HS, Condition( function Trig_HS_Conditions ) )
call TriggerAddAction( gg_trg_HS, function Trig_HS_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Multiple_Shot_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N018' ) ) then
return false
endif
return true
endfunction
function Trig_Multiple_Shot_Actions takes nothing returns nothing
local unit d
local location pc = GetUnitLoc(GetTriggerUnit())
set udg_Delphine = GetTriggerUnit()
set udg_MS_duration = 5
if ( not IsTriggerEnabled(gg_trg_MS_2) ) then
call EnableTrigger( gg_trg_MS_2 )
call SetUnitAbilityLevel( udg_Delphine, 'A00L', 2 )
endif
set d = CreateUnitAtLoc( GetOwningPlayer(udg_Delphine), 'h000', pc, 0.00 )
call UnitAddAbility( d, 'A03B')
call SetUnitAbilityLevel(d, 'A03B', GetHeroLevel(udg_Delphine))
call IssueTargetOrder( d, "unholyfrenzy", udg_Delphine )
set d = null
call RemoveLocation(pc)
endfunction
//===========================================================================
function InitTrig_Multiple_Shot takes nothing returns nothing
set gg_trg_Multiple_Shot = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Multiple_Shot, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Multiple_Shot, Condition( function Trig_Multiple_Shot_Conditions ) )
call TriggerAddAction( gg_trg_Multiple_Shot, function Trig_Multiple_Shot_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_MS_2_Actions takes nothing returns nothing
//local real r = (110 + GetUnitMissingPercentMana(udg_Yiting))* (1 + 0.4 * GetHeroLevel(udg_Yiting)) * 0.01
if ( udg_MS_duration > 0 and GetUnitLife(udg_Delphine) > 0) then
//call SetUnitState( udg_Yiting, UNIT_STATE_MANA, GetUnitState(udg_Yiting, UNIT_STATE_MANA) + r )
//call SetUnitLife( udg_Yiting, GetUnitLife( udg_Yiting ) + 2.6 * r )
//call FadingText( "+", udg_Yiting, 11.00, 74, 74, 89, 0 )
set udg_MS_duration = ( udg_MS_duration - 0.25 )
else
call DisableTrigger( GetTriggeringTrigger() )
set udg_MS_duration = 0
call SetUnitAbilityLevel( udg_Delphine, 'A00L', 1 )
endif
//call DisplayTextToForce( GetPlayersAll(), R2S(udg_MY_duration) )
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
endfunction
//===========================================================================
function InitTrig_MS_2 takes nothing returns nothing
set gg_trg_MS_2 = CreateTrigger( )
call DisableTrigger( gg_trg_MS_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_MS_2, 0.25 )
call TriggerAddAction( gg_trg_MS_2, function Trig_MS_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Hail_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A019' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N018' ) ) then
return false
endif
return true
endfunction
function Trig_Hail_1_Actions takes nothing returns nothing
//local integer i = GetHeroLevel(GetTriggerUnit())
local location pc = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local location p = GetSpellTargetLoc()
if DistanceBetweenPoints(pc, pt) < 600 then
set p = PolarProjectionBJ(pc, 600, AngleBetweenPoints(pc,pt))
endif
call DisableTrigger( gg_trg_Hail_1 )
set udg_Hail_caster = GetTriggerUnit()
set udg_Hail_point = p
set udg_Hail_int = 4
//( 1 + GetUnitAbilityLevel(GetTriggerUnit(), 'A019'))
call EnableTrigger( gg_trg_Hail_2 )
call RemoveLocation (pc)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Hail_1 takes nothing returns nothing
set gg_trg_Hail_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hail_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Hail_1, Condition( function Trig_Hail_1_Conditions ) )
call TriggerAddAction( gg_trg_Hail_1, function Trig_Hail_1_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Hail_2_Actions takes nothing returns nothing
local unit c = udg_Hail_caster
local location p = GetUnitLoc(c)
local location put = udg_Hail_point
local integer v = R2I(0.8 * GetHeroStr(c, true))
local unit d
local integer i = 1
local real rx
local real ax
local location pu
if ( udg_Hail_int > 0 ) then
loop
exitwhen i > 8
set rx = 40 * udg_Hail_int + GetRandomReal(0,50)
set ax = 45 * i + GetRandomReal(0,45)
set pu = PolarProjectionBJ(put, rx, ax)
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01U', p, bj_UNIT_FACING )
call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "attackground", pu )
call RemoveLocation(pu)
set i = i + 1
endloop
set udg_Hail_int = udg_Hail_int - 1
else
call DisableTrigger( gg_trg_Hail_2 )
call EnableTrigger( gg_trg_Hail_1 )
call RemoveLocation(put)
endif
set c = null
set d = null
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_Hail_2 takes nothing returns nothing
set gg_trg_Hail_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Hail_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Hail_2, 0.16 )
call TriggerAddAction( gg_trg_Hail_2, function Trig_Hail_2_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function Trig_Curse_of_the_Depths_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0C6' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N018' ) ) then
return false
endif
return true
endfunction
function Trig_Curse_of_the_Depths_Actions takes nothing returns nothing
local unit d
local unit u = GetSpellTargetUnit()
local location p = GetUnitLoc(GetTriggerUnit())
local integer i = GetUnitAbilityLevel(GetTriggerUnit(),'A0C6')
local integer v = GetHeroInt(GetTriggerUnit(),true)
set d = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'h02A', p,0)
call UnitAddAbility(d, 'A0C5')
call SetUnitAbilityLevel(d, 'A0C5', i)
call SetUnitUserData(d, v)
call IssueTargetOrder(d, "acidbomb", u)
call RemoveLocation(p)
set d = null
//call DisplayTextToForce( GetPlayersAll(), I2S(i) )
endfunction
//===========================================================================
function InitTrig_Curse_of_the_Depths takes nothing returns nothing
set gg_trg_Curse_of_the_Depths = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Curse_of_the_Depths, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Curse_of_the_Depths, Condition( function Trig_Curse_of_the_Depths_Conditions ) )
call TriggerAddAction( gg_trg_Curse_of_the_Depths, function Trig_Curse_of_the_Depths_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_Will_of_the_Goddess_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0CE' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N018' ) ) then
return false
endif
return true
endfunction
function Trig_Will_of_the_Goddess_Actions takes nothing returns nothing
local integer i = 1
local integer j = 10 + 2 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0CE')
local unit d
local unit fx
local location pc = GetUnitLoc(GetTriggerUnit())
local location pd
local integer v1 = GetHeroStr(GetTriggerUnit(), true)
local integer v2 = GetHeroAgi(GetTriggerUnit(), true)
local integer v3 = GetHeroInt(GetTriggerUnit(), true)
local integer v = R2I(0.5*(32 * j + v1 + v2 + v3))
loop
exitwhen i > j
set pd = PolarProjectionBJ(pc, 600, i*360/j)
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'n01K', pd, i*360/j -180 )
call SetUnitScale( fx, 1.6, 1.6, 1.6 )
call UnitApplyTimedLife( fx, 'BTLF', 0.01 )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'n01K', pd, i*360/j -180 )
call UnitApplyTimedLife( d, 'BTLF', 0.02 * v )
//call UnitAddAbility(d2, 'A03F')
call SetUnitUserData( d, v )
set fx = null
set d = null
set i = i + 1
endloop
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Will_of_the_Goddess takes nothing returns nothing
set gg_trg_Will_of_the_Goddess = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Will_of_the_Goddess, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Will_of_the_Goddess, Condition( function Trig_Will_of_the_Goddess_Conditions ) )
call TriggerAddAction( gg_trg_Will_of_the_Goddess, function Trig_Will_of_the_Goddess_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_Rock_Storm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09O' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N017' ) ) then
return false
endif
return true
endfunction
function Trig_Rock_Storm_Func001001003 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return ( a and IsTarget() )
endfunction
function Trig_Rock_Storm_Actions takes nothing returns nothing
local location p = GetSpellTargetLoc()
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu
local group g
local unit d
local unit u
local integer i = 110 * GetUnitAbilityLevel(GetTriggerUnit(), 'A017' ) + GetHeroInt(GetTriggerUnit(), true)
local integer ix = 1
local unit fx
local real ax
local real rx
set g = GetUnitsInRangeOfLocMatching(350.00, p, Condition(function Trig_Rock_Storm_Func001001003))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pc, bj_UNIT_FACING )
call UnitAddAbility( d, 'A09N' )
call SetUnitUserData( d, i )
//call SetUnitScale( d, 2, 2, 2 )
call IssueTargetOrder( d, "firebolt", u )
set d = null
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
//vfx
loop
exitwhen ix > 11
set rx = GetRandomReal(0,240)
set ax = 30 * ix + GetRandomReal(0,30)
set pu = PolarProjectionBJ(p, rx, ax)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h02M', pc, bj_UNIT_FACING )
//call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "attackground", pu )
call RemoveLocation(pu)
set ix = ix + 1
endloop
call RemoveLocation (pc)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Rock_Storm takes nothing returns nothing
set gg_trg_Rock_Storm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Rock_Storm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Rock_Storm, Condition( function Trig_Rock_Storm_Conditions ) )
call TriggerAddAction( gg_trg_Rock_Storm, function Trig_Rock_Storm_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Metallic_Flare_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08C' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N017' ) ) then
return false
endif
return true
endfunction
function Trig_Metallic_Flare_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return a and IsTarget()
endfunction
function Trig_Metallic_Flare_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
local unit d
local unit u
local group g = GetUnitsInRangeOfLocMatching(550.00, p, Condition(function Trig_Metallic_Flare_Filter))
local real r1 = 7 + 2 * I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A08C'))
local real r = 24 + (0.01* GetUnitMaxLife(GetTriggerUnit())) * r1 + 3.5 * GetHeroBonusInt(GetTriggerUnit())
set udg_MF_real = r
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h013', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A07C')
call SetUnitAbilityLevel( d, 'A07C', GetUnitAbilityLevel(GetTriggerUnit(),'A08C') )
call SetUnitScale( d, 2, 2, 2 )
call IssuePointOrderLoc( d, "silence", p )
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, 0.55 * r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call FadingText( ( I2S(R2I(r)) + "!" ), u, 12.00, 72.00, 72.00, 77.00, 0 )
call GroupRemoveUnit (g,u)
endloop
call RemoveLocation (p)
set d = null
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Metallic_Flare takes nothing returns nothing
set gg_trg_Metallic_Flare = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Metallic_Flare, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Metallic_Flare, Condition( function Trig_Metallic_Flare_Conditions ) )
call TriggerAddAction( gg_trg_Metallic_Flare, function Trig_Metallic_Flare_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Unstable_Magnitude_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09W' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N017' ) ) then
return false
endif
return true
endfunction
function Trig_Unstable_Magnitude_Func001001003 takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(), 'B03H' ) == 1 and IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true)
endfunction
function Trig_Unstable_Magnitude_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local unit u
local unit d
local location p
local integer i = GetHeroLevel(GetTriggerUnit()) + 11 * GetUnitAbilityLevel(GetTriggerUnit(),'A09W')
local group g
local unit fx
call TriggerSleepAction (0.4)
set g = GetUnitsInRangeOfLocMatching(2000.00, pc, Condition(function Trig_Unstable_Magnitude_Func001001003))
call TriggerSleepAction (2)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set p = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p, bj_UNIT_FACING )
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01M', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A09V' )
call SetUnitUserData( d, i )
call IssueImmediateOrder( d, "stomp" )
set d = null
call RemoveLocation (p)
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Unstable_Magnitude takes nothing returns nothing
set gg_trg_Unstable_Magnitude = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unstable_Magnitude, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Unstable_Magnitude, Condition( function Trig_Unstable_Magnitude_Conditions ) )
call TriggerAddAction( gg_trg_Unstable_Magnitude, function Trig_Unstable_Magnitude_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Crushing_Upheaval_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09W' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N017' ) ) then
return false
endif
return true
endfunction
function Trig_Crushing_Upheaval_Actions takes nothing returns nothing
local integer i = 1
local location p = GetUnitLoc(GetTriggerUnit())
local location pi
local real ra
call DisableTrigger( gg_trg_Crushing_Upheaval )
set udg_CU_caster = GetTriggerUnit()
set udg_CU_real = 48
loop
exitwhen i > 48
set pi = PolarProjectionBJ(p, 700.00, 7.5 * i + 90)
set ra = AngleBetweenPoints(pi, p)
set udg_CU_fx[i] = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h018', pi , ra )
call SetUnitVertexColor( udg_CU_fx[i], 255, 255, 255, 25 )
set i = i + 1
endloop
call EnableTrigger( gg_trg_CU_2 )
endfunction
//===========================================================================
function InitTrig_Crushing_Upheaval takes nothing returns nothing
set gg_trg_Crushing_Upheaval = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crushing_Upheaval, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Crushing_Upheaval, Condition( function Trig_Crushing_Upheaval_Conditions ) )
call TriggerAddAction( gg_trg_Crushing_Upheaval, function Trig_Crushing_Upheaval_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_CU_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy( GetFilterUnit(), GetOwningPlayer(udg_CU_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return a and b and IsTarget()
endfunction
function Trig_CU_2_Actions takes nothing returns nothing
local integer i = 1
local unit d
local location p = GetUnitLoc(udg_CU_caster)
local location pu
local location pfx
local group g
local unit u
local unit fx
local integer v = 2 * GetHeroLevel(udg_CU_caster) + 24 * GetUnitAbilityLevel(udg_CU_caster,'A09W')
local real r = v + 2.4 * GetHeroInt(udg_CU_caster, true)
if ( udg_CU_real > 0 ) then
loop
exitwhen i > 48
set pfx = PolarProjectionBJ(p, 700, 7.5 * i)
call SetUnitPositionLoc(udg_CU_fx[i], pfx)
call RemoveLocation(pfx)
set i = i + 1
endloop
call SetUnitVertexColor( udg_CU_fx[R2I(udg_CU_real)], 255, 255, 255, 255 )
else
set i = 1
loop
exitwhen i > 48
call RemoveUnit( udg_CU_fx[i] )
set i = i + 1
endloop
set g = GetUnitsInRangeOfLocMatching(700.00, p, Condition(function Trig_CU_2_Filter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_CU_caster), 'h01Y', pu, bj_UNIT_FACING )
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_CU_caster), 'h01M', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A09V' )
call SetUnitUserData( d, v )
call UnitDamageTargetBJ( udg_CU_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitAbilityLevel( d, 'A09V', GetUnitAbilityLevel(udg_CU_caster, 'A09W'))
call IssueImmediateOrder( d, "stomp" )
set d = null
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
call DisableTrigger( gg_trg_CU_2 )
call EnableTrigger( gg_trg_Crushing_Upheaval )
call DestroyGroup(g)
endif
call RemoveLocation(p)
set udg_CU_real = udg_CU_real - 1
endfunction
//===========================================================================
function InitTrig_CU_2 takes nothing returns nothing
set gg_trg_CU_2 = CreateTrigger( )
call DisableTrigger( gg_trg_CU_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_CU_2, 0.05 )
call TriggerAddAction( gg_trg_CU_2, function Trig_CU_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_PI_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06C' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N019' ) ) then
return false
endif
return true
endfunction
function Trig_PI_Actions takes nothing returns nothing
local real x = 1.25 + 0.03 * GetUnitLevel(GetTriggerUnit()) + 0.2 * GetUnitAbilityLevel(GetTriggerUnit(), 'A09L')
call SetUnitMoveSpeed( GetTriggerUnit(), GetUnitDefaultMoveSpeed(GetTriggerUnit()) * x )
call TriggerSleepAction( 5.00 )
call SetUnitMoveSpeed( GetTriggerUnit(), GetUnitDefaultMoveSpeed(GetTriggerUnit()) )
endfunction
//===========================================================================
function InitTrig_PI takes nothing returns nothing
set gg_trg_PI = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_PI, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_PI, Condition( function Trig_PI_Conditions ) )
call TriggerAddAction( gg_trg_PI, function Trig_PI_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_HA_2_Actions takes nothing returns nothing
local unit c = udg_HA_caster
local unit u = udg_HA_target
local location pc = GetUnitLoc(c)
local location pu = GetUnitLoc(u)
local location p = PolarProjectionBJ(pc, 90 + 0.1*GetUnitMoveSpeedX(c), udg_HA_angle)
local unit fx
local real r1 = 0.2 + 0.2 * I2R(GetUnitAbilityLevel(c,'A06D'))
local real r2 = GetHeroLevel(udg_HA_caster)* 28 + r1 * (120 + GetUnitMoveSpeedX(c))
if ((DistanceBetweenPoints(p, pu) <= 120.00) and udg_HA_bool) then
call UnitDamageTargetBJ( c, u, r2, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
//set udg_HA_int = 4
set udg_HA_bool = false
//set udg_HA_angle = udg_HA_angle + 180
if r2 > 500 then
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_HA_caster), 'h010', pu , bj_UNIT_FACING )
endif
endif
if ( udg_HA_int > 0 ) then
call SetUnitPositionLoc( c, p )
else
call DisableTrigger( gg_trg_HA_2 )
call SetUnitPathing( c, true )
call SetUnitAnimation(c, "stand" )
endif
set udg_HA_int = udg_HA_int - 1
set u = null
set c = null
call RemoveLocation (p)
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_HA_2 takes nothing returns nothing
set gg_trg_HA_2 = CreateTrigger( )
call DisableTrigger( gg_trg_HA_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_HA_2, 0.02 )
call TriggerAddAction( gg_trg_HA_2, function Trig_HA_2_Actions )
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function Trig_HF_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A06H' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N019' ) ) then
return false
endif
return true
endfunction
function Trig_HF_Func004002003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_HF_Func004002003 takes nothing returns boolean
return GetBooleanAnd( IsTarget(), Trig_HF_Func004002003002() )
endfunction
function Trig_HF_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu
local group g = GetUnitsInRangeOfLocMatching(300.00, pc, Condition(function Trig_HF_Func004002003))
local unit d
local unit u
local real r = 12 * GetHeroLevel(GetTriggerUnit()) + 70 * I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A06H'))
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pc, bj_UNIT_FACING )
call UnitAddAbility( d,'A06J' )
call SetUnitAbilityLevel( d, 'A06J', GetUnitAbilityLevel(GetTriggerUnit(), 'A06H') )
call IssuePointOrderLoc( d, "silence", pc )
loop
set u = FirstOfGroup (g)
exitwhen u == null
set pu = GetUnitLoc(u)
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
set g = null
set u = null
set d = null
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_HF takes nothing returns nothing
set gg_trg_HF = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_HF, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_HF, Condition( function Trig_HF_Conditions ) )
call TriggerAddAction( gg_trg_HF, function Trig_HF_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Vermilion_Mark_Conditions takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(GetTriggerUnit(),'B039') > 0
return ( GetUnitTypeId(GetAttacker()) == 'N019' and a )
endfunction
function Trig_Vermilion_Mark_Actions takes nothing returns nothing
local integer v
local real r
local location p = GetUnitLoc(GetTriggerUnit())
set udg_VM_caster = GetAttacker()
set udg_VM_target = GetTriggerUnit()
call DisableTrigger( gg_trg_Vermilion_Mark )
call CreateUnitAtLoc( GetOwningPlayer(udg_VM_caster), 'h01F', p, bj_UNIT_FACING )
call TriggerSleepAction(3)
set v = GetUnitAbilityLevel(udg_VM_caster, 'A04A')
set r = 0.01 * ( 120 + 190 * v ) * ( 100 + (0.5 + 0.2 * v ) * GetUnitMissingPercentLife(udg_VM_target) )
call FadingText( ( I2S(R2I(r)) + "!!" ), udg_VM_target, 19.00, 100, 0, 0, 0 )
call UnitDamageTargetBJ( udg_VM_caster, udg_VM_target, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call UnitRemoveAbility ( udg_VM_target, 'B039')
call CreateUnitAtLoc( GetOwningPlayer(udg_VM_caster), 'h01K', p, bj_UNIT_FACING )
call RemoveLocation (p)
set udg_VM_caster = null
set udg_VM_target = null
call EnableTrigger( gg_trg_Vermilion_Mark )
endfunction
//===========================================================================
function InitTrig_Vermilion_Mark takes nothing returns nothing
set gg_trg_Vermilion_Mark = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vermilion_Mark, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Vermilion_Mark, Condition( function Trig_Vermilion_Mark_Conditions ) )
call TriggerAddAction( gg_trg_Vermilion_Mark, function Trig_Vermilion_Mark_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Inc_passive_new_Condtions takes nothing returns boolean
return( GetUnitLife(udg_Cynthia) > 0)
endfunction
function Trig_Inc_passive_new_Actions takes nothing returns nothing
local integer i = GetUnitLevel(udg_Cynthia)
if ( Daytime() ) then
set i = i + 25
endif
call SetUnitAbilityLevel(udg_Cynthia, 'A072', i )
call SetPlayerTechResearched( GetOwningPlayer(udg_Cynthia), 'R004', GetUnitAbilityLevel(udg_Cynthia, 'A011') )
//call SetPlayerAbilityAvailable( GetOwningPlayer(c), 'A011', Daytime() )
//call SetPlayerAbilityAvailable( GetOwningPlayer(c), 'A071', not Daytime() )
endfunction
//===========================================================================
function InitTrig_Inc_passive_new takes nothing returns nothing
set gg_trg_Inc_passive_new = CreateTrigger( )
call DisableTrigger( gg_trg_Inc_passive_new )
call TriggerRegisterTimerEventPeriodic( gg_trg_Inc_passive_new, 1 )
call TriggerAddCondition( gg_trg_Inc_passive_new, Condition(function Trig_Inc_passive_new_Condtions ) )
call TriggerAddAction( gg_trg_Inc_passive_new, function Trig_Inc_passive_new_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Flame_Shield_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03J' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00N' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Shield_Actions takes nothing returns nothing
local unit d
local unit c = GetTriggerUnit()
local location p = GetUnitLoc(c)
local integer i = GetUnitAbilityLevel(c, 'A03J')
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility(d, 'A079')
call SetUnitAbilityLevel( d, 'A079', i)
call IssueTargetOrder( d, "antimagicshell", c )
set d = null
//call DisplayTextToForce( GetPlayersAll(), I2S(i) )
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_Flame_Shield takes nothing returns nothing
set gg_trg_Flame_Shield = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Shield, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flame_Shield, Condition( function Trig_Flame_Shield_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Shield, function Trig_Flame_Shield_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Execute_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N012' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A03T' ) ) then
return false
endif
return true
endfunction
function Trig_Execute_Actions takes nothing returns nothing
local unit c = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local string s
local real r1 = 3 + GetUnitAbilityLevel(c,'A03T')
local real r = r1 * (100 + 0.2 * GetHeroStr(c,true)) - 150
local real rr
local real z
local location pu = GetUnitLoc(u)
local boolean a = GetUnitLife(u)*GetUnitMaxLife(c) > GetUnitLife(c)*GetUnitMaxLife(u)
local boolean b = GetUnitAbilityLevel(c, 'B030') > 0
if (a or b) then
call CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h002', pu, GetRandomReal(0, 360.00) )
set s = I2S(R2I(r)) + "!!"
set z = 15
set rr = 0
else
set r = r * 0.4
set s = I2S(R2I(r)) + "!"
set z = 12
set rr = 80
endif
call UnitDamageTargetBJ( c, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
call FadingText( s, u, z, 80, rr, rr, 0 )
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Execute takes nothing returns nothing
set gg_trg_Execute = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Execute, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Execute, Condition( function Trig_Execute_Conditions ) )
call TriggerAddAction( gg_trg_Execute, function Trig_Execute_Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function Trig_Inspire_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A085' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N012' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetTriggerUnit(),'A093') > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Inspire_Actions takes nothing returns nothing
local unit d
local unit u = GetSpellTargetUnit()
local location p = GetUnitLoc(u)
local integer i = GetUnitAbilityLevel(GetTriggerUnit(),'A093')*3 + R2I(0.4*GetHeroLevel(GetTriggerUnit()))
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A095')
call SetUnitAbilityLevel(d, 'A095', i)
call IssueTargetOrder( d, "innerfire", u )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Inspire takes nothing returns nothing
set gg_trg_Inspire = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Inspire, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Inspire, Condition( function Trig_Inspire_Conditions ) )
call TriggerAddAction( gg_trg_Inspire, function Trig_Inspire_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_Crusaders_Fury_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(udg_Andrew)) == true ) ) then
return false
endif
if ( not ( GetTriggerUnit() != udg_Andrew ) ) then
return false
endif
if ( not ( GetUnitLife(udg_Andrew) > 0 ) ) then
return false
endif
return GetUnitAbilityLevel(udg_Andrew,'A093') > 0
endfunction
function Trig_Crusaders_Fury_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(udg_Andrew)
local integer i = GetUnitAbilityLevel(udg_Andrew,'A093')*3 + R2I(0.4 * GetHeroLevel(udg_Andrew))
set d = CreateUnitAtLoc( GetOwningPlayer(udg_Andrew), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A095')
call SetUnitAbilityLevel(d, 'A095', i)
call IssueTargetOrder( d, "innerfire", udg_Andrew )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Crusaders_Fury takes nothing returns nothing
set gg_trg_Crusaders_Fury = CreateTrigger( )
call DisableTrigger( gg_trg_Crusaders_Fury )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crusaders_Fury, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Crusaders_Fury, Condition( function Trig_Crusaders_Fury_Conditions ) )
call TriggerAddAction( gg_trg_Crusaders_Fury, function Trig_Crusaders_Fury_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Knights_Vow_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0B8' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00A' ) ) then
return false
endif
return true
endfunction
function Trig_Knights_Vow_Actions takes nothing returns nothing
local location pu = GetUnitLoc(GetSpellTargetUnit())
call DisableTrigger( GetTriggeringTrigger() )
set udg_Tag_dummy = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h020', pu, 0 )
set udg_Tag_target = GetSpellTargetUnit()
set udg_Tag_caster = GetTriggerUnit()
set udg_Tag_duration = 8.00
call EnableTrigger( gg_trg_KV_2 )
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Knights_Vow takes nothing returns nothing
set gg_trg_Knights_Vow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Knights_Vow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Knights_Vow, Condition( function Trig_Knights_Vow_Conditions ) )
call TriggerAddAction( gg_trg_Knights_Vow, function Trig_Knights_Vow_Actions )
endfunction
//TESH.scrollpos=19
//TESH.alwaysfold=0
function Trig_KV_2_Actions takes nothing returns nothing
local boolean a = udg_KV_duration > 0
local boolean b = GetUnitLife(udg_KV_target) > 0
local location pu = GetUnitLoc( udg_KV_target )
local location pc = GetUnitLoc( udg_KV_caster )
if (a and b) then
call ShowUnit( udg_KV_dummy, true )
call SetUnitPositionLoc( udg_KV_dummy, pu )
if DistanceBetweenPoints( pc, pu ) > 1000 then
call ShowUnit( udg_KV_dummy, false )
//call DisplayTextToForce(GetPlayersAll(), "transparent")
else
call ShowUnit( udg_KV_dummy, true )
//call DisplayTextToForce(GetPlayersAll(), "opaque")
endif
set udg_KV_duration = udg_KV_duration - 0.05
else
set udg_KV_duration = 0
set udg_KV_target = null
call DisableTrigger( gg_trg_KV_2 )
call EnableTrigger( gg_trg_Shadow_Tag )
call KillUnit( udg_KV_dummy )
endif
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_KV_2 takes nothing returns nothing
set gg_trg_KV_2 = CreateTrigger( )
call DisableTrigger( gg_trg_KV_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_KV_2, 0.05 )
call TriggerAddAction( gg_trg_KV_2, function Trig_KV_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Triumphant_Overthrow_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Y' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N012' ) ) then
return false
endif
return true
endfunction
function Trig_Triumphant_Overthrow_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetUnitLoc(GetSpellTargetUnit())
call DisableTrigger( GetTriggeringTrigger() )
set udg_TO_caster = GetTriggerUnit()
set udg_TO_target = GetSpellTargetUnit()
set udg_TO_angle = AngleBetweenPoints(pc, pu)
set udg_TO_distance = DistanceBetweenPoints(pc, pu) - 50
set udg_TO_timer = 0.00
call UnitAddAbilityBJ( 'Arav', GetTriggerUnit() )
call UnitRemoveAbilityBJ( 'Arav', GetTriggerUnit() )
call SetUnitPathing( udg_TO_caster, false )
call PauseUnitBJ( true, GetTriggerUnit() )
call EnableTrigger( gg_trg_TO_2 )
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Triumphant_Overthrow takes nothing returns nothing
set gg_trg_Triumphant_Overthrow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Triumphant_Overthrow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Triumphant_Overthrow, Condition( function Trig_Triumphant_Overthrow_Conditions ) )
call TriggerAddAction( gg_trg_Triumphant_Overthrow, function Trig_Triumphant_Overthrow_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_TO_2_Func001Func006001003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_TO_caster)) == true )
endfunction
function Trig_TO_2_Func001Func006001003 takes nothing returns boolean
return GetBooleanAnd( IsTarget(), Trig_TO_2_Func001Func006001003002() )
endfunction
function Trig_TO_2_Actions takes nothing returns nothing
local unit c = udg_TO_caster
local location p = GetUnitLoc(c)
local group g = GetUnitsInRangeOfLocMatching(600.00, p, Condition(function Trig_TO_2_Func001Func006001003))
local unit u
local unit d
local real height
local real r = ( GetUnitAbilityLevel(c, 'A00Y') * 25 + GetHeroLevel(c) ) * ( 15 + GetUnitMaxLife(udg_TO_target) * 0.005 )
local integer i = 1
local location pd
if ( udg_TO_timer < 30 ) then
set udg_TO_timer = ( udg_TO_timer + (1500/udg_TO_distance) )
set height = ( 225.00 - (udg_TO_timer - 15.00)*(udg_TO_timer - 15.00) )
call SetUnitFlyHeightBJ( c, height, 8000000 )
call SetUnitPositionLoc( c, PolarProjectionBJ(p, 50, udg_TO_angle) )
else
call DisableTrigger( GetTriggeringTrigger() )
call PauseUnitBJ( false, udg_TO_caster )
call ResetUnitAnimation( c )
call SetUnitPathing( c, true )
set height = 0
call SetUnitFlyHeightBJ( c, height, 8000000 )
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( c, u, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
// decoration
call FadingText( I2S(R2I(r)) + "!!" , udg_TO_target, 15, 80, 50, 50, 0 )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_TO_caster), 'h01I', p , bj_UNIT_FACING )
loop
exitwhen i > 6
set pd = PolarProjectionBJ(p, 300.00, ( 60.00 * I2R(i) ))
set d = CreateUnitAtLoc( GetOwningPlayer(udg_TO_caster), 'h01I', pd, 0)
call RemoveLocation (pd)
set d = null
set i = i + 1
endloop
set udg_TO_timer = 0
call EnableTrigger( gg_trg_Triumphant_Overthrow )
endif
call RemoveLocation(p)
call RemoveLocation(pd)
set d = null
set g = null
endfunction
//===============================================
function InitTrig_TO_2 takes nothing returns nothing
set gg_trg_TO_2 = CreateTrigger( )
call DisableTrigger( gg_trg_TO_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_TO_2, 0.02 )
call TriggerAddAction( gg_trg_TO_2, function Trig_TO_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Lightning_Ball_2_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N005' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetSpellTargetUnit(), 'B01E' ) > 0 ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00G' or GetSpellAbilityId() == 'A01V' ) ) then
return false
endif
return true
endfunction
function Trig_Lightning_Ball_2_Actions takes nothing returns nothing
local unit d
local unit u = GetSpellTargetUnit()
local location pc
local integer i = GetUnitMaxMana(GetTriggerUnit())/220 + GetHeroBonusInt(GetTriggerUnit())/10 + GetUnitAbilityLevel(GetTriggerUnit(),'A062')*10
call TriggerSleepAction(1)
set pc = GetUnitLoc(GetTriggerUnit())
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pc, bj_UNIT_FACING )
call UnitAddAbility( d, 'A09G')
call SetUnitAbilityLevel(d, 'A09G', i)
call IssueTargetOrder( d, "forkedlightning", u )
set d = null
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Lightning_Ball_2 takes nothing returns nothing
set gg_trg_Lightning_Ball_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning_Ball_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lightning_Ball_2, Condition( function Trig_Lightning_Ball_2_Conditions ) )
call TriggerAddAction( gg_trg_Lightning_Ball_2, function Trig_Lightning_Ball_2_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Lightning_Surge_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N005' ) ) then
return false
endif
return true
endfunction
function Trig_Lightning_Surge_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
local integer i = GetHeroLevel(GetTriggerUnit())
local real x = 2.2 * i
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p, 0.00 )
call UnitAddAbility( d, 'A099')
//call SetUnitAbilityLevel(d, 'A099', i)
call IssueTargetOrder( d, "bloodlust", GetTriggerUnit() )
set d = null
//
set udg_FL_caster = GetTriggerUnit()
//set udg_FL_target = GetSpellTargetUnit()
set udg_FL_duration = udg_FL_duration + 5
set udg_FL_count = udg_FL_count + 1
set udg_FL_off = 2
if IsTriggerEnabled( gg_trg_FL_2 ) == false then
call EnableTrigger( gg_trg_FL_2 )
call SetUnitMoveSpeed( udg_FL_caster, GetUnitDefaultMoveSpeed(udg_FL_caster) + x )
endif
//
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Lightning_Surge takes nothing returns nothing
set gg_trg_Lightning_Surge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lightning_Surge, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Lightning_Surge, Condition( function Trig_Lightning_Surge_Conditions ) )
call TriggerAddAction( gg_trg_Lightning_Surge, function Trig_Lightning_Surge_Actions )
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function Trig_FL_2_Filter takes nothing returns boolean
return IsTarget() and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_FL_caster))
endfunction
function Trig_FL_2_Actions takes nothing returns nothing
local boolean a = GetUnitLife( udg_FL_caster ) > 0
local boolean b1 = udg_FL_duration > 0
local boolean b2 = udg_FL_off <= 0
local boolean b3 = udg_FL_count > 0
local location pc = GetUnitLoc( udg_FL_caster )
local group g = GetUnitsInRangeOfLocMatching(550.00, pc, Condition(function Trig_FL_2_Filter))
local unit u = FirstOfGroup (g)
local real v1 = GetUnitMaxMana(udg_FL_caster) * 0.01
local real v2 = 5 + GetHeroLevel(udg_FL_caster) * 2
local integer v = R2I(v1 + v2)
if ( a and b1 ) then
if ( b2 and b3 and u != null ) then
call ForkTarget(udg_FL_caster, u, v)
set udg_FL_count = udg_FL_count - 1
set udg_FL_off = 1
endif
set udg_FL_duration = udg_FL_duration - 0.1
set udg_FL_off = udg_FL_off - 0.1
else
call DisableTrigger( gg_trg_FL_2 )
call SetUnitMoveSpeed( udg_FL_caster, GetUnitDefaultMoveSpeed(udg_FL_caster) )
set udg_FL_caster = null
set udg_FL_duration = 0
set udg_FL_off = 0
set udg_FL_count = 0
endif
//call DisplayTextToForce( GetPlayersAll(), "duration: " + R2S(udg_FL_duration) )
//call DisplayTextToForce( GetPlayersAll(), "off: " + R2S(udg_FL_off) )
//call DisplayTextToForce( GetPlayersAll(), "count: " + R2S(udg_FL_count) )
call RemoveLocation (pc)
call DestroyGroup (g)
endfunction
//===========================================================================
function InitTrig_FL_2 takes nothing returns nothing
set gg_trg_FL_2 = CreateTrigger( )
call DisableTrigger( gg_trg_FL_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_FL_2, 0.1 )
call TriggerAddAction( gg_trg_FL_2, function Trig_FL_2_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Forked_Lightning_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0C3' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N005' ) ) then
return false
endif
return true
endfunction
function Trig_Forked_Lightning_Actions takes nothing returns nothing
local real v1 = GetUnitMaxMana(GetTriggerUnit()) * 0.01
local real v2 = 4 + GetUnitAbilityLevel(GetTriggerUnit(),'A0C3')*8
local integer v = R2I(v1 + v2)
local location pc = GetUnitLoc(GetTriggerUnit())
local unit u = GetSpellTargetUnit()
call ForkTarget( GetTriggerUnit(), u, v )
call RemoveLocation(pc)
endfunction
//===========================================================================
function InitTrig_Forked_Lightning takes nothing returns nothing
set gg_trg_Forked_Lightning = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Forked_Lightning, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Forked_Lightning, Condition( function Trig_Forked_Lightning_Conditions ) )
call TriggerAddAction( gg_trg_Forked_Lightning, function Trig_Forked_Lightning_Actions )
endfunction
//TESH.scrollpos=7
//TESH.alwaysfold=0
function Trig_Lightball_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A062' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N005' ) ) then
return false
endif
return true
endfunction
function Trig_Lightball_Actions takes nothing returns nothing
local unit d
local location pd = GetSpellTargetLoc()
set udg_UE_caster = GetTriggerUnit()
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h014', pd, bj_UNIT_FACING )
call SetUnitAnimation( d, "birth" )
call RemoveLocation (pd)
endfunction
//===========================================================================
function InitTrig_Unstable_Energy takes nothing returns nothing
set gg_trg_Unstable_Energy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unstable_Energy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Unstable_Energy, Condition( function Trig_Lightball_Conditions ) )
call TriggerAddAction( gg_trg_Unstable_Energy, function Trig_Lightball_Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function Trig_UE_2_Conditions takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(GetTriggerUnit(), 'B01E') > 0
local boolean b = GetUnitLife(udg_UE_caster) > 0
local location p1 = GetUnitLoc(udg_UE_caster)
local location p2 = GetUnitLoc( GetTriggerUnit() )
local boolean dist = DistanceBetweenPoints( p1, p2 ) < 1000
return a and b and dist
endfunction
function Trig_UE_2_Actions takes nothing returns nothing
local real v1 = GetUnitMaxMana(udg_UE_caster) * 0.01
local real v2 = 4 + GetUnitAbilityLevel(udg_UE_caster,'A062') * 8
local integer v = R2I(v1 + v2)
call ForkTarget(udg_UE_caster, GetTriggerUnit(), v)
call UnitRemoveAbility(GetTriggerUnit(), 'B01E')
endfunction
//===========================================================================
function InitTrig_UE_2 takes nothing returns nothing
set gg_trg_UE_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_UE_2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_UE_2, Condition( function Trig_UE_2_Conditions ) )
call TriggerAddAction( gg_trg_UE_2, function Trig_UE_2_Actions )
endfunction
//TESH.scrollpos=20
//TESH.alwaysfold=0
function Trig_Thunderpulse_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01V' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N005' ) ) then
return false
endif
return true
endfunction
function Trig_Thunderpulse_Actions takes nothing returns nothing
local unit d
local unit fx
local location p
local unit u = GetSpellTargetUnit()
local integer i = 1
local real v1 = GetUnitMaxMana(GetTriggerUnit()) * 0.0055
local real v2 = GetUnitAbilityLevel(GetTriggerUnit(),'A01V') * 10
local integer v = R2I(v1 + v2)
loop
exitwhen i > 10
set p = GetUnitLoc(u)
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01G', p , bj_UNIT_FACING )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p , bj_UNIT_FACING )
call UnitAddAbility( d, 'A096' )
call SetUnitUserData( d, v )
call IssueImmediateOrder( d, "thunderclap" )
set d = null
set fx = null
call TriggerSleepAction(0.55)
set i = i + 1
call RemoveLocation (p)
endloop
endfunction
//===========================================================================
function InitTrig_Thunderpulse takes nothing returns nothing
set gg_trg_Thunderpulse = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Thunderpulse, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Thunderpulse, Condition( function Trig_Thunderpulse_Conditions ) )
call TriggerAddAction( gg_trg_Thunderpulse, function Trig_Thunderpulse_Actions )
endfunction
//TESH.scrollpos=27
//TESH.alwaysfold=0
function Trig_Quietus_Imminent_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0CK' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01E' ) ) then
return false
endif
return true
endfunction
function Trig_Quietus_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_QI_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true
local boolean c = GetUnitAbilityLevel(GetFilterUnit(), 'B05O') > 0
return (a and b and c and IsTarget())
endfunction
function Quietus_Pop takes nothing returns nothing
local unit u
local location p = GetUnitLoc(udg_QI_caster)
local group g = GetUnitsInRectMatching( bj_mapInitialPlayableArea, Condition(function Trig_Quietus_Filter))
local integer ii = GetHeroInt(udg_QI_caster, true)
local integer vi = GetUnitAbilityLevel(udg_QI_caster, 'A0CK')
local real r = 0.25 * (100 + ii) * (2 + vi)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set r = r + (0.2 + 0.1 * vi) * GetUnitMissingLife(u)
call UnitDamageTargetPDD(udg_QI_caster, u, r, 0)
call FadingText( I2S(R2I(r)) + "!" , u, 15.00, 20.00, 30.00, 20.00, 0 )
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
call GroupRemoveUnit(g,u)
endloop
endfunction
function Trig_Quietus_Imminent_Actions takes nothing returns nothing
local timer t = CreateTimer()
local integer i = R2I(0.4 * (50 + GetHeroInt(GetTriggerUnit(), true)) * (2 + GetUnitAbilityLevel(GetTriggerUnit(),'A0CK')))
local location p = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local unit d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h02A', p , bj_UNIT_FACING )
local unit d2
set udg_QI_caster = GetTriggerUnit()
call SetUnitScale( d, 2.5, 2.5, 2.5 )
call UnitAddAbility(d, 'A0CJ')
call SetUnitUserData( d, i )
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call TimerStart(t,3,false, function Quietus_Pop)
//set t = null
call RemoveLocation (p)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Quietus_Imminent takes nothing returns nothing
set gg_trg_Quietus_Imminent = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Quietus_Imminent, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Quietus_Imminent, Condition( function Trig_Quietus_Imminent_Conditions ) )
call TriggerAddAction( gg_trg_Quietus_Imminent, function Trig_Quietus_Imminent_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Demonic_Portal_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01E' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00J' ) ) then
return false
endif
return true
endfunction
function Trig_ZP_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit c = udg_ZP_caster
local location p = udg_ZP_point
local real v = GetHeroLevel(udg_ZP_caster) + 11.5 * GetUnitAbilityLevel(udg_ZP_caster,'A00J')
local real r = 0.0115 * v * GetUnitMissingLife(udg_ZP_caster)
local unit fx
if udg_ZP_duration > 0 then
call TimerStart (t, 1, false, function Trig_ZP_Blink )
call FadingText( I2S(R2I(udg_ZP_duration)), c, 10, 50, 80, 50, 0 )
set udg_ZP_duration = udg_ZP_duration - 1
else
call SetUnitPositionLoc( c, p )
//call UnitDamageTargetBJ( c, u, udg_SM_real, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitLife( udg_ZP_caster, GetUnitLife( udg_ZP_caster ) + r )
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_ZP_caster), 'h02E', p , bj_UNIT_FACING )
call FadingText( "+" + I2S(R2I(r)), c, 11, 50, 80, 50, 0 )
call PauseTimer(t)
call DestroyTimer(t)
call RemoveLocation (p)
endif
set t = null
set c = null
endfunction
function Trig_Demonic_Portal_Actions takes nothing returns nothing
local timer t = CreateTimer()
local location p = GetSpellTargetLoc()
//
set udg_ZP_caster = GetTriggerUnit()
set udg_ZP_point = p
set udg_ZP_duration = 3
//
//call FadingText( I2S(3), GetTriggerUnit(), 10, 50, 80, 50, 0 )
call TimerStart (t, 1, false, function Trig_ZP_Blink )
//
set t = null
endfunction
//===========================================================================
function InitTrig_Demonic_Portal takes nothing returns nothing
set gg_trg_Demonic_Portal = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Demonic_Portal, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Demonic_Portal, Condition( function Trig_Demonic_Portal_Conditions ) )
call TriggerAddAction( gg_trg_Demonic_Portal, function Trig_Demonic_Portal_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Faerie_Grace_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(), 'B00V' ) > 0
endfunction
function Trig_Faerie_Grace_2 takes nothing returns nothing
local timer t = GetExpiredTimer()
set udg_FG_boolean = true
//call DisplayTextToForce(GetPlayersAll(),"yeet")
call DestroyTimer(t)
endfunction
function Trig_Faerie_Grace_Actions takes nothing returns nothing
local timer t = CreateTimer()
local group g = GetUnitsOfTypeIdAll('N01C')
local unit c = FirstOfGroup(g)
local location p = GetUnitLoc(GetTriggerUnit())
local unit d
local real r = GetRandomReal(1,50) + GetHeroInt(c, true) * 1.5
if udg_FG_boolean and GetRandomReal(0,100) > 50 + 2*GetHeroLevel(c) then
//call DisplayTextToForce(GetPlayersAll(),"yeet")
set udg_FG_boolean = false
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h023', p, bj_UNIT_FACING )
call SetUnitLife( GetTriggerUnit(), GetUnitLife(GetTriggerUnit()) + r )
call FadingText( I2S(R2I(r)) + "!", GetTriggerUnit(), 12.5, 75, 75, 50, 0 )
call TimerStart (t, 3, false, function Trig_Faerie_Grace_2 )
endif
set t = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Faerie_Grace takes nothing returns nothing
set gg_trg_Faerie_Grace = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Faerie_Grace, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Faerie_Grace, Condition( function Trig_Faerie_Grace_Conditions ) )
call TriggerAddAction( gg_trg_Faerie_Grace, function Trig_Faerie_Grace_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Faerie_Light_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0CF' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01C' ) ) then
return false
endif
return true
endfunction
function Trig_Faerie_Light_Actions takes nothing returns nothing
local unit d
local unit u = GetSpellTargetUnit()
local integer i = R2I(10 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0CF') + 0.01 * GetHeroInt(GetTriggerUnit(), true))
local location p = GetUnitLoc(GetTriggerUnit())
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p , bj_UNIT_FACING )
call UnitAddAbility( d, 'A04E' )
call SetUnitAbilityLevel( d, 'A04E', i )
//call DisplayTextToForce( GetPlayersAll(), I2S(i) )
call IssueTargetOrder(d, "healingwave", u)
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Faerie_Light takes nothing returns nothing
set gg_trg_Faerie_Light = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Faerie_Light, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Faerie_Light, Condition( function Trig_Faerie_Light_Conditions ) )
call TriggerAddAction( gg_trg_Faerie_Light, function Trig_Faerie_Light_Actions )
endfunction
//TESH.scrollpos=33
//TESH.alwaysfold=0
function Trig_Illuminate_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08L' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01C' ) ) then
return false
endif
return true
endfunction
function Trig_Illuminate_Func001001003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Illuminate_Func001001003002001 takes nothing returns boolean
return ( GetUnitLife(GetFilterUnit()) > 0 )
endfunction
function Trig_Illuminate_Func001001003002002 takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Illuminate_Func001001003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Illuminate_Func001001003002001(), Trig_Illuminate_Func001001003002002() )
endfunction
function Trig_Illuminate_Func001001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Illuminate_Func001001003001(), Trig_Illuminate_Func001001003002() )
endfunction
function Trig_Illuminate_Actions takes nothing returns nothing
local location p = GetSpellTargetLoc()
local location pu
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_Illuminate_Func001001003))
local unit u
local unit d
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A08L')*10 + R2I(0.2 * GetHeroBonusInt(GetTriggerUnit()))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A08K' )
call SetUnitAbilityLevel( d, 'A08K', i )
call IssueTargetOrder( d, "holybolt", u )
set d = null
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (p)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Illuminate takes nothing returns nothing
set gg_trg_Illuminate = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Illuminate, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Illuminate, Condition( function Trig_Illuminate_Conditions ) )
call TriggerAddAction( gg_trg_Illuminate, function Trig_Illuminate_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Ethereal_Dust_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A08W' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01C' ) ) then
return false
endif
return true
endfunction
function Trig_Ethereal_Dust_Func001001003 takes nothing returns boolean
return IsTarget()
endfunction
function Trig_Ethereal_Dust_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(500.00, pc, Condition(function Trig_Ethereal_Dust_Func001001003))
local unit u
local unit d
local real damage = 75 * GetUnitAbilityLevel(GetTriggerUnit(), 'A08W') + GetHeroInt(GetTriggerUnit(), true)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if IsUnitEnemy(u, GetOwningPlayer(GetTriggerUnit())) then
call UnitDamageTargetBJ( GetTriggerUnit(), u, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
endif
//cast banish on them
set d = CreateUnitAtLoc( GetOwningPlayer(u), 'h000', pc, 0 )
call UnitAddAbility( d, 'A08V' )
call IssueTargetOrder( d, "banish", u )
call GroupRemoveUnit(g, u)
endloop
call DestroyGroup (g)
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Ethereal_Dust takes nothing returns nothing
set gg_trg_Ethereal_Dust = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ethereal_Dust, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ethereal_Dust, Condition( function Trig_Ethereal_Dust_Conditions ) )
call TriggerAddAction( gg_trg_Ethereal_Dust, function Trig_Ethereal_Dust_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_MY_2_AllyFilter takes nothing returns boolean
local boolean a = IsUnitAlly( GetFilterUnit(), GetOwningPlayer(udg_MY_caster))
return a and IsTarget()
endfunction
function Trig_MY_2_EnemyFilter takes nothing returns boolean
local boolean a = IsUnitEnemy( GetFilterUnit(), GetOwningPlayer(udg_MY_caster))
return a and IsTarget()
endfunction
function Trig_MY_2_Actions takes nothing returns nothing
local integer i = 1
local unit d
local location p
local location pu
local location pfx
local real r
local group g
local unit u
local real damage = 300.00 * GetUnitAbilityLevel(udg_MY_caster, 'A0BF') + 2 * GetHeroInt(udg_MY_caster, true)
set udg_MY_real = ( udg_MY_real + 1 )
if ( udg_MY_real < 60 ) then
loop
exitwhen i > 30
set pfx = PolarProjectionBJ(udg_MY_point, 900-15*udg_MY_real, 12*(i + udg_MY_real))
call SetUnitPositionLoc(udg_MY_fx[i], pfx)
call RemoveLocation(pfx)
set i = i + 1
endloop
else
set udg_MY_real = 0
set i = 1
loop
exitwhen i > 30
call RemoveUnit( udg_MY_fx[i] )
set i = i + 1
endloop
set g = GetUnitsInRangeOfLocMatching(600.00, udg_MY_point, Condition(function Trig_MY_2_AllyFilter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_MY_caster), 'h023', pu, bj_UNIT_FACING )
call SetUnitLife( u, GetUnitLife(u) + damage )
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
set g = GetUnitsInRangeOfLocMatching(600.00, udg_MY_point, Condition(function Trig_MY_2_EnemyFilter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_MY_caster), 'h023', pu, bj_UNIT_FACING )
call UnitDamageTargetBJ( udg_MY_caster, u, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation (udg_MY_point)
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Mystic_Singularity )
endif
call RemoveLocation (p)
set g = null
endfunction
//===========================================================================
function InitTrig_MY_2 takes nothing returns nothing
set gg_trg_MY_2 = CreateTrigger( )
call DisableTrigger( gg_trg_MY_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_MY_2, 0.03 )
call TriggerAddAction( gg_trg_MY_2, function Trig_MY_2_Actions )
endfunction
//TESH.scrollpos=16
//TESH.alwaysfold=0
function Trig_Natural_Blast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0C0' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N001' ) ) then
return false
endif
return true
endfunction
function Trig_Natural_Blast_Filter takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and IsTarget())
endfunction
function Trig_Natural_Blast_Actions takes nothing returns nothing
local location p = GetSpellTargetLoc()
local group g = GetUnitsInRangeOfLocMatching(350.00, p, Condition(function Trig_Natural_Blast_Filter))
local unit u
local unit d
local real r = GetUnitAbilityLevel(GetTriggerUnit(), 'A0C0') * 70
local real x = 1.4 * GetHeroInt(GetTriggerUnit(),true)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h008', p, 0)
call SetUnitScale(d, 1.6, 1.6, 1.6)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r + x, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call FadingText( ( I2S(R2I(0.09 * GetUnitMaxLife(u))) + "!" ), u, 12.00, 72.00, 0.00, 72.00, 0 )
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Natural_Blast takes nothing returns nothing
set gg_trg_Natural_Blast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Natural_Blast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Natural_Blast, Condition( function Trig_Natural_Blast_Conditions ) )
call TriggerAddAction( gg_trg_Natural_Blast, function Trig_Natural_Blast_Actions )
endfunction
//TESH.scrollpos=1
//TESH.alwaysfold=0
function Trig_Chlorophyll_Burn_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N001' ) ) then
return false
endif
return true
endfunction
function Trig_Chlorophyll_Burn_Actions takes nothing returns nothing
local texttag t
local unit c = GetTriggerUnit()
local unit u = GetSpellTargetUnit()
local real x = 0.5 * GetHeroInt(c, true)
local real r1 = (GetUnitAbilityLevel(c, 'A000') + 0.5) * 56
local real r2 = r1 + 0.2 * GetUnitMissingMana(u)
call UnitDamageTargetBJ( c, u, r2 + x, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitState( u, UNIT_STATE_MANA, GetUnitState(u,UNIT_STATE_MANA)- ( r1 + x ) )
call FadingText( ( "+" + I2S(R2I(r2 + x)) ), u, 14.00, 0.00, 100.00, 50.00, 0 )
endfunction
//===========================================================================
function InitTrig_Chlorophyll_Burn takes nothing returns nothing
set gg_trg_Chlorophyll_Burn = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chlorophyll_Burn, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chlorophyll_Burn, Condition( function Trig_Chlorophyll_Burn_Conditions ) )
call TriggerAddAction( gg_trg_Chlorophyll_Burn, function Trig_Chlorophyll_Burn_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Chlorophyll_Pulse_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00F' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N001' ) ) then
return false
endif
return true
endfunction
function Trig_Chlorophyll_Pulse_Filter takes nothing returns boolean
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (IsTarget() and a and b)
endfunction
function Trig_Chlorophyll_Pulse_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
local unit u
local group g = GetUnitsInRangeOfLocMatching(1000.00, p, Condition(function Trig_Chlorophyll_Pulse_Filter))
local real r1 = 5 + I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A00F'))
local real x
local real r
loop
set u = FirstOfGroup(g)
exitwhen u == null
set x = (GetUnitMissingPercentMana(u) + 150) * 0.004 * r1
set r = x * GetUnitMaxLife(u) * 0.01
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call SetUnitState(u,UNIT_STATE_MANA, GetUnitState(u,UNIT_STATE_MANA)-(r * 0.01 * GetUnitMaxLife(u)))
call FadingText( ( I2S(R2I(r)) + "!" ), u, 14.00, 0.00, 100.00, 50.00, 0 )
call GroupRemoveUnit (g,u)
endloop
call RemoveLocation (p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Chlorophyll_Pulse takes nothing returns nothing
set gg_trg_Chlorophyll_Pulse = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chlorophyll_Pulse, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chlorophyll_Pulse, Condition( function Trig_Chlorophyll_Pulse_Conditions ) )
call TriggerAddAction( gg_trg_Chlorophyll_Pulse, function Trig_Chlorophyll_Pulse_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Great_Nature_loop_Func003001003 takes nothing returns boolean
if ( not ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_GN_caster)) == true ) ) then
return false
endif
if ( not ( GetUnitLife(GetFilterUnit()) > 0 ) ) then
return false
endif
if ( not ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
return true
endfunction
function Trig_Great_Nature_loop_Actions takes nothing returns nothing
local unit u
local unit c = udg_GN_caster
local location p = GetUnitLoc(c)
local group g = GetUnitsInRangeOfLocMatching(1000.00, p, Condition(function Trig_Great_Nature_loop_Func003001003))
local real r1 = 0.4 + 1.2 * GetUnitAbilityLevel(c, 'A002')
local real r
if (udg_GN_duration > 0 and GetUnitLife(udg_GN_caster) > 0) then
loop
set u = FirstOfGroup(g)
exitwhen u == null
if ( IsUnitType(u, UNIT_TYPE_HERO) == true ) then
set r = (GetUnitMissingPercentMana(u) + 40) * r1
else
set r = 40 * r1
endif
call UnitDamageTargetBJ( c, u, 0.1 * r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
set udg_GN_duration = udg_GN_duration - 0.1
else
call DisableTrigger( gg_trg_Great_Nature_loop )
call EnableTrigger( gg_trg_Great_Nature )
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Great_Nature_loop takes nothing returns nothing
set gg_trg_Great_Nature_loop = CreateTrigger( )
call DisableTrigger( gg_trg_Great_Nature_loop )
call TriggerRegisterTimerEventPeriodic( gg_trg_Great_Nature_loop, 0.1 )
call TriggerAddAction( gg_trg_Great_Nature_loop, function Trig_Great_Nature_loop_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Generate_Chloroplast_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N001' ) ) then
return false
endif
return true
endfunction
function Trig_Generate_Chloroplast_Actions takes nothing returns nothing
local unit d
local location pd = GetSpellTargetLoc()
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00T', pd, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 4 + 14 * I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A001')), 'BTLF', d )
call SetUnitAbilityLevel(d, 'A07S', GetHeroLevel(GetTriggerUnit()))
call RemoveLocation (pd)
endfunction
//===========================================================================
function InitTrig_Generate_Chloroplast takes nothing returns nothing
set gg_trg_Generate_Chloroplast = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Generate_Chloroplast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Generate_Chloroplast, Condition( function Trig_Generate_Chloroplast_Conditions ) )
call TriggerAddAction( gg_trg_Generate_Chloroplast, function Trig_Generate_Chloroplast_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Phoenix_Blade_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0BT' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00M' ) ) then
return false
endif
return true
endfunction
function Trig_Phoenix_Blade_Actions takes nothing returns nothing
local integer i1 = GetHeroBonusInt(GetTriggerUnit())*4
local integer i2 = GetHeroAgi(GetTriggerUnit(), true)
local integer i = i1 + i2 + GetUnitAbilityLevel(GetTriggerUnit(),'A00H')*110 + 90
local location p = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local unit d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p , bj_UNIT_FACING )
local unit d2
call UnitAddAbility(d, 'A0AX')
call SetUnitUserData( d, i )
call TriggerSleepAction(0)
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call RemoveLocation (p)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Phoenix_Blade takes nothing returns nothing
set gg_trg_Phoenix_Blade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Phoenix_Blade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Phoenix_Blade, Condition( function Trig_Phoenix_Blade_Conditions ) )
call TriggerAddAction( gg_trg_Phoenix_Blade, function Trig_Phoenix_Blade_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DO_2_Filter takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_DO_caster)) and IsTarget())
endfunction
function Trig_DO_2_Func001Func012A takes nothing returns nothing
local unit c = udg_DO_caster
local unit u = GetEnumUnit()
local real r = 0.09 * GetUnitLife(u) + 90 * I2R(GetUnitAbilityLevel(c,'A01X')) + 1.3 * GetHeroBonusInt(c)
call UnitDamageTargetBJ( c, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set c = null
set u = null
endfunction
function Trig_DO_2_Actions takes nothing returns nothing
local location p1 = GetUnitLoc(udg_DO_caster)
local location p = PolarProjectionBJ(p1, 130.00, udg_DO_angle)
local unit d
if ( DistanceBetweenPoints(p1, udg_DO_point) > 130 and udg_DO_duration > 0 ) then
set d = CreateUnitAtLoc(GetOwningPlayer(udg_DO_caster), 'h00L', p , bj_UNIT_FACING )
call SetUnitPositionLoc( udg_DO_caster, p )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(260.00, p, Condition(function Trig_DO_2_Filter)), function Trig_DO_2_Func001Func012A )
else
call DisableTrigger( gg_trg_DO_2 )
call SetUnitPathing( udg_DO_caster, true )
call ResetUnitAnimation( udg_DO_caster )
set udg_DO_dummy = CreateUnitAtLoc(GetOwningPlayer(udg_DO_caster), 'h00D', p1, 0 )
set udg_DO_duration = 9.03
call SetUnitMoveSpeed( udg_DO_caster, 650.00 )
//call SetUnitTimeScalePercent( udg_DO_caster, 200.00 )
call EnableTrigger( gg_trg_DO_3 )
endif
set udg_DO_duration = udg_DO_duration - 0.03
call RemoveLocation (p)
call RemoveLocation (p1)
set d = null
endfunction
//===========================================================================
function InitTrig_DO_2 takes nothing returns nothing
set gg_trg_DO_2 = CreateTrigger( )
call DisableTrigger( gg_trg_DO_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DO_2, 0.03 )
call TriggerAddAction( gg_trg_DO_2, function Trig_DO_2_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_DO_3_Actions takes nothing returns nothing
local boolean a = udg_DO_duration > 0
local boolean b = GetUnitLife(udg_DO_caster) > 0
local location p = GetUnitLoc( udg_DO_caster )
if (a and b) then
call UnitRemoveBuffsExBJ( bj_BUFF_POLARITY_NEGATIVE, bj_BUFF_RESIST_EITHER, udg_DO_caster, false, false )
call SetUnitPositionLoc( udg_DO_dummy, p )
set udg_DO_duration = udg_DO_duration - 0.05
else
set udg_DO_duration = 0
call SetUnitMoveSpeed( udg_DO_caster, GetUnitDefaultMoveSpeed(udg_DO_caster) )
//call SetUnitTimeScalePercent( udg_DO_caster, 100 )
call DisableTrigger( gg_trg_DO_3 )
call KillUnit( udg_DO_dummy )
set udg_DO_caster = null
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_DO_3 takes nothing returns nothing
set gg_trg_DO_3 = CreateTrigger( )
call DisableTrigger( gg_trg_DO_3 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DO_3, 0.05 )
call TriggerAddAction( gg_trg_DO_3, function Trig_DO_3_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Spirit_Break_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A009' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00M' ) ) then
return false
endif
return true
endfunction
function Trig_Spirit_Break_Actions takes nothing returns nothing
local integer i = GetUnitAbilityLevel(GetTriggerUnit(),'A008') * 10 + 2 * GetHeroLevel(GetTriggerUnit())
local location p = GetSpellTargetLoc()
local integer a = 1
local location pa
set udg_SB_soul = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00W', p, bj_UNIT_FACING )
loop
exitwhen a > 36
set pa = PolarProjectionBJ(p,900, 10*a)
set udg_SB_indi [a] = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01P', pa, bj_UNIT_FACING )
set a = a + 1
endloop
set udg_SB_caster = GetTriggerUnit()
set udg_SB_duration = 13.00
call AddLightningLoc( "HWPB", GetUnitLoc(udg_SB_soul), GetUnitLoc(udg_SB_caster) )
set udg_SB_lightning = GetLastCreatedLightningBJ()
call UnitAddAbility( GetTriggerUnit(), 'A042' )
call SetUnitAbilityLevel( GetTriggerUnit(), 'A042', i )
call SetPlayerAbilityAvailable( GetOwningPlayer(GetTriggerUnit()), 'A008', false )
//call SetUnitAbilityLevel( GetTriggerUnit(), 'A080', GetUnitLevel(GetTriggerUnit()) )
call EnableTrigger( gg_trg_Spirit_Break_2_jass )
call DisableTrigger( GetTriggeringTrigger() )
call RemoveLocation (p)
call RemoveLocation (pa)
endfunction
//===========================================================================
function InitTrig_Spirit_Break takes nothing returns nothing
set gg_trg_Spirit_Break = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spirit_Break, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spirit_Break, Condition( function Trig_Spirit_Break_Conditions ) )
call TriggerAddAction( gg_trg_Spirit_Break, function Trig_Spirit_Break_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Spirit_Break_2_jass_Func001C takes nothing returns boolean
local location p1 = GetUnitLoc(udg_SB_caster)
local location p2 = GetUnitLoc(udg_SB_soul)
if ( ( DistanceBetweenPoints(p1, p2) > 900.00 ) ) then
return true
endif
if ( ( GetUnitPercentLife(udg_SB_caster) <= 13 ) ) then
return true
endif
if ( ( udg_SB_duration == 0 ) ) then
return true
endif
call RemoveLocation (p1)
call RemoveLocation (p2)
return false
endfunction
function Trig_Spirit_Break_2_jass_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_SB_soul)
local location p2 = GetUnitLoc(udg_SB_caster)
local integer a = 1
local unit d
if ( Trig_Spirit_Break_2_jass_Func001C() ) then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_SB_caster), 'h00Y', p, bj_UNIT_FACING )
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', d )
loop
exitwhen a > 36
call RemoveUnit( udg_SB_indi[a] )
set a = a + 1
endloop
call RemoveUnit( udg_SB_soul )
call DestroyLightning( udg_SB_lightning )
call UnitRemoveAbility( udg_SB_caster, 'A042')
call SetPlayerAbilityAvailable( GetOwningPlayer(udg_SB_caster), 'A008', true )
//call SetUnitAbilityLevel(udg_SB_caster, 'A080', 1)
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Spirit_Break )
else
call MoveLightningLoc( udg_SB_lightning, p, p2 )
set udg_SB_duration = udg_SB_duration - 0.05
call UnitRemoveBuffsExBJ( bj_BUFF_POLARITY_NEGATIVE, bj_BUFF_RESIST_EITHER, udg_SB_caster, false, false )
endif
set d = null
call RemoveLocation(p)
call RemoveLocation(p2)
endfunction
//===========================================================================
function InitTrig_Spirit_Break_2_jass takes nothing returns nothing
set gg_trg_Spirit_Break_2_jass = CreateTrigger( )
call DisableTrigger( gg_trg_Spirit_Break_2_jass )
call TriggerRegisterTimerEventPeriodic( gg_trg_Spirit_Break_2_jass, 0.05 )
call TriggerAddAction( gg_trg_Spirit_Break_2_jass, function Trig_Spirit_Break_2_jass_Actions )
endfunction
//TESH.scrollpos=10
//TESH.alwaysfold=0
function Trig_Frost_Armour_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00T' ) ) then
return false
endif
return true
endfunction
function Trig_Frost_Armour_Filter takes nothing returns boolean
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
local boolean b = IsUnitAlly(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return a and b
endfunction
function Trig_Frost_Armour_Actions takes nothing returns nothing
local unit d
local unit u
local location pu
local location ps = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(900.00, ps, Condition(function Trig_Frost_Armour_Filter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A07R' )
call SetUnitAbilityLevel( d, 'A07R', GetHeroLevel(GetTriggerUnit()))
call IssueTargetOrder(d, "frostarmor", u)
set d = null
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation (ps)
endfunction
//===========================================================================
function InitTrig_Frost_Armour takes nothing returns nothing
set gg_trg_Frost_Armour = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Armour, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Armour, Condition( function Trig_Frost_Armour_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Armour, function Trig_Frost_Armour_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Frost_Chime_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07S' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00T' ) ) then
return false
endif
return true
endfunction
function Trig_Frost_Chime_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local unit d
local location pc
local location pu
local integer i = 3
local real r = (0.25 + 0.09 * GetUnitAbilityLevel(GetTriggerUnit(), 'A07S')) * GetHeroInt(GetTriggerUnit(), true)
local integer v = R2I(16 * GetUnitAbilityLevel(GetTriggerUnit(), 'A07S') + r)
local real dist
loop
exitwhen i == 0 or GetUnitLife(GetTriggerUnit()) < 0 or GetUnitLife(u) < 0
call TriggerSleepAction(0.4)
set pu = GetUnitLoc(u)
set pc = GetUnitLoc(GetTriggerUnit())
set dist = DistanceBetweenPoints(pc, pu)
if dist < 900 then
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pc, bj_UNIT_FACING )
call UnitAddAbility( d, 'A068' )
call SetUnitUserData( d, v )
//call SetUnitScale( d, 2, 2, 2 )
call IssueTargetOrder( d, "firebolt", u )
set d = null
endif
call RemoveLocation (pc)
call RemoveLocation (pu)
set i = i - 1
endloop
endfunction
//===========================================================================
function InitTrig_Frost_Chime takes nothing returns nothing
set gg_trg_Frost_Chime = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Frost_Chime, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Frost_Chime, Condition( function Trig_Frost_Chime_Conditions ) )
call TriggerAddAction( gg_trg_Frost_Chime, function Trig_Frost_Chime_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Nightfall_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00T' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A088' ) ) then
return false
endif
return true
endfunction
function Trig_Nightfall_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and IsTarget())
//
endfunction
function Trig_Nightfall_Actions takes nothing returns nothing
local location pc = GetSpellTargetLoc()
local unit u
local unit d
local location p
local group g = GetUnitsInRangeOfLocMatching(600, pc, Condition(function Trig_Nightfall_Filter))
call TriggerSleepAction (3)
loop
set u = FirstOfGroup(g)
exitwhen u == null
if ( GetUnitAbilityLevel(u, 'B03T' ) > 0 ) then
set p = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A004' )
//call SetUnitAbilityLevel( d, 'A004', GetUnitAbilityLevel(GetTriggerUnit(),'A088'))
call IssueTargetOrder(d, "thunderbolt", u)
call UnitRemoveAbility( u, 'B03T' )
set d = null
call RemoveLocation (p)
endif
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Nightfall takes nothing returns nothing
set gg_trg_Nightfall = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Nightfall, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Nightfall, Condition( function Trig_Nightfall_Conditions ) )
call TriggerAddAction( gg_trg_Nightfall, function Trig_Nightfall_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Dark_Chrysalis_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0B7' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00T' ) ) then
return false
endif
return true
endfunction
function Trig_Dark_Chrysalis_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetSpellTargetUnit())
set udg_DC_target = GetSpellTargetUnit()
set udg_DC_caster = GetTriggerUnit()
set udg_DC_duration = 3
set udg_DC_dummy = CreateUnitAtLoc(GetOwningPlayer(udg_DC_caster), 'h027', p, 0 )
call EnableTrigger( gg_trg_DC_2 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Dark_Chrysalis takes nothing returns nothing
set gg_trg_Dark_Chrysalis = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dark_Chrysalis, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dark_Chrysalis, Condition( function Trig_Dark_Chrysalis_Conditions ) )
call TriggerAddAction( gg_trg_Dark_Chrysalis, function Trig_Dark_Chrysalis_Actions )
endfunction
//TESH.scrollpos=7
//TESH.alwaysfold=0
function Trig_Dark_Chrysalis_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_DC_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and IsTarget())
endfunction
function Trig_DC_2_Actions takes nothing returns nothing
local boolean a = udg_DC_duration > 0
local boolean b = GetUnitLife(udg_DC_target) > 0
local location p = GetUnitLoc( udg_DC_target )
local real r = 70 * GetUnitAbilityLevel(udg_DC_caster, 'A0B7' ) + 0.7 * GetHeroInt(udg_DC_caster, true)
local group g
local unit u
local unit fx
if (a and b) then
call SetUnitPositionLoc( udg_DC_dummy, p )
set udg_DC_duration = udg_DC_duration - 0.05
//call UnitDamageTargetBJ( udg_DC_caster, udg_DC_target, 0.01*r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
set udg_DC_duration = 0
set g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_Dark_Chrysalis_Filter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_DC_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
call GroupRemoveUnit(g,u)
endloop
call FadingText( ( I2S(R2I(r)) + "!" ), udg_DC_target, 12.00, 72.00, 0.00, 72.00, 0 )
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_DC_caster), 'h01T', p , bj_UNIT_FACING )
set fx = null
call DisableTrigger( gg_trg_DC_2 )
call KillUnit( udg_DC_dummy )
set udg_DC_target = null
endif
call DestroyGroup(g)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_DC_2 takes nothing returns nothing
set gg_trg_DC_2 = CreateTrigger( )
call DisableTrigger( gg_trg_DC_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DC_2, 0.05 )
call TriggerAddAction( gg_trg_DC_2, function Trig_DC_2_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function Trig_Cryosphere_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03H' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00T' ) ) then
return false
endif
return true
endfunction
function Trig_Cryosphere_1_Actions takes nothing returns nothing
set udg_Cryo_caster = GetTriggerUnit()
set udg_Cryo_dummy = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01L', GetSpellTargetLoc(), bj_UNIT_FACING )
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Cryosphere_2 )
call TriggerSleepAction( 9.00 )
call DisableTrigger( gg_trg_Cryosphere_2 )
call EnableTrigger( gg_trg_Cryosphere_1 )
endfunction
//===========================================================================
function InitTrig_Cryosphere_1 takes nothing returns nothing
set gg_trg_Cryosphere_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cryosphere_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cryosphere_1, Condition( function Trig_Cryosphere_1_Conditions ) )
call TriggerAddAction( gg_trg_Cryosphere_1, function Trig_Cryosphere_1_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
function Trig_Cryosphere_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Cryo_caster))
local boolean b = GetRandomReal (0,144) < 98
return (a and b and IsTarget())
endfunction
function Trig_Cryosphere_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_Cryo_dummy)
local group g = GetUnitsInRangeOfLocMatching(700.00, p, Condition(function Trig_Cryosphere_Filter))
local unit c = udg_Cryo_caster
local unit d
local unit u
local location pu
local integer v = GetHeroLevel(udg_Cryo_caster) + 16 * GetUnitAbilityLevel(udg_Cryo_caster, 'A03H')
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc(GetOwningPlayer(c), 'h01Y', pu, bj_UNIT_FACING )
call UnitAddAbility(d, 'A03O')
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "frostnova", u )
call GroupRemoveUnit(g,u)
endloop
set d = null
set c = null
set u = null
call RemoveLocation (p)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Cryosphere_2 takes nothing returns nothing
set gg_trg_Cryosphere_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Cryosphere_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Cryosphere_2, 0.90 )
call TriggerAddAction( gg_trg_Cryosphere_2, function Trig_Cryosphere_2_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_Obli_Death_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Obli_Death_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
local integer v = GetHeroLevel(GetTriggerUnit())
local unit fx
local location pi
local integer i = 1
local real radius = 350 + 14 * v
local integer ifx = R2I(20 + 0.4 * v)
//vfx time
loop
exitwhen i > ifx
set pi = PolarProjectionBJ(p, radius, ( 360 * i / ifx ))
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h02O', pi, bj_UNIT_FACING )
set fx = null
call RemoveLocation (pi)
set i = i + 1
endloop
//main
call TriggerSleepAction (1)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A0DC' )
call SetUnitAbilityLevel( d, 'A0DC', v )
call SetUnitUserData( d, GetHeroInt(GetTriggerUnit(),true) )
//call DisplayTextToForce( GetPlayersAll(), I2S(v) )
call IssuePointOrderLoc( d, "inferno", p )
endfunction
//===========================================================================
function InitTrig_Obli_Death takes nothing returns nothing
set gg_trg_Obli_Death = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Obli_Death, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Obli_Death, Condition( function Trig_Obli_Death_Conditions ) )
call TriggerAddAction( gg_trg_Obli_Death, function Trig_Obli_Death_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Obli_Storm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03G' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Obli_Storm_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return ( a and IsTarget() )
endfunction
function Trig_Obli_Storm_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu
local group g = GetUnitsInRangeOfLocMatching(700.00, pc, Condition(function Trig_Obli_Storm_Filter))
local unit d
local unit u
local integer k = 1
local integer v1 = GetUnitAbilityLevel(GetTriggerUnit(), 'A03G' )
local integer v = R2I(21 * v1 + (0.5 + 0.1 * v1) * GetHeroInt(GetTriggerUnit(), true))
loop
set u = FirstOfGroup(g)
exitwhen u == null or k > 7
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A03A' )
call SetUnitFlyHeightBJ( d, 1000, 1000 )
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "chainlightning", u )
call RemoveLocation (pu)
set k = k + 1
call GroupRemoveUnit( g, u )
endloop
call RemoveLocation (pc)
call DestroyGroup (g)
set d = null
set u = null
endfunction
//===========================================================================
function InitTrig_Obli_Storm takes nothing returns nothing
set gg_trg_Obli_Storm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Obli_Storm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Obli_Storm, Condition( function Trig_Obli_Storm_Conditions ) )
call TriggerAddAction( gg_trg_Obli_Storm, function Trig_Obli_Storm_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Obli_Earth_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03D' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Obli_Earth_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetSpellTargetLoc()
local location pd
local real r = AngleBetweenPoints(pc,pu) + 90
local location pt = PolarProjectionBJ (pu, 4 * 170, 180 + r)
local unit d
local unit d2
local integer i = 1
local integer v1 = GetUnitAbilityLevel(GetTriggerUnit(), 'A03D' )
local integer v = R2I(21 * v1 + (0.5 + 0.1 * v1) * GetHeroInt(GetTriggerUnit(), true))
loop
exitwhen i > 7
set pd = PolarProjectionBJ (pt, i * 170, r)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pd, bj_UNIT_FACING )
call UnitAddAbility (d, 'A0B0')
call SetUnitUserData( d, v )
call IssueImmediateOrder( d, "stomp")
set d2 = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01M', pd , bj_UNIT_FACING )
call SetUnitScale( d2, 0.5, 0.5, 0.5 )
set d = null
set d2 = null
call RemoveLocation (pd)
set i = i + 1
endloop
call RemoveLocation (pc)
call RemoveLocation (pu)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Obli_Earth takes nothing returns nothing
set gg_trg_Obli_Earth = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Obli_Earth, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Obli_Earth, Condition( function Trig_Obli_Earth_Conditions ) )
call TriggerAddAction( gg_trg_Obli_Earth, function Trig_Obli_Earth_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Obli_Fire_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00N' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00Z' ) ) then
return false
endif
return true
endfunction
function Trig_OF_Filter takes nothing returns boolean
return IsTarget() and IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_OF_caster))
endfunction
function Trig_OF_Damage takes nothing returns nothing
local unit u
local group g = GetUnitsInRangeOfLocMatching(350.00, udg_OF_point, Condition(function Trig_OF_Filter))
local integer v1 = GetUnitAbilityLevel(udg_OF_caster, 'A00N' )
local real r = 21 * v1 + (0.5 + 0.1 * v1) * GetHeroInt(udg_OF_caster, true)
//call DisplayTextToForce( GetPlayersAll(), I2S(CountUnitsInGroup(g)) )
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_OF_caster, u, 0.7*r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call DisplayTextToForce( GetPlayersAll(), GetUnitName(u) )
call GroupRemoveUnit(g, u)
endloop
if udg_OF_duration > 0 then
set udg_OF_duration = udg_OF_duration - 0.7
call TimerStart( udg_OF_timer, 0.7, false, function Trig_OF_Damage )
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
endif
endfunction
function Trig_Obli_Fire_Actions takes nothing returns nothing
local timer t = CreateTimer()
local location pt = GetSpellTargetLoc()
local unit d
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', pt, bj_UNIT_FACING )
call UnitAddAbility (d, 'A0BW')
//call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "flamestrike", pt )
//fuck this spell fucking cause so many problems
set udg_OF_caster = GetTriggerUnit()
set udg_OF_point = pt
set udg_OF_duration = 7
call TimerStart (t, 1, false, function Trig_OF_Damage )
set d = null
//call RemoveLocation (pt)
set t = null
endfunction
//===========================================================================
function InitTrig_Obli_Fire takes nothing returns nothing
set gg_trg_Obli_Fire = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Obli_Fire, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Obli_Fire, Condition( function Trig_Obli_Fire_Conditions ) )
call TriggerAddAction( gg_trg_Obli_Fire, function Trig_Obli_Fire_Actions )
endfunction
//TESH.scrollpos=45
//TESH.alwaysfold=0
function Trig_Obli_Universe_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0B1' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Obli_Universe_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
//local boolean c = GetFilterUnit() == GetTriggerUnit()
return (a and b and IsTarget())
endfunction
function Trig_Obli_Universe_Actions takes nothing returns nothing
local location pt = GetSpellTargetLoc()
local location pfx
local group g = GetUnitsInRangeOfLocMatching(700, pt, Condition(function Trig_Obli_Universe_Filter))
local unit u
local unit d
local real rx = 2 * GetHeroInt(GetTriggerUnit(), true) + GetHeroBonusInt(GetTriggerUnit())
local integer v1 = GetUnitAbilityLevel(GetTriggerUnit(),'A0B1')
local real r = 170 * v1 + (0.7 + 0.2 * v1) * rx
local real s
local real t
local integer i = 1
local location pu
local location pu2
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set s = DistanceBetweenPoints( pu, pt )
set t = AngleBetweenPoints( pu, pt )
set pu2 = PolarProjectionBJ( pu, 1.4 * s, t )
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call SetUnitPositionLoc( u, pu2 )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Z', pu2 , bj_UNIT_FACING )
set d = null
call RemoveLocation (pu)
call RemoveLocation (pu2)
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
loop
//soul vfx
exitwhen i > 12
set pfx = PolarProjectionBJ( pt, 700, i*30 )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PR_caster), 'h004', pfx, bj_UNIT_FACING )
call RemoveLocation (pfx)
set i = i + 1
endloop
call RemoveLocation (pu)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Obli_Universe takes nothing returns nothing
set gg_trg_Obli_Universe = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Obli_Universe, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Obli_Universe, Condition( function Trig_Obli_Universe_Conditions ) )
call TriggerAddAction( gg_trg_Obli_Universe, function Trig_Obli_Universe_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Oblifire_2_jass_Actions takes nothing returns nothing
local integer i = GetUnitAbilityLevel(udg_Oblifire_caster, 'A03D')
local integer j = 3 + 2 * i
local unit d
local location p
set udg_Oblifire_int = udg_Oblifire_int + 1
if (udg_Oblifire_int <= j) then
set p = PolarProjectionBJ(udg_Oblifire_point, 600 , udg_Oblifire_angle - 15*(2+i) + 15.00 * udg_Oblifire_int )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_Oblifire_caster), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A03F' )
call SetUnitAbilityLevel( d,'A03F', i*10 + GetHeroInt(udg_Oblifire_caster, true)/10 )
call IssuePointOrderLoc( d, "flamestrike", p )
else
call EnableTrigger(gg_trg_Obli_Earth)
call DisableTrigger( gg_trg_Oblifire_2_jass )
endif
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Oblifire_2_jass takes nothing returns nothing
set gg_trg_Oblifire_2_jass = CreateTrigger( )
call DisableTrigger( gg_trg_Oblifire_2_jass )
call TriggerRegisterTimerEventPeriodic( gg_trg_Oblifire_2_jass, 0.2 )
call TriggerAddAction( gg_trg_Oblifire_2_jass, function Trig_Oblifire_2_jass_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Intervention_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05G' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H01B' ) ) then
return false
endif
return true
endfunction
function Trig_Intervention_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and IsTarget())
endfunction
function Trig_Intervention_Actions takes nothing returns nothing
local location p = GetSpellTargetLoc()
local location pu
local group g = GetUnitsInRangeOfLocMatching(440.00, p, Condition(function Trig_Intervention_Filter))
local unit u
local unit d
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A05H' )
call SetUnitAbilityLevel( d, 'A05H', GetUnitAbilityLevel(GetTriggerUnit(), 'A05G' ) )
call IssueTargetOrder( d, "firebolt", u )
set d = null
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (p)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Intervention takes nothing returns nothing
set gg_trg_Intervention = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Intervention, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Intervention, Condition( function Trig_Intervention_Conditions ) )
call TriggerAddAction( gg_trg_Intervention, function Trig_Intervention_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_DL_2_Actions takes nothing returns nothing
local unit c = udg_DL_caster
local location p = GetUnitLoc(udg_DL_caster)
local integer i = GetUnitAbilityLevel(udg_DL_caster, 'A097')*8 + GetHeroLevel(udg_DL_caster) * 2
local unit d
if ( udg_DL_int > 0 ) then
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01S', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A098' )
call SetUnitAbilityLevel( d, 'A098', i )
call IssueImmediateOrder( d, "fanofknives" )
set udg_DL_int = udg_DL_int - 1
else
call DisableTrigger( gg_trg_DL_2 )
call EnableTrigger( gg_trg_Diffusing_Light )
endif
set c = null
set d = null
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_DL_2 takes nothing returns nothing
set gg_trg_DL_2 = CreateTrigger( )
call DisableTrigger( gg_trg_DL_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DL_2, 0.55)
call TriggerAddAction( gg_trg_DL_2, function Trig_DL_2_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Arcane_equi_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H01B' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetTriggerUnit(), 'A04R') > 0) ) then
return false
endif
return true
endfunction
function Trig_Arcane_equi_Actions takes nothing returns nothing
local texttag t
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A04R')
local real r1 = 0.02 + 0.04 * i
local real r = ( r1 * ( GetUnitMaxLife(GetTriggerUnit()) - GetUnitLife(GetTriggerUnit()) ) )
call SetUnitLife( GetTriggerUnit(), ( GetUnitLife(GetTriggerUnit()) + r ) )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h013', p, bj_UNIT_FACING )
call UnitAddAbility( d, 'A046')
//call SetUnitAbilityLevel(d, 'A046',i)
call IssuePointOrderLoc( d, "silence", p )
call FadingText("+" + I2S(R2I(r)), GetTriggerUnit(), 14.00, 100, 100, 50, 0 )
call RemoveLocation (p)
set d = null
endfunction
//===========================================================================
function InitTrig_Arcane_equi takes nothing returns nothing
set gg_trg_Arcane_equi = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arcane_equi, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arcane_equi, Condition( function Trig_Arcane_equi_Conditions ) )
call TriggerAddAction( gg_trg_Arcane_equi, function Trig_Arcane_equi_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_DY_2_Func003Func005001003 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_DY_caster)) and IsTarget() )
endfunction
function Trig_DY_2_Func003Func005A takes nothing returns nothing
local real rd = ( ( 10 + ( 22 * I2R(GetUnitAbilityLevel(udg_DY_caster, 'A036')) ) ) + ( 0.22 * I2R(GetHeroInt( udg_DY_caster, true)) ) )
call UnitDamageTargetBJ( udg_DY_caster, GetEnumUnit(), (rd * 0.05), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
function Trig_DY_2_Func003Func006001003 takes nothing returns boolean
return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_DY_caster)) and IsTarget() )
endfunction
function Trig_DY_2_Func003Func006A takes nothing returns nothing
local real rh = ( ( 22 + ( 22 * I2R(GetUnitAbilityLevel(udg_DY_caster, 'A036')) ) ) + ( 0.4 * I2R(GetHeroInt(udg_DY_caster, true)) ) )
call SetUnitLife( GetEnumUnit(), ( GetUnitLife(GetEnumUnit()) + (rh * 0.05)) )
endfunction
function Trig_DY_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_DY_caster)
call SetUnitPositionLoc( udg_DY_dummy, p )
if ( GetUnitLife(udg_DY_dummy) > 0 ) then
call ForGroupBJ( GetUnitsInRangeOfLocMatching(1000.00, p, Condition(function Trig_DY_2_Func003Func005001003)), function Trig_DY_2_Func003Func005A )
call ForGroupBJ( GetUnitsInRangeOfLocMatching(1000.00, p, Condition(function Trig_DY_2_Func003Func006001003)), function Trig_DY_2_Func003Func006A )
else
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Divine_Sanctuary )
endif
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_DY_2 takes nothing returns nothing
set gg_trg_DY_2 = CreateTrigger( )
call DisableTrigger( gg_trg_DY_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_DY_2, 0.05 )
call TriggerAddAction( gg_trg_DY_2, function Trig_DY_2_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Crippling_Slash_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03Y' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N013' ) ) then
return false
endif
return true
endfunction
function Trig_Crippling_Slash_Filter takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and IsTarget())
endfunction
function Trig_Crippling_Slash_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(450.00, pc, Condition(function Trig_Crippling_Slash_Filter))
local unit u
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A03Y')
local real r = ( 0.8 + 0.2 * v ) * GetHeroStr(GetTriggerUnit(),true)
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call FadingText( ( I2S(R2I(0.09 * GetUnitMaxLife(u))) + "!" ), u, 12.00, 72.00, 0.00, 72.00, 0 )
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Crippling_Slash takes nothing returns nothing
set gg_trg_Crippling_Slash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crippling_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Crippling_Slash, Condition( function Trig_Crippling_Slash_Conditions ) )
call TriggerAddAction( gg_trg_Crippling_Slash, function Trig_Crippling_Slash_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Orcish_Standard_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == 'o000'
endfunction
function Trig_Orcish_Standard_Actions takes nothing returns nothing
local integer i = GetPlayerTechCount( GetOwningPlayer(GetTriggerUnit()), 'R00J', true )
call SetUnitAbilityLevel( GetTriggerUnit(),'A0D6', i )
endfunction
//===========================================================================
function InitTrig_Orcish_Standard takes nothing returns nothing
set gg_trg_Orcish_Standard = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Orcish_Standard, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Orcish_Standard, Condition( function Trig_Orcish_Standard_Conditions ) )
call TriggerAddAction( gg_trg_Orcish_Standard, function Trig_Orcish_Standard_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Bloodrush_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0D4' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N013' ) ) then
return false
endif
return true
endfunction
function Trig_Bloodrush_1_Actions takes nothing returns nothing
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A0D4')
local integer i = R2I( GetHeroStr(GetTriggerUnit(), true) * (0.3 + 0.2 * v) )
local real r
call SetUnitScale( GetTriggerUnit(), 1.7, 1.7, 1.7 )
call ModifyHeroStat( bj_HEROSTAT_STR, GetTriggerUnit(), bj_MODIFYMETHOD_ADD, i )
call TriggerSleepAction( 9 )
set r = GetUnitLife(GetTriggerUnit())
call ModifyHeroStat( bj_HEROSTAT_STR, GetTriggerUnit(), bj_MODIFYMETHOD_SUB, i )
call SetUnitLife(GetTriggerUnit(), r)
call SetUnitScale( GetTriggerUnit(), 1.3, 1.3, 1.3 )
endfunction
//===========================================================================
function InitTrig_Bloodrush_1 takes nothing returns nothing
set gg_trg_Bloodrush_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bloodrush_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Bloodrush_1, Condition( function Trig_Bloodrush_1_Conditions ) )
call TriggerAddAction( gg_trg_Bloodrush_1, function Trig_Bloodrush_1_Actions )
endfunction
//TESH.scrollpos=4
//TESH.alwaysfold=0
function Trig_Bloodrush_2_Conditions takes nothing returns boolean
local boolean a = GetUnitTypeId(GetAttacker()) == 'N013'
local boolean b = IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO)
local boolean c = IsUnitEnemy(GetAttacker(), GetOwningPlayer(GetTriggerUnit()))
local boolean d = GetUnitAbilityLevel(GetAttacker(),'B02K') > 0
return a and b and c and d
endfunction
function Trig_Bloodrush_2_Actions takes nothing returns nothing
local unit d
local unit c = GetAttacker()
local unit u = GetTriggerUnit()
local location p = GetUnitLoc(c)
local integer i = GetUnitAbilityLevel(c,'A0D4')
call DisableTrigger(GetTriggeringTrigger())
//
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h000', p, 0.00 )
call UnitAddAbility(d,'A0D3')
call SetUnitAbilityLevel(d, 'A0D3', i)
call IssueTargetOrder(d, "innerfire", c)
//
set d = CreateUnitAtLoc( GetOwningPlayer(u), 'h000', p, 0.00 )
call UnitAddAbility(d,'A0D3')
call SetUnitAbilityLevel(d, 'A0D3', i)
call IssueTargetOrder(d, "innerfire", u)
//
set d = null
call RemoveLocation (p)
call TriggerSleepAction(0.5)
call EnableTrigger(GetTriggeringTrigger())
endfunction
//===========================================================================
function InitTrig_Bloodrush_2 takes nothing returns nothing
set gg_trg_Bloodrush_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Bloodrush_2, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Bloodrush_2, Condition( function Trig_Bloodrush_2_Conditions ) )
call TriggerAddAction( gg_trg_Bloodrush_2, function Trig_Bloodrush_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Ethereal_Regen_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetTriggerUnit()) == 'N00L' )
endfunction
function Trig_Ethereal_Regen_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p , bj_UNIT_FACING )
call UnitAddAbility( d, 'A08X' )
call SetUnitAbilityLevel( d, 'A08X', GetHeroLevel(GetTriggerUnit()) )
call IssueTargetOrder( d, "rejuvination", GetTriggerUnit() )
call UnitAddAbility( d, 'A0BD' )
call IssueTargetOrder( d, "invisibility", GetTriggerUnit() )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Ethereal_Regen takes nothing returns nothing
set gg_trg_Ethereal_Regen = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ethereal_Regen, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ethereal_Regen, Condition( function Trig_Ethereal_Regen_Conditions ) )
call TriggerAddAction( gg_trg_Ethereal_Regen, function Trig_Ethereal_Regen_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Scream_of_Terror_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00V' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00L' ) ) then
return false
endif
return true
endfunction
function Trig_Scream_of_Terror_Func001001003 takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and IsTarget())
endfunction
function Trig_Scream_of_Terror_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local real x = 0.09 + 0.03 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0CW')
local group g = GetUnitsInRangeOfLocMatching(360.00, pc, Condition(function Trig_Scream_of_Terror_Func001001003))
local unit u
local unit d
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, (x * GetUnitMaxLife(u)), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call FadingText( ( I2S(R2I(0.09 * GetUnitMaxLife(u))) + "!" ), u, 12.00, 72.00, 0.00, 72.00, 0 )
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Scream_of_Terror takes nothing returns nothing
set gg_trg_Scream_of_Terror = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Scream_of_Terror, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Scream_of_Terror, Condition( function Trig_Scream_of_Terror_Conditions ) )
call TriggerAddAction( gg_trg_Scream_of_Terror, function Trig_Scream_of_Terror_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_SZ_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_SZ_caster))
local boolean b = not (IsUnitInGroup(GetFilterUnit(), udg_SZ_group))
return a and b and IsTarget()
endfunction
function Trig_SZ_2_Actions takes nothing returns nothing
local unit c = udg_SZ_caster
local unit d
local unit u
local location p = GetUnitLoc(udg_SZ_caster)
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_SZ_2_Filter))
local integer v = GetUnitAbilityLevel(udg_SZ_caster, 'A0CS')
local real r = GetHeroLevel(udg_SZ_caster) * 8 + 72 * v
local unit fx
if (udg_SZ_duration > 0) then
set u = FirstOfGroup(g)
if u != null then
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_SZ_caster), 'h01J', p, bj_UNIT_FACING )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_SZ_caster), 'h000', p, bj_UNIT_FACING )
call UnitAddAbility(d, 'A01F')
call SetUnitAbilityLevel( d, 'A01F', v )
call IssueTargetOrder( d, "cripple", u )
call GroupAddUnit( udg_SZ_group, u )
call UnitDamageTargetBJ( udg_SZ_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
if IsUnitType(u, UNIT_TYPE_HERO) then
// call DisplayTextToForce( GetPlayersAll(), "yeet" )
call SetUnitLife( udg_SZ_caster, GetUnitLife( udg_SZ_caster ) + 0.09 * GetUnitMaxLife(udg_SZ_caster) )
endif
endif
set udg_SZ_duration = udg_SZ_duration - 0.1
else
call DisableTrigger( gg_trg_SZ_2 )
call EnableTrigger( gg_trg_Spectral_Rush )
set udg_SZ_caster = null
loop
set u = FirstOfGroup(udg_SZ_group)
exitwhen u == null
call GroupRemoveUnit(udg_SZ_group, u)
endloop
endif
set d = null
set u = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_SZ_2 takes nothing returns nothing
set gg_trg_SZ_2 = CreateTrigger( )
call DisableTrigger( gg_trg_SZ_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_SZ_2, 0.1 )
call TriggerAddAction( gg_trg_SZ_2, function Trig_SZ_2_Actions )
endfunction
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_PR_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_PR_caster))
return a and IsTarget()
endfunction
function Trig_PR_2_Actions takes nothing returns nothing
local location pc = GetUnitLoc(udg_PR_caster)
local real angle = AngleBetweenPoints(pc, udg_PR_point)
local location p = PolarProjectionBJ(pc, 50.00, angle)
local real r = GetHeroStr(udg_PR_caster, true)*2 + 180 * I2R(GetUnitAbilityLevel( udg_PR_caster, 'A0BE' ) )
local unit d
local unit u
local integer i = 1
local location pfx
local group g = GetUnitsInRangeOfLocMatching(600.00, p, Condition(function Trig_PR_2_Filter))
if ( DistanceBetweenPoints(pc, udg_PR_point) > 100.00 and udg_PR_duration > 0 ) then
call SetUnitPositionLoc( udg_PR_caster, p )
set udg_PR_duration = udg_PR_duration - 1
else
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_PR_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
call DisableTrigger( gg_trg_PR_2 )
call SetUnitPathing( udg_PR_caster, true )
loop
//soul vfx
exitwhen i > 12
set pfx = PolarProjectionBJ( p, 300, i*30 )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PR_caster), 'h006', pfx, bj_UNIT_FACING )
call RemoveLocation (pfx)
set pfx = PolarProjectionBJ( p, 600, i*30 )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_PR_caster), 'h004', pfx, bj_UNIT_FACING )
call RemoveLocation (pfx)
set i = i + 1
endloop
endif
call RemoveLocation (p)
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_PR_2 takes nothing returns nothing
set gg_trg_PR_2 = CreateTrigger( )
call DisableTrigger( gg_trg_PR_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_PR_2, 0.03 )
call TriggerAddAction( gg_trg_PR_2, function Trig_PR_2_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function snipe_and takes nothing returns boolean
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_PN_caster))
return (a and b and IsTarget())
endfunction
function Trig_snipe_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_PN_dummy)
local location p2 = PolarProjectionBJ(p, 120.00, udg_PN_angle)
local group g = GetUnitsInRangeOfLocMatching(200.00, p, Condition(function snipe_and))
local unit u = FirstOfGroup(g)
local real r
local integer v = GetUnitAbilityLevel(udg_PN_caster, 'A065')
local unit fx
if ( u != null ) then
set r = ( 300 * v ) * (1 + udg_PN_duration * v)
//call FadingText ( I2S(R2I(r)) + "!!" ), u, 20.00, 0.00, 100.00, 0.00, 0 )
call UnitDamageTargetBJ( udg_PN_caster, u , r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_PN_caster), 'h00J', p2, 0 )
//call SetUnitScale( fx, 1.3,1.3,1.3)
set udg_PN_duration = 0.75
endif
if ( u == null or udg_PN_duration < 0.75 ) then
set udg_PN_duration = udg_PN_duration + 0.03
call SetUnitPositionLocFacingBJ( udg_PN_dummy, p2, udg_PN_angle )
else
call DisableTrigger( gg_trg_snipe_2 )
call RemoveUnit(udg_PN_dummy)
set udg_PN_caster = null
set udg_PN_dummy = null
endif
set g = null
set u = null
call RemoveLocation (p)
call RemoveLocation (p2)
endfunction
//===========================================================================
function InitTrig_snipe_2 takes nothing returns nothing
set gg_trg_snipe_2 = CreateTrigger( )
call DisableTrigger( gg_trg_snipe_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_snipe_2, 0.03 )
call TriggerAddAction( gg_trg_snipe_2, function Trig_snipe_2_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Flame_Strike_new_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0A3' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N009' ) ) then
return false
endif
return true
endfunction
function Trig_Flame_Strike_Filter takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and IsTarget())
endfunction
function Trig_Flame_Strike_new_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A0A3')*30 + R2I(0.6 * GetHeroInt(GetTriggerUnit(), true))
local unit d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h02A', pc , bj_UNIT_FACING )
//local unit u
//local group g = GetUnitsInRangeOfLocMatching(300.00, pt, Condition(function Trig_Flame_Strike_Filter))
call UnitAddAbility( d, 'A022' )
call SetUnitUserData( d, i )
call IssuePointOrderLoc( d, "flamestrike", pt )
set d = null
call RemoveLocation (pc)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Flame_Strike_new takes nothing returns nothing
set gg_trg_Flame_Strike_new = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Strike_new, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flame_Strike_new, Condition( function Trig_Flame_Strike_new_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Strike_new, function Trig_Flame_Strike_new_Actions )
endfunction
//TESH.scrollpos=36
//TESH.alwaysfold=0
function Trig_Hexagon_FB_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A024' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N009' ) ) then
return false
endif
return true
endfunction
function Trig_Hexagon_Filter takes nothing returns boolean
return (IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) and IsTarget())
endfunction
function Trig_Hexagon_FB_Actions takes nothing returns nothing
local location pt = GetUnitLoc(GetSpellTargetUnit())
local unit u
local location pu
local group g = GetUnitsInRangeOfLocMatching(900.00, pt, Condition(function Trig_Hexagon_Filter))
local integer i = 1
local location pd
local unit d
local integer i2 = GetUnitAbilityLevel(GetTriggerUnit(),'A024')
local real r = 120 + 0.6 * ( 2 + i2 ) * GetHeroInt(GetTriggerUnit(), true)
//if ( GetUnitAbilityLevel(GetTriggerUnit(), 'A067') >= 1 ) then
// call ForGroupBJ( g, function Trig_Hexagon_FB_Func001A )
//endif
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
if DistanceBetweenPoints(pt,pu) < 600 then
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
else
call UnitDamageTargetBJ( GetTriggerUnit(), u, 0.6* r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endif
call GroupRemoveUnit (g,u)
endloop
call UnitDamageTargetBJ( GetTriggerUnit(), GetSpellTargetUnit(), 0.2* r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//vfx
loop
exitwhen i > 6
set pd = PolarProjectionBJ(pt, 300.00, ( 60.00 * I2R(i) ))
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00L', pd, 0)
//call DummyCastPoint(GetTriggerUnit(), pd, pd, 'A022', i3, "flamestrike")
call RemoveLocation (pd)
set d = null
set i = i + 1
endloop
set i = 1
loop
exitwhen i > 16
set pd = PolarProjectionBJ(pt, 750.00, ( 22.50 * I2R(i) ))
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00L', pd, 0)
call SetUnitScale( d, 0.6, 0.6, 0.6 )
//call DummyCastPoint(GetTriggerUnit(), pd, pd, 'A022', i3, "flamestrike")
call RemoveLocation (pd)
set d = null
set i = i + 1
endloop
set g = null
call RemoveLocation (pu)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Hexagon_FB takes nothing returns nothing
set gg_trg_Hexagon_FB = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hexagon_FB, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Hexagon_FB, Condition( function Trig_Hexagon_FB_Conditions ) )
call TriggerAddAction( gg_trg_Hexagon_FB, function Trig_Hexagon_FB_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Rage_Decay_Actions takes nothing returns nothing
local real r = 5 + udg_RB_rage * 0.02
local real x = udg_RB_rage/GetUnitMaxLife(udg_Aaron)
local integer red = R2I(x * 250)
//
//
//call DisplayTextToForce( GetPlayersAll(), "combat timer: " + R2S(udg_RB_combat) )
//call DisplayTextToForce( GetPlayersAll(), "rage: " + R2S(udg_RB_rage) )
//
if ( GetUnitLife( udg_Aaron ) > 0 and udg_RB_rage > 0 ) then
if udg_RB_combat > 0 then
set udg_RB_combat = udg_RB_combat - 0.2
else
set udg_RB_rage = ( udg_RB_rage - r )
endif
call SetUnitLife( udg_Aaron, GetUnitLife( udg_Aaron ) + 0.2 * r )
else
call DisableTrigger( gg_trg_Rage_Decay )
set udg_RB_rage = 0
endif
call SetUnitVertexColor( udg_Aaron, 255, 255-red, 255-red, 255 )
endfunction
//===========================================================================
function InitTrig_Rage_Decay takes nothing returns nothing
set gg_trg_Rage_Decay = CreateTrigger( )
call DisableTrigger( gg_trg_Rage_Decay )
call TriggerRegisterTimerEventPeriodic( gg_trg_Rage_Decay, 0.20 )
call TriggerAddAction( gg_trg_Rage_Decay, function Trig_Rage_Decay_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_StompofRage_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02H' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H00M' ) ) then
return false
endif
return true
endfunction
function Trig_StompofRage_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return IsTarget() and a
endfunction
function Trig_StompofRage_Actions takes nothing returns nothing
local unit u
local location p = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(400.00, p, Condition(function Trig_StompofRage_Filter))
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A02H')
local real rv = GetUnitAbilityLevel(GetTriggerUnit(), 'A02I')
local real rx = 1 + GetUnitAbilityLevel(GetTriggerUnit(), 'B063') * (0.1 + 0.2 * rv)
local real r = ( 50 + 0.02 * rx * udg_RB_rage ) * ( 2.5 + v )
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit (g,u)
endloop
call RemoveLocation (p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_StompofRage takes nothing returns nothing
set gg_trg_StompofRage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_StompofRage, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_StompofRage, Condition( function Trig_StompofRage_Conditions ) )
call TriggerAddAction( gg_trg_StompofRage, function Trig_StompofRage_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Induced_Wounds_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09Y' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H00M' ) ) then
return false
endif
return true
endfunction
function Trig_Induced_Wounds_Actions takes nothing returns nothing
//local effect sp
set udg_IW_caster = GetTriggerUnit()
set udg_Aaron = GetTriggerUnit()
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_IW_2 )
//set sp = AddSpecialEffectTargetUnitBJ( "chest", GetTriggerUnit(), "Objects\\Spawnmodels\\Human\\HumanLargeDeathExplode\\HumanLargeDeathExplode.mdl" )
if ( not IsTriggerEnabled( gg_trg_Rage_Decay ) ) then
call EnableTrigger( gg_trg_Rage_Decay )
endif
//call TriggerSleepAction (2)
//call DestroyEffect (sp)
endfunction
//===========================================================================
function InitTrig_Induced_Wounds takes nothing returns nothing
set gg_trg_Induced_Wounds = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Induced_Wounds, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Induced_Wounds, Condition( function Trig_Induced_Wounds_Conditions ) )
call TriggerAddAction( gg_trg_Induced_Wounds, function Trig_Induced_Wounds_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_IW_2_Actions takes nothing returns nothing
local unit fx
local location p = GetUnitLoc(udg_IW_caster)
local real rv = GetUnitAbilityLevel(udg_IW_caster, 'A02I')
local real rx = 1 + GetUnitAbilityLevel(udg_IW_caster, 'B063') * (0.1 + 0.2 * rv)
if ( GetUnitAbilityLevel(udg_IW_caster, 'B04L') > 0 and GetUnitLife(udg_IW_caster) > 0 ) then
if GetUnitPercentLife(udg_IW_caster) > 25 then
call SetUnitLife( udg_IW_caster, GetUnitLife( udg_IW_caster ) + 0.01 * rx * GetUnitMaxLife(udg_IW_caster) )
endif
if udg_RB_rage < GetUnitMaxLife(udg_IW_caster) then
set udg_RB_rage = udg_RB_rage + 0.01 * GetUnitMaxLife(udg_IW_caster)
endif
set fx = CreateUnitAtLoc( GetOwningPlayer(udg_IW_caster), 'h002', p, bj_UNIT_FACING )
set fx = null
else
//set udg_IW_int = 0
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Induced_Wounds )
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_IW_2 takes nothing returns nothing
set gg_trg_IW_2 = CreateTrigger( )
call DisableTrigger( gg_trg_IW_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_IW_2, 0.25 )
call TriggerAddAction( gg_trg_IW_2, function Trig_IW_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Crushing_Blow_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07M' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H00M' ) ) then
return false
endif
return true
endfunction
function Trig_Crushing_Blow_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetUnitLoc(GetSpellTargetUnit())
local real r1 = 50 + 0.02 * udg_RB_rage
local real r2 = 2 + GetUnitAbilityLevel(GetTriggerUnit(), 'A07M')
local real rv = GetUnitAbilityLevel(GetTriggerUnit(), 'A02I')
local real rx = 1 + GetUnitAbilityLevel(GetTriggerUnit(), 'B063') * (0.1 + 0.2 * rv)
local real r = r1 * r2 * rv
call DisableTrigger( GetTriggeringTrigger() )
set udg_CB_angle = AngleBetweenPoints(pc, pu)
set udg_CB_target = GetSpellTargetUnit()
set udg_CB_caster = GetTriggerUnit()
set udg_CB_int = 130
call UnitDamageTargetBJ( udg_CB_caster, udg_CB_target, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call SetUnitPathing( udg_CB_target, false )
call EnableTrigger( gg_trg_CB_2 )
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Crushing_Blow takes nothing returns nothing
set gg_trg_Crushing_Blow = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Crushing_Blow, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Crushing_Blow, Condition( function Trig_Crushing_Blow_Conditions ) )
call TriggerAddAction( gg_trg_Crushing_Blow, function Trig_Crushing_Blow_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CB_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_CB_target)
local effect sp
local unit d
local location pu = PolarProjectionBJ(p, 25.00, udg_CB_angle)
local real r1 = 50 + 0.02 * udg_RB_rage
local real r2 = 2 + GetUnitAbilityLevel(udg_CB_caster, 'A07M')
local real rv = GetUnitAbilityLevel(udg_CB_caster, 'A02I')
local real rx = 1 + GetUnitAbilityLevel(udg_CB_caster, 'B063') * (0.1 + 0.2 * rv)
local real r = r1 * r2 * rv
if (udg_CB_int < 100) then
if (udg_CB_int >= 5) then
call SetUnitPositionLoc( udg_CB_target, pu )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_CB_caster), 'h01J', p , bj_UNIT_FACING )
else
call DisableTrigger( GetTriggeringTrigger() )
call SetUnitPathing( udg_CB_target, true )
set d = CreateUnitAtLoc(GetOwningPlayer(udg_CB_caster), 'h01I', p , bj_UNIT_FACING )
call UnitDamageTargetBJ( udg_CB_caster, udg_CB_target, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call EnableTrigger( gg_trg_Crushing_Blow )
endif
endif
set udg_CB_int = udg_CB_int - 5
call RemoveLocation(p)
call RemoveLocation(pu)
set d = null
endfunction
//===========================================================================
function InitTrig_CB_2 takes nothing returns nothing
set gg_trg_CB_2 = CreateTrigger( )
call DisableTrigger( gg_trg_CB_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_CB_2, 0.02 )
call TriggerAddAction( gg_trg_CB_2, function Trig_CB_2_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_RB_PDD_Conditions takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_PDD_target, GetOwningPlayer(udg_PDD_source)) == true ) ) then
return false
endif
if ( not ( udg_PDD_damageType == udg_PDD_PHYSICAL ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(udg_PDD_source, 'A02K') > 0 ) ) then
return false
endif
if ( not ( GetUnitTypeId(udg_PDD_source) == 'H00M' ) ) then
return false
endif
if ( not ( IsUnitType(udg_PDD_target, UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( udg_RB_rage > 200 ) ) then
return false
endif
return true
endfunction
function Trig_RB_PDD_Actions takes nothing returns nothing
local effect sp
local location p = GetUnitLoc(udg_PDD_target)
local real r1 = 0.2 + ( 0.2 * I2R(GetUnitAbilityLevel(udg_PDD_source, 'A02K')) )
local real r = udg_RB_rage * r1
set udg_PDD_amount = ( udg_PDD_amount + r )
call FadingText( ( "+" + I2S(R2I(r)) ), udg_PDD_source, 20.00, 90.00, 0, 0, 0 )
set udg_RB_rage = udg_RB_rage * 0.4
call CreateUnitAtLoc( GetOwningPlayer(udg_PDD_source), 'h010', p, bj_UNIT_FACING )
endfunction
//===========================================================================
function InitTrig_RB_PDD takes nothing returns nothing
set gg_trg_RB_PDD = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_RB_PDD, "udg_PDD_damageEventTrigger", EQUAL, 1.00 )
call TriggerAddCondition( gg_trg_RB_PDD, Condition( function Trig_RB_PDD_Conditions ) )
call TriggerAddAction( gg_trg_RB_PDD, function Trig_RB_PDD_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_RB_PDD_2_Conditions takes nothing returns boolean
return (GetUnitTypeId(udg_PDD_target) == 'H00M')
endfunction
function Trig_RB_PDD_2_Actions takes nothing returns nothing
set udg_Aaron = udg_PDD_target
set udg_RB_rage = udg_RB_rage + 0.2* udg_PDD_amount
if ( not IsTriggerEnabled(gg_trg_Rage_Decay) ) then
call EnableTrigger( gg_trg_Rage_Decay)
endif
endfunction
//===========================================================================
function InitTrig_RB_PDD_2 takes nothing returns nothing
set gg_trg_RB_PDD_2 = CreateTrigger( )
call TriggerRegisterVariableEvent( gg_trg_RB_PDD_2, "udg_PDD_damageEventTrigger", EQUAL, 1.00 )
call TriggerAddCondition( gg_trg_RB_PDD_2, Condition( function Trig_RB_PDD_2_Conditions ) )
call TriggerAddAction( gg_trg_RB_PDD_2, function Trig_RB_PDD_2_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Eternal_Cross_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03I' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H001' ) ) then
return false
endif
return true
endfunction
function Trig_Eternal_Cross_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pu = GetSpellTargetLoc()
local location pd
local real f = GetUnitFacing(GetTriggerUnit())
local unit d
local unit fx
local integer i = R2I(1.1 * (120 + GetUnitMissingPercentLife(GetTriggerUnit()))) * (1 + GetUnitAbilityLevel(GetTriggerUnit(), 'A03I' ))
local integer x = 1
local integer y = 1
loop
exitwhen x > 4
set y = 1
loop
exitwhen y > 4
set pd = PolarProjectionBJ (pu, x * 220, f + 90 * y)
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h023', pd, bj_UNIT_FACING )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01S', pd, bj_UNIT_FACING )
call UnitAddAbility ( d, 'A0CH' )
call SetUnitUserData( d, i )
call IssueImmediateOrder( d, "thunderclap" )
//set d = null
call RemoveLocation (pd)
set y = y + 1
endloop
set x = x + 1
endloop
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h023', pu, bj_UNIT_FACING )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01S', pu, bj_UNIT_FACING )
call UnitAddAbility ( d, 'A0CH' )
call SetUnitUserData( d, i )
call IssueImmediateOrder( d, "thunderclap" )
set d = null
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_Eternal_Cross takes nothing returns nothing
set gg_trg_Eternal_Cross = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Eternal_Cross, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Eternal_Cross, Condition( function Trig_Eternal_Cross_Conditions ) )
call TriggerAddAction( gg_trg_Eternal_Cross, function Trig_Eternal_Cross_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Call_rearguards_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'H001' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00W' ) ) then
return false
endif
return true
endfunction
function Trig_Call_rearguards_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
local unit d
local integer a = 1
local integer b = GetUnitAbilityLevel(GetTriggerUnit(), 'A00W' )
loop
set d = FirstOfGroup(udg_Royal_group)
exitwhen d == null
call KillUnit(d)
call GroupRemoveUnit( udg_Royal_group, d )
endloop
loop
exitwhen a > ( 3 + 2 * b )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00A', p, bj_UNIT_FACING )
call GroupAddUnit( udg_Royal_group, d )
call UnitApplyTimedLifeBJ( 30, 'BTLF', d )
set a = a + 1
endloop
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Call_rearguards takes nothing returns nothing
set gg_trg_Call_rearguards = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Call_rearguards, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Call_rearguards, Condition( function Trig_Call_rearguards_Conditions ) )
call TriggerAddAction( gg_trg_Call_rearguards, function Trig_Call_rearguards_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_RS_2_Actions takes nothing returns nothing
local location pc = GetUnitLoc(udg_RS_caster)
local location pu = GetUnitLoc(udg_RS_target)
local boolean dist = DistanceBetweenPoints(pc, pu) < 1200
local unit d
if ( udg_RS_int > 0 ) then
set d = CreateUnitAtLoc( GetOwningPlayer(udg_RS_caster), 'h029', pc, bj_UNIT_FACING )
if dist then
call SetUnitUserData(d, GetHeroInt(udg_RS_caster, true))
call IssueTargetOrder( d, "attack", udg_RS_target )
else
call SetUnitUserData(d, 100)
endif
else
call DisableTrigger( gg_trg_RS_2 )
endif
set udg_RS_int = udg_RS_int - 1
set d = null
call RemoveLocation(pc)
call RemoveLocation(pu)
endfunction
//===========================================================================
function InitTrig_RS_2 takes nothing returns nothing
set gg_trg_RS_2 = CreateTrigger( )
call DisableTrigger( gg_trg_RS_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_RS_2, 0.15 )
call TriggerAddAction( gg_trg_RS_2, function Trig_RS_2_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Paralyzing_Chain_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0C2' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00V' ) ) then
return false
endif
return true
endfunction
function Trig_Paralyzing_Chain_Actions takes nothing returns nothing
local unit d
local unit u = GetSpellTargetUnit()
local location p = GetUnitLoc(GetTriggerUnit())
local integer v = R2I(0.5* GetHeroInt(GetTriggerUnit(), true) + 40 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0C2'))
set d = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'h02A', p,0)
call UnitAddAbility(d, 'A06I')
call SetUnitAbilityLevel(d, 'A06I', GetUnitAbilityLevel(GetTriggerUnit(),'A0C2'))
call SetUnitUserData(d, v)
call IssueTargetOrder(d, "chainlightning", u)
call RemoveLocation(p)
set u = null
endfunction
//===========================================================================
function InitTrig_Paralyzing_Chain takes nothing returns nothing
set gg_trg_Paralyzing_Chain = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Paralyzing_Chain, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Paralyzing_Chain, Condition( function Trig_Paralyzing_Chain_Conditions ) )
call TriggerAddAction( gg_trg_Paralyzing_Chain, function Trig_Paralyzing_Chain_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_RS_ult_1_new_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A033' ) ) then
return false
endif
return true
endfunction
function Trig_RS_ult_1_new_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
set udg_Paraglaive = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00P', p, GetUnitFacing(GetTriggerUnit()) )
call UnitApplyTimedLifeBJ( 9, 'BTLF', udg_Paraglaive )
set udg_PG_caster = GetTriggerUnit()
call EnableTrigger( gg_trg_RS_ult_2_mui )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_RS_ult_1_new takes nothing returns nothing
set gg_trg_RS_ult_1_new = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_RS_ult_1_new, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_RS_ult_1_new, Condition( function Trig_RS_ult_1_new_Conditions ) )
call TriggerAddAction( gg_trg_RS_ult_1_new, function Trig_RS_ult_1_new_Actions )
endfunction
//TESH.scrollpos=24
//TESH.alwaysfold=0
function Trig_RS_ult_2_mui_Func001Func001001003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_PG_caster)) == true )
endfunction
function Trig_RS_ult_2_mui_Func001Func001001003 takes nothing returns boolean
return GetBooleanAnd( IsTarget(), Trig_RS_ult_2_mui_Func001Func001001003002() )
endfunction
function Trig_RS_ult_2_mui_Actions takes nothing returns nothing
local unit u
local unit c = udg_PG_caster
local unit d = udg_Paraglaive
local location pd = GetUnitLoc(d)
local real r = ( ( I2R(( GetHeroInt(c, true) - 75 )) * 0.12 ) + ( 5.00 * I2R(GetUnitAbilityLevel(c, 'A033')) ) )
local group g = GetUnitsInRangeOfLocMatching(200.00, pd, Condition(function Trig_RS_ult_2_mui_Func001Func001001003))
local location pc = GetUnitLoc(udg_PG_caster)
local real cap = 500 + GetHeroInt(udg_PG_caster, true)
local real speed = cap * 300 / DistanceBetweenPoints(pc, pd)
if speed > cap then
set speed = cap
endif
if speed < 200 then
set speed = 200
endif
if ( GetUnitLife(udg_Paraglaive) <= 0 ) then
call DisableTrigger( GetTriggeringTrigger() )
else
call SetUnitMoveSpeed(udg_Paraglaive, speed )
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( c, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
endif
set u = null
set c = null
set d = null
set g = null
call RemoveLocation (pd)
endfunction
//===========================================================================
function InitTrig_RS_ult_2_mui takes nothing returns nothing
set gg_trg_RS_ult_2_mui = CreateTrigger( )
call DisableTrigger( gg_trg_RS_ult_2_mui )
call TriggerRegisterTimerEventPeriodic( gg_trg_RS_ult_2_mui, 0.09 )
call TriggerAddAction( gg_trg_RS_ult_2_mui, function Trig_RS_ult_2_mui_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shadow_Storm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A05S' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01D' ) ) then
return false
endif
return true
endfunction
function Trig_Shadow_Storm_Actions takes nothing returns nothing
local location pt = GetSpellTargetLoc()
local location pc = GetUnitLoc(GetTriggerUnit())
set udg_SS_angle = AngleBetweenPoints (pc,pt)
set udg_SS_caster = GetTriggerUnit()
set udg_SS_int = 27
call EnableTrigger( gg_trg_SS_2 )
call DisableTrigger( gg_trg_Shadow_Storm )
call RemoveLocation (pc)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Shadow_Storm takes nothing returns nothing
set gg_trg_Shadow_Storm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shadow_Storm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shadow_Storm, Condition( function Trig_Shadow_Storm_Conditions ) )
call TriggerAddAction( gg_trg_Shadow_Storm, function Trig_Shadow_Storm_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_SS_2_Actions takes nothing returns nothing
local unit c = udg_SS_caster
local location pc = GetUnitLoc(udg_SS_caster)
local location pc2
local location pd
local location pt
local integer v = R2I(0.26 * GetHeroInt(udg_SS_caster, true) + 13*GetUnitAbilityLevel(udg_SS_caster,'A05S'))
local integer i = 1
local unit d
//local real z = 0.9 + 0.001 * GetHeroInt(udg_SS_caster, true)
if ( udg_SS_int > 0 and GetUnitLife(udg_SS_caster) > 0) then
if udg_SS_int == 27 or udg_SS_int == 18 or udg_SS_int == 9 then
set pc2 = PolarProjectionBJ(pc,260, udg_SS_angle-90)
loop
exitwhen i > 3
set pd = PolarProjectionBJ( pc2, 130*i, udg_SS_angle + 90 )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_SS_caster), 'h01Y', pd, udg_SS_angle )
set pt = PolarProjectionBJ( pd, 600, udg_SS_angle )
call UnitAddAbility( d,'A04T')
call SetUnitUserData( d, v )
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call RemoveLocation(pd)
call RemoveLocation(pt)
set i = i + 1
endloop
endif
set udg_SS_int = udg_SS_int - 1
else
call DisableTrigger( gg_trg_SS_2 )
call EnableTrigger( gg_trg_Shadow_Storm )
endif
call RemoveLocation(pc)
call RemoveLocation(pt)
endfunction
//===========================================================================
function InitTrig_SS_2 takes nothing returns nothing
set gg_trg_SS_2 = CreateTrigger( )
call DisableTrigger( gg_trg_SS_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_SS_2, 0.1 )
call TriggerAddAction( gg_trg_SS_2, function Trig_SS_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Dark_Divergence_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A091' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01D' ) ) then
return false
endif
return true
endfunction
function Trig_Dark_Divergence_Actions takes nothing returns nothing
local unit d
local location p = GetSpellTargetLoc()
local location pi
local integer i = 1
local real r = 160 + 40 * GetUnitAbilityLevel(GetTriggerUnit(),'A091')
set udg_DD_caster = GetTriggerUnit()
set udg_DD_point = GetSpellTargetLoc()
call TimerStart( udg_DD_timer, 1.80, false, null )
loop
exitwhen i > 18
set pi = PolarProjectionBJ(udg_DD_point, r, 20.00 * i)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h02L', pi, bj_UNIT_FACING )
set d = null
call RemoveLocation (pi)
set i = i + 1
endloop
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Dark_Divergence takes nothing returns nothing
set gg_trg_Dark_Divergence = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dark_Divergence, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dark_Divergence, Condition( function Trig_Dark_Divergence_Conditions ) )
call TriggerAddAction( gg_trg_Dark_Divergence, function Trig_Dark_Divergence_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Dark_Divergence_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_DD_caster))
return (a and IsTarget())
endfunction
function Trig_DD_2_Actions takes nothing returns nothing
local location p = udg_DD_point
local location pu
local real r = 180 + 40 * GetUnitAbilityLevel(udg_DD_caster,'A091')
local group g = GetUnitsInRangeOfLocMatching(r, p, Condition(function Trig_Dark_Divergence_Filter))
local unit u
local unit d
local integer v = GetUnitAbilityLevel(udg_DD_caster,'A091') * 26 + GetHeroBonusInt(udg_DD_caster)
call CreateUnitAtLoc( GetOwningPlayer(udg_DD_caster), 'h01T', p, bj_UNIT_FACING )
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_DD_caster), 'h01Y', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A0CB' )
call SetUnitUserData( d, v )
call IssueTargetOrder( d, "entanglingroots", u )
set d = null
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup (g)
call RemoveLocation (p)
call RemoveLocation (pu)
set udg_DD_caster = null
endfunction
//===========================================================================
function InitTrig_DD_2 takes nothing returns nothing
set gg_trg_DD_2 = CreateTrigger( )
call TriggerRegisterTimerExpireEventBJ( gg_trg_DD_2, udg_DD_timer )
call TriggerAddAction( gg_trg_DD_2, function Trig_DD_2_Actions )
endfunction
//TESH.scrollpos=17
//TESH.alwaysfold=0
function Trig_Horizon_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0BG' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01D' ) ) then
return false
endif
return true
endfunction
function Trig_Horizon_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and IsTarget() )
endfunction
function Trig_Horizon_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local location pd
local real r = AngleBetweenPoints(pc,pt)
local location pt2 = PolarProjectionBJ(pt, 1300, r - 90)
local unit d
local integer i = 1
local group g
local unit u
local integer v = 90 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0BG') + GetHeroInt(GetTriggerUnit(), true)
loop
exitwhen i > 39
set pd = PolarProjectionBJ (pt2, 0.3*Pow(i-20,2)+ 180, r)
if RAbsBJ(GetLocationX(pd)) < 3600 and RAbsBJ(GetLocationY(pd)) < 3600 then
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00F', pd , r + 1.5 * (i-18))
call SetUnitUserData(d, v)
call SetUnitLife(d, 120 + 260 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0BG'))
set d = null
endif
set pd = PolarProjectionBJ (pt2, 0.3*Pow(i-20,2)+ 180, r + 180 )
if RAbsBJ(GetLocationX(pd)) < 3600 and RAbsBJ(GetLocationY(pd)) < 3600 then
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00F', pd , r + 1.5 * (i-18))
call SetUnitUserData(d, v)
call SetUnitLife(d, 120 + 260 * GetUnitAbilityLevel(GetTriggerUnit(), 'A0BG'))
set d = null
endif
call RemoveLocation (pd)
set pt2 = PolarProjectionBJ(pt2, 65, r + 90)
set i = i + 1
endloop
call RemoveLocation (pc)
call RemoveLocation (pt2)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Horizon takes nothing returns nothing
set gg_trg_Horizon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Horizon, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Horizon, Condition( function Trig_Horizon_Conditions ) )
call TriggerAddAction( gg_trg_Horizon, function Trig_Horizon_Actions )
endfunction
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_Reaper_Blade_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09P' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N011' ) ) then
return false
endif
return true
endfunction
function Trig_Reaper_Blade_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local location pd = PolarProjectionBJ(GetUnitLoc(GetTriggerUnit()), 100.00, AngleBetweenPoints( pc, pt ))
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A05W')
set udg_SR_angle = AngleBetweenPoints( pc, pt )
set udg_SR_dummy = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01R', pd, udg_SR_angle )
set udg_SR_caster = GetTriggerUnit()
set udg_SR_int = 0
if v > 14 then
set v = 19
else
set v = v + 5
endif
call SetUnitAbilityLevel(GetTriggerUnit(), 'A05W', v )
call EnableTrigger( gg_trg_SR_2 )
call RemoveLocation(pc)
call RemoveLocation(pt)
call RemoveLocation(pd)
endfunction
//===========================================================================
function InitTrig_Reaper_Blade takes nothing returns nothing
set gg_trg_Reaper_Blade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reaper_Blade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Reaper_Blade, Condition( function Trig_Reaper_Blade_Conditions ) )
call TriggerAddAction( gg_trg_Reaper_Blade, function Trig_Reaper_Blade_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function SR_2_filter takes nothing returns boolean
local boolean a = IsTarget()
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_SR_caster))
local boolean c = IsUnitInGroup(GetFilterUnit(), udg_SR_group )
return (a and b and not c)
endfunction
function Trig_SR_2_Actions takes nothing returns nothing
local unit dd = udg_SR_dummy
local unit d
local location p = GetUnitLoc(dd)
local location pu
local group g
local unit u
local location p2 = PolarProjectionBJ(p, 45.00, GetUnitFacing(dd))
local real r = 45 * GetUnitAbilityLevel(udg_SR_caster,'A09P') + GetHeroAgi(udg_SR_caster,true) * 1.9
local effect sp
if (udg_SR_int < 30) then
set udg_SR_int = udg_SR_int + 1
call SetUnitPositionLoc( dd, p2 )
set g = GetUnitsInRangeOfLocMatching(190.00, p2, Condition(function SR_2_filter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc(GetOwningPlayer(udg_SR_caster), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility(d, 'A0BU')
//call SetUnitAbilityLevel( d, 'A0A3', GetUnitAbilityLevel(udg_SR_caster, 'A09P') )
call IssueTargetOrder( d, "slow", u )
call UnitDamageTargetBJ( udg_SR_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupAddUnit(udg_SR_group, u)
call GroupRemoveUnit(g,u)
endloop
else
call DisableTrigger( gg_trg_SR_2 )
call RemoveUnit(udg_SR_dummy)
loop
set u = FirstOfGroup(udg_SR_group)
exitwhen u == null
call GroupRemoveUnit(udg_SR_group,u)
endloop
endif
set g = null
set u = null
set d = null
set dd = null
call RemoveLocation (p)
call RemoveLocation (pu)
call RemoveLocation (p2)
endfunction
//===========================================================================
function InitTrig_SR_2 takes nothing returns nothing
set gg_trg_SR_2 = CreateTrigger( )
call DisableTrigger( gg_trg_SR_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_SR_2, 0.03 )
call TriggerAddAction( gg_trg_SR_2, function Trig_SR_2_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Hurricane_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0AB' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N011' ) ) then
return false
endif
return true
endfunction
function Trig_Hurricane_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = GetUnitAbilityLevel(GetFilterUnit(), 'B040') > 0
return a and b and IsTarget()
endfunction
function Trig_Hurricane_Actions takes nothing returns nothing
local unit u
local location p
local group g = GetUnitsInRangeOfLocMatching(380.00, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_Hurricane_Filter))
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A05W')
local real r
if v > 14 then
set v = 19
else
set v = v + 5
endif
call SetUnitAbilityLevel(GetTriggerUnit(), 'A05W', v )
loop
set u = FirstOfGroup (g)
exitwhen u == null
set r = (1 + 0.019 * GetUnitMissingPercentLife(u)) * GetHeroBonusInt(GetTriggerUnit())
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
//call UnitRemoveAbility( u, 'B040')
call GroupRemoveUnit (g,u)
endloop
endfunction
//===========================================================================
function InitTrig_Hurricane takes nothing returns nothing
set gg_trg_Hurricane = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hurricane, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Hurricane, Condition( function Trig_Hurricane_Conditions ) )
call TriggerAddAction( gg_trg_Hurricane, function Trig_Hurricane_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Shimmer_Filter1 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = GetUnitAbilityLevel(GetFilterUnit(), 'B040') > 0
local boolean c = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and b and c and IsTarget())
endfunction
function Trig_Shimmer_Filter2 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = GetUnitAbilityLevel(GetFilterUnit(), 'B040') > 0
local boolean c = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and b and IsTarget())
endfunction
function Trig_Shimmer_Filter3 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
return (a and IsTarget())
endfunction
function Trig_Shimmer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N011' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A03V' ) ) then
return false
endif
return true
endfunction
function Trig_Shimmer_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = udg_SM_target
local unit c = udg_SM_caster
local location pu
if (u != null) then
set pu = GetUnitLoc(u)
call SetUnitPositionLoc( c, pu )
call UnitDamageTargetBJ( c, u, udg_SM_real, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call FadingText( (I2S(R2I(udg_SM_real)) + "!" ), u, 10, 100, 100, 100, 0 )
//set sp = AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", pu )
endif
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set u = null
endfunction
function Trig_Shimmer_Actions takes nothing returns nothing
local timer t = CreateTimer()
local unit d
local unit u
local location pc = GetUnitLoc(GetTriggerUnit())
local real r = 100
local group g
local integer i = -10 + 40 * GetUnitAbilityLevel(GetTriggerUnit(), 'A03V')
local real rd
local real multi = 1.9
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A05W')
if v > 14 then
set v = 19
else
set v = v + 5
endif
call SetUnitAbilityLevel(GetTriggerUnit(), 'A05W', v )
loop
set g = GetUnitsInRangeOfLocMatching(r, pc, Condition(function Trig_Shimmer_Filter1))
set u = FirstOfGroup(g)
exitwhen u != null or r > 1900
set r = r + 100
endloop
if (u == null) then
set multi = 1
set r = 100
loop
set g = GetUnitsInRangeOfLocMatching(r, pc, Condition(function Trig_Shimmer_Filter2))
set u = FirstOfGroup(g)
exitwhen u != null or r > 1900
set r = r + 100
endloop
if (u == null) then
set multi = 0.9
set r = 100
loop
set g = GetUnitsInRangeOfLocMatching(r, pc, Condition(function Trig_Shimmer_Filter3))
set u = FirstOfGroup(g)
exitwhen u != null or r > 450
set r = r + 100
endloop
endif
//else
//call UnitRemoveBuffBJ( 'B040', u )
endif
set udg_SM_real = (i + GetHeroInt(GetTriggerUnit(), true)) * multi
set udg_SM_caster = GetTriggerUnit()
set udg_SM_target = u
//
call TimerStart (t, 0.3, false, function Trig_Shimmer_Blink)
//
set t = null
set u = null
call RemoveLocation (pc)
call DestroyGroup (g)
endfunction
//===========================================================================
function InitTrig_Shimmer takes nothing returns nothing
set gg_trg_Shimmer = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shimmer, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shimmer, Condition( function Trig_Shimmer_Conditions ) )
call TriggerAddAction( gg_trg_Shimmer, function Trig_Shimmer_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Cloak_and_Dagger_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03Q' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N011' ) ) then
return false
endif
return true
endfunction
function Trig_Cloak_and_Dagger_Actions takes nothing returns nothing
local integer v = GetUnitAbilityLevel(GetTriggerUnit(), 'A05W')
set v = 19
call SetUnitAbilityLevel(GetTriggerUnit(), 'A05W', v )
endfunction
//===========================================================================
function InitTrig_Cloak_and_Dagger takes nothing returns nothing
set gg_trg_Cloak_and_Dagger = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Cloak_and_Dagger, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Cloak_and_Dagger, Condition( function Trig_Cloak_and_Dagger_Conditions ) )
call TriggerAddAction( gg_trg_Cloak_and_Dagger, function Trig_Cloak_and_Dagger_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Reaper_Instinct_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetKillingUnit()) == 'N011' ) ) then
return false
endif
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel( GetKillingUnit(), 'A04V' ) > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Reaper_Instinct_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetKillingUnit())
local real r = 1 + GetUnitAbilityLevel( GetKillingUnit(), 'A04V' )
call SetUnitManaPercentBJ( GetKillingUnit(), ( GetUnitManaPercent(GetKillingUnit()) + 10 * r ) )
call AdjustPlayerStateBJ( R2I(90 * r - 80), GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD )
call CreateUnitAtLoc( GetOwningPlayer(GetKillingUnit()), 'h02J', p, 0 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Reaper_Instinct takes nothing returns nothing
set gg_trg_Reaper_Instinct = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Reaper_Instinct, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Reaper_Instinct, Condition( function Trig_Reaper_Instinct_Conditions ) )
call TriggerAddAction( gg_trg_Reaper_Instinct, function Trig_Reaper_Instinct_Actions )
endfunction
//TESH.scrollpos=68
//TESH.alwaysfold=0
function Trig_Shimmer_Func001002003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true )
endfunction
function Trig_Shimmer_Func001002003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Shimmer_Filter1 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true
local boolean c = GetUnitAbilityLevel(GetFilterUnit(), 'B040') > 0
return (a and b and c and IsTarget())
endfunction
function Trig_Shimmer_Filter2 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true
local boolean c = GetUnitAbilityLevel(GetFilterUnit(), 'B040') > 0
return (a and b and IsTarget())
endfunction
function Trig_Shimmer_Filter3 takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == true
local boolean c = GetUnitAbilityLevel(GetFilterUnit(), 'B040') > 0
return (a and IsTarget())
endfunction
function Trig_Shimmer_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N011' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A03V' ) ) then
return false
endif
return true
endfunction
function Trig_Shimmer_Actions takes nothing returns nothing
local texttag t
local unit d
local unit u
local location pc = GetUnitLoc(GetTriggerUnit())
local real r = 100
local group g
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A03V')*3 + 7
local location pu
local effect sp
local real rd
local real multi = 19
loop
set g = GetUnitsInRangeOfLocMatching(r, pc, Condition(function Trig_Shimmer_Filter1))
set u = FirstOfGroup(g)
exitwhen u != null or r > 2000
set r = r + 100
endloop
if (u == null) then
set multi = 10
set r = 100
loop
set g = GetUnitsInRangeOfLocMatching(r, pc, Condition(function Trig_Shimmer_Filter2))
set u = FirstOfGroup(g)
exitwhen u != null or r > 1000
set r = r + 100
endloop
if (u == null) then
set multi = 9
set r = 100
loop
set g = GetUnitsInRangeOfLocMatching(r, pc, Condition(function Trig_Shimmer_Filter3))
set u = FirstOfGroup(g)
exitwhen u != null or r > 1000
set r = r + 100
endloop
endif
//else
//call UnitRemoveBuffBJ( 'B040', u )
endif
call TriggerSleepAction(0)
if (u != null) then
set pu = GetUnitLoc(u)
set rd = (i + GetHeroBonusInt(GetTriggerUnit())*0.19)* multi
call SetUnitPositionLoc( GetTriggerUnit(), pu )
call UnitDamageTargetBJ( GetTriggerUnit(), u, rd, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
call FadingText( (I2S(R2I(rd)) + "!" ), u, 11, 100, 100, 100, 0 )
set sp = AddSpecialEffectLoc("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", pu )
endif
set u = null
call RemoveLocation (pu)
call RemoveLocation (pc)
call DestroyGroup (g)
call DestroyEffect (sp)
endfunction
//===========================================================================
function InitTrig_Shimmer_Copy takes nothing returns nothing
set gg_trg_Shimmer_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shimmer_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shimmer_Copy, Condition( function Trig_Shimmer_Conditions ) )
call TriggerAddAction( gg_trg_Shimmer_Copy, function Trig_Shimmer_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Tag_2_Actions takes nothing returns nothing
local texttag t
set udg_Tag_duration = ( udg_Tag_duration + 1 )
if ( udg_Tag_duration >= 25 ) then
if ( udg_Tag_duration < 30 ) then
call CreateTextTagUnitBJ( "I'm still it...", udg_Tag_dummy, 0.00, 20.00, 100.00, 100.00, 100, 0 )
set t = GetLastCreatedTextTag()
call SetTextTagPermanentBJ( t, false )
call SetTextTagVelocityBJ( t, 64, 90 )
call SetTextTagLifespanBJ( t, 5.00 )
call SetTextTagFadepointBJ( t, 1.00 )
call SetUnitManaBJ( udg_Tag_dummy, GetUnitState( udg_Tag_dummy, UNIT_STATE_MANA) * 0.5 )
else
endif
call DisableTrigger( GetTriggeringTrigger() )
call DisableTrigger( gg_trg_Tag_hit )
call EnableTrigger( gg_trg_Tag_1 )
set udg_Tag_duration = 0
call TriggerSleepAction(2)
call DestroyTextTag(t)
else
endif
endfunction
//===========================================================================
function InitTrig_Tag_2 takes nothing returns nothing
set gg_trg_Tag_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Tag_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Tag_2, 0.2 )
call TriggerAddAction( gg_trg_Tag_2, function Trig_Tag_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Tag_hit_Conditions takes nothing returns boolean
if ( not ( GetAttacker() == udg_Tag_dummy ) ) then
return false
endif
if ( not ( GetTriggerUnit() == udg_Tag_target ) ) then
return false
endif
return true
endfunction
function Trig_Tag_hit_Actions takes nothing returns nothing
local texttag t
local real r = ( 100.00 * I2R(GetUnitAbilityLevel(udg_Tag_dummy, 'A03N')) ) + 3.00 * I2R(GetHeroAgi(udg_Tag_dummy, true) - 100)
call DisableTrigger( GetTriggeringTrigger() )
set udg_Tag_duration = 30
call TriggerSleepAction( 0.35 )
call UnitDamageTargetBJ( udg_Tag_dummy, GetTriggerUnit(), r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call CreateTextTagUnitBJ( "You're It!", udg_Tag_dummy, 0.00, 20.00, 100.00, 100.00, 100, 0 )
set t = GetLastCreatedTextTag()
call SetTextTagPermanentBJ( t, false )
call SetTextTagVelocityBJ( t, 64, 90 )
call SetTextTagLifespanBJ( t, 5.00 )
call SetTextTagFadepointBJ( t, 1.00 )
call TriggerSleepAction(2)
call DestroyTextTag(t)
endfunction
//===========================================================================
function InitTrig_Tag_hit takes nothing returns nothing
set gg_trg_Tag_hit = CreateTrigger( )
call DisableTrigger( gg_trg_Tag_hit )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Tag_hit, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Tag_hit, Condition( function Trig_Tag_hit_Conditions ) )
call TriggerAddAction( gg_trg_Tag_hit, function Trig_Tag_hit_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Spectral_Purge_gui_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00P' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N008' ) ) then
return false
endif
return true
endfunction
function Trig_Spectral_Purge_gui_Filter takes nothing returns boolean
local boolean a = IsTarget()
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean c = (IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO) == false) or (GetUnitAbilityLevel(GetFilterUnit(),'B03U') > 0)
return (a and b and c)
endfunction
function Trig_Spectral_Purge_gui_Actions takes nothing returns nothing
local real r = 150.00 + ( 120.00 * I2R(GetUnitAbilityLevel(GetTriggerUnit(), 'A00P')) )
local unit u
local group g = GetUnitsInRangeOfLocMatching(300.00, GetSpellTargetLoc(), Condition(function Trig_Spectral_Purge_gui_Filter))
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Spectral_Purge_gui takes nothing returns nothing
set gg_trg_Spectral_Purge_gui = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spectral_Purge_gui, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spectral_Purge_gui, Condition( function Trig_Spectral_Purge_gui_Conditions ) )
call TriggerAddAction( gg_trg_Spectral_Purge_gui, function Trig_Spectral_Purge_gui_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Curse_Tether_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N008' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00M' ) ) then
return false
endif
return true
endfunction
function Trig_Curse_Tether_Actions takes nothing returns nothing
local real r = 4*(3+I2R(GetUnitAbilityLevel(GetTriggerUnit(),'A00M')))* (10+I2R(GetHeroLevel(GetSpellTargetUnit())))
local location pc = GetUnitLoc(udg_CT_caster)
local location pu = GetUnitLoc(udg_CT_target)
call DisableTrigger( GetTriggeringTrigger() )
set udg_CT_caster = GetTriggerUnit()
set udg_CT_target = GetSpellTargetUnit()
call AddLightningLoc( "HWPB", pc, pu )
set udg_CT_lightning = GetLastCreatedLightningBJ()
call SetLightningColorBJ( udg_CT_lightning, 1, 0.00, 1.00, 1 )
call EnableTrigger( gg_trg_CT_2 )
call TriggerSleepAction( 3.00 )
call EnableTrigger( GetTriggeringTrigger() )
if ( ( IsTriggerEnabled(gg_trg_CT_2) == true ) ) then
call DisableTrigger( gg_trg_CT_2 )
call UnitDamageTargetBJ( udg_CT_caster, udg_CT_target, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call DestroyLightningBJ( udg_CT_lightning )
call HexDO(udg_CT_caster, udg_CT_target)
call AddSpecialEffectTargetUnitBJ( "origin", udg_CT_target, "Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" )
else
endif
endfunction
//===========================================================================
function InitTrig_Curse_Tether takes nothing returns nothing
set gg_trg_Curse_Tether = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Curse_Tether, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Curse_Tether, Condition( function Trig_Curse_Tether_Conditions ) )
call TriggerAddAction( gg_trg_Curse_Tether, function Trig_Curse_Tether_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CT_2_Func001C takes nothing returns boolean
return (( GetUnitLife(udg_CT_caster) > 0 ) and ( GetUnitLife(udg_CT_target) > 0 ))
endfunction
function Trig_CT_2_Actions takes nothing returns nothing
local location pc = GetUnitLoc(udg_CT_caster)
local location pu = GetUnitLoc(udg_CT_target)
if ( Trig_CT_2_Func001C() and DistanceBetweenPoints(pc,pu) < 600) then
call MoveLightningLoc( udg_CT_lightning, pc, pu )
else
call DestroyLightning( udg_CT_lightning )
call UnitRemoveAbility(udg_CT_target, 'B00R')
call DisableTrigger( gg_trg_CT_2 )
endif
call RemoveLocation (pc)
call RemoveLocation (pu)
endfunction
//===========================================================================
function InitTrig_CT_2 takes nothing returns nothing
set gg_trg_CT_2 = CreateTrigger( )
call DisableTrigger( gg_trg_CT_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_CT_2, 0.03 )
call TriggerAddAction( gg_trg_CT_2, function Trig_CT_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Hex_Barrier_Conditions takes nothing returns boolean
return ( GetUnitAbilityLevel(GetTriggerUnit(), 'B02U') > 0 )
endfunction
function Trig_Hex_Barrier_Actions takes nothing returns nothing
call HexDO(GetTriggerUnit(),GetAttacker())
endfunction
//===========================================================================
function InitTrig_Hex_Barrier takes nothing returns nothing
set gg_trg_Hex_Barrier = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hex_Barrier, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Hex_Barrier, Condition( function Trig_Hex_Barrier_Conditions ) )
call TriggerAddAction( gg_trg_Hex_Barrier, function Trig_Hex_Barrier_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_ED2_Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevel(udg_ED_caster, 'B00Q') > 0 ) ) then
return false
endif
if ( not ( GetUnitLife(udg_ED_target) > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_ED2_Actions takes nothing returns nothing
local integer stat = 1+ GetUnitAbilityLevel(udg_ED_caster, 'A00Q' )
if ( Trig_ED2_Func001C() ) then
set udg_ED_int = ( udg_ED_int + 1 )
if ( GetUnitLife(udg_ED_target) < 200 ) then
call UnitDamageTargetBJ( udg_ED_caster, udg_ED_target, 1000.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endif
if ( GetHeroStr(udg_ED_target, false) > 10 ) then
call ModifyHeroStat( bj_HEROSTAT_STR, udg_ED_target, bj_MODIFYMETHOD_SUB, stat )
set udg_ED_attribute[1] = udg_ED_attribute[1] + stat
endif
if ( GetHeroAgi(udg_ED_target, false) > 10 ) then
call ModifyHeroStat( bj_HEROSTAT_AGI, udg_ED_target, bj_MODIFYMETHOD_SUB, stat )
set udg_ED_attribute[2] = udg_ED_attribute[2] + stat
endif
if ( GetHeroInt(udg_ED_target, false) > 10 ) then
call ModifyHeroStat( bj_HEROSTAT_INT, udg_ED_target, bj_MODIFYMETHOD_SUB, stat )
set udg_ED_attribute[3] = udg_ED_attribute[3] + stat
endif
else
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 10.00 )
call ModifyHeroStat( bj_HEROSTAT_STR, udg_ED_target, bj_MODIFYMETHOD_ADD, udg_ED_attribute[1] )
call ModifyHeroStat( bj_HEROSTAT_AGI, udg_ED_target, bj_MODIFYMETHOD_ADD, udg_ED_attribute[2] )
call ModifyHeroStat( bj_HEROSTAT_INT, udg_ED_target, bj_MODIFYMETHOD_ADD, udg_ED_attribute[3] )
set udg_ED_int = 0
endif
endfunction
//===========================================================================
function InitTrig_ED2 takes nothing returns nothing
set gg_trg_ED2 = CreateTrigger( )
call DisableTrigger( gg_trg_ED2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_ED2, 0.20 )
call TriggerAddAction( gg_trg_ED2, function Trig_ED2_Actions )
endfunction
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_Flash_Cripple_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01E' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00D' ) ) then
return false
endif
return true
endfunction
function Trig_FK_Blink takes nothing returns nothing
local timer t = GetExpiredTimer()
local location p = udg_FK_point
call SetUnitPositionLoc( udg_FK_caster, p )
call PauseTimer(t)
call DestroyTimer(t)
call RemoveLocation (p)
//call DisplayTextToForce( GetPlayersAll(), R2S(GetLocationX(p)) )
set t = null
endfunction
function Trig_Flash_Cripple_Actions takes nothing returns nothing
local timer t = CreateTimer()
local location p = GetUnitLoc(GetSpellTargetUnit())
set udg_FK_caster = GetTriggerUnit()
set udg_FK_point = p
call TimerStart (t, 0.3, false, function Trig_FK_Blink)
set t = null
//call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Flash_Cripple takes nothing returns nothing
set gg_trg_Flash_Cripple = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flash_Cripple, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flash_Cripple, Condition( function Trig_Flash_Cripple_Conditions ) )
call TriggerAddAction( gg_trg_Flash_Cripple, function Trig_Flash_Cripple_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Devious_Light_Conditions takes nothing returns boolean
local real r = 18 + 8 * GetUnitAbilityLevel(GetTriggerUnit(), 'A03R')
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00D' ) ) then
return false
endif
if ( not ( GetUnitAbilityLevel(GetTriggerUnit(), 'A03R') > 0 ) ) then
return false
endif
if ( GetSpellAbilityId() == 'A01H' ) then
set r = 100
endif
return (GetRandomInt(1, 100) < r)
endfunction
function Trig_Devious_Light_Actions takes nothing returns nothing
local unit d
local unit c = GetTriggerUnit()
local location p = GetUnitLoc(c)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Devious_Light takes nothing returns nothing
set gg_trg_Devious_Light = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Devious_Light, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Devious_Light, Condition( function Trig_Devious_Light_Conditions ) )
call TriggerAddAction( gg_trg_Devious_Light, function Trig_Devious_Light_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Arclight_Renewal_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01H' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00D' ) ) then
return false
endif
return true
endfunction
function Trig_Arclight_Renewal_Actions takes nothing returns nothing
call SetUnitPercentLife( GetTriggerUnit(), 50 + 0.5 * GetUnitPercentLife(GetTriggerUnit()))
endfunction
//===========================================================================
function InitTrig_Arclight_Ruination takes nothing returns nothing
set gg_trg_Arclight_Ruination = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Arclight_Ruination, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Arclight_Ruination, Condition( function Trig_Arclight_Renewal_Conditions ) )
call TriggerAddAction( gg_trg_Arclight_Ruination, function Trig_Arclight_Renewal_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Shuriken_Petalstorm_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0CY' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00D' ) ) then
return false
endif
return true
endfunction
function Trig_Shuriken_Petalstorm_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
set udg_XP_caster = GetTriggerUnit()
set udg_XP_int = 0
set udg_XP_duration = 3.00
//call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_XP_2 )
call RemoveLocation (p)
//call SetUnitPercentLife( GetTriggerUnit(), 50 + 0.5 * GetUnitPercentLife(GetTriggerUnit()))
endfunction
//===========================================================================
function InitTrig_Shuriken_Petalstorm takes nothing returns nothing
set gg_trg_Shuriken_Petalstorm = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Shuriken_Petalstorm, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Shuriken_Petalstorm, Condition( function Trig_Shuriken_Petalstorm_Conditions ) )
call TriggerAddAction( gg_trg_Shuriken_Petalstorm, function Trig_Shuriken_Petalstorm_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_XP_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_XP_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and IsTarget())
endfunction
function Trig_XP_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_XP_caster)
local unit u
local unit d
local location pn
local integer n = 1
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_XP_2_Filter))
local integer i = GetUnitAbilityLevel(udg_XP_caster,'A0CY')*40
local real r = GetHeroInt(udg_XP_caster, true) * 0.3 + i
if (udg_XP_duration > 0 and GetUnitLife(udg_XP_caster) > 0) then
loop
exitwhen n > 4
set pn = PolarProjectionBJ(p, 240, n * 90 + 18 * udg_XP_int )
set d = CreateUnitAtLoc( GetOwningPlayer(udg_XP_caster), 'h013', pn, bj_UNIT_FACING )
call SetUnitScale( d, 0.1, 0.1, 0.1 )
call RemoveLocation (pn)
set n = n + 1
endloop
// call SetUnitPositionLoc(udg_XP_int, p)
set udg_XP_int = udg_XP_int + 1
if udg_XP_int == 5 then
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_XP_caster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
//call SetUnitLife(udg_XP_caster, GetUnitLife(udg_XP_caster) + 0.09 * r)
call GroupRemoveUnit (g,u)
endloop
set udg_XP_int = 0
endif
set udg_XP_duration = udg_XP_duration - 0.06
else
call DisableTrigger( gg_trg_XP_2 )
endif
call RemoveLocation (p)
//call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_XP_2 takes nothing returns nothing
set gg_trg_XP_2 = CreateTrigger( )
call DisableTrigger( gg_trg_XP_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_XP_2, 0.06 )
call TriggerAddAction( gg_trg_XP_2, function Trig_XP_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Critical_Damping_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00X' ) ) then
return false
endif
return true
endfunction
function Trig_Critical_Damping_Actions takes nothing returns nothing
set udg_Yiting = GetTriggerUnit()
set udg_CD_int = 11
if ( not IsTriggerEnabled(gg_trg_CD_2) ) then
call EnableTrigger( gg_trg_CD_2 )
endif
endfunction
//===========================================================================
function InitTrig_Critical_Damping takes nothing returns nothing
set gg_trg_Critical_Damping = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Critical_Damping, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Critical_Damping, Condition( function Trig_Critical_Damping_Conditions ) )
call TriggerAddAction( gg_trg_Critical_Damping, function Trig_Critical_Damping_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_CD_2_Actions takes nothing returns nothing
local real r = (110 + GetUnitMissingPercentMana(udg_Yiting))* (1 + 0.48 * GetHeroLevel(udg_Yiting)) * 0.01
if ( udg_CD_int > 0 and GetUnitLife( udg_Yiting ) > 0) then
call SetUnitState( udg_Yiting, UNIT_STATE_MANA, GetUnitState(udg_Yiting, UNIT_STATE_MANA) + r )
call SetUnitLife( udg_Yiting, GetUnitLife( udg_Yiting ) + 2.6 * r )
//call FadingText( "+", udg_Yiting, 11.00, 74, 74, 89, 0 )
set udg_CD_int = ( udg_CD_int - 1 )
else
call DisableTrigger( GetTriggeringTrigger() )
set udg_CD_int = 0
endif
//call DisplayTextToForce( GetPlayersAll(), I2S(udg_CD_int) )
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
endfunction
//===========================================================================
function InitTrig_CD_2 takes nothing returns nothing
set gg_trg_CD_2 = CreateTrigger( )
call DisableTrigger( gg_trg_CD_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_CD_2, 0.26 )
call TriggerAddAction( gg_trg_CD_2, function Trig_CD_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Drizzling_Wave_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00H' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00X' ) ) then
return false
endif
return true
endfunction
function Trig_Drizzling_Wave_Actions takes nothing returns nothing
local integer i = R2I(GetHeroInt(GetTriggerUnit(), true)*0.04) + GetUnitAbilityLevel(GetTriggerUnit(),'A00H')*10
local location p = GetUnitLoc(GetTriggerUnit())
local location pt = GetSpellTargetLoc()
local unit d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01Y', p , bj_UNIT_FACING )
local unit d2
call UnitAddAbility(d, 'A03U')
call SetUnitUserData( d, i )
call IssuePointOrderLoc( d, "carrionswarm", pt )
set d = null
call RemoveLocation (p)
call RemoveLocation (pt)
endfunction
//===========================================================================
function InitTrig_Drizzling_Wave takes nothing returns nothing
set gg_trg_Drizzling_Wave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Drizzling_Wave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Drizzling_Wave, Condition( function Trig_Drizzling_Wave_Conditions ) )
call TriggerAddAction( gg_trg_Drizzling_Wave, function Trig_Drizzling_Wave_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Water_star_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03C' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N00X' ) ) then
return false
endif
return true
endfunction
function Trig_Water_star_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
set udg_Starcaster = GetTriggerUnit()
set udg_Starcount = ( GetUnitAbilityLevel(GetTriggerUnit(), 'A03C' ) * 2 + 3 )
set udg_Starpoint = GetUnitLoc(GetTriggerUnit())
set udg_Starpoint2 = GetSpellTargetLoc()
call EnableTrigger( gg_trg_Water_star_2 )
endfunction
//===========================================================================
function InitTrig_Water_star takes nothing returns nothing
set gg_trg_Water_star = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Water_star, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Water_star, Condition( function Trig_Water_star_Conditions ) )
call TriggerAddAction( gg_trg_Water_star, function Trig_Water_star_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Water_star_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Starcaster))
return (a and IsTarget() )
endfunction
function Trig_Water_star_2_Actions takes nothing returns nothing
local group g
local unit d
local unit u
local location pd
local real r = 90 * GetUnitAbilityLevel(udg_Starcaster, 'A03C') + 0.55 * (GetHeroInt(udg_Starcaster,true))
local real angle = AngleBetweenPoints(udg_Starpoint, udg_Starpoint2)
set udg_Starcount2 = ( udg_Starcount2 + 1 )
if ( udg_Starcount2 < udg_Starcount ) then
set pd = PolarProjectionBJ(udg_Starpoint, 200.00 * udg_Starcount2, angle)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_Starcaster), 'h00R', pd, bj_UNIT_FACING )
set g = GetUnitsInRangeOfLocMatching(200.00, pd, Condition(function Trig_Water_star_2_Filter))
loop
set u = FirstOfGroup (g)
exitwhen u == null
call UnitDamageTargetBJ( udg_Starcaster, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit (g,u)
endloop
call RemoveLocation (pd)
else
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Water_star )
set udg_Starcaster = null
set udg_Starcount2 = 0
endif
endfunction
//===========================================================================
function InitTrig_Water_star_2 takes nothing returns nothing
set gg_trg_Water_star_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Water_star_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Water_star_2, 0.26 )
call TriggerAddAction( gg_trg_Water_star_2, function Trig_Water_star_2_Actions )
endfunction
//TESH.scrollpos=32
//TESH.alwaysfold=0
function Trig_Cosmic_Meteor_2_GroupFilter takes nothing returns boolean
local location p = GetUnitLoc(GetFilterUnit())
local boolean a = IsUnitEnemy( GetFilterUnit(), GetOwningPlayer(udg_CM_caster))
local boolean b = DistanceBetweenPoints( udg_CM_point, p ) > 260.00
call RemoveLocation (p)
return a and b and IsTarget()
endfunction
function Trig_Cosmic_Meteor_2_Actions takes nothing returns nothing
local integer i = 1
local integer j = 1
local integer k = 1
local unit d
local location p
local location pu
local real r
local unit u
local group g = GetUnitsInRangeOfLocMatching(520.00, udg_CM_point, Condition(function Trig_Cosmic_Meteor_2_GroupFilter))
local real damage = 520.00 * GetUnitAbilityLevel(udg_CM_caster, 'A02D') + 2.6 * GetHeroInt(udg_CM_caster,true)
set udg_CM_int = ( udg_CM_int + 1 )
// insert above code
if ( udg_CM_int < 25 ) then
loop
exitwhen j > 18
set r = ( 100.00 - ( ( 100.00 / 25.00 ) * I2R(udg_CM_int) ) )
call SetUnitScalePercent( udg_CM_indicator[j], r, r, 100 )
set j = j + 1
endloop
else
set udg_CM_int = 0
loop
exitwhen k > 18
set p = PolarProjectionBJ(udg_CM_point, 400, k *20)
set d = CreateUnitAtLoc( GetOwningPlayer(udg_CM_caster), 'h00E', p, bj_UNIT_FACING )
call RemoveUnit( udg_CM_indicator[k] )
call RemoveLocation (p)
set k = k + 1
endloop
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
call UnitDamageTargetBJ( udg_CM_caster, u, damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', pu, bj_UNIT_FACING )
call UnitAddAbility( d, 'A05E' )
call IssueTargetOrder( d, "firebolt", u )
set d = null
call FadingText( I2S(R2I(damage)) + "!", u, 11.00, 74, 74, 89, 0 )
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Cosmic_Meteor )
endif
set g = null
endfunction
//===========================================================================
function InitTrig_Cosmic_Meteor_2 takes nothing returns nothing
set gg_trg_Cosmic_Meteor_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Cosmic_Meteor_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Cosmic_Meteor_2, 0.05 )
call TriggerAddAction( gg_trg_Cosmic_Meteor_2, function Trig_Cosmic_Meteor_2_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Time_Dilation_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A006' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N002' ) ) then
return false
endif
return true
endfunction
function Trig_Time_Dilation_Actions takes nothing returns nothing
local location pc = GetUnitLoc(GetTriggerUnit())
set udg_TD_agility = 26 * GetUnitAbilityLevel(GetTriggerUnit(), 'A006')
call DisableTrigger( GetTriggeringTrigger() )
//call SetBlightRadiusLocBJ( true, GetOwningPlayer(GetTriggerUnit()), pc, 400.00 )
set udg_TD_unit = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00X', pc, bj_UNIT_FACING )
call SetUnitVertexColor( udg_TD_unit, 255, 255, 255, 130 )
set udg_TD_origin = pc
set udg_TD_elapsed = 0
set udg_TD_caster = GetTriggerUnit()
call SetHeroAgi(GetTriggerUnit(), GetHeroAgi(GetTriggerUnit(),false) + udg_TD_agility, true)
call SetUnitMoveSpeed( udg_TD_caster, 700.00 )
call SetUnitAbilityLevel( udg_TD_unit, 'S001', GetUnitAbilityLevel(GetTriggerUnit(), 'A006' ) )
//call SetUnitTimeScalePercent( udg_TD_caster, 200.00 )
call EnableTrigger( gg_trg_Time_Dilation_2 )
endfunction
//===========================================================================
function InitTrig_Time_Dilation takes nothing returns nothing
set gg_trg_Time_Dilation = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Dilation, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Time_Dilation, Condition( function Trig_Time_Dilation_Conditions ) )
call TriggerAddAction( gg_trg_Time_Dilation, function Trig_Time_Dilation_Actions )
endfunction
//TESH.scrollpos=14
//TESH.alwaysfold=0
function Trig_Time_Dilation_2_boolean takes nothing returns boolean
local location pc = GetUnitLoc(udg_TD_caster)
local boolean a = udg_TD_elapsed <= 130
local boolean b = DistanceBetweenPoints(pc, udg_TD_origin) < 700.00
local boolean c = GetUnitLife(udg_TD_caster) > 0
call RemoveLocation (pc)
return (a and b and c)
endfunction
function Trig_Time_Dilation_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_TD_caster))
return (a and IsTarget())
endfunction
function Trig_Time_Dilation_2_Func004A takes nothing returns nothing
call SetUnitTimeScalePercent( GetEnumUnit(), 100.00 )
endfunction
function Trig_Time_Dilation_2_Func005A takes nothing returns nothing
call SetUnitTimeScalePercent( GetEnumUnit(), 40.00 )
endfunction
function Trig_Time_Dilation_2_Actions takes nothing returns nothing
local location pc = GetUnitLoc(udg_TD_unit)
set udg_TD_elapsed = ( udg_TD_elapsed + 1 )
if ( not Trig_Time_Dilation_2_boolean() ) then
call SetUnitMoveSpeed( udg_TD_caster, GetUnitDefaultMoveSpeed(udg_TD_caster) )
call RemoveUnit( udg_TD_unit )
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Time_Dilation )
set udg_TD_elapsed = 0
//call SetUnitTimeScalePercent( udg_TD_caster, 100.00 )
call SetHeroAgi(udg_TD_caster, GetHeroAgi(udg_TD_caster,false) - udg_TD_agility, true)
else
endif
if GetUnitLife(udg_TD_unit) < 100 then
set udg_TD_unit = CreateUnitAtLoc( GetOwningPlayer(udg_TD_caster), 'h00X', udg_TD_origin, bj_UNIT_FACING )
call SetUnitAbilityLevel( udg_TD_unit, 'S001', GetUnitAbilityLevel(udg_TD_caster, 'A006' ) )
call SetUnitVertexColor( udg_TD_unit, 255, 255, 255, 130 )
endif
set udg_TD_slowgroup[udg_TD_elapsed] = GetUnitsInRangeOfLocMatching(700.00, udg_TD_origin, Condition(function Trig_Time_Dilation_2_Filter))
call ForGroupBJ( udg_TD_slowgroup[( udg_TD_elapsed - 1 )], function Trig_Time_Dilation_2_Func004A )
call ForGroupBJ( udg_TD_slowgroup[udg_TD_elapsed], function Trig_Time_Dilation_2_Func005A )
call RemoveLocation (pc)
endfunction
//===========================================================================
function InitTrig_Time_Dilation_2 takes nothing returns nothing
set gg_trg_Time_Dilation_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Time_Dilation_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Time_Dilation_2, 0.1 )
call TriggerAddAction( gg_trg_Time_Dilation_2, function Trig_Time_Dilation_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Poetry_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0AE' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01F' ) ) then
return false
endif
return true
endfunction
function Trig_Poetry_Actions takes nothing returns nothing
local location p
local integer x = 1
local unit d
local integer i2 = R2I(GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_MANA)*0.0025)
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A0AE') * 7 + i2
loop
exitwhen x > 4
call TriggerSleepAction (1)
set p = GetUnitLoc(GetTriggerUnit())
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01T', p , bj_UNIT_FACING )
call UnitAddAbility( d, 'A0AF' )
call SetUnitAbilityLevel(d, 'A0AF', i )
call IssueImmediateOrder( d, "thunderclap" )
set d = null
set x = x + 1
endloop
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Poetry takes nothing returns nothing
set gg_trg_Poetry = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Poetry, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Poetry, Condition( function Trig_Poetry_Conditions ) )
call TriggerAddAction( gg_trg_Poetry, function Trig_Poetry_Actions )
endfunction
//TESH.scrollpos=11
//TESH.alwaysfold=0
function Trig_Death_Vessel_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A025' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01F' ) ) then
return false
endif
return true
endfunction
function Trig_Death_Vessel_Func005001003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction
function Trig_Death_Vessel_Func005001003 takes nothing returns boolean
return GetBooleanAnd( IsTarget(), Trig_Death_Vessel_Func005001003002() )
endfunction
function Trig_Death_Vessel_Actions takes nothing returns nothing
local real r1 = 4 * GetUnitAbilityLevel(GetTriggerUnit(), 'A025')
local real r2 = 0.01 * (GetUnitMaxLife(GetTriggerUnit()) - GetUnitLife(GetTriggerUnit()))
local real r3 = 0.01 * GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_MANA)
local real r = r2 * ( 36 + r1 + 0.4 * r3 )
local location p = GetUnitLoc(GetTriggerUnit())
//call DisplayTextToForce( GetPlayersAll(), R2S(r) )
call DisableTrigger( GetTriggeringTrigger() )
set udg_DV_caster = GetTriggerUnit()
set udg_DV_real = r
set udg_DV_int = 100
call SetUnitLife( udg_DV_caster, ( GetUnitLife(udg_DV_caster) + udg_DV_real ) )
set udg_DV_dummy = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h000', p, bj_UNIT_FACING )
call EnableTrigger( gg_trg_Death_Vessel_2 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Death_Vessel takes nothing returns nothing
set gg_trg_Death_Vessel = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Death_Vessel, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Death_Vessel, Condition( function Trig_Death_Vessel_Conditions ) )
call TriggerAddAction( gg_trg_Death_Vessel, function Trig_Death_Vessel_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Death_Vessel_2_Actions takes nothing returns nothing
local real r = udg_DV_real * 0.01
if ( udg_DV_int > 0 and GetUnitLife(udg_DV_caster) > 0 ) then
call SetUnitLife( udg_DV_caster, ( GetUnitLife(udg_DV_caster) + r ) )
call UnitDamageTargetBJ( udg_DV_dummy, udg_DV_caster, r*2, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
set udg_DV_int = udg_DV_int - 1
else
set udg_DV_dummy = null
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Death_Vessel )
endif
endfunction
//===========================================================================
function InitTrig_Death_Vessel_2 takes nothing returns nothing
set gg_trg_Death_Vessel_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Death_Vessel_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Death_Vessel_2, 0.03 )
call TriggerAddAction( gg_trg_Death_Vessel_2, function Trig_Death_Vessel_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Morbid_Elegy_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01F' ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A0AG' ) ) then
return false
endif
return true
endfunction
function Trig_Morbid_Elegy_Actions takes nothing returns nothing
local unit u = GetSpellTargetUnit()
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A0AG') * 70
local real r = GetUnitState(GetTriggerUnit(), UNIT_STATE_MAX_MANA) * 0.09
call SetUnitState( u ,UNIT_STATE_MANA, GetUnitState( u , UNIT_STATE_MANA) - (i+r)*0.4)
call UnitDamageTargetBJ( GetTriggerUnit(), u, i+r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call FadingText( (I2S(R2I(i+r)) + "!" ), u, 13.00, 100, 80, 100, 0 )
endfunction
//===========================================================================
function InitTrig_Morbid_Elegy takes nothing returns nothing
set gg_trg_Morbid_Elegy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Morbid_Elegy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Morbid_Elegy, Condition( function Trig_Morbid_Elegy_Conditions ) )
call TriggerAddAction( gg_trg_Morbid_Elegy, function Trig_Morbid_Elegy_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Calamity_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A07I' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01F' ) ) then
return false
endif
return true
endfunction
function Trig_Calamity_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
set udg_AS_caster = GetTriggerUnit()
set udg_AS_dummy = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01H', p, bj_UNIT_FACING )
set udg_AS_duration = 13.00
call SetUnitScale( GetTriggerUnit(), 1.3, 1.3, 1.3 )
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Calamity_2 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Calamity takes nothing returns nothing
set gg_trg_Calamity = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Calamity, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Calamity, Condition( function Trig_Calamity_Conditions ) )
call TriggerAddAction( gg_trg_Calamity, function Trig_Calamity_Actions )
endfunction
//TESH.scrollpos=12
//TESH.alwaysfold=0
function Trig_Calamity_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_AS_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and b and IsTarget())
endfunction
function Trig_Calamity_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_AS_caster)
local unit u
local group g = GetUnitsInRangeOfLocMatching(900.00, p, Condition(function Trig_Calamity_2_Filter))
local integer i = GetUnitAbilityLevel(udg_AS_caster,'A08C')*40
local real r = (i + 0.04* GetUnitMaxMana(udg_AS_caster))*0.05
if (udg_AS_duration > 0 and GetUnitLife(udg_AS_caster) > 0) then
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( udg_AS_caster, u, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
call SetUnitLife(udg_AS_caster, GetUnitLife(udg_AS_caster) + 0.09 * r)
call GroupRemoveUnit (g,u)
endloop
call SetUnitPositionLoc(udg_AS_dummy, p)
set udg_AS_duration = udg_AS_duration - 0.05
else
call SetUnitScale( udg_AS_caster, 0.9, 0.9, 0.9 )
call DisableTrigger( gg_trg_Calamity_2 )
call EnableTrigger( gg_trg_Calamity )
call KillUnit(udg_AS_dummy)
endif
call RemoveLocation (p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Calamity_2 takes nothing returns nothing
set gg_trg_Calamity_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Calamity_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Calamity_2, 0.05 )
call TriggerAddAction( gg_trg_Calamity_2, function Trig_Calamity_2_Actions )
endfunction
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Puncture_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N016' ) ) then
return false
endif
return true
endfunction
function Trig_Puncture_Actions takes nothing returns nothing
local unit d
local integer v = GetHeroLevel(GetTriggerUnit()) + 7 * GetUnitAbilityLevel(GetTriggerUnit(), 'A001')
local location p = GetUnitLoc(GetSpellTargetUnit())
local effect fx
set d = CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'h000', p, 0)
call UnitAddAbility( d, 'A020' )
call SetUnitAbilityLevel(d, 'A020', v)
set fx = AddSpecialEffectLoc( "Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl", p )
call IssueImmediateOrder( d, "thunderclap" )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Puncture takes nothing returns nothing
set gg_trg_Puncture = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Puncture, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Puncture, Condition( function Trig_Puncture_Conditions ) )
call TriggerAddAction( gg_trg_Puncture, function Trig_Puncture_Actions )
endfunction
//TESH.scrollpos=30
//TESH.alwaysfold=0
function Trig_Flash_Fire_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01J' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N007' ) ) then
return false
endif
return true
endfunction
function Trig_Flash_Fire_Func001 takes nothing returns boolean
return (( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true ) and (IsTarget()))
endfunction
function Trig_Flash_Fire_Actions takes nothing returns nothing
local unit d
local location p = GetSpellTargetLoc()
local group g = GetUnitsInRangeOfLocMatching(300.00, p, Condition(function Trig_Flash_Fire_Func001))
local unit u
local location pu
local real r1 = GetUnitLife(GetTriggerUnit())*0.12
local real r = (GetHeroLevel(GetTriggerUnit())+25)*0.02 * r1
call SetUnitLife(GetTriggerUnit(),GetUnitLife(GetTriggerUnit())*0.88)
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01A', pu, bj_UNIT_FACING )
//call UnitAddAbility( d, 'A064' )
//call SetUnitAbilityLevel( d, 'A064', i )
//call IssueTargetOrder( d, "curse", u )
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
//call FadingText( I2S(R2I(r)) + "!", u, 9.80, 70, 30, 30, 0 )
set d = null
call RemoveLocation (pu)
call GroupRemoveUnit(g,u)
endloop
call FadingText( I2S(R2I(r)) + "!", GetTriggerUnit(), 9.80, 70, 30, 30, 0 )
set d = null
call DestroyGroup (g)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Flash_Fire takes nothing returns nothing
set gg_trg_Flash_Fire = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flash_Fire, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flash_Fire, Condition( function Trig_Flash_Fire_Conditions ) )
call TriggerAddAction( gg_trg_Flash_Fire, function Trig_Flash_Fire_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Flame_Contrary_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'B05G') > 0
endfunction
function Trig_Flame_Contrary_Actions takes nothing returns nothing
local unit d
local location p = GetUnitLoc(GetTriggerUnit())
local real x = 0.05 + 0.05 * GetUnitAbilityLevel(udg_FY_caster, 'A0C7')
local real r = GetUnitLife(udg_FY_caster) * x
set d = CreateUnitAtLoc( GetOwningPlayer(udg_FY_caster), 'h01A', p, bj_UNIT_FACING )
call UnitDamageTargetBJ( udg_FY_caster, GetTriggerUnit(), r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
call FadingText( I2S(R2I(r)) + "!", GetTriggerUnit(), 12, 70, 30, 30, 0 )
set d = null
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Flame_Contrary takes nothing returns nothing
set gg_trg_Flame_Contrary = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Contrary, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flame_Contrary, Condition( function Trig_Flame_Contrary_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Contrary, function Trig_Flame_Contrary_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Radiant_Flame_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03K' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N007' ) ) then
return false
endif
return true
endfunction
function Trig_Radiant_Flame_Actions takes nothing returns nothing
//local unit d
//local unit c = GetTriggerUnit()
//local location p = GetUnitLoc(c)
local integer i = GetUnitAbilityLevel(GetTriggerUnit(), 'A03K')
//local integer v = R2I(0.006 * GetUnitMaxLife(c)) + 12 * i
set udg_RF_caster = GetTriggerUnit()
set udg_RF_duration = i + 2
call EnableTrigger( gg_trg_RF_2 )
//call DisplayTextToForce( GetPlayersAll(), I2S(v) )
//call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_Radiant_Flame takes nothing returns nothing
set gg_trg_Radiant_Flame = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Radiant_Flame, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Radiant_Flame, Condition( function Trig_Radiant_Flame_Conditions ) )
call TriggerAddAction( gg_trg_Radiant_Flame, function Trig_Radiant_Flame_Actions )
endfunction
//TESH.scrollpos=21
//TESH.alwaysfold=0
function Trig_RF_2_Filter takes nothing returns boolean
local boolean a = IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_RF_caster))
local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and b and IsTarget())
endfunction
function Trig_RF_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_RF_caster)
local unit fx
local location pu
//local integer v = GetUnitAbilityLevel(udg_RF_caster, 'A03K')
local unit u
local group g = GetUnitsInRangeOfLocMatching(600, p, Condition(function Trig_RF_2_Filter))
//local real rx = 0.12 + 0.06 * v
local real r = (0.03 * GetUnitLife(udg_RF_caster))
if (udg_RF_duration > 0 and GetUnitLife(udg_RF_caster) > 0) then
loop
set u = FirstOfGroup(g)
exitwhen u == null
set pu = GetUnitLoc(u)
call SetUnitLife(u, GetUnitLife(u) + r)
set fx = CreateUnitAtLoc(GetOwningPlayer(udg_RF_caster), 'h02B', pu, 0 )
call GroupRemoveUnit (g,u)
set fx = null
call RemoveLocation (pu)
endloop
call FadingText( "+" + I2S(R2I(r)), udg_RF_caster, 9.80, 70, 30, 30, 0 )
//call SetUnitPositionLoc(udg_TH_dummy, p)
set udg_RF_duration = udg_RF_duration - 1
else
//call SetUnitScale( udg_TH_caster, 1, 1, 1 )
call DisableTrigger( gg_trg_RF_2 )
//call EnableTrigger( gg_trg_Heatwave )
//call KillUnit(udg_TH_dummy)
endif
call RemoveLocation (p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_RF_2 takes nothing returns nothing
set gg_trg_RF_2 = CreateTrigger( )
call DisableTrigger( gg_trg_RF_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_RF_2, 1 )
call TriggerAddAction( gg_trg_RF_2, function Trig_RF_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Heatwave_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0C1' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N007' ) ) then
return false
endif
return true
endfunction
function Trig_Heatwave_Actions takes nothing returns nothing
local location p = GetUnitLoc(GetTriggerUnit())
local integer i = 0
set udg_TH_caster = GetTriggerUnit()
set udg_TH_dummy = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h00B', p, bj_UNIT_FACING )
set udg_TH_duration = 4
//call SetUnitScale( GetTriggerUnit(), 1.3, 1.3, 1.3 )
call DisableTrigger( GetTriggeringTrigger() )
call EnableTrigger( gg_trg_Heatwave_2 )
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Heatwave takes nothing returns nothing
set gg_trg_Heatwave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heatwave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Heatwave, Condition( function Trig_Heatwave_Conditions ) )
call TriggerAddAction( gg_trg_Heatwave, function Trig_Heatwave_Actions )
endfunction
//TESH.scrollpos=8
//TESH.alwaysfold=0
function Trig_Heatwave_2_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_TH_caster))
//local boolean b = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
return (a and IsTarget())
endfunction
function Trig_Heatwave_2_Actions takes nothing returns nothing
local location p = GetUnitLoc(udg_TH_caster)
local integer v = GetUnitAbilityLevel(udg_TH_caster, 'A0C1')
local real aoe = 300 + 300 * v
local unit u
local group g = GetUnitsInRangeOfLocMatching(aoe, p, Condition(function Trig_Heatwave_2_Filter))
local real x = (0.12 + 0.06 * v )
local real rx = x * GetUnitLife(udg_TH_caster)
//local real rc2 = rx * GetUnitState(udg_TH_caster, UNIT_STATE_MANA)
local real rc = 0.03 * (rx)
local real ru
if (udg_TH_duration > 0 and GetUnitLife(udg_TH_caster) > 0) then
loop
set u = FirstOfGroup(g)
exitwhen u == null
set ru = 0.03 * x * GetUnitLife(u)
call UnitDamageTargetBJ( udg_TH_caster, u, rc + ru, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
call GroupRemoveUnit (g,u)
endloop
call SetUnitLife(udg_TH_caster, GetUnitLife(udg_TH_caster) - 0.04 * rx )
//call SetUnitState(udg_TH_caster, UNIT_STATE_MANA, GetUnitState(udg_TH_caster, UNIT_STATE_MANA) - 0.03 * rc1)
call SetUnitPositionLoc(udg_TH_dummy, p)
set udg_TH_duration = udg_TH_duration - 0.05
else
//call SetUnitScale( udg_TH_caster, 1, 1, 1 )
call DisableTrigger( gg_trg_Heatwave_2 )
call EnableTrigger( gg_trg_Heatwave )
call KillUnit(udg_TH_dummy)
endif
call RemoveLocation (p)
call DestroyGroup(g)
endfunction
//===========================================================================
function InitTrig_Heatwave_2 takes nothing returns nothing
set gg_trg_Heatwave_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Heatwave_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Heatwave_2, 0.05 )
call TriggerAddAction( gg_trg_Heatwave_2, function Trig_Heatwave_2_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function WP_2_and takes nothing returns boolean
local boolean a = IsUnitType(GetFilterUnit(), UNIT_TYPE_HERO)
local boolean b = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_WP_caster))
return (a and b and IsTarget())
endfunction
function Trig_WP_2_Actions takes nothing returns nothing
local unit d = udg_WP_dummy
local location p = GetUnitLoc(d)
local group g
local unit u
local location p2 = PolarProjectionBJ(p, 40.00, GetUnitFacing(d))
local integer i = 10 + 8 * GetUnitAbilityLevel(udg_WP_caster,'A08J') + GetHeroBonusInt(udg_WP_caster)/6
local effect sp
if (udg_WP_int < 15) then
set udg_WP_int = udg_WP_int + 1
call SetUnitPositionLoc( d, p2 )
set g = GetUnitsInRangeOfLocMatching(210.00, p, Condition(function WP_2_and))
set u = FirstOfGroup(g)
if u != null or udg_WP_int == 15 then
set udg_WP_int = 15
call UnitAddAbility( d, 'A08I' )
call SetUnitAbilityLevel(d,'A08I', i)
set sp = AddSpecialEffectLoc( "Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl", p2 )
call IssueImmediateOrder( d, "thunderclap" )
set d = null
endif
else
call DisableTrigger( gg_trg_WP_2 )
call RemoveUnit(udg_WP_dummy)
endif
set g = null
set u = null
set d = null
call RemoveLocation (p)
call RemoveLocation (p2)
endfunction
//===========================================================================
function InitTrig_WP_2 takes nothing returns nothing
set gg_trg_WP_2 = CreateTrigger( )
call DisableTrigger( gg_trg_WP_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_WP_2, 0.03 )
call TriggerAddAction( gg_trg_WP_2, function Trig_WP_2_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Spirit_Expulsion_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0AI' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01B' ) ) then
return false
endif
return true
endfunction
function Trig_Spirit_Expulsion_Filter takes nothing returns boolean
local boolean a = IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit()))
local boolean b = true
return (a and IsTarget())
endfunction
function Trig_Spirit_Expulsion_Actions takes nothing returns nothing
local unit u
local location p = GetUnitLoc(GetTriggerUnit())
local group g = GetUnitsInRangeOfLocMatching(480.00, p, Condition(function Trig_Spirit_Expulsion_Filter))
local integer x = CountUnitsInGroup(g)
local integer i = GetUnitAbilityLevel(GetTriggerUnit(),'A01A')
local real r = (GetHeroBonusInt(GetTriggerUnit()) * 2.1 + 210 * i) / x
loop
set u = FirstOfGroup(g)
exitwhen u == null
call UnitDamageTargetBJ( GetTriggerUnit(), u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g,u)
endloop
endfunction
//===========================================================================
function InitTrig_Spirit_Expulsion takes nothing returns nothing
set gg_trg_Spirit_Expulsion = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spirit_Expulsion, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spirit_Expulsion, Condition( function Trig_Spirit_Expulsion_Conditions ) )
call TriggerAddAction( gg_trg_Spirit_Expulsion, function Trig_Spirit_Expulsion_Actions )
endfunction
//TESH.scrollpos=9
//TESH.alwaysfold=0
function Trig_Replenish_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A09X' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'N01B' ) ) then
return false
endif
return true
endfunction
function Trig_Replenish_Actions takes nothing returns nothing
set udg_RE_caster = GetTriggerUnit()
set udg_RE_duration = 3
if not IsTriggerEnabled( gg_trg_Replenish_2 ) then
call EnableTrigger( gg_trg_Replenish_2 )
endif
endfunction
//===========================================================================
function InitTrig_Replenish takes nothing returns nothing
set gg_trg_Replenish = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Replenish, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Replenish, Condition( function Trig_Replenish_Conditions ) )
call TriggerAddAction( gg_trg_Replenish, function Trig_Replenish_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Replenish_2_Actions takes nothing returns nothing
local real x = 1 + ( udg_RE_duration * ( 0.04 + 0.04 * GetUnitAbilityLevel(udg_RE_caster, 'A09X')))
local real r = 0.03 * GetHeroInt(udg_RE_caster, true)
if udg_RE_duration > 0 and GetUnitLife( udg_RE_caster ) > 0 then
call SetUnitMoveSpeed( udg_RE_caster, GetUnitDefaultMoveSpeed(udg_RE_caster) * x )
call SetUnitLife( udg_RE_caster, GetUnitLife(udg_RE_caster) + r )
//call FadingText( "+" + I2S(R2I(r)), udg_RE_caster, 10.50, 80, 80, 90, 0 )
//call DisplayTextToForce( GetPlayersAll(), R2S(GetUnitDefaultMoveSpeed(udg_RE_caster) * x) )
else
call DisableTrigger( gg_trg_Replenish_2 )
call SetUnitMoveSpeed( udg_RE_caster, GetUnitDefaultMoveSpeed(udg_RE_caster) )
endif
set udg_RE_duration = udg_RE_duration - 0.1
endfunction
//===========================================================================
function InitTrig_Replenish_2 takes nothing returns nothing
set gg_trg_Replenish_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Replenish_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Replenish_2, 0.10 )
call TriggerAddAction( gg_trg_Replenish_2, function Trig_Replenish_2_Actions )
endfunction
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Aerial_Footwork_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02T' ) ) then
return false
endif
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'E002' ) ) then
return false
endif
return true
endfunction
function Trig_Aerial_Footwork_Actions takes nothing returns nothing
local real r
local real r2
set udg_AF_caster = GetTriggerUnit()
set udg_AF_point1 = GetUnitLoc(GetTriggerUnit())
call DisableTrigger( gg_trg_Aerial_Footwork )
call EnableTrigger( gg_trg_AF_2 )
endfunction
//===========================================================================
function InitTrig_Aerial_Footwork takes nothing returns nothing
set gg_trg_Aerial_Footwork = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Aerial_Footwork, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Aerial_Footwork, Condition( function Trig_Aerial_Footwork_Conditions ) )
call TriggerAddAction( gg_trg_Aerial_Footwork, function Trig_Aerial_Footwork_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_AF_2_Boolean takes nothing returns boolean
local boolean a = GetUnitAbilityLevel(udg_AF_caster, 'B00C') > 0
local boolean b = GetUnitLife(udg_AF_caster) > 0
return a and b
endfunction
function Trig_AF_2_Actions takes nothing returns nothing
local real r
local real r2
if Trig_AF_2_Boolean() then
set udg_AF_point2 = GetUnitLoc(udg_AF_caster)
set r = DistanceBetweenPoints(udg_AF_point1,udg_AF_point2) * 0.00025
set r2 = GetUnitState(udg_AF_caster, UNIT_STATE_MAX_MANA) * r
call SetUnitManaBJ( udg_AF_caster, ( GetUnitState(udg_AF_caster, UNIT_STATE_MANA) + r2 ) )
set udg_AF_point1 = GetUnitLoc(udg_AF_caster)
else
call DisableTrigger( gg_trg_AF_2 )
call EnableTrigger( gg_trg_Aerial_Footwork )
call RemoveLocation (udg_AF_point1)
call RemoveLocation (udg_AF_point2)
endif
endfunction
//===========================================================================
function InitTrig_AF_2 takes nothing returns nothing
set gg_trg_AF_2 = CreateTrigger( )
call DisableTrigger( gg_trg_AF_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_AF_2, 0.10 )
call TriggerAddAction( gg_trg_AF_2, function Trig_AF_2_Actions )
endfunction
//TESH.scrollpos=22
//TESH.alwaysfold=0
function Trig_Magic_Breeze_2_Func001001003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction
function Trig_Magic_Breeze_2_Func001001003002001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Magic_Breeze_2_Func001001003002002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_MB_caster)) == true )
endfunction
function Trig_Magic_Breeze_2_Func001001003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Magic_Breeze_2_Func001001003002001(), Trig_Magic_Breeze_2_Func001001003002002() )
endfunction
function Trig_Magic_Breeze_2_Func001001003 takes nothing returns boolean
return GetBooleanAnd( Trig_Magic_Breeze_2_Func001001003001(), Trig_Magic_Breeze_2_Func001001003002() )
endfunction
function Trig_Magic_Breeze_2_Actions takes nothing returns nothing
local unit c = udg_MB_caster
local location p = GetUnitLoc(udg_MB_caster)
local unit d
local unit u
local group g = GetUnitsInRangeOfLocMatching(600.00, p, Condition(function Trig_Magic_Breeze_2_Func001001003))
local group g2 = GetRandomSubGroup(1,g)
set u = FirstOfGroup(g2)
if ( udg_MB_int >= 0 and u != null) then
set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h01X', p, bj_UNIT_FACING )
call IssueTargetOrder( d, "attack", u )
call SetUnitManaBJ( c, GetUnitState( c, UNIT_STATE_MANA ) + GetUnitState( c, UNIT_STATE_MAX_MANA ) * 0.03 )
endif
set udg_MB_int = udg_MB_int - 1
if ( udg_MB_int <= 0 )then
call DisableTrigger( gg_trg_Magic_Breeze_2 )
call EnableTrigger( gg_trg_Magic_Breeze )
endif
set u = null
set c = null
set d = null
call DestroyGroup (g)
call DestroyGroup (g2)
call RemoveLocation(p)
endfunction
//===========================================================================
function InitTrig_Magic_Breeze_2 takes nothing returns nothing
set gg_trg_Magic_Breeze_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Magic_Breeze_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Magic_Breeze_2, 0.1 )
call TriggerAddAction( gg_trg_Magic_Breeze_2, function Trig_Magic_Breeze_2_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_Bott_2_Func002001003002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Wotw)) == true )
endfunction
function gc takes nothing returns boolean
return GetBooleanAnd( IsTarget(), Trig_Bott_2_Func002001003002() )
endfunction
function Trig_Bott_2_Actions takes nothing returns nothing
local group g = GetUnitsInRangeOfLocMatching(330.00, GetUnitLoc(udg_Tornado), Condition(function gc))
local real b = 3.00 + (9.00 * I2R(GetUnitAbilityLevel( udg_Wotw, 'A03W')))
local real c
local unit u
local location pd = GetUnitLoc(udg_Tornado)
local location p = PolarProjectionBJ(pd, 27.00, GetUnitFacing(udg_Tornado))
call SetUnitPositionLocFacingBJ( udg_Tornado, p, GetUnitFacing(udg_Tornado) )
loop
set u = FirstOfGroup(g)
exitwhen u == null
set c = GetUnitMaxLife(u) * 0.01
call UnitDamageTargetBJ( udg_Wotw, u , b+c, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call GroupRemoveUnit(g, u)
endloop
set g = null
call RemoveLocation (p)
call RemoveLocation (pd)
endfunction
//===========================================================================
function InitTrig_Bott_2 takes nothing returns nothing
set gg_trg_Bott_2 = CreateTrigger( )
call DisableTrigger( gg_trg_Bott_2 )
call TriggerRegisterTimerEventPeriodic( gg_trg_Bott_2, 0.03 )
call TriggerAddAction( gg_trg_Bott_2, function Trig_Bott_2_Actions )
endfunction
//TESH.scrollpos=24
//TESH.alwaysfold=0
library MoveSpeedXGUI /* v1.1.0.0
*************************************************************************************
*
* This library allows you to set unit movement speeds beyond 522 without bugs.
* This is an extension of the library MoveSpeedX, but is formatted for GUI use.
* Credits to Jesus4Lyf for the original system.
*
************************************************************************************
*
* SETTINGS
*/
globals
private constant real PERIOD = 0.03125
// This is the period on which all units will be run.
// If you lower this value, movement bonuses will be smoother,
// but will require more processing power (lag more).
// Also, the lower this is, the higher the move speed can be
// before it starts bugging on waypoints. The lowest valid
// period is 0.00125. A period of 0.00625 is very robust.
private constant real MARGIN = 0.01
// This is the margin of approximation when comparing reals.
// You will most likely not need to change this.
endglobals
/*
************************************************************************************
*
* Functions
*
* function GetUnitMoveSpeedX takes unit whichUnit returns real
* - Returns a unit movement speed. The GUI function will
* - not return the correct value. This function will always
* - return the correct value regardless of whether the unit
* - has a movement speed beyond 522.
*
************************************************************************************
*
* REQUIREMENTS
*
* 1. JassNewGen Pack v5d
* 2. JassHelper 0.A.2.B
* 3. Any unit indexer
*
* HOW TO IMPLEMENT
*
* 1. Copy the 'folder' MoveSpeedX.
* 2. Paste it into your map.
* 3. Open "Advanced -> Gameplay Constants".
* 4. Checkmark "Use Custom Gameplay Constants".
* 5. Find the field, "Movement - Unit Speed - Maximum", change
* that to 522.
* 6. Find the field, "Movement - Unit Speed - Minimum", hold
* shift and click, and change it to 0.
* 7. Read HOW TO USE.
*
************************************************************************************
*
* HOW TO USE
*
* This system will automatically work by itself. You can use the
* normal GUI function for modifying unit movement speeds. Simply
* use "Unit - Set Movement Speed", input whatever value you want,
* and you are good to go! It will handle values beyond 522 by itself.
*
* HOWEVER, the GUI function will not return correct values if a unit
* has a movement speed greater than 522. To fix this, use the function
* GetUnitMoveSpeedX to return the correct value. A sample is given in
* the trigger "Speed Change" in the test map.
*
************************************************************************************
*
* NOTES
*
* Units that were issued orders as groups might not *always* end up in the proper
* "order". (they might not end up in an organized formation) They do sometimes though.
* This is only for units with speeds above 522.
*
* This also will not factor in bonuses and probably not slows either.
*
* Units may waddle around the point for a little bit. Reduce PERIOD to fix
* it a little bit. I recommend about 0.02 if you have really high speeds.
*
************************************************************************************/
private function ApproxEqual takes real A, real B returns boolean
return (A >= (B - MARGIN)) and (A <= (B + MARGIN))
endfunction
private module M
private static trigger issued = CreateTrigger()
thistype next
thistype prev
boolean enabled
unit curr
real speed
real x
real y
real ox
real oy
method destroy takes nothing returns nothing
set this.next.prev = this.prev
set this.prev.next = this.next
set this.enabled = false
endmethod
private static method periodic takes nothing returns nothing
local thistype this = thistype(0).next // first instance in list
local real nx // the x-coordinate after tick
local real ny // the y-coordinate after tick
local real dx // distance between new-x and old-x
local real dy // distance between new-y and old-y
local real d // distance between new point and old point
local integer order // the unit's current order
local unit u // unit being affected
loop
exitwhen this == 0
set u = .curr
set nx = GetUnitX(u)
set ny = GetUnitY(u)
if IsUnitType(u, UNIT_TYPE_DEAD) then
call this.destroy()
elseif not ApproxEqual(nx, .x) or not ApproxEqual(ny, .y) then
if (not IsUnitPaused(u)) and GetUnitAbilityLevel(u, 'BSTN') == 0 and GetUnitAbilityLevel(u, 'BPSE') == 0 then
set order = GetUnitCurrentOrder(u)
set dx = nx - .x
set dy = ny - .y
set d = SquareRoot(dx * dx + dy * dy)
set dx = dx / d * .speed // move the unit offset-x by this
set dy = dy / d * .speed // move the unit offset-y by this
if (order == 851986 or order == 851971) and /*
*/ (this.ox - nx)*(this.ox - nx) < (dx*dx) and /*
*/ (this.oy - ny)*(this.oy - ny) < (dy*dy) then
// if the unit is issued a move or smart order and they are near their destination
// then move them there instantly (removes a bit of glitchyness towards the end)
call SetUnitX(u, .ox)
call SetUnitY(u, .oy)
set .x = .ox
set .y = .oy
call IssueImmediateOrderById(u, 851972) // order them to stop
else
set .x = nx + dx
set .y = ny + dy
call SetUnitX(u, .x)
call SetUnitY(u, .y)
endif
endif
endif
set this = this.next
endloop
set u = null
endmethod
static method create takes unit whichUnit, real newSpeed returns thistype
local thistype this = GetUnitUserData(whichUnit)
set this.next = thistype(0).next
set thistype(0).next.prev = this
set thistype(0).next = this
set this.prev = 0
set this.curr = whichUnit
set this.speed = (newSpeed - 522) * PERIOD
set this.x = GetUnitX(whichUnit)
set this.y = GetUnitY(whichUnit)
set this.enabled = true
return this
endmethod
static method update takes unit whichUnit, real newSpeed returns nothing
local thistype this = GetUnitUserData(whichUnit)
if this.enabled then
if newSpeed > 522 then
set this.speed = (newSpeed - 522) * PERIOD
else
call this.destroy()
endif
elseif newSpeed > 522 then
call thistype.create(whichUnit, newSpeed)
endif
endmethod
private static method storeOrderPoint takes nothing returns boolean
local thistype this = GetUnitUserData(GetTriggerUnit())
set this.ox = GetOrderPointX()
set this.oy = GetOrderPointY()
return false
endmethod
private static method onInit takes nothing returns nothing
call TimerStart(CreateTimer(), PERIOD, true, function thistype.periodic)
call TriggerRegisterAnyUnitEventBJ(issued, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerAddCondition(issued, Condition(function thistype.storeOrderPoint))
endmethod
endmodule
private struct MoveSpeedStruct extends array
implement M
endstruct
function GetUnitMoveSpeedX takes unit whichUnit returns real
if MoveSpeedStruct(GetUnitUserData(whichUnit)).enabled then
return udg_UnitSpeedX[GetUnitUserData(whichUnit)]
endif
return GetUnitMoveSpeed(whichUnit)
endfunction
function SetUnitMoveSpeedX takes unit whichUnit, real newSpeed returns nothing
call MoveSpeedStruct.update(whichUnit, newSpeed)
set udg_UnitSpeedX[GetUnitUserData(whichUnit)] = newSpeed
endfunction
hook SetUnitMoveSpeed SetUnitMoveSpeedX
endlibrary
//TESH.scrollpos=6
//TESH.alwaysfold=0
function Trig_Spiritbreak_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0A6' ) ) then
return false
endif
return true
endfunction
function Trig_Spiritbreak_Actions takes nothing returns nothing
local boolean a
local boolean b
local integer i = R2I(0.2 * GetHeroInt(GetTriggerUnit(), true))
call SetHeroInt(GetTriggerUnit(), GetHeroInt(GetTriggerUnit(),false) + i, true)
call TriggerSleepAction( 1.00 )
loop
set a = GetUnitAbilityLevel(GetTriggerUnit(),'B057') == 0
set b = GetUnitState(GetTriggerUnit(), UNIT_STATE_MANA) < 100
exitwhen ( a or b )
call SetUnitState(GetTriggerUnit(), UNIT_STATE_MANA, GetUnitState(GetTriggerUnit(), UNIT_STATE_MANA) - 100)
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call SetHeroInt(GetTriggerUnit(), GetHeroInt(GetTriggerUnit(),false) - i, true)
if (not a) then
call UnitRemoveAbility(GetTriggerUnit(),'B057')
endif
endfunction
//===========================================================================
function InitTrig_Spiritbreak takes nothing returns nothing
set gg_trg_Spiritbreak = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Spiritbreak, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Spiritbreak, Condition( function Trig_Spiritbreak_Conditions ) )
call TriggerAddAction( gg_trg_Spiritbreak, function Trig_Spiritbreak_Actions )
endfunction
//TESH.scrollpos=5
//TESH.alwaysfold=0
function Trig_Dagon_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A0BZ' or GetSpellAbilityId() == 'A05D'
endfunction
function Trig_Dagon_Actions takes nothing returns nothing
local location p = GetRectCenter(GetPlayableMapRect())
local unit d
local unit fx
local real r
local unit u = GetSpellTargetUnit()
set d = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h01S', p, bj_UNIT_FACING )
if GetSpellAbilityId() == 'A0BZ' then
set r = (6 * GetHeroInt(GetTriggerUnit(), true)) - (3 * GetHeroInt(GetTriggerUnit(), false))
call UnitDamageTargetBJ( d, u, r, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
call FadingText( ( I2S(R2I(r)) + "!" ), u, 12.00, 100.00, 50.00, 50.00, 0 )
else
set r = ( 0.25 + 0.01 * GetHeroLevel(GetTriggerUnit()) ) * GetUnitLife(GetSpellTargetUnit())
call UnitDamageTargetBJ( d, u, r, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL )
set fx = CreateUnitAtLoc( GetOwningPlayer(GetTriggerUnit()), 'h010', p, bj_UNIT_FACING )
call FadingText( ( I2S(R2I(r)) + "!" ), u, 12.00, 100.00, 50.00, 20.00, 0 )
endif
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Dagon takes nothing returns nothing
set gg_trg_Dagon = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dagon, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dagon, Condition( function Trig_Dagon_Conditions ) )
call TriggerAddAction( gg_trg_Dagon, function Trig_Dagon_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Charge_Conditions takes nothing returns boolean
local boolean a = not(IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO))
local boolean b = GetUnitTypeId(GetTriggerUnit()) == 'h02H' or GetUnitTypeId(GetTriggerUnit()) == 'h02I'
return a and b
endfunction
function Trig_Charge_Actions takes nothing returns nothing
local boolean rad = GetOwningPlayer(GetEnteringUnit()) == Player(4)
local boolean shad = GetOwningPlayer(GetEnteringUnit()) == Player(9)
local boolean br1 = RectContainsUnit(gg_rct_Radiant_Creeps_1, GetTriggerUnit())
local boolean br2 = RectContainsUnit(gg_rct_Shadow_Creeps_1, GetTriggerUnit())
local boolean bs1 = RectContainsUnit(gg_rct_Radiant_Creeps_2, GetTriggerUnit())
local boolean bs2 = RectContainsUnit(gg_rct_Shadow_Creeps_2, GetTriggerUnit())
local location p
local location prc1 = GetRandomLocInRect(gg_rct_Radiant_Creeps_1)
local location psc1 = GetRandomLocInRect(gg_rct_Shadow_Creeps_1)
local location prc2 = GetRandomLocInRect(gg_rct_Radiant_Creeps_2)
local location psc2 = GetRandomLocInRect(gg_rct_Shadow_Creeps_2)
local location prs = GetRandomLocInRect(gg_rct_Radiant_Spawn)
local location pss = GetRandomLocInRect(gg_rct_Shadow_Spawn)
if rad and br1 then
set p = psc1
elseif rad and br2 then
set p = psc2
elseif shad and bs1 then
set p = prc1
elseif shad and bs2 then
set p = prc2
elseif rad and (bs1 or bs2) then
set p = pss
elseif shad and (br1 or br2) then
set p = prs
endif
call IssuePointOrderLoc( GetEnteringUnit(), "attack", p )
call RemoveLocation (prc1)
call RemoveLocation (prc2)
call RemoveLocation (psc1)
call RemoveLocation (psc2)
call RemoveLocation (prs)
call RemoveLocation (pss)
endfunction
//===========================================================================
function InitTrig_Charge takes nothing returns nothing
set gg_trg_Charge = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Charge, gg_rct_Radiant_Creeps_1 )
call TriggerRegisterEnterRectSimple( gg_trg_Charge, gg_rct_Radiant_Creeps_2 )
call TriggerRegisterEnterRectSimple( gg_trg_Charge, gg_rct_Shadow_Creeps_1 )
call TriggerRegisterEnterRectSimple( gg_trg_Charge, gg_rct_Shadow_Creeps_2 )
call TriggerAddCondition( gg_trg_Charge, Condition( function Trig_Charge_Conditions ) )
call TriggerAddAction( gg_trg_Charge, function Trig_Charge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Last_hit_Conditions takes nothing returns boolean
local boolean a = GetUnitTypeId(GetTriggerUnit()) == 'h02H'
local boolean b = GetUnitTypeId(GetTriggerUnit()) == 'h02I'
local boolean c = IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(GetKillingUnit()))
return (a or b) and c
endfunction
function Trig_Last_hit_Actions takes nothing returns nothing
local texttag t = CreateTextTag()
local integer i = GetUnitPointValue(GetTriggerUnit())
//call DisplayTextToForce( GetPlayersAll(), I2S(i) )
call AdjustPlayerStateBJ( i, GetOwningPlayer(GetKillingUnit()), PLAYER_STATE_RESOURCE_GOLD )
//set t = GetLastCreatedTextTag()
call SetTextTagTextBJ(t, "+" + I2S(i), 10)
call SetTextTagPosUnitBJ(t, GetTriggerUnit(), -90)
call SetTextTagColorBJ(t, 100, 100, 0, 0 )
call ShowTextTagForceBJ( false, t, GetPlayersAll() )
call ShowTextTagForceBJ( true, t, GetForceOfPlayer(GetOwningPlayer(GetKillingUnit())) )
call SetTextTagVelocityBJ( t, 64, 90 )
call SetTextTagPermanent( t, false )
call SetTextTagLifespan( t, 5.00 )
call SetTextTagFadepoint( t, 1.00 )
endfunction
//===========================================================================
function InitTrig_Last_hit takes nothing returns nothing
set gg_trg_Last_hit = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Last_hit, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Last_hit, Condition( function Trig_Last_hit_Conditions ) )
call TriggerAddAction( gg_trg_Last_hit, function Trig_Last_hit_Actions )
endfunction
//TESH.scrollpos=14
//TESH.alwaysfold=0
function Trig_Revive_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), Player(4)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Revive_Actions takes nothing returns nothing
local timerdialog WINDOW
local integer HEROWAIT
local timer OURTIMER
local unit OURHERO
local location p1 = GetRectCenter(gg_rct_Radiant_Creeps_1)
local location p2 = GetRectCenter(gg_rct_Radiant_Creeps_2)
local location p3 = GetRectCenter(gg_rct_Radiant_Midspawn)
local location p
local integer i = GetRandomInt(1,3)
if i == 1 then
set p = p1
elseif i == 2 then
set p = p2
elseif i == 3 then
set p = p3
endif
set OURHERO = GetDyingUnit()
set HEROWAIT = 10
set OURTIMER = CreateTimer()
call StartTimerBJ( OURTIMER,false,( I2R(HEROWAIT) ))
call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
set WINDOW = GetLastCreatedTimerDialogBJ()
call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) )
call PolledWait( HEROWAIT )
call ReviveHeroLoc(OURHERO, p, true )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), p, 0.20 )
call SelectUnitForPlayerSingle( OURHERO, GetOwningPlayer(OURHERO) )
call DestroyTimerDialog(WINDOW)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Revive takes nothing returns nothing
set gg_trg_Revive = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive, Condition( function Trig_Revive_Conditions ) )
call TriggerAddAction( gg_trg_Revive, function Trig_Revive_Actions )
endfunction
//TESH.scrollpos=15
//TESH.alwaysfold=0
function Trig_Revive_2_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(GetTriggerUnit(), Player(9)) == true ) ) then
return false
endif
return true
endfunction
function Trig_Revive_2_Actions takes nothing returns nothing
local timerdialog WINDOW
local integer HEROWAIT
local timer OURTIMER
local unit OURHERO
local location p1 = GetRectCenter(gg_rct_Shadow_Creeps_1)
local location p2 = GetRectCenter(gg_rct_Shadow_Creeps_2)
local location p3 = GetRectCenter(gg_rct_Shadow_Midspawn)
local location p
local integer i = GetRandomInt(1,3)
if i == 1 then
set p = p1
elseif i == 2 then
set p = p2
elseif i == 3 then
set p = p3
endif
set OURHERO = GetDyingUnit()
set HEROWAIT = 10
set OURTIMER = CreateTimer()
call StartTimerBJ( OURTIMER,false,( I2R(HEROWAIT) ))
call CreateTimerDialogBJ( OURTIMER, GetPlayerName(GetOwningPlayer(OURHERO)) )
set WINDOW = GetLastCreatedTimerDialogBJ()
call TimerDialogDisplayForPlayerBJ( true, WINDOW, GetOwningPlayer(OURHERO) )
call PolledWait( HEROWAIT )
call ReviveHeroLoc(OURHERO, p, true )
call PanCameraToTimedLocForPlayer( GetOwningPlayer(OURHERO), p, 0.20 )
call DestroyTimerDialog(WINDOW)
call RemoveLocation (p)
endfunction
//===========================================================================
function InitTrig_Revive_2 takes nothing returns nothing
set gg_trg_Revive_2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive_2, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Revive_2, Condition( function Trig_Revive_2_Conditions ) )
call TriggerAddAction( gg_trg_Revive_2, function Trig_Revive_2_Actions )
endfunction