//TESH.scrollpos=220
//TESH.alwaysfold=0
function CodeGen_Init takes nothing returns nothing
set udg_SaveLoad_Char = SubString(udg_SaveLoad_Alphabet, 0, 1)
set udg_SaveLoad_Alphabet = SubString(udg_SaveLoad_Alphabet, 1, 999)
set udg_SaveLoad_Base = udg_SaveLoad_Base - 1
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_Alphabet takes string s returns integer
local integer i = 0
local string x = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
local integer b = StringLength(x)
loop
exitwhen i > b
if s == SubString(x, 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, 50)
endloop
return a+CodeGen_StrPos(s)
endfunction
function CodeGen_String takes string s returns integer
local integer i = 0
local integer x = StringLength(s)
local integer z = 0
loop
exitwhen i > x
set z = z + CodeGen_Alphabet(SubString(s, i, i + 1))
set i = i + 1
endloop
return z
endfunction
function CodeGen_Color takes string char returns string
local integer i = 0
local string s = udg_SaveLoad_Alphabet + udg_SaveLoad_Char
local string x = ""
loop
exitwhen i > udg_SaveLoad_Base+1
set x = SubString(s, i, i + 1)
if char == x then
if (x=="0"or x=="1"or x=="2"or x=="3"or x=="4"or x=="5"or x=="6"or x=="7"or x=="8"or x=="9"or x=="10") 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 = ""
if (x <= udg_SaveLoad_HyphenSpace) then
return s
endif
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 + "-"
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 not (a == "-") then
set out = out + a
endif
set i = i + 1
endloop
return out
endfunction
function CodeGen_Load takes string s returns nothing
local integer i = 0
local integer r = 0
local integer x = 0
local integer j = 0
local integer b = 0
set s = CodeGen_Strip(s)
set x = StringLength(s)
set j = CodeGen_Decode(SubString(s, x - 1, x))
set r = CodeGen_Decode(SubString(s, x - j - 1, x - 1))
set s = SubString(s, 0, x - j - 1)
if (r != CodeGen_String(s)) then
set udg_SaveLoad_Valid = false
return
endif
set x = CodeGen_String(GetPlayerName(GetTriggerPlayer()))
set udg_SaveLoad_Valid = true
if (udg_SaveLoad_CheckName) then
if not (CodeGen_Decode(SubString(s, 0, 2)) == x) then
if not (CodeGen_Decode(SubString(s, 0, 1)) == x) then
set udg_SaveLoad_Valid = false
return
else
set s = SubString(s, 1, 999)
endif
else
set s = SubString(s, 2, 999)
endif
endif
set j = StringLength(s)
set x = 0
loop
exitwhen i == j
if (SubString(s, i, i + 1) == udg_SaveLoad_Char) then
set b = CodeGen_Decode(SubString(s, i + 1, i + 2))
set udg_Load[x] = CodeGen_Decode(SubString(s, i + 2, i + (b + 2)))
set i = i + b + 1
else
set udg_Load[x] = CodeGen_Decode(SubString(s, i, i + 1))
endif
set x = x + 1
set i = i + 1
endloop
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 = ""
if (udg_SaveLoad_CheckName) then
set out = out + CodeGen_Encode(CodeGen_String(GetPlayerName(GetTriggerPlayer())))
endif
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 + CodeGen_Encode(j)
endif
set out = out + x
set i = i + 1
endloop
set x = CodeGen_Encode(CodeGen_String(out))
return CodeGen_Format(out + x + CodeGen_Encode(StringLength(x)))
endfunction
Name | Type | is_array | initial_value |
Accumulation | integer | Yes | |
AI_H | rect | Yes | |
AI_Lanes | boolean | Yes | |
Arrows_Point | location | Yes | |
ArrowsLoc | location | No | |
attackpoint | location | No | |
blademaster | unit | No | |
Blocking_Chancer | integer | Yes | |
Bolt_Point | location | No | |
Boss_Point | location | No | |
Camera | boolean | Yes | |
Caster | unit | No | |
CasterLoc | location | No | |
chancer | integer | Yes | |
ChargeLoc | location | No | |
Code | StringExt | No | |
Combat_Mode | boolean | Yes | |
Creeps_Point | location | No | |
Dark_Orb | location | No | |
Darksage_Oracle | unit | No | |
DelugeCaster | unit | No | |
Drive_target | unit | No | |
Driver | unit | Yes | |
Drops_Common | itemcode | Yes | |
Drops_Rare | itemcode | Yes | |
Drops_Unique | itemcode | Yes | |
DS_Loc | location | No | |
DS_Point | location | No | |
Dummy | unit | Yes | |
Dummy_Point | location | Yes | |
ES_Caster | unit | No | |
ES_Dummy | unit | Yes | |
ES_Effect | effect | No | |
ES_Group | group | No | |
ES_Point | location | No | |
Explosion_effects | effect | Yes | |
Facing1 | real | No | |
Facing2 | real | No | |
Firecaster | unit | Yes | |
firewall_left | integervar | No | |
firewall_right | integervar | No | |
Floating | location | No | |
Floor | boolean | Yes | |
Force | unit | No | |
FP | location | Yes | |
Frost_Point | location | Yes | |
Fury_Point | location | No | |
Fury_Target | unit | No | |
Gamble | integer | No | |
Group_AI | group | No | |
Group_Arrows | group | No | |
Group_AutoItem | group | No | |
Group_Awaken | group | No | |
Group_Charge | group | No | |
Group_ChargeX | group | No | |
Group_Creeps | group | No | |
Group_Dash | group | No | |
Group_FArrows | group | No | |
Group_FireFall | group | No | |
Group_Flame | group | No | |
Group_Float | group | No | |
Group_Force | group | No | |
Group_Force_Copy | group | No | |
Group_Forced | group | No | |
Group_Hunters | group | No | |
Group_Meteor | group | No | |
Group_Push | group | No | |
Group_Ring | group | No | |
Group_SStealed | group | No | |
Group_Target | group | No | |
Group_WaterFall | group | No | |
GroupCharge | group | No | |
HeavenDrived | unit | Yes | |
HeavenDriver | unit | Yes | |
HeavenPoint | location | No | |
Hero | unit | No | |
Hero_Dead | unit | Yes | |
Hero_in_Dungeon | boolean | Yes | |
Hero_Is_Dead | boolean | Yes | |
Hero_is_Mining | boolean | Yes | |
Hero_Selected | boolean | Yes | |
Hero_Selecting | boolean | Yes | |
Heroes | unit | Yes | |
Heroes_Count | integer | No | |
Holy_Strike_Angs | real | Yes | |
Holy_Strike_Point | location | Yes | |
Hunter_Hero | unit | No | |
Hunters | force | Yes | |
Ice_1 | unit | Yes | |
Ice_2 | unit | Yes | |
Impale | location | No | |
Item | item | No | |
Item_Effect | abilcode | Yes | |
Item_Healing_Effects | effect | No | |
ItemEffected | unit | No | |
ItemLocation | location | Yes | |
Items_Common | itemcode | Yes | |
Items_Rare | itemcode | Yes | |
Items_Unique | itemcode | Yes | |
ItemSkill | unit | Yes | |
Kills1 | integer | No | |
Kills2 | integer | No | |
Kills3 | integer | No | |
Kills4 | integer | No | |
Kills5 | integer | No | |
Kills6 | integer | No | |
Kills7 | integer | No | |
Kills8 | integer | No | |
Light_caster | unit | Yes | |
Light_target | unit | Yes | |
Lightning_Effects | lightning | Yes | |
Lightsage_Oracle | unit | No | |
Load | integer | Yes | |
LoadCount | integer | No | |
Loc1 | location | Yes | |
Location | location | No | |
Lock_On | boolean | Yes | |
Lock_Unit_Target | unit | Yes | |
LocPoint1 | location | Yes | |
LocPoint2 | location | Yes | |
LocPoint3 | location | Yes | |
LocPoint4 | location | Yes | |
LocPoint5 | location | Yes | |
LS_Loc | location | No | |
LS_Point | location | No | |
MB_Caster | unit | No | |
MB_Point | location | No | |
MB_Target | unit | No | |
MegaPoint | location | No | |
Meteor_Effect1 | effect | No | |
Meteor_Effect2 | effect | No | |
Meteor_Effect3 | effect | No | |
Meter | string | Yes | |
Miners | unit | Yes | |
Mode_Duel_Request | boolean | Yes | |
NovaReal | real | No | |
Open_Inventory | boolean | Yes | |
p1 | location | No | |
p2 | location | No | |
p3 | location | No | |
p4 | location | No | |
p5 | location | No | |
Pierce_Effect1 | effect | Yes | |
Pierce_Effect2 | effect | Yes | |
Pierce_Point | location | No | |
Player_Colors | string | Yes | |
Player_Count | integer | No | |
PlayerColorStrings | string | Yes | |
point_firewall | location | No | |
Point_Target | location | No | |
Priest_Caster | unit | Yes | |
Priest_Target | unit | No | |
Prophet | unit | No | |
Push | location | Yes | |
Quest_Main | quest | No | |
Quest_Main_Rec | questitem | Yes | |
Quest_Mares | quest | Yes | |
Quest_Mares_Get | boolean | Yes | |
Quest_Mares_Kill | integer | Yes | |
Quest_Mares_Rec | questitem | Yes | |
Quest_On | boolean | Yes | |
Quest_Reward | integer | No | |
Quest_Task_A | quest | Yes | |
Quest_Task_A_Get | boolean | Yes | |
Quest_Task_A_Kill | integer | Yes | |
Quest_Task_A_Rec | questitem | Yes | |
Ressu_Level | integer | No | |
Resu_01 | string | No | |
Resu_02 | string | No | |
Resu_Auto | dialog | No | |
Resu_Auto_No | button | No | |
Resu_Auto_Yes | button | No | |
Resu_Players | dialog | No | |
Resu_Players_No | button | No | |
Resu_Players_Yes | button | No | |
Resu_Point | location | Yes | |
Ride | boolean | Yes | |
ringstop | real | No | |
Sage_Mode | boolean | Yes | |
Save | integer | Yes | |
SaveCount | integer | No | |
SaveLoad_Alphabet | string | No | |
SaveLoad_Base | integer | No | |
SaveLoad_Char | string | No | |
SaveLoad_CheckName | boolean | 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_Number | string | No | |
SaveLoad_Upper | string | No | |
SaveLoad_Valid | boolean | No | |
SB_Caster | unit | No | |
SB_Group | group | No | |
SB_Point | location | No | |
SD_Caster | unit | No | |
SD_Point | location | No | |
SD_Target | unit | No | |
Shadow | unit | No | |
ShoutPoint | location | No | |
Skill_Damage | integer | Yes | |
Skill_Point | location | Yes | |
Skill_Target | unit | No | |
Soul_lite | boolean | Yes | |
SpecialEffects | effect | Yes | |
Stat_Dark | integer | Yes | |
Stat_Dark_Bonus | integer | Yes | |
Stat_Dark_Total | integer | Yes | |
Stat_Earth | integer | Yes | |
Stat_Earth_Bonus | integer | Yes | |
Stat_Earth_Total | integer | Yes | |
Stat_Fire | integer | Yes | |
Stat_Fire_Bonus | integer | Yes | |
Stat_Fire_Total | integer | Yes | |
Stat_Light | integer | Yes | |
Stat_Light_Bonus | integer | Yes | |
Stat_Light_Total | integer | Yes | |
Stat_Poison | integer | Yes | |
Stat_Poison_Bonus | integer | Yes | |
Stat_Poison_Total | integer | Yes | |
Stat_Water | integer | Yes | |
Stat_Water_Bonus | integer | Yes | |
Stat_Water_Total | integer | Yes | |
Stat_Wind | integer | Yes | |
Stat_Wind_Bonus | integer | Yes | |
Stat_Wind_Total | integer | Yes | |
Status_Reputation | integer | Yes | |
Status_Soul | integer | Yes | |
StrikenSmashEffect | effect | No | |
StrikenSmashEffect2 | effect | No | |
SwordEffect | effect | No | |
SwordEffect2 | effect | No | |
Target | unit | Yes | |
TargetLoc | location | No | |
targetpoint | rect | No | |
TBAura | effect | No | |
TBCaster | unit | No | |
TempCastingPointForText | location | No | |
TempGroup | group | No | |
TempLoc | location | Yes | |
TempPoint | location | No | |
temppoint | location | No | |
temppoint2 | location | No | |
TempPoint2 | location | No | |
TempUnit | unit | No | |
TimeCount | integer | No | |
TimeWave | leaderboard | No | |
ToD_Ability | integer | No | |
ToD_Base_Chance | integer | No | |
ToD_Base_Heal | real | No | |
ToD_Caster | unit | No | |
ToD_Dummy_Ability | abilcode | No | |
ToD_Dummy_Ability_Frenzy | abilcode | No | |
ToD_Heal_Group | group | No | |
ToD_Owner | player | No | |
ToD_Position | location | No | |
ToD_Target_Location | location | No | |
ToD_Unit_Counter | integer | No | |
victim | unit | No | |
Vital_Fury_Mode | boolean | Yes | |
Vocum_Caster | unit | No | |
Vocum_Group | group | No | |
Vocum_Point | location | No | |
Vocumed_Unit | unit | No | |
Wanderer | unit | No | |
Wave_Point | location | Yes | |
WayPoint | rect | Yes | |
Whirlpool | abilcode | Yes | |
WhirlpoolCaster | unit | No | |
x | real | No | |
Your_Soul | unit | Yes |