Name | Type | is_array | initial_value |
aRed_Cast_Level | integer | No | |
aRed_Flex_Cap | integer | No | |
aRed_Flex_Value | integer | No | |
aRed_Kills | integer | No | |
aRed_Mana_Mod | real | No | |
aRed_Max_Cast | integer | No | |
aRed_Unit_Max | integer | No | |
aRed_Units | group | No | |
bBlue_Cast_Level | integer | No | |
bBlue_Flex_Cap | integer | No | |
bBlue_Flex_Value | integer | No | |
bBlue_Kills | integer | No | |
bBlue_Mana_Mod | real | No | |
bBlue_Max_Cast | integer | No | |
bBlue_Unit_Max | integer | No | |
bBlue_Units | group | No | |
cTeal_Cast_Level | integer | No | |
cTeal_Flex_Cap | integer | No | |
cTeal_Flex_Value | integer | No | |
cTeal_Kills | integer | No | |
cTeal_Mana_Mod | real | No | |
cTeal_Max_Cast | integer | No | |
cTeal_Unit_Max | integer | No | |
cTeal_Units | group | No | |
dPurple_Cast_Level | integer | No | |
dPurple_Flex_Cap | integer | No | |
dPurple_Flex_Value | integer | No | |
dPurple_Kills | integer | No | |
dPurple_Mana_Mod | real | No | |
dPurple_Max_Cast | integer | No | |
dPurple_Unit_Max | integer | No | |
dPurple_Units | group | No | |
Spawn_Protection | group | No | |
Temp_Point | location | No | |
vaaActual_Players | force | No | |
vaaAlive_Crafter | group | No | |
vaaEnlightented | group | No | |
vaRed_Blood_Crafter | unit | No | |
vbBlue_Blood_Crafter | unit | No | |
vcTeal_Blood_Crafter | unit | No | |
vdPurple_Blood_Crafter | unit | No | |
wBase_Exp_Value | integer | No | 10 |
wBase_Mana_Cost | real | No | 14.00 |
wBloodmute_Base_Mana | real | No | 20.00 |
wBloodmute_Cast_Mana | real | No | |
wCast_Experience_Modifier | real | No | |
xKills_Per_Point | integer | No | 5 |
xReal | real | No | |
xThreshold | integer | No | |
yRank_I | real | No | 30.00 |
yRank_II | real | No | 100.00 |
yRank_III | real | No | 325.00 |
yRank_IV | real | No | 800.00 |
yRank_V | real | No | 1125.00 |
zaaBlood_Works | unit | Yes | |
zaBlood_Works_Red | unit | No | |
zbBlood_Works_Blue | unit | No | |
zcBlood_Works_Teal | unit | No | |
zdBlood_Works_Purple | unit | No | |
zeBlood_Works_Yellow | unit | No | |
zfBlood_Works_Orange | unit | No | |
zgBlood_Works_Green | unit | No | |
zhBlood_Works_Pink | unit | No | |
ziBlood_Works_Gray | unit | No | |
zjBlood_Works_Light_Blue | unit | No | |
zkBlood_Works_Dark_Green | unit | No | |
zlBlood_Works_Brown | unit | No |
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unit_Enterence_Conditions takes nothing returns boolean
if ( not ( GetUnitPointValue(GetEnteringUnit()) < 4 ) ) then
return false
endif
return true
endfunction
function Trig_Spawn_Heal_Actions takes nothing returns nothing
local unit SM = GetEnteringUnit()
call GroupAddUnitSimple( SM, udg_Spawn_Protection )
call TriggerSleepAction( 1.00 )
call GroupRemoveUnitSimple( SM, udg_Spawn_Protection )
call UnitAddItemByIdSwapped( 'I00B', SM )
call UnitAddItemByIdSwapped( 'I00C', SM )
call UnitAddItemByIdSwapped( 'I00E', SM )
call UnitAddItemByIdSwapped( 'I00D', SM )
endfunction
//===========================================================================
function InitTrig_Unit_Enterence takes nothing returns nothing
set gg_trg_Unit_Enterence = CreateTrigger( )
call TriggerRegisterEnterRectSimple( gg_trg_Unit_Enterence, GetPlayableMapRect() )
call TriggerAddCondition( gg_trg_Unit_Enterence, Condition( function Trig_Unit_Enterence_Conditions ) )
call TriggerAddAction( gg_trg_Unit_Enterence, function Trig_Spawn_Heal_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Unit_Count takes nothing returns boolean
if ( not ( GetPlayerState(Player(PLAYER_NEUTRAL_AGGRESSIVE), PLAYER_STATE_RESOURCE_FOOD_USED) <= 4 ) ) then
return false
endif
return true
endfunction
function Trig_Run_Waves_Actions takes nothing returns nothing
call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Defend the |cffFF0000Blood Well|r!
(You 90 second to ready yourselves)" )
call TriggerSleepAction( 50.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "30 seconds till first wave." )
call TriggerSleepAction( 20.00 )
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "Wave I" )
set udg_Wave_Number = ( udg_Wave_Number + 1 )
call EnableTrigger( gg_trg_Wave_I )
call TriggerSleepAction( 120.00 )
call DisableTrigger( gg_trg_Wave_I )
loop
exitwhen ( Trig_Unit_Count() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_7171" )
set udg_Wave_Number = ( udg_Wave_Number + 1 )
call EnableTrigger( gg_trg_Wave_II )
call TriggerSleepAction( 120.00 )
call DisableTrigger( gg_trg_Wave_II )
loop
exitwhen ( Trig_Unit_Count() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_7172" )
set udg_Wave_Number = ( udg_Wave_Number + 1 )
call EnableTrigger( gg_trg_Wave_III )
call TriggerSleepAction( 120.00 )
call DisableTrigger( gg_trg_Wave_III )
loop
exitwhen ( Trig_Unit_Count() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_7173" )
set udg_Wave_Number = ( udg_Wave_Number + 1 )
call EnableTrigger( gg_trg_Wave_IV )
call TriggerSleepAction( 120.00 )
call DisableTrigger( gg_trg_Wave_IV )
loop
exitwhen ( Trig_Unit_Count() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_7174" )
set udg_Wave_Number = ( udg_Wave_Number + 1 )
call EnableTrigger( gg_trg_Wave_V )
call TriggerSleepAction( 120.00 )
call DisableTrigger( gg_trg_Wave_V )
loop
exitwhen ( Trig_Unit_Count() )
call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 1))
endloop
call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_7175" )
set udg_Wave_Number = ( udg_Wave_Number + 1 )
call EnableTrigger( gg_trg_Wave_VI )
call TriggerSleepAction( 120.00 )
call DisableTrigger( gg_trg_Wave_VI )
call EnableTrigger( gg_trg_PVE_Victory )
endfunction
//===========================================================================
function InitTrig_Run_Waves takes nothing returns nothing
set gg_trg_Run_Waves = CreateTrigger( )
call TriggerAddAction( gg_trg_Run_Waves, function Trig_Run_Waves_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Wave_I_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( ( 1 ), 'n006', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRectCenter(gg_rct_Guild_Hall_Blue), GetRandomReal(0, 360.00) )
call CreateNUnitsAtLoc( ( 1 ), 'n006', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRectCenter(gg_rct_Guild_Hall_Green), GetRandomReal(0, 360.00) )
call CreateNUnitsAtLoc( ( 1 ), 'n006', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRectCenter(gg_rct_Guild_Hall_Purple), GetRandomReal(0, 360.00) )
call CreateNUnitsAtLoc( ( 1 ), 'n006', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRectCenter(gg_rct_Guild_Hall_Red), GetRandomReal(0, 360.00) )
endfunction
//===========================================================================
function InitTrig_Wave_I takes nothing returns nothing
set gg_trg_Wave_I = CreateTrigger( )
call DisableTrigger( gg_trg_Wave_I )
call TriggerRegisterTimerEventPeriodic( gg_trg_Wave_I, 10.00 )
call TriggerAddAction( gg_trg_Wave_I, function Trig_Wave_I_Actions )
endfunction
//TESH.scrollpos=34
//TESH.alwaysfold=0
function Trig_Lancer_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00Z' ) ) then
return false
endif
return true
endfunction
function Trig_Lancer_Func002C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) < udg_wBloodmute_Cast_Mana ) ) then
return false
endif
return true
endfunction
function Trig_Lancer_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) != 'h007' ) ) then
return false
endif
return true
endfunction
function Trig_Lancer_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) == 'h007' ) ) then
return false
endif
return true
endfunction
function Trig_Lancer_Actions takes nothing returns nothing
local effect VO
set udg_wBloodmute_Cast_Mana = ( udg_wBloodmute_Base_Mana * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
if ( Trig_Lancer_Func002C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5317" )
return
else
endif
if ( Trig_Lancer_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_4678" )
return
else
endif
if ( Trig_Lancer_Func004C() ) then
call TriggerSleepAction( 0.50 )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - udg_wBloodmute_Cast_Mana ) )
call ReplaceUnitBJ( GetSpellTargetUnit(), 'h00A', bj_UNIT_STATE_METHOD_RELATIVE )
call AddHeroXPSwapped( ( ( udg_wBase_Exp_Value * ( 1 + ( R2I(0.10) * GetPlayerTechCountSimple('R00Z', GetOwningPlayer(GetSpellAbilityUnit())) ) ) ) * 1 ), GetSpellAbilityUnit(), true )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastReplacedUnitBJ(), "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set VO = GetLastCreatedEffectBJ()
call TriggerSleepAction( 3.25 )
call DestroyEffectBJ( VO )
else
endif
endfunction
//===========================================================================
function InitTrig_Lancer takes nothing returns nothing
set gg_trg_Lancer = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Lancer, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Lancer, Condition( function Trig_Lancer_Conditions ) )
call TriggerAddAction( gg_trg_Lancer, function Trig_Lancer_Actions )
endfunction
//TESH.scrollpos=35
//TESH.alwaysfold=0
function Trig_Swordsman_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01K' ) ) then
return false
endif
return true
endfunction
function Trig_Swordsman_Func002C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) < udg_wBloodmute_Cast_Mana ) ) then
return false
endif
return true
endfunction
function Trig_Swordsman_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) != 'h007' ) ) then
return false
endif
return true
endfunction
function Trig_Swordsman_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) == 'h007' ) ) then
return false
endif
return true
endfunction
function Trig_Swordsman_Actions takes nothing returns nothing
local effect VO
set udg_wBloodmute_Cast_Mana = ( udg_wBloodmute_Base_Mana * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
if ( Trig_Swordsman_Func002C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5317" )
return
else
endif
if ( Trig_Swordsman_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_4678" )
return
else
endif
if ( Trig_Swordsman_Func004C() ) then
call TriggerSleepAction( 0.50 )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - udg_wBloodmute_Cast_Mana ) )
call ReplaceUnitBJ( GetSpellTargetUnit(), 'h00B', bj_UNIT_STATE_METHOD_RELATIVE )
call AddHeroXPSwapped( ( ( udg_wBase_Exp_Value * ( 1 + ( R2I(0.10) * GetPlayerTechCountSimple('R00Z', GetOwningPlayer(GetSpellAbilityUnit())) ) ) ) * 1 ), GetSpellAbilityUnit(), true )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastReplacedUnitBJ(), "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set VO = GetLastCreatedEffectBJ()
call TriggerSleepAction( 3.25 )
call DestroyEffectBJ( VO )
else
endif
endfunction
//===========================================================================
function InitTrig_Swordsman takes nothing returns nothing
set gg_trg_Swordsman = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Swordsman, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Swordsman, Condition( function Trig_Swordsman_Conditions ) )
call TriggerAddAction( gg_trg_Swordsman, function Trig_Swordsman_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Ranger_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A014' ) ) then
return false
endif
return true
endfunction
function Trig_Ranger_Func002C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) < udg_wBloodmute_Cast_Mana ) ) then
return false
endif
return true
endfunction
function Trig_Ranger_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) != 'n001' ) ) then
return false
endif
return true
endfunction
function Trig_Ranger_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) == 'n001' ) ) then
return false
endif
return true
endfunction
function Trig_Ranger_Actions takes nothing returns nothing
local effect VO
set udg_wBloodmute_Cast_Mana = ( udg_wBloodmute_Base_Mana * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
if ( Trig_Ranger_Func002C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5317" )
return
else
endif
if ( Trig_Ranger_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_4678" )
return
else
endif
if ( Trig_Ranger_Func004C() ) then
call TriggerSleepAction( 0.50 )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - udg_wBloodmute_Cast_Mana ) )
call ReplaceUnitBJ( GetSpellTargetUnit(), 'n003', bj_UNIT_STATE_METHOD_RELATIVE )
call AddHeroXPSwapped( ( ( udg_wBase_Exp_Value * ( 1 + ( R2I(0.10) * GetPlayerTechCountSimple('R00Z', GetOwningPlayer(GetSpellAbilityUnit())) ) ) ) * 1 ), GetSpellAbilityUnit(), true )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastReplacedUnitBJ(), "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set VO = GetLastCreatedEffectBJ()
call TriggerSleepAction( 3.25 )
call DestroyEffectBJ( VO )
else
endif
endfunction
//===========================================================================
function InitTrig_Ranger takes nothing returns nothing
set gg_trg_Ranger = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ranger, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Ranger, Condition( function Trig_Ranger_Conditions ) )
call TriggerAddAction( gg_trg_Ranger, function Trig_Ranger_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Priest_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A012' ) ) then
return false
endif
return true
endfunction
function Trig_Priest_Func002C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) < udg_wBloodmute_Cast_Mana ) ) then
return false
endif
return true
endfunction
function Trig_Priest_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) != 'h008' ) ) then
return false
endif
return true
endfunction
function Trig_Priest_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) == 'h008' ) ) then
return false
endif
return true
endfunction
function Trig_Priest_Actions takes nothing returns nothing
local effect VO
set udg_wBloodmute_Cast_Mana = ( udg_wBloodmute_Base_Mana * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
if ( Trig_Priest_Func002C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5317" )
return
else
endif
if ( Trig_Priest_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_4678" )
return
else
endif
if ( Trig_Priest_Func004C() ) then
call TriggerSleepAction( 0.50 )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - udg_wBloodmute_Cast_Mana ) )
call ReplaceUnitBJ( GetSpellTargetUnit(), 'h005', bj_UNIT_STATE_METHOD_RELATIVE )
call AddHeroXPSwapped( ( ( udg_wBase_Exp_Value * ( 1 + ( R2I(0.10) * GetPlayerTechCountSimple('R00Z', GetOwningPlayer(GetSpellAbilityUnit())) ) ) ) * 1 ), GetSpellAbilityUnit(), true )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastReplacedUnitBJ(), "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set VO = GetLastCreatedEffectBJ()
call TriggerSleepAction( 3.25 )
call DestroyEffectBJ( VO )
else
endif
endfunction
//===========================================================================
function InitTrig_Priest takes nothing returns nothing
set gg_trg_Priest = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Priest, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Priest, Condition( function Trig_Priest_Conditions ) )
call TriggerAddAction( gg_trg_Priest, function Trig_Priest_Actions )
endfunction
//TESH.scrollpos=35
//TESH.alwaysfold=0
function Trig_War_Mage_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01Q' ) ) then
return false
endif
return true
endfunction
function Trig_War_Mage_Func002C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) < udg_wBloodmute_Cast_Mana ) ) then
return false
endif
return true
endfunction
function Trig_War_Mage_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) != 'h008' ) ) then
return false
endif
return true
endfunction
function Trig_War_Mage_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) == 'h008' ) ) then
return false
endif
return true
endfunction
function Trig_War_Mage_Actions takes nothing returns nothing
local effect VO
set udg_wBloodmute_Cast_Mana = ( udg_wBloodmute_Base_Mana * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
if ( Trig_War_Mage_Func002C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5317" )
return
else
endif
if ( Trig_War_Mage_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_4678" )
return
else
endif
if ( Trig_War_Mage_Func004C() ) then
call TriggerSleepAction( 0.50 )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - udg_wBloodmute_Cast_Mana ) )
call ReplaceUnitBJ( GetSpellTargetUnit(), 'h00C', bj_UNIT_STATE_METHOD_RELATIVE )
call AddHeroXPSwapped( ( ( udg_wBase_Exp_Value * ( 1 + ( R2I(0.10) * GetPlayerTechCountSimple('R00Z', GetOwningPlayer(GetSpellAbilityUnit())) ) ) ) * 1 ), GetSpellAbilityUnit(), true )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastReplacedUnitBJ(), "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set VO = GetLastCreatedEffectBJ()
call TriggerSleepAction( 3.25 )
call DestroyEffectBJ( VO )
else
endif
endfunction
//===========================================================================
function InitTrig_War_Mage takes nothing returns nothing
set gg_trg_War_Mage = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_War_Mage, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_War_Mage, Condition( function Trig_War_Mage_Conditions ) )
call TriggerAddAction( gg_trg_War_Mage, function Trig_War_Mage_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Guardain_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01O' ) ) then
return false
endif
return true
endfunction
function Trig_Guardain_Func002C takes nothing returns boolean
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) < udg_wBloodmute_Cast_Mana ) ) then
return false
endif
return true
endfunction
function Trig_Guardain_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) != 'n001' ) ) then
return false
endif
return true
endfunction
function Trig_Guardain_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetSpellTargetUnit()) == 'n001' ) ) then
return false
endif
return true
endfunction
function Trig_Guardain_Actions takes nothing returns nothing
local effect VO
set udg_wBloodmute_Cast_Mana = ( udg_wBloodmute_Base_Mana * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
if ( Trig_Guardain_Func002C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5317" )
return
else
endif
if ( Trig_Guardain_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_4678" )
return
else
endif
if ( Trig_Guardain_Func004C() ) then
call TriggerSleepAction( 0.50 )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - udg_wBloodmute_Cast_Mana ) )
call ReplaceUnitBJ( GetSpellTargetUnit(), 'h002', bj_UNIT_STATE_METHOD_RELATIVE )
call AddHeroXPSwapped( ( ( udg_wBase_Exp_Value * ( 1 + ( R2I(0.10) * GetPlayerTechCountSimple('R00Z', GetOwningPlayer(GetSpellAbilityUnit())) ) ) ) * 1 ), GetSpellAbilityUnit(), true )
call AddSpecialEffectTargetUnitBJ( "overhead", GetLastReplacedUnitBJ(), "Abilities\\Spells\\Orc\\Voodoo\\VoodooAuraTarget.mdl" )
set VO = GetLastCreatedEffectBJ()
call TriggerSleepAction( 3.25 )
call DestroyEffectBJ( VO )
else
endif
endfunction
//===========================================================================
function InitTrig_Guardain takes nothing returns nothing
set gg_trg_Guardain = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Guardain, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Guardain, Condition( function Trig_Guardain_Conditions ) )
call TriggerAddAction( gg_trg_Guardain, function Trig_Guardain_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Blue_Melee_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(1) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A01N' ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func004C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func006001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Blue_Melee_Forge_Func006A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Melee_Forge_Func008C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func010001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Blue_Melee_Forge_Func010A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Melee_Forge_Func012C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func014001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Blue_Melee_Forge_Func014A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Melee_Forge_Func016C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func018001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Blue_Melee_Forge_Func018A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Melee_Forge_Func019Func002Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func019Func002C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func019Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func019C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_bBlue_Units) >= ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_bBlue_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func022C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func023C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func024C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Func025C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Melee_Forge_Actions takes nothing returns nothing
set udg_bBlue_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_bBlue_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_bBlue_Mana_Mod) )
if ( Trig_Blue_Melee_Forge_Func004C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5429" )
return
else
endif
set udg_bBlue_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Melee_Forge_Func006001002)), function Trig_Blue_Melee_Forge_Func006A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Melee_Forge_Func008C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Melee_Forge_Func010001002)), function Trig_Blue_Melee_Forge_Func010A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Melee_Forge_Func012C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Melee_Forge_Func014001002)), function Trig_Blue_Melee_Forge_Func014A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Melee_Forge_Func016C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Melee_Forge_Func018001002)), function Trig_Blue_Melee_Forge_Func018A )
if ( Trig_Blue_Melee_Forge_Func019C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Flex_Cap
if ( Trig_Blue_Melee_Forge_Func019Func002C() ) then
set udg_bBlue_Cast_Level = GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit())
if ( Trig_Blue_Melee_Forge_Func019Func002Func003C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
return
else
endif
if ( Trig_Blue_Melee_Forge_Func019Func003C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
return
else
endif
set udg_bBlue_Unit_Max = ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 )
set udg_bBlue_Cast_Level = ( udg_bBlue_Unit_Max - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Melee_Forge_Func022C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5430" )
call GroupClear( udg_bBlue_Units )
return
else
endif
if ( Trig_Blue_Melee_Forge_Func023C() ) then
set udg_bBlue_Cast_Level = GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit())
else
endif
if ( Trig_Blue_Melee_Forge_Func024C() ) then
set udg_bBlue_Cast_Level = 12
else
endif
if ( Trig_Blue_Melee_Forge_Func025C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
call GroupClear( udg_bBlue_Units )
endfunction
//===========================================================================
function InitTrig_Blue_Melee_Forge takes nothing returns nothing
set gg_trg_Blue_Melee_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blue_Melee_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Blue_Melee_Forge, Condition( function Trig_Blue_Melee_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Blue_Melee_Forge, function Trig_Blue_Melee_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Blue_Ranged_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(1) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00C' ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func004C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func006001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Blue_Ranged_Forge_Func006A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Ranged_Forge_Func008C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func010001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Blue_Ranged_Forge_Func010A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Ranged_Forge_Func012C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func014001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Blue_Ranged_Forge_Func014A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Ranged_Forge_Func016C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func018001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Blue_Ranged_Forge_Func018A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Ranged_Forge_Func019Func002Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func019Func002C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func019Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func019C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_bBlue_Units) >= ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_bBlue_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func022C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func023C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func024C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Func025C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Ranged_Forge_Actions takes nothing returns nothing
set udg_bBlue_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_bBlue_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_bBlue_Mana_Mod) )
if ( Trig_Blue_Ranged_Forge_Func004C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5431" )
return
else
endif
set udg_bBlue_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Ranged_Forge_Func006001002)), function Trig_Blue_Ranged_Forge_Func006A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Ranged_Forge_Func008C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Ranged_Forge_Func010001002)), function Trig_Blue_Ranged_Forge_Func010A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Ranged_Forge_Func012C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Ranged_Forge_Func014001002)), function Trig_Blue_Ranged_Forge_Func014A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Ranged_Forge_Func016C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Ranged_Forge_Func018001002)), function Trig_Blue_Ranged_Forge_Func018A )
if ( Trig_Blue_Ranged_Forge_Func019C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Flex_Cap
if ( Trig_Blue_Ranged_Forge_Func019Func002C() ) then
set udg_bBlue_Cast_Level = GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit())
if ( Trig_Blue_Ranged_Forge_Func019Func002Func003C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
return
else
endif
if ( Trig_Blue_Ranged_Forge_Func019Func003C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
return
else
endif
set udg_bBlue_Unit_Max = ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 )
set udg_bBlue_Cast_Level = ( udg_bBlue_Unit_Max - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Ranged_Forge_Func022C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5432" )
call GroupClear( udg_bBlue_Units )
return
else
endif
if ( Trig_Blue_Ranged_Forge_Func023C() ) then
set udg_bBlue_Cast_Level = GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit())
else
endif
if ( Trig_Blue_Ranged_Forge_Func024C() ) then
set udg_bBlue_Cast_Level = 12
else
endif
if ( Trig_Blue_Ranged_Forge_Func025C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
call GroupClear( udg_bBlue_Units )
endfunction
//===========================================================================
function InitTrig_Blue_Ranged_Forge takes nothing returns nothing
set gg_trg_Blue_Ranged_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blue_Ranged_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Blue_Ranged_Forge, Condition( function Trig_Blue_Ranged_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Blue_Ranged_Forge, function Trig_Blue_Ranged_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Blue_Magic_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(1) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A006' ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func005001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Blue_Magic_Forge_Func005A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Magic_Forge_Func007C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func009001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Blue_Magic_Forge_Func009A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Magic_Forge_Func011C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func013001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Blue_Magic_Forge_Func013A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Magic_Forge_Func015C takes nothing returns boolean
if ( not ( udg_bBlue_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func017001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Blue_Magic_Forge_Func017A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_bBlue_Units )
endfunction
function Trig_Blue_Magic_Forge_Func018Func002Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func018Func002C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func018Func003C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func018C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_bBlue_Units) >= ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_bBlue_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func021C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func022C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func023C takes nothing returns boolean
if ( not ( udg_bBlue_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Func024C takes nothing returns boolean
if ( not ( udg_bBlue_Max_Cast < udg_bBlue_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Blue_Magic_Forge_Actions takes nothing returns nothing
set udg_bBlue_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_bBlue_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_bBlue_Mana_Mod) )
if ( Trig_Blue_Magic_Forge_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5433" )
return
else
endif
set udg_bBlue_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Magic_Forge_Func005001002)), function Trig_Blue_Magic_Forge_Func005A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Magic_Forge_Func007C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Magic_Forge_Func009001002)), function Trig_Blue_Magic_Forge_Func009A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Magic_Forge_Func011C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Magic_Forge_Func013001002)), function Trig_Blue_Magic_Forge_Func013A )
set udg_bBlue_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Magic_Forge_Func015C() ) then
set udg_bBlue_Flex_Cap = ( udg_bBlue_Flex_Cap + udg_bBlue_Flex_Value )
else
endif
call GroupClear( udg_bBlue_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Blue_Magic_Forge_Func017001002)), function Trig_Blue_Magic_Forge_Func017A )
if ( Trig_Blue_Magic_Forge_Func018C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Flex_Cap
if ( Trig_Blue_Magic_Forge_Func018Func002C() ) then
set udg_bBlue_Cast_Level = GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit())
if ( Trig_Blue_Magic_Forge_Func018Func002Func003C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
return
else
endif
if ( Trig_Blue_Magic_Forge_Func018Func003C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
return
else
endif
set udg_bBlue_Unit_Max = ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 )
set udg_bBlue_Cast_Level = ( udg_bBlue_Unit_Max - CountUnitsInGroup(udg_bBlue_Units) )
if ( Trig_Blue_Magic_Forge_Func021C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5434" )
call GroupClear( udg_bBlue_Units )
return
else
endif
if ( Trig_Blue_Magic_Forge_Func022C() ) then
set udg_bBlue_Cast_Level = GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit())
else
endif
if ( Trig_Blue_Magic_Forge_Func023C() ) then
set udg_bBlue_Cast_Level = 12
else
endif
if ( Trig_Blue_Magic_Forge_Func024C() ) then
set udg_bBlue_Cast_Level = udg_bBlue_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_bBlue_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_bBlue_Cast_Level) * udg_bBlue_Mana_Mod ) ) )
call GroupClear( udg_bBlue_Units )
endfunction
//===========================================================================
function InitTrig_Blue_Magic_Forge takes nothing returns nothing
set gg_trg_Blue_Magic_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Blue_Magic_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Blue_Magic_Forge, Condition( function Trig_Blue_Magic_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Blue_Magic_Forge, function Trig_Blue_Magic_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Teal_Melee_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(2) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A01N' ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func005C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func007001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Teal_Melee_Forge_Func007A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Melee_Forge_Func009C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func011001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Teal_Melee_Forge_Func011A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Melee_Forge_Func013C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func015001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Teal_Melee_Forge_Func015A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Melee_Forge_Func017C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func019001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Teal_Melee_Forge_Func019A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Melee_Forge_Func020Func002Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func020Func002C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func020Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func020C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_cTeal_Units) >= ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_cTeal_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func023C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func024C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func025C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Func026C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Melee_Forge_Actions takes nothing returns nothing
set udg_cTeal_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_cTeal_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_cTeal_Mana_Mod) )
if ( Trig_Teal_Melee_Forge_Func005C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5435" )
return
else
endif
set udg_cTeal_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Melee_Forge_Func007001002)), function Trig_Teal_Melee_Forge_Func007A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Melee_Forge_Func009C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Melee_Forge_Func011001002)), function Trig_Teal_Melee_Forge_Func011A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Melee_Forge_Func013C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Melee_Forge_Func015001002)), function Trig_Teal_Melee_Forge_Func015A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Melee_Forge_Func017C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Melee_Forge_Func019001002)), function Trig_Teal_Melee_Forge_Func019A )
if ( Trig_Teal_Melee_Forge_Func020C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Flex_Cap
if ( Trig_Teal_Melee_Forge_Func020Func002C() ) then
set udg_cTeal_Cast_Level = GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit())
if ( Trig_Teal_Melee_Forge_Func020Func002Func003C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
return
else
endif
if ( Trig_Teal_Melee_Forge_Func020Func003C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
return
else
endif
set udg_cTeal_Unit_Max = ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 )
set udg_cTeal_Cast_Level = ( udg_cTeal_Unit_Max - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Melee_Forge_Func023C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5436" )
call GroupClear( udg_cTeal_Units )
return
else
endif
if ( Trig_Teal_Melee_Forge_Func024C() ) then
set udg_cTeal_Cast_Level = GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit())
else
endif
if ( Trig_Teal_Melee_Forge_Func025C() ) then
set udg_cTeal_Cast_Level = 12
else
endif
if ( Trig_Teal_Melee_Forge_Func026C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
call GroupClear( udg_cTeal_Units )
endfunction
//===========================================================================
function InitTrig_Teal_Melee_Forge takes nothing returns nothing
set gg_trg_Teal_Melee_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Teal_Melee_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Teal_Melee_Forge, Condition( function Trig_Teal_Melee_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Teal_Melee_Forge, function Trig_Teal_Melee_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Teal_Ranged_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(2) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00C' ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func004C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func006001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Teal_Ranged_Forge_Func006A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Ranged_Forge_Func008C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func010001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Teal_Ranged_Forge_Func010A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Ranged_Forge_Func012C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func014001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Teal_Ranged_Forge_Func014A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Ranged_Forge_Func016C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func018001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Teal_Ranged_Forge_Func018A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Ranged_Forge_Func019Func002Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func019Func002C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func019Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func019C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_cTeal_Units) >= ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_cTeal_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func022C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func023C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func024C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Func025C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Ranged_Forge_Actions takes nothing returns nothing
set udg_cTeal_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_cTeal_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_cTeal_Mana_Mod) )
if ( Trig_Teal_Ranged_Forge_Func004C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5437" )
return
else
endif
set udg_cTeal_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Ranged_Forge_Func006001002)), function Trig_Teal_Ranged_Forge_Func006A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Ranged_Forge_Func008C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Ranged_Forge_Func010001002)), function Trig_Teal_Ranged_Forge_Func010A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Ranged_Forge_Func012C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Ranged_Forge_Func014001002)), function Trig_Teal_Ranged_Forge_Func014A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Ranged_Forge_Func016C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Ranged_Forge_Func018001002)), function Trig_Teal_Ranged_Forge_Func018A )
if ( Trig_Teal_Ranged_Forge_Func019C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Flex_Cap
if ( Trig_Teal_Ranged_Forge_Func019Func002C() ) then
set udg_cTeal_Cast_Level = GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit())
if ( Trig_Teal_Ranged_Forge_Func019Func002Func003C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
return
else
endif
if ( Trig_Teal_Ranged_Forge_Func019Func003C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
return
else
endif
set udg_cTeal_Unit_Max = ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 )
set udg_cTeal_Cast_Level = ( udg_cTeal_Unit_Max - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Ranged_Forge_Func022C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5438" )
call GroupClear( udg_cTeal_Units )
return
else
endif
if ( Trig_Teal_Ranged_Forge_Func023C() ) then
set udg_cTeal_Cast_Level = GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit())
else
endif
if ( Trig_Teal_Ranged_Forge_Func024C() ) then
set udg_cTeal_Cast_Level = 12
else
endif
if ( Trig_Teal_Ranged_Forge_Func025C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
call GroupClear( udg_cTeal_Units )
endfunction
//===========================================================================
function InitTrig_Teal_Ranged_Forge takes nothing returns nothing
set gg_trg_Teal_Ranged_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Teal_Ranged_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Teal_Ranged_Forge, Condition( function Trig_Teal_Ranged_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Teal_Ranged_Forge, function Trig_Teal_Ranged_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Teal_Magic_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(2) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A006' ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func005001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Teal_Magic_Forge_Func005A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Magic_Forge_Func007C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func009001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Teal_Magic_Forge_Func009A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Magic_Forge_Func011C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func013001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Teal_Magic_Forge_Func013A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Magic_Forge_Func015C takes nothing returns boolean
if ( not ( udg_cTeal_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func017001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Teal_Magic_Forge_Func017A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_cTeal_Units )
endfunction
function Trig_Teal_Magic_Forge_Func018Func002Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func018Func002C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func018Func003C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func018C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_cTeal_Units) >= ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_cTeal_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func021C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func022C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func023C takes nothing returns boolean
if ( not ( udg_cTeal_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Func024C takes nothing returns boolean
if ( not ( udg_cTeal_Max_Cast < udg_cTeal_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Teal_Magic_Forge_Actions takes nothing returns nothing
set udg_cTeal_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_cTeal_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_cTeal_Mana_Mod) )
if ( Trig_Teal_Magic_Forge_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5439" )
return
else
endif
set udg_cTeal_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Magic_Forge_Func005001002)), function Trig_Teal_Magic_Forge_Func005A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Magic_Forge_Func007C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Magic_Forge_Func009001002)), function Trig_Teal_Magic_Forge_Func009A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Magic_Forge_Func011C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Magic_Forge_Func013001002)), function Trig_Teal_Magic_Forge_Func013A )
set udg_cTeal_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Magic_Forge_Func015C() ) then
set udg_cTeal_Flex_Cap = ( udg_cTeal_Flex_Cap + udg_cTeal_Flex_Value )
else
endif
call GroupClear( udg_cTeal_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Teal_Magic_Forge_Func017001002)), function Trig_Teal_Magic_Forge_Func017A )
if ( Trig_Teal_Magic_Forge_Func018C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Flex_Cap
if ( Trig_Teal_Magic_Forge_Func018Func002C() ) then
set udg_cTeal_Cast_Level = GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit())
if ( Trig_Teal_Magic_Forge_Func018Func002Func003C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
return
else
endif
if ( Trig_Teal_Magic_Forge_Func018Func003C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
return
else
endif
set udg_cTeal_Unit_Max = ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 )
set udg_cTeal_Cast_Level = ( udg_cTeal_Unit_Max - CountUnitsInGroup(udg_cTeal_Units) )
if ( Trig_Teal_Magic_Forge_Func021C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5440" )
call GroupClear( udg_cTeal_Units )
return
else
endif
if ( Trig_Teal_Magic_Forge_Func022C() ) then
set udg_cTeal_Cast_Level = GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit())
else
endif
if ( Trig_Teal_Magic_Forge_Func023C() ) then
set udg_cTeal_Cast_Level = 12
else
endif
if ( Trig_Teal_Magic_Forge_Func024C() ) then
set udg_cTeal_Cast_Level = udg_cTeal_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_cTeal_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_cTeal_Cast_Level) * udg_cTeal_Mana_Mod ) ) )
call GroupClear( udg_cTeal_Units )
endfunction
//===========================================================================
function InitTrig_Teal_Magic_Forge takes nothing returns nothing
set gg_trg_Teal_Magic_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Teal_Magic_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Teal_Magic_Forge, Condition( function Trig_Teal_Magic_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Teal_Magic_Forge, function Trig_Teal_Magic_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Purple_Melee_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(3) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A01N' ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func005C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func007001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Purple_Melee_Forge_Func007A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Melee_Forge_Func009C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func011001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Purple_Melee_Forge_Func011A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Melee_Forge_Func013C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func015001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Purple_Melee_Forge_Func015A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Melee_Forge_Func017C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func019001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Purple_Melee_Forge_Func019A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Melee_Forge_Func020Func002Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func020Func002C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func020Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func020C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_dPurple_Units) >= ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_dPurple_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func023C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func024C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func025C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Func026C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Melee_Forge_Actions takes nothing returns nothing
set udg_dPurple_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_dPurple_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_dPurple_Mana_Mod) )
if ( Trig_Purple_Melee_Forge_Func005C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5462" )
return
else
endif
set udg_dPurple_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Melee_Forge_Func007001002)), function Trig_Purple_Melee_Forge_Func007A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Melee_Forge_Func009C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Melee_Forge_Func011001002)), function Trig_Purple_Melee_Forge_Func011A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Melee_Forge_Func013C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Melee_Forge_Func015001002)), function Trig_Purple_Melee_Forge_Func015A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Melee_Forge_Func017C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Melee_Forge_Func019001002)), function Trig_Purple_Melee_Forge_Func019A )
if ( Trig_Purple_Melee_Forge_Func020C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Flex_Cap
if ( Trig_Purple_Melee_Forge_Func020Func002C() ) then
set udg_dPurple_Cast_Level = GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit())
if ( Trig_Purple_Melee_Forge_Func020Func002Func003C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
return
else
endif
if ( Trig_Purple_Melee_Forge_Func020Func003C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
return
else
endif
set udg_dPurple_Unit_Max = ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 )
set udg_dPurple_Cast_Level = ( udg_dPurple_Unit_Max - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Melee_Forge_Func023C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5463" )
call GroupClear( udg_dPurple_Units )
return
else
endif
if ( Trig_Purple_Melee_Forge_Func024C() ) then
set udg_dPurple_Cast_Level = GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit())
else
endif
if ( Trig_Purple_Melee_Forge_Func025C() ) then
set udg_dPurple_Cast_Level = 12
else
endif
if ( Trig_Purple_Melee_Forge_Func026C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A01N', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
call GroupClear( udg_dPurple_Units )
endfunction
//===========================================================================
function InitTrig_Purple_Melee_Forge takes nothing returns nothing
set gg_trg_Purple_Melee_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Purple_Melee_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Purple_Melee_Forge, Condition( function Trig_Purple_Melee_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Purple_Melee_Forge, function Trig_Purple_Melee_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Purple_Ranged_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(3) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A00C' ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func004C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func006001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Purple_Ranged_Forge_Func006A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Ranged_Forge_Func008C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func010001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Purple_Ranged_Forge_Func010A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Ranged_Forge_Func012C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func014001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Purple_Ranged_Forge_Func014A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Ranged_Forge_Func016C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func018001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Purple_Ranged_Forge_Func018A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Ranged_Forge_Func019Func002Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func019Func002C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func019Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func019C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_dPurple_Units) >= ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_dPurple_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func022C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func023C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func024C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Func025C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Ranged_Forge_Actions takes nothing returns nothing
set udg_dPurple_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_dPurple_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_dPurple_Mana_Mod) )
if ( Trig_Purple_Ranged_Forge_Func004C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5472" )
return
else
endif
set udg_dPurple_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Ranged_Forge_Func006001002)), function Trig_Purple_Ranged_Forge_Func006A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Ranged_Forge_Func008C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Ranged_Forge_Func010001002)), function Trig_Purple_Ranged_Forge_Func010A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Ranged_Forge_Func012C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Ranged_Forge_Func014001002)), function Trig_Purple_Ranged_Forge_Func014A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Ranged_Forge_Func016C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Ranged_Forge_Func018001002)), function Trig_Purple_Ranged_Forge_Func018A )
if ( Trig_Purple_Ranged_Forge_Func019C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Flex_Cap
if ( Trig_Purple_Ranged_Forge_Func019Func002C() ) then
set udg_dPurple_Cast_Level = GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit())
if ( Trig_Purple_Ranged_Forge_Func019Func002Func003C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
return
else
endif
if ( Trig_Purple_Ranged_Forge_Func019Func003C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
return
else
endif
set udg_dPurple_Unit_Max = ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 )
set udg_dPurple_Cast_Level = ( udg_dPurple_Unit_Max - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Ranged_Forge_Func022C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5473" )
call GroupClear( udg_dPurple_Units )
return
else
endif
if ( Trig_Purple_Ranged_Forge_Func023C() ) then
set udg_dPurple_Cast_Level = GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit())
else
endif
if ( Trig_Purple_Ranged_Forge_Func024C() ) then
set udg_dPurple_Cast_Level = 12
else
endif
if ( Trig_Purple_Ranged_Forge_Func025C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A00C', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
call GroupClear( udg_dPurple_Units )
endfunction
//===========================================================================
function InitTrig_Purple_Ranged_Forge takes nothing returns nothing
set gg_trg_Purple_Ranged_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Purple_Ranged_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Purple_Ranged_Forge, Condition( function Trig_Purple_Ranged_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Purple_Ranged_Forge, function Trig_Purple_Ranged_Forge_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Purple_Magic_Forge_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(3) ) ) then
return false
endif
if ( not ( GetSpellAbilityId() == 'A006' ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast == 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func005001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 1 )
endfunction
function Trig_Purple_Magic_Forge_Func005A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Magic_Forge_Func007C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func009001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 2 )
endfunction
function Trig_Purple_Magic_Forge_Func009A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Magic_Forge_Func011C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func013001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Purple_Magic_Forge_Func013A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Magic_Forge_Func015C takes nothing returns boolean
if ( not ( udg_dPurple_Flex_Value < 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func017001002 takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Purple_Magic_Forge_Func017A takes nothing returns nothing
call GroupAddUnitSimple( GetEnumUnit(), udg_dPurple_Units )
endfunction
function Trig_Purple_Magic_Forge_Func018Func002Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func018Func002C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func018Func003C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func018C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_dPurple_Units) >= ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) ) ) then
return false
endif
if ( not ( udg_dPurple_Flex_Cap > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func021C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level <= 0 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func022C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func023C takes nothing returns boolean
if ( not ( udg_dPurple_Cast_Level > 12 ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Func024C takes nothing returns boolean
if ( not ( udg_dPurple_Max_Cast < udg_dPurple_Cast_Level ) ) then
return false
endif
return true
endfunction
function Trig_Purple_Magic_Forge_Actions takes nothing returns nothing
set udg_dPurple_Mana_Mod = ( udg_wBase_Mana_Cost * ( 1 - ( I2R(GetPlayerTechMaxAllowedSwap('R00Z', GetOwningPlayer(GetSpellAbilityUnit()))) * 0.03 ) ) )
set udg_dPurple_Max_Cast = ( R2I(GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit())) / R2I(udg_dPurple_Mana_Mod) )
if ( Trig_Purple_Magic_Forge_Func003C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5470" )
return
else
endif
set udg_dPurple_Flex_Cap = GetHeroStatBJ(bj_HEROSTAT_AGI, GetSpellAbilityUnit(), true)
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Magic_Forge_Func005001002)), function Trig_Purple_Magic_Forge_Func005A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A01M', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Magic_Forge_Func007C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Magic_Forge_Func009001002)), function Trig_Purple_Magic_Forge_Func009A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A00I', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Magic_Forge_Func011C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Magic_Forge_Func013001002)), function Trig_Purple_Magic_Forge_Func013A )
set udg_dPurple_Flex_Value = ( ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 ) - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Magic_Forge_Func015C() ) then
set udg_dPurple_Flex_Cap = ( udg_dPurple_Flex_Cap + udg_dPurple_Flex_Value )
else
endif
call GroupClear( udg_dPurple_Units )
call ForGroupBJ( GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellAbilityUnit()), Condition(function Trig_Purple_Magic_Forge_Func017001002)), function Trig_Purple_Magic_Forge_Func017A )
if ( Trig_Purple_Magic_Forge_Func018C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Flex_Cap
if ( Trig_Purple_Magic_Forge_Func018Func002C() ) then
set udg_dPurple_Cast_Level = GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit())
if ( Trig_Purple_Magic_Forge_Func018Func002Func003C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
return
else
endif
if ( Trig_Purple_Magic_Forge_Func018Func003C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
return
else
endif
set udg_dPurple_Unit_Max = ( GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit()) * 2 )
set udg_dPurple_Cast_Level = ( udg_dPurple_Unit_Max - CountUnitsInGroup(udg_dPurple_Units) )
if ( Trig_Purple_Magic_Forge_Func021C() ) then
call IssueImmediateOrderBJ( GetSpellAbilityUnit(), "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(GetSpellAbilityUnit())), "TRIGSTR_5471" )
call GroupClear( udg_dPurple_Units )
return
else
endif
if ( Trig_Purple_Magic_Forge_Func022C() ) then
set udg_dPurple_Cast_Level = GetUnitAbilityLevelSwapped('A005', GetSpellAbilityUnit())
else
endif
if ( Trig_Purple_Magic_Forge_Func023C() ) then
set udg_dPurple_Cast_Level = 12
else
endif
if ( Trig_Purple_Magic_Forge_Func024C() ) then
set udg_dPurple_Cast_Level = udg_dPurple_Max_Cast
else
endif
call SetUnitAbilityLevelSwapped( 'A006', GetSpellAbilityUnit(), udg_dPurple_Cast_Level )
call SetUnitManaBJ( GetSpellAbilityUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetSpellAbilityUnit()) - ( I2R(udg_dPurple_Cast_Level) * udg_dPurple_Mana_Mod ) ) )
call GroupClear( udg_dPurple_Units )
endfunction
//===========================================================================
function InitTrig_Purple_Magic_Forge takes nothing returns nothing
set gg_trg_Purple_Magic_Forge = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Purple_Magic_Forge, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Purple_Magic_Forge, Condition( function Trig_Purple_Magic_Forge_Conditions ) )
call TriggerAddAction( gg_trg_Purple_Magic_Forge, function Trig_Purple_Magic_Forge_Actions )
endfunction