Name | Type | is_array | initial_value |
Ability_Being_Cast | abilcode | Yes | |
aCasting_Level | integer | No | |
aFlex_Cap | integer | No | |
aFlex_Value | integer | No | |
aLife_Cost | real | No | 50.00 |
aMax_Casts | integer | No | |
aMax_Units | integer | No | |
aTemp_Unit_Count | integer | No | |
baaPlayer_Unit_Kills | integer | Yes | |
baKills | integer | No | |
bBlue_Kills | integer | No | |
bBrown_Kills | integer | No | |
bDark_Green_Kills | integer | No | |
bGray_Kills | integer | No | |
bGreen_Kills | integer | No | |
bLight_Blue_Kills | integer | No | |
bOrange_Kills | integer | No | |
bPink_Kills | integer | No | |
bPurple_Kills | integer | No | |
bRed_Kills | integer | No | |
bTeal_Kills | integer | No | |
bYellow_Kills | integer | No | |
Craft_Board | multiboard | Yes | |
Custom_Data_End | integer | No | 18 |
Custom_Unit_Value | integer | No | 0 |
Data_String | string | Yes | |
Is_Summoning | group | No | |
Multiboard | multiboard | Yes | |
Numbers | group | Yes | |
rDeath_Number | integer | No | |
Spawn_Number | integer | No | |
Spawn_Protection | group | No | |
sPortal_Index | rect | Yes | |
sPortal_Roll | integer | No | |
sTemp_Point | location | No | |
tAbility | string | No | None |
tAttack_Pulse | real | No | 45.00 |
tAttack_Type | string | Yes | |
tAttack_Vaule | integer | No | |
tCreep_Type_Roll | integer | No | |
tCreep_Unit | unitcode | Yes | |
tCreep_Unit_I | unitcode | No | |
tCreep_Unit_II | unitcode | No | |
tCreep_Unit_III | unitcode | No | |
tDefense_Type | string | Yes | |
tDefense_Vaule | integer | No | |
tDisplay_Time | real | No | 20.00 |
Temp_Force | force | No | |
Temp_Group | group | No | |
Temp_Integer | integer | No | |
Temp_Integer_2 | integer | No | |
Temp_Point | location | No | |
Temp_Point_2 | location | No | |
Temp_Point_3 | location | No | |
Temp_Point_CD | location | Yes | |
Temp_Unit | unit | No | |
tQuadrant_Index | rect | Yes | |
tQuadrant_Point | location | No | |
tQuadrant_Roll | integer | No | |
tRange | integer | No | |
tRange_Lenghts | string | Yes | |
tReady_Timer | timer | No | |
tRemaining_Creeps | integer | No | |
tSpawn_Cut_Delay | real | No | 120.00 |
tSpawn_Number_Mod | integer | No | 1 |
uButton_I | button | No | |
uButton_II | button | No | |
uButton_III | button | No | |
uDiffticulty_Dialog | dialog | No | |
uGoal_Dialog | dialog | No | |
uKills_Dialog | dialog | No | |
uMode_Dialog | dialog | No | |
Unit_Type_Magic | unitcode | Yes | |
Unit_Type_Melee | unitcode | Yes | |
Unit_Type_Ranged | unitcode | Yes | |
uPVE_quest | quest | No | |
uPVP_quest | quest | No | |
vaaActual_Players | force | No | |
vaaAlive_Crafter | group | No | |
vaaBlood_Crafter | unit | Yes | |
vabWinning_BC | unit | No | |
wBase_Exp_Mult | integer | No | 2 |
wBase_Mana_Cost | real | No | 10.00 |
wBloodmute_Exp_Mult | integer | No | 15 |
wBloodmute_Mana_Cost | real | No | 30.00 |
xKills_For_Point | integer | No | 5 |
xKills_Needed | integer | No | |
xPlayer | integer | No | |
xThreshold | real | No | 40.00 |
xWoodGain | integer | No | 1 |
yAutoCast_Attacker | group | No | |
yEnhancement_Ability | abilcode | Yes | |
yEnhancement_Affect | string | Yes | |
yEnhancement_Threshold | real | Yes | |
yMessage | string | No | |cffaeaeaemetal|r |
yPlayer | player | No | |
ySlot_1 | integer | No | |
ySlot_2 | integer | No | |
ySlot_3 | integer | No | |
ySlot_4 | integer | No | |
yTech_Type | techcode | No | |
yTemp_Point | location | No | |
yVeterancy_Value | real | No | |
zaaBlood_Works | unit | Yes | |
zBlood_Forge_Hero | unit | Yes | |
zzBlood_Well | unit | No |
//TESH.scrollpos=29
//TESH.alwaysfold=0
function Trig_Arcane_Bond_Conditions takes nothing returns boolean
if ( not ( GetUnitPointValue(GetEnteringUnit()) < 4 ) ) then
return false
endif
return true
endfunction
function Safety takes nothing returns boolean
local unit a = udg_Temp_Unit
if ( ( RectContainsUnit(gg_rct_Center, a) == true ) ) then
set a = null
return true
endif
if ( ( UnitHasBuffBJ(a, 'B002') == true ) ) then
set a = null
return true
endif
if ( IsUnitDeadBJ(a) == true ) then
set a = null
return true
endif
set a = null
return false
endfunction
function Arcane_Bond takes nothing returns nothing
local unit a = udg_Temp_Unit
local effect b
loop
call TriggerSleepAction( .50)
if ( not ( RectContainsUnit(gg_rct_Center, a) == true ) ) then
if ( not ( UnitHasBuffBJ(a, 'B002') == true ) ) then
call AddSpecialEffectTargetUnitBJ( "chest", a, "war3mapImported\\BloodCloud.mdx" )
set b = GetLastCreatedEffectBJ()
loop
set udg_Temp_Unit = a
call SetUnitLifeBJ( a, ( GetUnitStateSwap(UNIT_STATE_LIFE, a) - 25 ) )
call SetUnitManaBJ( a, ( GetUnitStateSwap(UNIT_STATE_MANA, a) - 25 ) )
exitwhen (Safety() == true)
call TriggerSleepAction( .50)
endloop
call DestroyEffectBJ( b )
set b = null
endif
endif
exitwhen ( IsUnitDeadBJ(a) == true )
endloop
set a = null
endfunction
//===========================================================================
function InitTrig_Arcane_Bond takes nothing returns nothing
set gg_trg_Arcane_Bond = CreateTrigger( )
call TriggerAddAction( gg_trg_Arcane_Bond, function Arcane_Bond )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Structure_Check takes nothing returns boolean
if ( not ( IsUnitType(GetAttackedUnitBJ(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
return true
endfunction
function Trig_Flanking_Actions takes nothing returns nothing
local unit u = GetAttacker()
local unit u2 = GetAttackedUnitBJ()
local real a = GetUnitFacing(u)
local real b = GetUnitFacing(u2)
local real c
if (a <= 90) then
if (b > 180) then
set a = a + 360
endif
endif
if (b <= 90) then
if (a > 180) then
set b = b + 360
endif
endif
set c = RAbsBJ(a - b)
if c <= 90 then
call TriggerSleepAction( .5)
call UnitDamageTargetBJ( u, u2, GetRandomReal(4.99, 20.01), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNKNOWN )
endif
set u = null
set u2 = null
endfunction
//===========================================================================
function InitTrig_Flanking takes nothing returns nothing
set gg_trg_Flanking = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flanking, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Flanking, Condition( function Structure_Check ) )
call TriggerAddAction( gg_trg_Flanking, function Trig_Flanking_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Defend_Animation_Conditions takes nothing returns boolean
if ( not ( GetIssuedOrderIdBJ() == String2OrderIdBJ("berserk") ) ) then
return false
endif
return true
endfunction
function Trig_Defend_Animation_Actions takes nothing returns nothing
local unit D = GetOrderedUnit()
call AddUnitAnimationPropertiesBJ( true, "defend", D )
call TriggerSleepAction( 12.00 )
call AddUnitAnimationPropertiesBJ( false, "defend", D )
set D = null
endfunction
//===========================================================================
function InitTrig_Defend_Animation takes nothing returns nothing
set gg_trg_Defend_Animation = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Defend_Animation, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( gg_trg_Defend_Animation, Condition( function Trig_Defend_Animation_Conditions ) )
call TriggerAddAction( gg_trg_Defend_Animation, function Trig_Defend_Animation_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Summoned_Actions takes nothing returns nothing
local unit a = udg_Temp_Unit
local effect b
call AddSpecialEffectTargetUnitBJ( "origin", a, "war3mapImported\\BloodTornado.mdx" )
set b = GetLastCreatedEffectBJ()
call TriggerSleepAction( 2.00)
call DestroyEffectBJ( b )
set a = null
set b = null
endfunction
//===========================================================================
function InitTrig_Summoned takes nothing returns nothing
set gg_trg_Summoned = CreateTrigger( )
call TriggerAddAction( gg_trg_Summoned, function Trig_Summoned_Actions )
endfunction
//TESH.scrollpos=42
//TESH.alwaysfold=0
function Trig_Craft_Melee_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A01M' ) ) then
return false
endif
return true
endfunction
function Trig_Craft_Melee_Actions takes nothing returns nothing
local integer FC
local integer LI
local integer UC
local integer FV
local integer E = 0
local unit H = GetSpellAbilityUnit()
local location H2 = GetUnitLoc(H)
local location B2
call SetUnitAbilityLevelSwapped( 'A006', H, 1 )
loop
call TriggerSleepAction( 4.00 - .25 * GetUnitAbilityLevelSwapped( 'A01M', H))
if ( not ( GetUnitAbilityLevelSwapped('A006', H) == 1 ) ) then
set E = 1
endif
if ( not ( IsUnitInGroup(H, udg_Is_Summoning) == true ) ) then
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
if ( GetUnitLifePercent(H) <= 10 ) then
call IssueImmediateOrderBJ( H, "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(H)), "|cffff0000Failure:|r|cff00ff00 Your health is cirtical.|r" )
set E = 1
endif
exitwhen E == 1
set FC = GetHeroStatBJ(bj_HEROSTAT_AGI, H, true)
set LI = 1
loop
set UC = CountUnitsInGroup(udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + LI )])
set FV = ( ( GetUnitAbilityLevelSwapped(udg_Ability_Being_Cast[LI], H) * 2 ) - UC )
if ( FV < 0 ) then
set FC = ( FC + FV )
endif
exitwhen LI == 3
set LI = LI + 1
endloop
set UC = CountUnitsInGroup(udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 1 )])
if (( GetUnitAbilityLevelSwapped('A01M', H) * 2 - UC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Melee[GetUnitAbilityLevelSwapped('A020', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 1 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
if (( FC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Melee[GetUnitAbilityLevelSwapped('A020', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 1 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
endif
endloop
set H = null
call RemoveLocation( H2)
endfunction
//===========================================================================
function InitTrig_Craft_Melee takes nothing returns nothing
set gg_trg_Craft_Melee = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Craft_Melee, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Craft_Melee, Condition( function Trig_Craft_Melee_Conditions ) )
call TriggerAddAction( gg_trg_Craft_Melee, function Trig_Craft_Melee_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_Craft_Ranged_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A00I' ) ) then
return false
endif
return true
endfunction
function Trig_Craft_Ranged_Actions takes nothing returns nothing
local integer FC
local integer LI
local integer UC
local integer FV
local integer E = 0
local unit H = GetSpellAbilityUnit()
local location H2 = GetUnitLoc(H)
local location B2
call SetUnitAbilityLevelSwapped( 'A006', H, 2 )
loop
call TriggerSleepAction( 4.00 - .25 * GetUnitAbilityLevelSwapped( 'A00I', H))
if ( not ( GetUnitAbilityLevelSwapped('A006', H) == 2 ) ) then
set E = 1
endif
if ( not ( IsUnitInGroup(H, udg_Is_Summoning) == true ) ) then
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
if ( GetUnitLifePercent(H) <= 10 ) then
call IssueImmediateOrderBJ( H, "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(H)), "|cffff0000Failure:|r|cff00ff00 Your health is cirtical.|r" )
set E = 1
endif
exitwhen E == 1
set FC = GetHeroStatBJ(bj_HEROSTAT_AGI, H, true)
set LI = 1
loop
set UC = CountUnitsInGroup(udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + LI )])
set FV = ( ( GetUnitAbilityLevelSwapped(udg_Ability_Being_Cast[LI], H) * 2 ) - UC )
if ( FV < 0 ) then
set FC = ( FC + FV )
endif
exitwhen LI == 3
set LI = LI + 1
endloop
set UC = CountUnitsInGroup(udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 2 )])
if (( GetUnitAbilityLevelSwapped('A00I', H) * 2 - UC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Ranged[GetUnitAbilityLevelSwapped('A021', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 2 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
if (( FC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Ranged[GetUnitAbilityLevelSwapped('A021', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 2 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
endif
endloop
set H = null
call RemoveLocation( H2)
endfunction
//===========================================================================
function InitTrig_Craft_Ranged takes nothing returns nothing
set gg_trg_Craft_Ranged = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Craft_Ranged, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Craft_Ranged, Condition( function Trig_Craft_Ranged_Conditions ) )
call TriggerAddAction( gg_trg_Craft_Ranged, function Trig_Craft_Ranged_Actions )
endfunction
//TESH.scrollpos=23
//TESH.alwaysfold=0
function Trig_Craft_Magic_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A005' ) ) then
return false
endif
return true
endfunction
function Trig_Craft_Magic_Actions takes nothing returns nothing
local integer FC
local integer LI
local integer UC
local integer FV
local integer E = 0
local unit H = GetSpellAbilityUnit()
local location H2 = GetUnitLoc(H)
local location B2
call SetUnitAbilityLevelSwapped( 'A006', H, 3 )
loop
call TriggerSleepAction( 4.00 - .25 * GetUnitAbilityLevelSwapped( 'A005', H))
if ( not ( GetUnitAbilityLevelSwapped('A006', H) == 3 ) ) then
set E = 1
endif
if ( not ( IsUnitInGroup(H, udg_Is_Summoning) == true ) ) then
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
if ( GetUnitLifePercent(H) <= 10 ) then
call IssueImmediateOrderBJ( H, "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(H)), "|cffff0000Failure:|r|cff00ff00 Your health is cirtical.|r" )
set E = 1
endif
exitwhen E == 1
set FC = GetHeroStatBJ(bj_HEROSTAT_AGI, H, true)
set LI = 1
loop
set UC = CountUnitsInGroup(udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + LI )])
set FV = ( ( GetUnitAbilityLevelSwapped(udg_Ability_Being_Cast[LI], H) * 2 ) - UC )
if ( FV < 0 ) then
set FC = ( FC + FV )
endif
exitwhen LI == 3
set LI = LI + 1
endloop
set UC = CountUnitsInGroup(udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 3 )])
if (( GetUnitAbilityLevelSwapped('A005', H) * 2 - UC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Magic[GetUnitAbilityLevelSwapped('A022', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 3 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
if (( FC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Magic[GetUnitAbilityLevelSwapped('A022', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 3 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
endif
endloop
set H = null
call RemoveLocation( H2)
endfunction
//===========================================================================
function InitTrig_Craft_Magic takes nothing returns nothing
set gg_trg_Craft_Magic = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Craft_Magic, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Craft_Magic, Condition( function Trig_Craft_Magic_Conditions ) )
call TriggerAddAction( gg_trg_Craft_Magic, function Trig_Craft_Magic_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Multi_Actions takes nothing returns nothing
local integer i = 1
call TriggerSleepAction( 0.00 )
loop
exitwhen i > 12
set udg_Multiboard[i] = CreateMultiboardBJ( 6, 4, "Blood Craft" )
call MultiboardDisplayBJ( false, udg_Multiboard[i] )
set i = i + 1
endloop
set i = 0
loop
exitwhen i > 12
if GetLocalPlayer() == Player(i) then
call MultiboardDisplayBJ( true, udg_Multiboard[i + 1] )
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Multi takes nothing returns nothing
set gg_trg_Multi = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Multi, 1.00 )
call TriggerAddAction( gg_trg_Multi, function Trig_Multi_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Forge_Point takes nothing returns nothing
local unit a = udg_Temp_Unit
local integer hold
set hold = udg_Temp_Integer + S2I(udg_Data_String[GetUnitUserData( a )])
if ( hold > R2I(udg_xThreshold)*100 ) then
set hold = hold - R2I(udg_xThreshold)*100
set udg_Data_String[GetUnitUserData( a )] = I2S(hold)
call AdjustPlayerStateBJ( udg_xWoodGain, GetOwningPlayer(a), PLAYER_STATE_RESOURCE_LUMBER )
call ConditionalTriggerExecute( gg_trg_Set_Skill_Points)
else
set udg_Data_String[GetUnitUserData( a )] = I2S(hold)
endif
set a = null
endfunction
//===========================================================================
function InitTrig_Forge_Point_Gain takes nothing returns nothing
set gg_trg_Forge_Point_Gain = CreateTrigger( )
call TriggerAddAction( gg_trg_Forge_Point_Gain, function Forge_Point )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Enhancement_Advancement_Conditions takes nothing returns boolean
local integer a = 1
loop
if ( GetUnitAbilityLevelSwapped(udg_yEnhancement_Ability[a], udg_Temp_Unit) == 6 ) then
return false
endif
exitwhen ( a == 3 )
set a = a + 1
endloop
return true
endfunction
function Enhancement_Advancement takes nothing returns nothing
local unit a = udg_Temp_Unit
local integer hold = udg_Temp_Integer
local integer c = 6
local integer d = udg_Temp_Integer_2
loop
if ( hold >= R2I(udg_yEnhancement_Threshold[c - 1] * 100) ) then
if ( not ( GetUnitAbilityLevelSwapped(udg_yEnhancement_Ability[d], a) == c ) ) then
call AddSpecialEffectTargetUnitBJ( "origin", a, udg_yEnhancement_Affect[d])
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call SetUnitAbilityLevelSwapped( udg_yEnhancement_Ability[d], a, c )
call SetUnitAbilityLevelSwapped( udg_yEnhancement_Ability[d+3], a, c )
set c = 2
endif
set c = 2
endif
exitwhen ( c == 2 )
set c = c - 1
endloop
set a = null
endfunction
//===========================================================================
function InitTrig_Enhancement_Advancement takes nothing returns nothing
set gg_trg_Enhancement_Advancement = CreateTrigger( )
call TriggerAddCondition( gg_trg_Enhancement_Advancement, Condition( function Enhancement_Advancement_Conditions ) )
call TriggerAddAction( gg_trg_Enhancement_Advancement, function Enhancement_Advancement )
endfunction
//TESH.scrollpos=60
//TESH.alwaysfold=0
function Trig_Attacks_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetAttacker(), UNIT_TYPE_HERO) != true ) ) then
return false
endif
if ( not ( GetUnitPointValue(GetAttacker()) < 4 ) ) then
return false
endif
return true
endfunction
function Trig_Attacks_Actions takes nothing returns nothing
local unit a = GetAttacker()
local player b = GetOwningPlayer(a)
local integer datastart = 1
local integer dataend = 6
local integer hold
local string part2
local string part1
local string part3
if ( GetUnitPointValue(a) == 1 ) then
set udg_yTech_Type = 'R009'
endif
if ( GetUnitPointValue(a) == 2 ) then
set udg_yTech_Type = 'R00B'
endif
if ( GetUnitPointValue(a) == 3 ) then
set udg_yTech_Type = 'R00C'
endif
set part2 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], datastart, dataend )
set udg_Temp_Unit = udg_zBlood_Forge_Hero[GetConvertedPlayerId(GetOwningPlayer(a))]
set udg_Temp_Integer = R2I(100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
call ConditionalTriggerExecute( gg_trg_Forge_Point_Gain)
set hold = S2I(part2) + R2I(100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
set udg_Temp_Unit = a
set udg_Temp_Integer = hold
set udg_Temp_Integer_2 = 1
call ConditionalTriggerExecute( gg_trg_Enhancement_Advancement)
if ( hold >= 999000 ) then
return
endif
if ( hold < 1000 ) then
set part2 = "000"+I2S(hold)
else
if ( hold < 10000 ) then
set part2 = "00"+I2S(hold)
else
if ( hold < 100000 ) then
set part2 = "0"+I2S(hold)
endif
endif
endif
if datastart == 1 then
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part2 + part3
else
if( dataend == udg_Custom_Data_End ) then
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2
else
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2 + part3
endif
endif
if ( IsUnitInGroup(a, udg_yAutoCast_Attacker) == true ) then
set datastart = 13
set dataend = 18
set part2 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], datastart, dataend )
set udg_Temp_Unit = udg_zBlood_Forge_Hero[GetConvertedPlayerId(GetOwningPlayer(a))]
set udg_Temp_Integer = R2I(100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
call ConditionalTriggerExecute( gg_trg_Forge_Point_Gain)
set hold = S2I(part2) + R2I(100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
set udg_Temp_Unit = a
set udg_Temp_Integer = hold
set udg_Temp_Integer_2 = 3
call ConditionalTriggerExecute( gg_trg_Enhancement_Advancement)
if ( hold >= 999000 ) then
return
endif
if ( hold < 1000 ) then
set part2 = "000"+I2S(hold)
else
if ( hold < 10000 ) then
set part2 = "00"+I2S(hold)
else
if ( hold < 100000 ) then
set part2 = "0"+I2S(hold)
endif
endif
endif
if datastart == 1 then
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part2 + part3
else
if( dataend == udg_Custom_Data_End ) then
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2
else
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2 + part3
endif
endif
endif
set a = null
set b = null
set part1 = null
set part2 = null
set part3 = null
endfunction
//===========================================================================
function InitTrig_Attacks takes nothing returns nothing
set gg_trg_Attacks = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attacks, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attacks, Condition( function Trig_Attacks_Conditions ) )
call TriggerAddAction( gg_trg_Attacks, function Trig_Attacks_Actions )
endfunction
//TESH.scrollpos=44
//TESH.alwaysfold=0
function Trig_Hits_Conditions takes nothing returns boolean
if ( not ( GetUnitPointValue(GetAttackedUnitBJ()) < 4 ) ) then
return false
endif
return true
endfunction
function Trig_Hits_Actions takes nothing returns nothing
local unit a = GetAttackedUnitBJ()
local player b = GetOwningPlayer(a)
local integer datastart = 7
local integer dataend = 12
local integer hold
local string part2
local string part1
local string part3
if ( GetUnitPointValue(a) == 1 ) then
set udg_yTech_Type = 'R009'
endif
if ( GetUnitPointValue(a) == 2 ) then
set udg_yTech_Type = 'R00B'
endif
if ( GetUnitPointValue(a) == 3 ) then
set udg_yTech_Type = 'R00C'
endif
set part2 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], datastart, dataend )
set udg_Temp_Unit = udg_zBlood_Forge_Hero[GetConvertedPlayerId(GetOwningPlayer(a))]
set udg_Temp_Integer = R2I( 2 * 100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
call ConditionalTriggerExecute( gg_trg_Forge_Point_Gain)
set hold = S2I(part2) + R2I(100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
set udg_Temp_Unit = a
set udg_Temp_Integer = hold
set udg_Temp_Integer_2 = 2
call ConditionalTriggerExecute( gg_trg_Enhancement_Advancement)
if ( hold >= 999000 ) then
return
endif
if ( hold < 1000 ) then
set part2 = "000"+I2S(hold)
else
if ( hold < 10000 ) then
set part2 = "00"+I2S(hold)
else
if ( hold < 100000 ) then
set part2 = "0"+I2S(hold)
endif
endif
endif
if datastart == 1 then
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part2 + part3
else
if( dataend == udg_Custom_Data_End ) then
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2
else
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2 + part3
endif
endif
set a = null
set b = null
set part1 = null
set part2 = null
set part3 = null
endfunction
//===========================================================================
function InitTrig_Hits takes nothing returns nothing
set gg_trg_Hits = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hits, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Hits, Condition( function Trig_Hits_Conditions ) )
call TriggerAddAction( gg_trg_Hits, function Trig_Hits_Actions )
endfunction
//TESH.scrollpos=29
//TESH.alwaysfold=0
function Trig_Ability_Uses_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) != true ) ) then
return false
endif
if ( not ( GetUnitPointValue(GetTriggerUnit()) < 4 ) ) then
return false
endif
return true
endfunction
function Trig_Ability_Uses_Actions takes nothing returns nothing
local unit a = GetSpellAbilityUnit()
local player b = GetOwningPlayer(a)
local integer datastart = 13
local integer dataend = 18
local integer xp = 500
local integer hold
local string part2
local string part1
local string part3
if ( GetUnitPointValue(a) == 1 ) then
set udg_yTech_Type = 'R009'
endif
if ( GetUnitPointValue(a) == 2 ) then
set udg_yTech_Type = 'R00B'
endif
if ( GetUnitPointValue(a) == 3 ) then
set udg_yTech_Type = 'R00C'
endif
if ( GetSpellAbilityId() == 'A00E' ) then
set xp = 100
endif
if ( GetSpellAbilityId() == 'A011' ) then
set xp = 100
endif
if ( GetSpellAbilityId() == 'A007' ) then
set xp = 100
endif
if ( GetSpellAbilityId() == 'A01R' ) then
set xp = 100
endif
set part2 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], datastart, dataend )
set udg_Temp_Unit = udg_zBlood_Forge_Hero[GetConvertedPlayerId(GetOwningPlayer(a))]
set udg_Temp_Integer = R2I(xp * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
call ConditionalTriggerExecute( gg_trg_Forge_Point_Gain)
if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, a) > 0.00 ) ) then
set a = null
set b = null
set part1 = null
set part2 = null
set part3 = null
return
endif
set hold = S2I(part2) + R2I( xp * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
set udg_Temp_Unit = a
set udg_Temp_Integer = hold
set udg_Temp_Integer_2 = 3
call ConditionalTriggerExecute( gg_trg_Enhancement_Advancement)
if ( hold >= 999000 ) then
return
endif
if ( hold < 1000 ) then
set part2 = "000"+I2S(hold)
else
if ( hold < 10000 ) then
set part2 = "00"+I2S(hold)
else
if ( hold < 100000 ) then
set part2 = "0"+I2S(hold)
endif
endif
endif
if datastart == 1 then
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part2 + part3
else
if( dataend == udg_Custom_Data_End ) then
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2
else
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2 + part3
endif
endif
set a = null
set b = null
set part1 = null
set part2 = null
set part3 = null
endfunction
//===========================================================================
function InitTrig_Ability_Uses takes nothing returns nothing
set gg_trg_Ability_Uses = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ability_Uses, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ability_Uses, Condition( function Trig_Ability_Uses_Conditions ) )
call TriggerAddAction( gg_trg_Ability_Uses, function Trig_Ability_Uses_Actions )
endfunction
//TESH.scrollpos=42
//TESH.alwaysfold=0
function Trig_Craft_Magic_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A005' ) ) then
return false
endif
return true
endfunction
function Is_Magic takes nothing returns boolean
return ( GetUnitPointValue(GetFilterUnit()) == 3 )
endfunction
function Trig_Craft_Magic_Actions takes nothing returns nothing
local integer FC
local integer LI = 1
local integer UC
local integer FV
local integer E = 0
local unit H = GetSpellAbilityUnit()
local location H2 = GetUnitLoc(H)
local location B2
call SetUnitAbilityLevelSwapped( 'A006', H, 3 )
loop
call TriggerSleepAction( 4.00 - .25 * GetUnitAbilityLevelSwapped( 'A005', H))
if ( not ( GetUnitAbilityLevelSwapped('A006', H) == 3 ) ) then
set E = 1
endif
if ( not ( IsUnitInGroup(H, udg_Is_Summoning) == true ) ) then
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
if ( GetUnitLifePercent(H) <= 10 ) then
call IssueImmediateOrderBJ( H, "stop" )
call DisplayTextToForce( GetForceOfPlayer(GetOwningPlayer(H)), "|cffff0000Failure:|r|cff00ff00 Your health is cirtical.|r" )
set E = 1
endif
exitwhen E == 1
set FC = GetHeroStatBJ(bj_HEROSTAT_AGI, H, true)
loop
set udg_Temp_Integer = LI
set UC = CountUnitsInGroup(GetUnitsOfPlayerMatching(GetOwningPlayer(H), Condition( function Point_Value)))
set FV = ( ( GetUnitAbilityLevelSwapped(udg_Ability_Being_Cast[LI], H) * 2 ) - UC )
if ( FV < 0 ) then
set FC = ( FC + FV )
endif
exitwhen LI == 3
set LI = LI + 1
endloop
set LI = 1
set UC = CountUnitsInGroup(GetUnitsOfPlayerMatching(GetOwningPlayer(H), Condition(function Is_Magic)))
if (( GetUnitAbilityLevelSwapped('A005', H) * 2 - UC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Magic[GetUnitAbilityLevelSwapped('A022', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 3 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
if (( FC ) > 0 ) then
set B2 = PolarProjectionBJ(H2, 256, GetUnitFacing(H))
call CreateNUnitsAtLoc( 1, udg_Unit_Type_Magic[GetUnitAbilityLevelSwapped('A022', H)], GetOwningPlayer(H), B2, GetUnitFacing(H) )
call GroupAddUnitSimple( GetLastCreatedUnit(), udg_Numbers[( ( GetConvertedPlayerId(GetOwningPlayer(H)) * 3 ) + 3 )] )
set udg_Temp_Unit = GetLastCreatedUnit()
call ConditionalTriggerExecute( gg_trg_Arcane_Bond )
call ConditionalTriggerExecute( gg_trg_Acquisition_Range_Set )
call ConditionalTriggerExecute( gg_trg_Summoned)
call RemoveLocation( B2)
call SetUnitLifeBJ( H, ( GetUnitStateSwap(UNIT_STATE_LIFE, H) - udg_aLife_Cost ) )
call AddHeroXPSwapped( ( udg_wBase_Exp_Mult * GetHeroLevel(H) ), H, true )
else
call IssueImmediateOrderBJ( H, "stop" )
set E = 1
endif
endif
endloop
set H = null
call RemoveLocation( H2)
endfunction
//===========================================================================
function InitTrig_Craft_Magic_Copy takes nothing returns nothing
set gg_trg_Craft_Magic_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Craft_Magic_Copy, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Craft_Magic_Copy, Condition( function Trig_Craft_Magic_Conditions ) )
call TriggerAddAction( gg_trg_Craft_Magic_Copy, function Trig_Craft_Magic_Actions )
endfunction
//TESH.scrollpos=18
//TESH.alwaysfold=0
function Trig_Not_Building_Actions takes nothing returns nothing
local unit a = GetTriggerUnit()
local player b = GetOwningPlayer(a)
local integer datastart = 1
local integer dataend = 6
local integer hold
local string part2
local string part1
local string part3
if ( GetUnitPointValue(a) == 1 ) then
set udg_yTech_Type = 'R009'
endif
if ( GetUnitPointValue(a) == 2 ) then
set udg_yTech_Type = 'R00B'
endif
if ( GetUnitPointValue(a) == 3 ) then
set udg_yTech_Type = 'R00C'
endif
set part2 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], datastart, dataend )
set hold = S2I(part2) + R2I(100 * (1 + I2R(GetPlayerTechCountSimple(udg_yTech_Type, b)) * 0.05))
if ( hold < 10 ) then
set part2 = "00000"+I2S(hold)
else
if ( hold < 100 ) then
set part2 = "0000"+I2S(hold)
else
if ( hold < 1000 ) then
set part2 = "000"+I2S(hold)
else
if ( hold < 10000 ) then
set part2 = "00"+I2S(hold)
else
if ( hold < 100000 ) then
set part2 = "0"+I2S(hold)
endif
endif
endif
endif
endif
if datastart == 1 then
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part2 + part3
else
if( dataend == udg_Custom_Data_End ) then
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2
else
set part1 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (1), datastart - 1 )
set part3 = SubStringBJ(udg_Data_String[GetUnitUserData( a )], (dataend + 1), udg_Custom_Data_End )
set udg_Data_String[GetUnitUserData( a )] = part1 + part2 + part3
endif
endif
set a = null
set b = null
set part1 = null
set part2 = null
set part3 = null
endfunction
//===========================================================================
function InitTrig_String_Frame takes nothing returns nothing
set gg_trg_String_Frame = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_String_Frame, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerRegisterAnyUnitEventBJ( gg_trg_String_Frame, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( gg_trg_String_Frame, Condition( function Trig_Not_Building_Conditions ) )
call TriggerAddAction( gg_trg_String_Frame, function Trig_Not_Building_Actions )
endfunction