constant function MaxStateModifierId takes unitstate u returns integer
if u == UNIT_STATE_MAX_LIFE then
return 'A008' // Rawcode of the Max Life Modifier ability.
elseif u == UNIT_STATE_MAX_MANA then
return 'A001' // Rawcode of the Max Mana Modifier ability.
endif
return 0
endfunction
function SetUnitMaxState takes unit whichUnit, unitstate whichUnitState, integer newVal returns boolean
local integer c = newVal-R2I(GetUnitState(whichUnit, whichUnitState))
local integer i = MaxStateModifierId(whichUnitState)
if i == 0 then
return false
endif
if c > 0 then
loop
exitwhen c == 0
call UnitAddAbility(whichUnit, i)
if c >= 100 then
set c = c - 100
call SetUnitAbilityLevel(whichUnit, i, 4)
elseif c >= 10 then
set c = c - 10
call SetUnitAbilityLevel(whichUnit, i, 3)
else
set c = c - 1
call SetUnitAbilityLevel(whichUnit, i, 2)
endif
call UnitRemoveAbility(whichUnit, i)
endloop
elseif c < 0 then
set c = -c
loop
exitwhen c == 0
call UnitAddAbility(whichUnit, i)
if c >= 100 then
set c = c - 100
call SetUnitAbilityLevel(whichUnit, i, 7)
elseif c >= 10 then
set c = c - 10
call SetUnitAbilityLevel(whichUnit, i, 6)
else
set c = c - 1
call SetUnitAbilityLevel(whichUnit, i, 5)
endif
call UnitRemoveAbility(whichUnit, i)
endloop
endif
return true
endfunction
Name | Type | is_array | initial_value |
ABlack | integer | No | |
ABlue | integer | No | |
AGreen | integer | No | |
AmountLifeLostLastRound | integer | No | |
AmountLifeLostThisRound | integer | No | |
AnzahlFlying | integer | No | 7 |
AnzahlHeavy | integer | No | 2 |
AnzahlMedium | integer | No | 2 |
AnzahlNormal | integer | No | 2 |
AnzahlUnarmored | integer | No | 2 |
ARandInt | integer | No | |
ARed | integer | No | |
Artefaktgegenstand | itemcode | No | I000 |
AWhite | integer | No | |
Black | integer | No | 10 |
Blue | integer | No | 10 |
Board | leaderboard | No | |
CreepsStronger | integer | No | |
Defenders | force | No | |
DehydrationActive | integer | No | |
DehydrationBlack | button | No | |
DehydrationBlue | button | No | |
DehydrationCancel | button | No | |
DehydrationGreen | button | No | |
DehydrationRed | button | No | |
DehydrationWhite | button | No | |
DialogDehydration | dialog | No | |
DialogPyroclasm | dialog | No | |
DialogResearchBlack | dialog | No | |
DialogResearchBlue | dialog | No | |
DialogResearchGreen | dialog | No | |
DialogResearchRed | dialog | No | |
DialogResearchWhite | dialog | No | |
DialogTribalUnity | dialog | No | |
Difficulty | string | No | |
DifficultyGesamt | integer | No | |
DifficultyMod | real | No | 1.00 |
Easy | integer | No | |
EasyBut | button | No | |
Farbe | string | No | |c0020EE55 |
Goldbonus | integer | Yes | |
Green | integer | No | 10 |
Hard | integer | No | |
HardBut | button | No | |
HP | integer | Yes | 0 |
HP_ModTemp | real | No | |
i | integer | No | |
Kick | integer | Yes | |
KickSomeone | integer | No | |
leaks | integer | Yes | |
LifeGain | integer | Yes | |
Lives | integer | No | 20 |
LlanowarsBonus | boolean | No | |
LostLifeLastRound | boolean | No | false |
LostLifeThisRound | boolean | No | false |
LostLifeTwoRoundsAgo | boolean | No | false |
NoMercyActive | integer | No | |
Normal | integer | No | |
NormalBut | button | No | |
NumberofPlayers | integer | No | |
NumberofTerrorcast | integer | No | |
PreventDamage | integer | No | |
PyroBlack | button | No | |
PyroBlue | button | No | |
PyroCancel | button | No | |
PyroclasmGebiet | rect | No | |
PyroclasmGebiet2 | rect | No | |
PyroGreen | button | No | |
PyroRed | button | No | |
PyroWhite | button | No | |
RBlackCancel | button | No | |
RBlueCancel | button | No | |
RDehydration | button | No | |
RDeluge | button | No | |
RDivineCongregation | button | No | |
Red | integer | No | 10 |
RGreenCancel | button | No | |
RLightningStorm | button | No | |
RNoMercy | button | No | |
Round | integer | No | 0 |
Round2 | integer | No | |
RPyroclasm | button | No | |
RRedCancel | button | No | |
RStoryCircle | button | No | |
RStreamofLife | button | No | |
RTerror | button | No | |
RTribalUnity | button | No | |
RWhiteCancel | button | No | |
Spawn | integer | No | 10 |
SpellsBlackNoMercy | integer | No | |
SpellsBlackTerror | integer | No | |
SpellsBlueDehydration | integer | No | |
SpellsBlueDeluge | integer | No | |
SpellsGreenStreamofLife | integer | No | |
SpellsGreenTribalUnity | integer | No | |
SpellsRedLightningStorm | integer | No | |
SpellsRedPyroclasm | integer | No | |
SpellsWhiteDivineCongregation | integer | No | |
SpellsWhiteStoryCircle | integer | No | |
StopGame | integer | No | |
StopGameBut | button | No | |
Temp_Group | group | No | |
TempInt | integer | No | |
TempInt2 | integer | No | |
TempReal | real | No | |
Timer | timer | No | |
TribalBlack | button | No | |
TribalBlue | button | No | |
TribalCancel | button | No | |
TribalGreen | button | No | |
TribalRed | button | No | |
TribalWhite | button | No | |
u | unit | No | |
Units_Gesamt | unitcode | Yes | |
Units_Verteilt | unitcode | Yes | |
UnitsTemp | unitcode | No | |
VarDialogDifficulty | dialog | No | |
White | integer | No | 10 |