//TESH.scrollpos=90
//TESH.alwaysfold=0
function CodeGen_SaveToDisk takes string loadcode, string filename returns nothing
call PreloadGenClear()
call PreloadGenStart()
call Preload(loadcode)
call PreloadGenEnd(filename)
call ClearSelection()
endfunction
function CodeGen_Init takes nothing returns nothing
local integer i = 1
local integer b = udg_SaveLoad_Base
local integer m = udg_SaveLoad_MaxValue
loop
exitwhen i >= udg_SaveLoad_MaxValue
set udg_SaveLoad_Char[i] = SubString(udg_SaveLoad_Alphabet, i, i+1)
set i = i + 1
endloop
set udg_SaveLoad_Alphabet = SubString(udg_SaveLoad_Alphabet, 0, 1) + SubString(udg_SaveLoad_Alphabet, m + 1, b)
set udg_SaveLoad_Base = b - m
endfunction
function CodeGen_ConvertItem takes integer id returns integer
local integer i = 1
loop
exitwhen i > udg_SaveLoad_ItemCount
if (id == udg_SaveLoad_Item[i]) then
return i
endif
set i = i + 1
endloop
return 0
endfunction
function CodeGen_ConvertUnit takes integer id returns integer
local integer i = 1
loop
exitwhen i > udg_SaveLoad_HeroCount
if (id == udg_SaveLoad_Hero[i]) then
return i
endif
set i = i + 1
endloop
return 0
endfunction
function CodeGen_Encode takes integer i returns string
local integer b
local string s = ""
if i <= udg_SaveLoad_Base then
return SubString(udg_SaveLoad_Alphabet, i, i + 1)
endif
loop
exitwhen i <= 0
set b = i - (i / udg_SaveLoad_Base) * udg_SaveLoad_Base
set s = SubString(udg_SaveLoad_Alphabet, b, b + 1) + s
set i = i / udg_SaveLoad_Base
endloop
return s
endfunction
function CodeGen_StrPos takes string s returns integer
local integer i = 0
loop
exitwhen i > udg_SaveLoad_Base
if s == SubString(udg_SaveLoad_Alphabet, i, i + 1) then
return i
endif
set i = i + 1
endloop
return -1
endfunction
function CodeGen_Decode takes string s returns integer
local integer a = 0
loop
exitwhen StringLength(s) == 1
set a = a * udg_SaveLoad_Base + udg_SaveLoad_Base * CodeGen_StrPos(SubString(s, 0, 1))
set s = SubString(s, 1, 99)
endloop
return a+CodeGen_StrPos(s)
endfunction
function CodeGen_StringChecksum takes string in returns integer
local integer i = 0
local integer l = StringLength(in)
local integer t = 0
local integer o = 0
loop
exitwhen i >= l
set t = CodeGen_Decode(SubString(in, i, i + 1))
set o = o + t
set i = i + 1
endloop
return o
endfunction
function CodeGen_Color takes string char returns string
local integer i = 0
local integer l = StringLength(udg_SaveLoad_Full)
local string x = ""
loop
exitwhen i >= l
set x = SubString(udg_SaveLoad_Full, i, i + 1)
if char == x then
if (x=="0" or S2I(x) > 0) then
return udg_SaveLoad_Number + char + "|r"
elseif StringCase(x, false) == x then
return udg_SaveLoad_Lower + char + "|r"
elseif StringCase(x, true) == x then
return udg_SaveLoad_Upper + char + "|r"
endif
endif
set i = i + 1
endloop
return char
endfunction
function CodeGen_Format takes string s returns string
local integer i = 0
local integer x = StringLength(s)
local integer j = 1
local string s2 = ""
loop
exitwhen i >= x
set s2 = s2 + CodeGen_Color(SubString(s, i, i + 1))
if (j >= udg_SaveLoad_HyphenSpace and i != (x-1)) then
set j = 0
set s2 = s2 + udg_SaveLoad_SeperationChar
endif
set j = j + 1
set i = i + 1
endloop
return s2
endfunction
function CodeGen_Strip takes string s returns string
local integer i = 0
local integer x = StringLength(s)
local string out = ""
local string a = ""
loop
exitwhen i >= x
set a = SubString(s, i, i + 1)
if (a != udg_SaveLoad_SeperationChar) then
set out = out + a
endif
set i = i + 1
endloop
return out
endfunction
// yeeahh descriptive variables
function CodeGen_Load takes string s returns nothing
local string str = CodeGen_Strip(s)
local string tmp = ""
local string c = ""
local integer x = 0
local integer i = 1
local integer l = 0
local integer j = 1
local integer f = 0
local boolean b = true
set udg_SaveLoad_Valid = false
if (udg_SaveLoad_Security) then
loop
exitwhen i > 3
if (CodeGen_Decode(SubString(str, 0, i)) == CodeGen_StringChecksum(SubString(str, i, 999))) then
set udg_SaveLoad_Valid = true
set str = SubString(str, i, 999)
set i = 4
endif
set i = i + 1
endloop
endif
if (not udg_SaveLoad_Valid) then
set udg_SaveLoad_Error = "Invalid Code"
return
endif
set i = 0
set l = StringLength(str)
if (udg_SaveLoad_CheckName) then
set c = CodeGen_Encode(CodeGen_StringChecksum(GetPlayerName(GetTriggerPlayer())))
set i = StringLength(c)
if (c != SubString(str, l - i, i)) then
set udg_SaveLoad_Valid = false
set udg_SaveLoad_Error = "Wrong username"
return
endif
set l = l - i
endif
set i = 0
loop
exitwhen i >= l
set tmp = SubString(str, i, i + 1)
set b = true
set f = 0
set j = 1
loop
exitwhen f >= (udg_SaveLoad_MaxValue)
if (tmp == udg_SaveLoad_Char[f]) then
set j = f + 2
set udg_Load[x] = CodeGen_Decode(SubString(str, i + 1, i + (j)))
set b = false
set f = udg_SaveLoad_MaxValue
endif
set f = f + 1
endloop
if (b) then
set udg_Load[x] = CodeGen_Decode(tmp)
endif
set i = i + j
set x = x + 1
endloop
set udg_SaveLoad_Valid = true
endfunction
function CodeGen_Compile takes nothing returns string
local integer i = 0
local integer j = 0
local string out = ""
local string ln = ""
local string x = ""
loop
exitwhen i > udg_SaveCount
set x = CodeGen_Encode(udg_Save[i])
set j = StringLength(x)
if (j > 1) then
set out = out + udg_SaveLoad_Char[j-1]
endif
set out = out + x
set i = i + 1
endloop
if (udg_SaveLoad_CheckName) then
set out = out + CodeGen_Encode(CodeGen_StringChecksum(GetPlayerName(GetTriggerPlayer())))
endif
if (udg_SaveLoad_Security) then
set out = CodeGen_Encode(CodeGen_StringChecksum(out)) + out
endif
if udg_SaveLoad_SaveToDisk and GetLocalPlayer() == GetTriggerPlayer() then
call CodeGen_SaveToDisk(out, udg_SaveLoad_Directory + "\\" + udg_SaveLoad_Filename)
endif
return CodeGen_Format(out)
endfunction
Name | Type | is_array | initial_value |
a01 | effect | No | |
a02 | effect | No | |
a03 | effect | No | |
Akama | unit | No | UnitNull |
AkamaReturnSpot | location | No | |
AP1_Player | player | No | Player00 |
APG1_Player | force | No | Force00 |
b01 | effect | No | |
b02 | effect | No | |
b03 | effect | No | |
BloodKey | item | No | ItemNull |
BridgeOpenLeft | boolean | No | |
BridgeOpenRight | boolean | No | |
BridgePlateLeft | destructable | No | |
BridgePlateRight | destructable | No | |
Butcher | unit | No | |
CagedUnit01 | unit | No | |
CagedUnit02 | unit | No | |
CagedUnit03 | unit | No | |
CagedUnit04 | unit | No | |
CagedUnit05 | unit | No | |
CagedUnit06 | unit | No | |
CameraReturnPoint | location | No | |
Catapult01 | unit | No | |
Catapult02 | unit | No | |
Catapult03 | unit | No | |
Catapult04 | unit | No | |
CinematicAkama | unit | No | |
CinematicIllidan | unit | No | |
CinematicKael | unit | No | |
CinematicMagtheridon | unit | No | |
CinematicRavael | unit | No | |
CinematicVashj | unit | No | |
Code | StringExt | No | |
CoinIslandVision2On | boolean | No | |
CoinIslandVision2VM | fogmodifier | No | |
CoinIslandVisionOn | boolean | No | |
CoinIslandVisionVM | fogmodifier | No | |
CombatCheckTimer | timer | No | |
CombinedKeys | item | No | ItemNull |
DocksVisionOn | boolean | No | |
DocksVM | fogmodifier | No | |
DraeneiUsed | boolean | No | |
ElevatorLeftA | destructable | No | |
ElevatorLeftB | destructable | No | |
ElevatorLeftC | destructable | No | |
ElevatorRightA | destructable | No | |
ElevatorRightB | destructable | No | |
ElevatorRightC | destructable | No | |
ElevatorSound | sound | No | |
EndGate01 | destructable | No | |
EndGate02 | destructable | No | |
Exchangefail1 | boolean | No | |
Exchangefail2 | boolean | No | |
Exchangefail3 | boolean | No | |
ExchangeSucces | boolean | No | |
Exchanging1 | boolean | No | |
Exchanging2 | boolean | No | |
ExchangingSelection1 | group | No | |
ExchangingSelection2 | group | No | |
ExpDisabledForAkama | boolean | No | false |
ExpDisabledForIllidan | boolean | No | false |
ExpDisabledForKael | boolean | No | false |
ExpDisabledForRavael | boolean | No | false |
ExpDisabledForVashj | boolean | No | false |
FF_AllowCliffs | boolean | Yes | |
FF_AllowedToKeepMoving | boolean | Yes | |
FF_AllowWater | boolean | Yes | |
FF_Angle | real | Yes | |
FF_AoEDamages | real | Yes | |
FF_BuildingAoE | boolean | Yes | |
FF_Caster | unit | Yes | |
FF_DistanceCast | real | No | |
FF_DistanceReached | real | Yes | |
FF_Done | boolean | Yes | |
FF_DummyUnit | unit | Yes | |
FF_ExplosionEffect | modelfile | Yes | |
FF_FinalAoE | real | Yes | |
FF_FireBall1 | unit | Yes | |
FF_FireBall2 | unit | Yes | |
FF_FireBallAdditionnalDistance | real | Yes | |
FF_FireBallAoE | real | Yes | |
FF_FireBallArc | real | Yes | |
FF_FireBallArcSettings | real | Yes | |
FF_FireBallDistance | real | Yes | |
FF_FireBallDistanceInit | real | No | |
FF_FireBallSpeed | real | Yes | |
FF_FireBallTempAdd | real | Yes | |
FF_FullDistance | real | Yes | |
FF_GoThroughBuildings | boolean | Yes | |
FF_GoThroughTrees | boolean | Yes | |
FF_GroupFireBall1 | group | Yes | |
FF_GroupFireBall2 | group | Yes | |
FF_HitBuildings | boolean | Yes | |
FF_Integer1 | integer | No | |
FF_Integer2 | integer | No | |
FF_Integer3 | integervar | No | |
FF_KillTrees | boolean | Yes | |
FF_KillTreesAoE | boolean | Yes | |
FF_MinimalDistance | real | No | |
FF_RealTimer | real | Yes | |
FF_SingleDamages | real | Yes | |
FF_SingleUnitEffect | modelfile | Yes | |
FF_TempGroup | group | No | |
FF_TempPoint1 | location | No | |
FF_TempPoint2 | location | No | |
FF_TempPoint3 | location | No | |
FodderUnits | group | No | |
GameOver | boolean | No | false |
Gate02LeftVisionOn | boolean | No | |
Gate02LeftVisionVM | fogmodifier | No | |
Gate02LeftVisionVM_Kopiuj | fogmodifier | No | |
Gate02RightVisionOn | boolean | No | |
Gate02RightVisionVM | fogmodifier | No | |
Gate02RightVisionVM_Kopiuj | fogmodifier | No | |
Gate03LeftVisionOn | boolean | No | |
Gate03LeftVisionVM | fogmodifier | No | |
Gate03LeftVisionVM_Kopiuj | fogmodifier | No | |
Gate03RightVisionOn | boolean | No | |
Gate03RightVisionVM | fogmodifier | No | |
Gate03RightVisionVM_Kopiuj | fogmodifier | No | |
Gate04LeftVisionOn | boolean | No | |
Gate04LeftVisionVM | fogmodifier | No | |
Gate04LeftVisionVM_Kopiuj | fogmodifier | No | |
Gate04RightVisionOn | boolean | No | |
Gate04RightVisionVM | fogmodifier | No | |
Gate04RightVisionVM_Kopiuj | fogmodifier | No | |
Gate05LeftVisionOn | boolean | No | |
Gate05LeftVisionVM | fogmodifier | No | |
Gate05LeftVisionVM_Kopiuj | fogmodifier | No | |
Gate05RightVisionOn | boolean | No | |
Gate05RightVisionVM | fogmodifier | No | |
Gate05RightVisionVM_Kopiuj | fogmodifier | No | |
GateVisionOn | boolean | No | |
GateVisionVM | fogmodifier | No | |
Generator02 | unit | No | |
Generator02Destroyed | boolean | No | |
Generator02Panned | boolean | No | |
Generator02VM | fogmodifier | No | |
Generator02VM_Kopiuj | fogmodifier | No | |
Generator03 | unit | No | |
Generator03Destroyed | boolean | No | |
Generator03Panned | boolean | No | |
Generator03VM | fogmodifier | No | |
Generator03VM_Kopiuj | fogmodifier | No | |
Generator04 | unit | No | |
Generator04Destroyed | boolean | No | |
Generator04Panned | boolean | No | |
Generator04VM | fogmodifier | No | |
Generator04VM_Kopiuj | fogmodifier | No | |
Generator05 | unit | No | |
Generator05Destroyed | boolean | No | |
Generator05Panned | boolean | No | |
Generator05VM | fogmodifier | No | |
Generator05VM_Kopiuj | fogmodifier | No | |
GeneratorsAlive | integer | No | 4 |
GhostKey | item | No | ItemNull |
Gold | integer | No | |
Hero | unit | No | |
HiddenUnits | group | No | |
HydraDenVisionOn | boolean | No | |
HydraDenVM | fogmodifier | No | |
Illidan | unit | No | UnitNull |
IllidanReturnSpot | location | No | |
InCinematic | boolean | No | false |
InCombat | boolean | No | false |
IntroAssassin01 | unit | No | |
IntroAssassin02 | unit | No | |
IntroAssassin03 | unit | No | |
IntroSaboteur01 | unit | No | |
IntroSaboteur02 | unit | No | |
IntroSkipped | boolean | No | false |
IntroSkipped1 | boolean | No | false |
IntroWarlock | unit | No | |
InvulnerableGuards | group | No | |
Item | item | No | |
Kael | unit | No | UnitNull |
KaelReturnSpot | location | No | |
Kiljaeden | unit | No | |
LadyVashj | unit | No | |
LeftPatrolA | unit | No | |
LeftPatrolB | unit | No | |
LeftPatrolC | unit | No | |
LeftPatrolTarget | integer | No | |
LeftPatrolUnits | group | No | |
Load | integer | Yes | |
LoadCount | integer | No | |
Magtheridon | unit | No | UnitNull |
MagtheridonGuard01 | unit | No | |
MagtheridonGuard02 | unit | No | |
MagtheridonGuard03 | unit | No | |
MagtheridonGuard04 | unit | No | |
MagtheridonRampVisionOn | boolean | No | |
MagtheridonRampVM | fogmodifier | No | |
MagtheridonTrigger | unit | No | |
Master | unit | No | |
MastersGuards | group | No | |
Mistress | unit | No | |
MistressGuards | group | No | |
MistressOrb | effect | No | |
NagaUsed | boolean | No | |
OrangeProductionBuildings | group | No | |
P04_Magtheridon | player | No | Player03 |
P05_ChaosOrcRight | player | No | Player04 |
P06_ChaosOrcLeft | player | No | Player05 |
P07_ChaosOrcRight | player | No | Player06 |
P08_ChaosOrcLeft | player | No | Player07 |
P09_Rescuables | player | No | Player08 |
P10_MistressOfTorment | player | No | Player09 |
P11_MasterOfPain | player | No | Player10 |
P12_Generators | player | No | Player11 |
P2_Orc | player | No | |
P3_Undead | player | No | |
PingTimer | timer | No | |
PinkProductionBuildings | group | No | |
PlateActivationSound | sound | No | |
QuestGenerators | quest | No | |
QuestGeneratorsReqDestroy | questitem | No | |
QuestGeneratorsReqHint | questitem | No | |
QuestKey | quest | No | |
QuestKeyReqKillMaster | questitem | No | |
QuestKeyReqKillMistress | questitem | No | |
QuestMagtheridon | quest | No | |
QuestMagtheridonReqKill | questitem | No | |
QuestSiege | quest | No | |
QuestSiegeReqKill | questitem | No | |
QuestSky | quest | No | |
Ravael | unit | No | UnitNull |
RefundGold | integer | No | |
RefundLumber | integer | No | |
ResourceDropBuildings | group | No | |
ResourceDropHashtable | hashtable | No | |
RevivalAltar | unit | No | UnitNull |
RevivalHero | unit | No | UnitNull |
RevivalReturnSpot | location | No | |
RevivalSpot | location | No | |
RightPatrolA | unit | No | |
RightPatrolB | unit | No | |
RightPatrolC | unit | No | |
RightPatrolTarget | integer | No | |
RightPatrolUnits | group | No | |
Save | integer | Yes | |
SaveCount | integer | No | |
SaveLoad_Abilities | abilcode | Yes | |
SaveLoad_AbilityCount | integer | No | |
SaveLoad_Alphabet | string | No | |
SaveLoad_Base | integer | No | |
SaveLoad_Char | string | Yes | |
SaveLoad_CheckName | boolean | No | |
SaveLoad_Directory | string | No | |
SaveLoad_Error | string | No | |
SaveLoad_Filename | string | No | |
SaveLoad_Full | string | No | |
SaveLoad_Hero | unitcode | Yes | |
SaveLoad_HeroCount | integer | No | |
SaveLoad_HyphenSpace | integer | No | |
SaveLoad_Item | itemcode | Yes | |
SaveLoad_ItemCount | integer | No | |
SaveLoad_Lower | string | No | |
SaveLoad_MaxValue | integer | No | |
SaveLoad_Number | string | No | |
SaveLoad_SaveToDisk | boolean | No | |
SaveLoad_Security | boolean | No | |
SaveLoad_SeperationChar | string | No | |
SaveLoad_Upper | string | No | |
SaveLoad_Valid | boolean | No | |
SelectedUnits | group | No | |
SelectionGroup1 | group | No | |
SelectionGroup2 | group | No | |
SiegeGuards | group | No | |
SiegeRescuables | group | No | |
SkyGuards | group | No | |
SkyRescuables | group | No | |
SpecialEffect01 | effect | No | |
SpecialEffect02 | effect | No | |
SpecialEffect03 | effect | No | |
SpecialEffect04 | effect | No | |
SpecialEffect05 | effect | No | |
SpecialEffect06 | effect | No | |
SpecialEffect07 | effect | No | |
SpecialEffect08 | effect | No | |
SpecialEffect09 | effect | No | |
StartingPriest01 | unit | No | |
StartingPriest02 | unit | No | |
StartingPriest03 | unit | No | |
StartingSorceress01 | unit | No | |
StartingSorceress02 | unit | No | |
StartingSpellBreaker01 | unit | No | |
StartingSpellBreaker02 | unit | No | |
StartingSpellBreaker03 | unit | No | |
StartingSpellBreaker04 | unit | No | |
StartingSpellBreaker05 | unit | No | |
SummonedUnits | group | No | |
TempBoolean | boolean | No | |
Tempinteger | integer | No | |
Tempitem | item | No | |
TempitemType | itemcode | No | |
TempPGroup | force | No | |
TempPGroup2 | force | No | |
TempPlayer | player | No | |
temppoint | location | No | |
TempPoint | location | No | |
temppoint2 | location | No | |
TempUGroup | group | No | |
tempugroup | group | No | |
TempUnit | unit | No | |
TempUnitType | unitcode | No | |
ThroneElevatorA | destructable | No | |
ThroneElevatorB | destructable | No | |
ThronePlate | destructable | No | |
UnitGoldCost | integer | No | |
UnitLumberCost | integer | No | |
Vashj | unit | No | UnitNull |
VashjReturnSpot | location | No | |
VictorySkipped | boolean | No | false |
VisibilityGate | fogmodifier | No | |
VisibilityGateA | fogmodifier | No | |
VisibilityGateB | fogmodifier | No | |
VisibilityGateC | fogmodifier | No | |
VisibilityGateD | fogmodifier | No | |
VisibilitySiegeGate | fogmodifier | No | |
VisibilitySiegeRescuables | fogmodifier | No | |
WhichUnitType | unitcode | No | |
x | real | No | |
y | real | No | |
zCoinVSource01 | location | No | |
zCoinVSource02 | location | No | |
zDocksVSource | location | No | |
zGateVSource | location | No | |
zGateVSource02LeftA | location | No | |
zGateVSource02LeftB | location | No | |
zGateVSource02LeftC | location | No | |
zGateVSource02LeftD | location | No | |
zGateVSource02LeftE | location | No | |
zGateVSource02RightA | location | No | |
zGateVSource02RightB | location | No | |
zGateVSource02RightC | location | No | |
zGateVSource02RightD | location | No | |
zGateVSource02RightE | location | No | |
zGateVSource03LeftA | location | No | |
zGateVSource03LeftB | location | No | |
zGateVSource03LeftC | location | No | |
zGateVSource03LeftD | location | No | |
zGateVSource03LeftE | location | No | |
zGateVSource03RightA | location | No | |
zGateVSource03RightB | location | No | |
zGateVSource03RightC | location | No | |
zGateVSource03RightD | location | No | |
zGateVSource03RightE | location | No | |
zGateVSource04LeftA | location | No | |
zGateVSource04LeftB | location | No | |
zGateVSource04LeftC | location | No | |
zGateVSource04LeftD | location | No | |
zGateVSource04LeftE | location | No | |
zGateVSource04RightA | location | No | |
zGateVSource04RightB | location | No | |
zGateVSource04RightC | location | No | |
zGateVSource04RightD | location | No | |
zGateVSource04RightE | location | No | |
zGateVSource05LeftA | location | No | |
zGateVSource05LeftB | location | No | |
zGateVSource05LeftC | location | No | |
zGateVSource05LeftD | location | No | |
zGateVSource05LeftE | location | No | |
zGateVSource05RightA | location | No | |
zGateVSource05RightB | location | No | |
zGateVSource05RightC | location | No | |
zGateVSource05RightD | location | No | |
zGateVSource05RightE | location | No | |
zHydraDenVSource | location | No | |
zMagtheridonVSourceA | location | No | |
zMagtheridonVSourceB | location | No | |
zPatrolPointLeft01A | location | No | |
zPatrolPointLeft01B | location | No | |
zPatrolPointLeft01C | location | No | |
zPatrolPointLeft02A | location | No | |
zPatrolPointLeft02B | location | No | |
zPatrolPointLeft02C | location | No | |
zPatrolPointRight01A | location | No | |
zPatrolPointRight01B | location | No | |
zPatrolPointRight01C | location | No | |
zPatrolPointRight02A | location | No | |
zPatrolPointRight02B | location | No | |
zPatrolPointRight02C | location | No |