scope slowandfast initializer I
private function A takes nothing returns nothing
local real ux = GetUnitX(GetSpellAbilityUnit())
local real uy = GetUnitY(GetSpellAbilityUnit())
local unit u = null
if GetSpellAbilityId() == 'A00M' then
if GetTimeOfDay() < 12.00 then
set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'e000', ux, uy, 270.00)
call UnitAddAbility(u, 'A00Z')
call SetUnitAbilityLevel(u, 'A00Z', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00M'))
call UnitApplyTimedLife(u, 'BTLF', 5.0)
endif
else
if GetSpellAbilityId() == 'A00K' then
if GetTimeOfDay() >= 12.00 then
set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'e000', ux, uy, 270.00)
call UnitAddAbility(u, 'A00Y')
call SetUnitAbilityLevel(u, 'A00Y', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00K'))
call UnitApplyTimedLife(u, 'BTLF', 5.0)
endif
endif
endif
set u = null
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction( t, function A )
endfunction
endscope
scope Day initializer I
private function agilnfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00E') > 0 )
endfunction
private function agilnact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A002' )
call UnitAddAbility(GetEnumUnit(), 'A005' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A005', GetUnitAbilityLevel(GetEnumUnit(),'A00E') )
call UnitRemoveAbility(GetEnumUnit(), 'A00I' )
endfunction
private function nsfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00B') > 0 )
endfunction
private function nsact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A008' )
call UnitAddAbility(GetEnumUnit(), 'A007' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A007', GetUnitAbilityLevel(GetEnumUnit(),'A00B') )
endfunction
private function dsfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00F') > 0 )
endfunction
private function dsact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A009' )
call UnitAddAbility(GetEnumUnit(), 'A00A' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A00A', GetUnitAbilityLevel(GetEnumUnit(),'A00F') )
endfunction
private function agildfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00D') > 0 )
endfunction
private function agildact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A006' )
call UnitAddAbility(GetEnumUnit(), 'A004' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A004', GetUnitAbilityLevel(GetEnumUnit(),'A00D') )
call UnitAddAbility(GetEnumUnit(), 'A00I' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A00I', GetUnitAbilityLevel(GetEnumUnit(),'A00D') )
endfunction
private function dmfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00P') > 0 )
endfunction
private function dmact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A00O' )
call UnitAddAbility(GetEnumUnit(), 'A00N' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A00N', GetUnitAbilityLevel(GetEnumUnit(),'A00P') )
endfunction
private function defilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00Q') > 0 )
endfunction
private function deact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A00S' )
call UnitAddAbility(GetEnumUnit(), 'A00O' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A00O', GetUnitAbilityLevel(GetEnumUnit(),'A00Q') )
endfunction
private function A takes nothing returns nothing
local group g = CreateGroup()
local unit PickedUnit = null
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agilnfilter))
call ForGroup(g, function agilnact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agildfilter))
call ForGroup(g, function agildact)
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function nsfilter))
call ForGroup(g, function nsact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dsfilter))
call ForGroup(g, function dsact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dmfilter))
call ForGroup(g, function dmact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function defilter))
call ForGroup(g, function deact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
set g = null
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( t, LESS_THAN, 12.00 )
call TriggerAddAction( t, function A )
endfunction
endscope
scope Day2 initializer I
private function A takes nothing returns nothing
local unit u = GetTriggerUnit()
if GetLearnedSkill() == 'A00B' then
if GetTimeOfDay() >= 12.00 then
call UnitRemoveAbility(u, 'A007')
call UnitAddAbility(u, 'A008')
call SetUnitAbilityLevel(u, 'A008', GetUnitAbilityLevel(u,'A00B') )
else
call UnitRemoveAbility(u, 'A008')
call UnitAddAbility(u, 'A007')
call SetUnitAbilityLevel( u, 'A007', GetUnitAbilityLevel(u,'A00B') )
call SetUnitAbilityLevel( u, 'A007', GetUnitAbilityLevel(u,'A00B') )
endif
else
if GetLearnedSkill() == 'A00E' then
if GetTimeOfDay() >= 12.00 then
call UnitRemoveAbility(u, 'A005')
call UnitAddAbility(u, 'A002')
call SetUnitAbilityLevel( u,'A002', GetUnitAbilityLevel(u,'A00E') )
call UnitAddAbility(u, 'A00I')
call SetUnitAbilityLevel( u,'A00I', GetUnitAbilityLevel(u,'A00E') )
else
call UnitRemoveAbility(u, 'A00I')
call UnitRemoveAbility(u, 'A002')
call UnitAddAbility(u, 'A005')
call SetUnitAbilityLevel(u, 'A005', GetUnitAbilityLevel(u,'A00E') )
endif
else
if GetLearnedSkill() == 'A00Q' then
if GetTimeOfDay() >= 12.00 then
call UnitRemoveAbility(u, 'A00O')
call UnitAddAbility(u, 'A00S')
call SetUnitAbilityLevel(u, 'A00S', GetUnitAbilityLevel(u,'A00Q') )
else
call UnitRemoveAbility(u, 'A00S')
call UnitAddAbility(u, 'A00O')
call SetUnitAbilityLevel(u, 'A00O', GetUnitAbilityLevel(u,'A00Q') )
endif
else
if GetLearnedSkill() == 'A00F' then
if GetTimeOfDay() < 12.00 then
call UnitRemoveAbility(u, 'A009')
call UnitAddAbility(u, 'A00A')
call SetUnitAbilityLevel(u, 'A00A', GetUnitAbilityLevel(u,'A00F') )
else
call UnitRemoveAbility(u, 'A00A')
call UnitAddAbility(u, 'A009')
call SetUnitAbilityLevel( u, 'A009', GetUnitAbilityLevel(u,'A00F') )
endif
else
if GetLearnedSkill() == 'A00D' then
if GetTimeOfDay() < 12.00 then
call UnitRemoveAbility(u, 'A006')
call UnitAddAbility(u, 'A004')
call SetUnitAbilityLevel( u,'A004', GetUnitAbilityLevel(u,'A00D') )
call UnitAddAbility(u, 'A00I')
call SetUnitAbilityLevel( u,'A00I', GetUnitAbilityLevel(u,'A00D') )
else
call UnitRemoveAbility(u, 'A00I')
call UnitRemoveAbility(u, 'A004')
call UnitAddAbility(u, 'A006')
call SetUnitAbilityLevel(u, 'A006', GetUnitAbilityLevel(u,'A00D') )
endif
else
if GetLearnedSkill() == 'A00P' then
if GetTimeOfDay() < 12.00 then
call UnitRemoveAbility(u, 'A00O')
call UnitAddAbility(u, 'A00N')
call SetUnitAbilityLevel(u, 'A00N', GetUnitAbilityLevel(u,'A00P') )
else
call UnitRemoveAbility(u, 'A00N')
call UnitAddAbility(u, 'A00O')
call SetUnitAbilityLevel(u, 'A00O', GetUnitAbilityLevel(u,'A00P') )
endif
else
if GetLearnedSkill() == 'A011' then
call UnitAddAbility(u, 'A010')
call SetUnitAbilityLevel(u, 'A010', GetUnitAbilityLevel(u,'A011') )
endif
if GetLearnedSkill() == 'A01H' then
call SetUnitAbilityLevel(u, 'A01I', (GetUnitAbilityLevel(u,'A01H')+1) )
endif
endif
endif
endif
endif
endif
endif
set u = null
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_HERO_SKILL )
call TriggerAddAction( t, function A )
endfunction
endscope
//this next one is a testing trigger, it's sweet!
Speed
Events
Player - Player 3 (Teal) types a chat message containing -speed as A substring
Conditions
(Substring((Entered chat string), 1, 7)) Equal to (==) -speed
Actions
Game - Set time of day speed to (Real((Integer((Substring((Entered chat string), 8, (Length of (Entered chat string))))))))% of the default speed
//this next one has some textmacro which i don't really understand, another map maker made that stuff up for me
scope Night initializer I
//! textmacro RemoveUnitsFromGroup takes UNIT, GROUP
loop
set $UNIT$ = FirstOfGroup($GROUP$)
exitwhen $UNIT$ == null
call GroupRemoveUnit($GROUP$, PickedUnit)
endloop
//! endtextmacro
private function agilnfilter takes nothing returns boolean
return ( GetUnitAbilityLevel( GetFilterUnit(), 'A00E') > 0 )
endfunction
private function agilnact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A005')
call UnitAddAbility(GetEnumUnit(), 'A002')
call SetUnitAbilityLevel(GetEnumUnit(), 'A002', GetUnitAbilityLevel(GetEnumUnit(),'A00E') )
call UnitAddAbility(GetEnumUnit(), 'A00I')
call SetUnitAbilityLevel(GetEnumUnit(), 'A00I', GetUnitAbilityLevel(GetEnumUnit(),'A00E') )
endfunction
private function nsfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00B') > 0 )
endfunction
private function nsact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A007' )
call UnitAddAbility(GetEnumUnit(), 'A008' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A008', GetUnitAbilityLevel(GetEnumUnit(),'A00B') )
endfunction
private function agildfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00D') > 0 )
endfunction
private function agildact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A004' )
call UnitAddAbility(GetEnumUnit(), 'A006' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A006', GetUnitAbilityLevel(GetEnumUnit(),'A00D') )
call UnitRemoveAbility(GetEnumUnit(), 'A00I' )
endfunction
private function dsfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00F') > 0 )
endfunction
private function dsact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A00A' )
call UnitAddAbility(GetEnumUnit(), 'A009' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A009', GetUnitAbilityLevel(GetEnumUnit(),'A00F') )
endfunction
private function dmfilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00P') > 0 )
endfunction
private function dmact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A00N' )
call UnitAddAbility(GetEnumUnit(), 'A00O' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A00O', GetUnitAbilityLevel(GetEnumUnit(),'A00P') )
endfunction
private function defilter takes nothing returns boolean
return ( GetUnitAbilityLevel(GetFilterUnit(),'A00Q') > 0 )
endfunction
private function deact takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(), 'A00O' )
call UnitAddAbility(GetEnumUnit(), 'A00S' )
call SetUnitAbilityLevel(GetEnumUnit(), 'A00S', GetUnitAbilityLevel(GetEnumUnit(),'A00Q') )
endfunction
private function A takes nothing returns nothing
local group g = CreateGroup()
local unit PickedUnit = null
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agilnfilter))
call ForGroup(g, function agilnact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agildfilter))
call ForGroup(g, function agildact)
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function nsfilter))
call ForGroup(g, function nsact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dsfilter))
call ForGroup(g, function dsact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dmfilter))
call ForGroup(g, function dmact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function defilter))
call ForGroup(g, function deact )
//! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
set g = null
endfunction
//===========================================================================
private function I takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterGameStateEventTimeOfDay( t, GREATER_THAN_OR_EQUAL, 12.00 )
call TriggerAddAction( t, function A )
endfunction
endscope
function Trig_strike_Actions takes nothing returns nothing
if UnitHasBuffBJ(GetAttacker(), 'B000') then
call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), ( ( GetUnitMoveSpeed(GetAttacker()) - GetUnitMoveSpeed(GetAttackedUnitBJ()) ) * I2R(GetUnitAbilityLevel(GetAttacker(),'A00B')) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
else
if UnitHasBuffBJ(GetAttacker(), 'B001') then
call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), ( ( GetUnitMoveSpeed(GetAttacker()) - GetUnitMoveSpeed(GetAttackedUnitBJ()) ) * I2R(GetUnitAbilityLevel(GetAttacker(),'A00F')) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
endif
endif
endfunction
//===========================================================================
function InitTrig_strike takes nothing returns nothing
set gg_trg_strike = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_strike, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_strike, function Trig_strike_Actions )
endfunction