//TESH.scrollpos=66
//TESH.alwaysfold=0
//I put AddLightningEx here because it does not work in GUI custom script...
//because the World Editor crashes...
function addEffect takes integer i, string s returns lightning
return AddLightningEx(s,true,GetLocationX(udg_Web_StartPoint[i]),GetLocationY(udg_Web_StartPoint[i]),udg_z1[i],GetLocationX(udg_Web_EndPoint[i]),GetLocationY(udg_Web_EndPoint[i]),udg_z2[i])
endfunction
//============================================================================
function SetUnitMaxState takes unit u, unitstate state, real newValue returns nothing
local integer stateAbility
local integer newVal = R2I(newValue)
local integer i = udg_MAX
local integer offset
if state == UNIT_STATE_MAX_LIFE then
set stateAbility = 'A00D'
elseif state == UNIT_STATE_MAX_MANA then
set stateAbility = 'A006'
else
debug call BJDebugMsg("SetUnitMaxState Error: Invalid unitstate")
return
endif
set newVal = newVal - R2I(GetUnitState(u, state))
if newVal > 0 then
set offset = udg_MAX + 3
elseif newVal < 0 then
set offset = 2
set newVal = -newVal
else
return
endif
loop
exitwhen newVal == 0 or i < 0
if newVal >= udg_PowersOf2[i] then
call UnitAddAbility(u, stateAbility)
call SetUnitAbilityLevel(u, stateAbility, offset + i)
call UnitRemoveAbility(u, stateAbility)
set newVal = newVal - udg_PowersOf2[i]
else
set i = i - 1
endif
endloop
endfunction
//===================================================================================
function Initialize takes unit u, unitstate us, real addedVal returns nothing
local integer i = 1
set udg_PowersOf2[0] = 1
loop
set udg_PowersOf2[i] = udg_PowersOf2[i - 1] * 2
set i = i + 1
exitwhen i == udg_MAX + 3
endloop
call SetUnitMaxState(u, us, addedVal)
endfunction
//===================================================================================
function AddUnitMaxState takes unit u, unitstate state, real addedVal returns nothing
local integer i = 1
set udg_PowersOf2[0] = 1
loop
set udg_PowersOf2[i] = udg_PowersOf2[i - 1] * 2
set i = i + 1
exitwhen i == udg_MAX + 3
endloop
call SetUnitMaxState(u,state,GetUnitState(u,state) + addedVal)
endfunction
Name | Type | is_array | initial_value |
AbilId | abilcode | Yes | |
BoomCaster | unit | Yes | |
BoomCounter | real | Yes | |
BoomDamage | real | Yes | |
BoomFT | texttag | Yes | |
BoomGroup | group | Yes | |
BoomIndex | integer | No | |
BoomLevel | integer | Yes | |
BoomLoopInteger | integer | No | |
BoomPickedUnit | unit | Yes | |
BoomPoint | location | Yes | |
BoomProj | unit | Yes | |
BoomRadius | real | Yes | |
BoomRunning | boolean | Yes | |
BoomTarget | unit | Yes | |
cCastingUnit | unit | No | |
cKnockDestroyTrees | boolean | No | |
cKnockDuration | real | No | |
cKnockedUnit | unit | No | |
cKnockSFX | string | No | |
cKnockSpeed | real | No | |
ConfigBoomAbility | abilcode | No | |
ConfigBoomCaster | unit | No | |
ConfigBoomDamage | real | Yes | |
ConfigBoomDelay | real | No | |
ConfigBoomLevel | integer | No | |
ConfigBoomRadius | real | No | |
ConfigBoomTarget | unit | No | |
ConfigDashCaster | unit | No | |
ConfigDashDamage | real | No | |
ConfigDashDistance | real | No | |
ConfigDashStunDur | real | No | |
ConfigDashTarget | location | No | |
ConfigGodCaster | unit | No | |
ConfigGodHPDrain | real | Yes | |
ConfigGodInterval | real | No | |
ConfigGodMaxStrikes | real | No | |
ConfigGodRadius | real | No | |
ConfigHPDamagePercent | real | No | |
ConfigHPDrain | real | Yes | |
ConfigIlluCaster | unit | No | |
ConfigIlluDur | real | No | |
ConfigIlluTarget | unit | No | |
ConfigSTCaster | unit | No | |
ConfigSTDamage | real | Yes | |
ConfigSTMaxDist | real | No | |
ConfigSTTarget | location | No | |
ConfigTimeCaster | unit | No | |
ConfigTimeLimit | real | No | |
ConfigWebCaster | unit | No | |
ConfigWebDamage | real | No | |
ConfigWebStunDur | real | No | |
ConfigWebTarget | unit | No | |
ConfigWMBonusSTR | real | No | |
ConfigWMCaster | unit | No | |
ConfigWMDur | real | No | |
Dash_Angle | real | Yes | |
Dash_Caster | unit | Yes | |
Dash_Counter | real | Yes | |
Dash_Damage | real | Yes | |
Dash_Distance | real | Yes | |
Dash_Group | group | Yes | |
Dash_Index | integer | No | |
Dash_Loop_Integer | integer | No | |
Dash_PickedUnit | unit | Yes | |
Dash_Point | location | Yes | |
Dash_Target | location | Yes | |
Factor | integer | Yes | |
GodCaster | unit | Yes | |
GodCounter | real | Yes | |
GodDur | real | Yes | |
GodDurInSec | integer | Yes | |
GodGroup | group | Yes | |
GodHPDamagePercent | real | Yes | |
GodHPDrain | real | Yes | |
GodIndex | integer | No | |
GodInterval | real | Yes | |
GodLevel | integer | Yes | |
GodLoopInteger | integer | No | |
GodPicked | unit | Yes | |
GodPoint | location | Yes | |
GodRadius | real | Yes | |
i | integer | No | |
IlluCaster | unit | Yes | |
IlluCounter | real | Yes | |
IlluCreated | unit | Yes | |
IlluIndex | integer | No | |
IlluLoopInteger | integer | No | |
IlluPoint | location | Yes | |
IlluTarget | unit | Yes | |
KnockAngle | real | Yes | |
KnockCaster | unit | Yes | |
KnockCounter | real | Yes | |
KnockDestroyTrees | boolean | Yes | |
KnockDistance | real | Yes | |
KnockDuration | real | Yes | |
KnockIndex | integer | No | |
KnockInteger | integer | No | |
KnockPoint | location | Yes | |
KnockSFX | string | Yes | |
KnockSpeed | real | Yes | |
KnockStartDistance | location | Yes | |
KnockStunEffect | effect | Yes | |
KnockTarget | unit | Yes | |
MAX | integer | No | 8 |
MAX_ABILITIES | integer | No | |
posX | real | Yes | |
posY | real | Yes | |
PowersOf2 | integer | Yes | |
STAngle | real | Yes | |
STCaster | unit | Yes | |
STDamage | real | Yes | |
STGroup | group | Yes | |
STIndex | integer | No | |
STLevel | integer | Yes | |
STLoopInteger | integer | No | |
STMaxDist | real | Yes | |
STPickedUnit | unit | Yes | |
STPoint | location | Yes | |
STProj | unit | Yes | |
STStartPoint | location | Yes | |
STTarget | location | Yes | |
STThrowing | boolean | Yes | |
TempPoint | location | Yes | |
TestAbil | abilcode | Yes | |
Time_Caster | unit | Yes | |
Time_Counter | real | Yes | |
Time_DefSpeed | real | Yes | |
Time_Group | group | Yes | |
Time_Index | integer | No | |
Time_Limit | real | Yes | |
Time_Loop_Integer | integer | No | |
Time_PickedUnit | unit | Yes | |
Web_AccPoint | real | Yes | |
Web_Caster | unit | Yes | |
Web_Counter | real | Yes | |
Web_CurDist | real | Yes | |
Web_CurHeight | real | Yes | |
Web_Damage | real | Yes | |
Web_DamagedGroup | group | Yes | |
Web_EndPoint | location | Yes | |
Web_Index | integer | No | |
Web_LightningEffect | lightning | Yes | |
Web_Loop_Integer | integer | No | |
Web_MaxHeight | real | Yes | |
Web_PickedDamagedUnit | unit | Yes | |
Web_PouncePoint | location | Yes | |
Web_ReachedMaxHeight | boolean | Yes | |
Web_SFX1 | effect | Yes | |
Web_StartPoint | location | Yes | |
Web_StunDur | real | Yes | |
Web_Target | unit | Yes | |
WMBonusSTR | real | Yes | |
WMCaster | unit | Yes | |
WMCounter | real | Yes | |
WMIndex | integer | No | |
WMLoopInteger | integer | No | |
z1 | real | Yes | |
z2 | real | Yes |
//TESH.scrollpos=3
//TESH.alwaysfold=0
function Trig_Initialization_Actions takes nothing returns nothing
set udg_AbilId[1] = 'A001'
set udg_AbilId[2] = 'A003'
set udg_AbilId[3] = 'A005'
set udg_AbilId[4] = 'A004'
set udg_AbilId[5] = 'A002'
set udg_AbilId[6] = 'A000'
set udg_AbilId[7] = 'A00A'
set udg_AbilId[8] = 'A00B'
call FogEnableOff( )
call FogMaskEnableOff( )
set udg_MAX_ABILITIES = 8
endfunction
//===========================================================================
function InitTrig_Initialization takes nothing returns nothing
set gg_trg_Initialization = CreateTrigger( )
call TriggerRegisterTimerEventSingle( gg_trg_Initialization, 0.00 )
call TriggerAddAction( gg_trg_Initialization, function Trig_Initialization_Actions )
endfunction
//TESH.scrollpos=0
//TESH.alwaysfold=0
function Trig_Map_Initialization_Actions takes nothing returns nothing
local integer i = 0
set udg_TempPoint[0] = GetRectCenter(GetPlayableMapRect())
set udg_TestAbil[0] = 'A00D'
set udg_TestAbil[1] = 'A006'
call CreateNUnitsAtLoc( 1, 'n000', Player(PLAYER_NEUTRAL_PASSIVE), udg_TempPoint[0], bj_UNIT_FACING )
loop
exitwhen i > 1
call UnitAddAbility(GetLastCreatedUnit(),udg_TestAbil[i])
set i = i + 1
endloop
call UnitApplyTimedLifeBJ( 1.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(udg_TempPoint[0])
endfunction
//===========================================================================
function InitTrig_Map_Initialization takes nothing returns nothing
set gg_trg_Map_Initialization = CreateTrigger( )
call TriggerAddAction( gg_trg_Map_Initialization, function Trig_Map_Initialization_Actions )
endfunction
function Trig_check_Actions takes nothing returns nothing
local string s = GetEventPlayerChatString()
local unit u = gg_unit_Hblm_0012
local unitstate state = UNIT_STATE_MAX_LIFE
call Initialize(u,state,S2R(SubString(s,5,StringLength(s))))
endfunction
//===========================================================================
function InitTrig_check takes nothing returns nothing
set gg_trg_check = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_check, Player(0), "-set ", false )
call TriggerAddAction( gg_trg_check, function Trig_check_Actions )
endfunction