function Colorized_Code takes string s, string numColor, string lowerColor, string upperColor, string specColor, integer start returns string
local string ns = ""
local string c
local integer m = StringLength(s)
local integer i = start
local boolean l
loop
exitwhen m == i
set c = SubString(s, i, i + 1)
if (c!=" ") then
set l = StringCase(c, false) == c
//special or number
if (c == StringCase(c, true) and l) then
//number character coloring
if ("0" == c or 0 != S2I(c)) then
set ns = ns + "|cff" + numColor + c
//special character coloring
else
set ns = ns + "|cff" + specColor + c
endif
//lowercase character coloring
elseif (l) then
set ns = ns + "|cff" + lowerColor + c
//uppercase character coloring
else
set ns = ns + "|cff" + upperColor + c
endif
else
set ns = ns + " "
endif
set i = i + 1
endloop
return ns
endfunction
function SL_IntegerToCode takes integer i, integer len returns string
local string s = ""
local integer m = 0
local integer c
local integer l = StringLength(udg_SL_STRING)
local boolean e = false
if l < 36 then
set c = 7
elseif l < 74 then
set c = 6
else
set c = 5
endif
if i <= Pow(l, c - 1) then
loop
set c = c - 1
if c > 0 then
if not e and i >= Pow(l, c) then
set e = true
endif
set m = i / R2I(Pow(l, c))
set i = i - m * R2I(Pow(l, c))
if not e and m == 0 then
else
set s = s + SubString(udg_SL_STRING, m, m + 1)
endif
else
set m = ModuloInteger(i, l)
set s = s + SubString(udg_SL_STRING, m, m + 1)
set i = 0
endif
exitwhen c == 0
endloop
endif
if len != - 1 then
loop
exitwhen StringLength(s) >= len
set s = SubString(udg_SL_STRING, 0, 1) + s
endloop
endif
return s
endfunction
function SL_CodeToInteger takes string c returns integer
local integer l = StringLength(c)
local integer m = StringLength(udg_SL_STRING)
local integer i = 0
local integer char
local string s
local integer int = 0
if l > 0 then
loop
exitwhen i == l
set s = SubString(c, i, i + 1)
if s != StringCase(s, true) then
set char = LoadInteger(udg_SL_HASHTABLE, StringHash(s), 2)
else
set char = LoadInteger(udg_SL_HASHTABLE, StringHash(s), 1)
endif
if char !=0 or i > 0 then
set int = int + R2I(Pow(m, l - i - 1)) * char
endif
set i = i + 1
endloop
endif
set s = null
return int
endfunction
function SL_GetIntegerSize takes integer a returns integer
local integer base = StringLength(udg_SL_STRING)
local integer max = 4
local integer i = 0
if base < 64 then
set max = 6
elseif base < 74 then
set max = 5
endif
loop
set i = i + 1
exitwhen i > max
if a < R2I(Pow(base,i)) then
return i
endif
endloop
endfunction
function SL_CodeCheckSum takes string c, player p returns string
local string EC = udg_SL_STRING
local integer MaxV = R2I(Pow(StringLength(EC), udg_SL_CRC_LEN))
local integer i
if udg_SL_BIND_TO_PLAYER then
set i = StringHash(c + StringCase(GetPlayerName(p), false))
else
set i = StringHash(c)
endif
if i < 0 then
set i = i * - 1
endif
if i > MaxV then
set i = ModuloInteger(i, MaxV)
endif
return SL_IntegerToCode(i, udg_SL_CRC_LEN)
endfunction
function SL_CodeValidation takes player p, string c returns boolean
local integer l = StringLength(c)
if StringLength(c) < (2+udg_SL_CRC_LEN) then
return false
else
return SL_CodeCheckSum(SubString(c, 0, l-udg_SL_CRC_LEN), p) == SubString(c, l-udg_SL_CRC_LEN, l)
endif
endfunction
function SL_LoadDataFromLoadCode takes player p, string CODE returns nothing
local integer l = StringLength(udg_SL_STRING) //get the string length of the alphabet string
local integer i = 0
local integer i2
local integer MinExp
local integer array Pow2
local integer CLASS // the hero unit type index in SL_HERO_TYPE array
local integer LV // hero level
local integer EXP // hero exp
local integer STR // hero strength
local integer AGI // hero agility
local integer INT // hero intelligence
local integer GOLD // player gold
local integer LUMBER // player lumber
local integer ITEM_SLOT
local integer MAX_X = R2I(GetRectMaxX(bj_mapInitialPlayableArea)) //highest X coordinate on map
local integer MAX_Y = R2I(GetRectMaxY(bj_mapInitialPlayableArea)) //highest Y coordinate on map
local integer COORD_LEN_X = SL_GetIntegerSize(MAX_X * 2) // how much character needed for save hero location
local integer COORD_LEN_Y = SL_GetIntegerSize(MAX_Y * 2) // how much character needed for save hero location
local integer X // hero x coordinate
local integer Y // hero y coordinate
local item itm
local integer a1
local integer a2
local integer a3
local integer a4
local integer c
local string Key
local string s
local location loc
local unit u
//----------- just preload the 2 bases, like 1,2,4,8,16,32 ----------------------
set i = 0
loop
set Pow2[i] = R2I(Pow(2, i))
set i = i + 1
exitwhen i > 6
endloop
//-------------------------------------------------------------------------------
set i = 0
//lets check 1st the custom values
if udg_SL_CUSTOM_VALUE_ON then
set a4 = 0
loop
set a1 = SL_CodeToInteger(SubString(CODE, i, i + 1)) //this say how much the next 2 data size
set i = i + 1
if a1 > 0 then
set a2 = a1 / 10
set a4 = a4 + 1
set a3 = SL_CodeToInteger(SubString(CODE, i, i + a2)) //1st piece
set udg_SL_CV_ARRAY[a4] = a3
set i = i + a2
set a1 = a1 - (a2 * 10)
if a1 > 0 then
set a4 = a4 + 1
set a3 = SL_CodeToInteger(SubString(CODE, i, i + a1)) //2nd piece
set udg_SL_CV_ARRAY[a4] = a3
set i = i + a1
endif
endif
exitwhen a4 == udg_SL_CV_MAX
endloop
endif
//don't forget i keep the position where ended the custom value and start the hero data
// we do several check
if udg_SL_SAVE_HERO then
set loc = GetStartLocationLoc(GetPlayerStartLocation(Player(0)))
set X = R2I(GetLocationX(loc))
set Y = R2I(GetLocationY(loc))
call RemoveLocation(loc)
set a1 = StringLength(SubString(CODE, i, StringLength(CODE)))
//if have remaining code then its mean we can read foward
if a1 > 0 then
//we get 1st the Key string, this string contain the lv,exp,str,int,agi,gold and lumber length
//the udg_SL_VAR array containing the data and we saved into code the array index
//we get 1st how much char needed for saveing the array index
set a1 = SL_GetIntegerSize(udg_SL_MAX_VAR)
set a2 = SL_CodeToInteger(SubString(CODE, i , i + a1))
set i = i + a1
set Key = udg_SL_VAR[a2]
set a1 = SL_GetIntegerSize(udg_SL_MAX_HERO)
set CLASS = SL_CodeToInteger(SubString(CODE, i, i + a1)) //after the key we read out the class
set i = i + a1
//we get the level from code
set a2 = S2I(SubString(Key, 0, 1))
if a2 > 0 then
set LV = SL_CodeToInteger(SubString(CODE, i, i + a2))
set i = i + a2
else
set LV = 0
endif
//we get exp from code
set a2 = S2I(SubString(Key, 1, 2))
if a2 > 0 then
set EXP = SL_CodeToInteger(SubString(CODE, i, i + a2))
set i = i + a2
else
set EXP = 0
endif
//we create the hero
set u = CreateUnit(p, udg_SL_HERO_TYPE[CLASS], X, Y, 0)
//we set hero exp & level
if LV == 0 and EXP > 0 then
call AddHeroXP (u, EXP, false)
else
if LV > 1 then
call SetHeroLevel(u, LV, false)
endif
if EXP > 0 then
call AddHeroXP (u, EXP, false)
endif
endif
if udg_SL_SAVE_STAT then
set a1 = S2I(SubString(Key, 2, 3))
set STR = SL_CodeToInteger(SubString(CODE, i, i + a1))
set i = i + a1
set a1 = S2I(SubString(Key, 3, 4))
set AGI = SL_CodeToInteger(SubString(CODE, i, i + a1))
set i = i + a1
set a1 = S2I(SubString(Key, 4, 5))
set INT = SL_CodeToInteger(SubString(CODE, i, i + a1))
set i = i + a1
call SetHeroStr(u, STR, true)
call SetHeroAgi(u, AGI, true)
call SetHeroInt(u, INT, true)
endif
if udg_SL_SAVE_GOLD then
set a1 = S2I(SubString(Key, 5, 6))
if a1 > 0 then
set GOLD = SL_CodeToInteger(SubString(CODE, i, i + a1))
set i = i + a1
else
set GOLD = 0
endif
call SetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD, GOLD)
endif
if udg_SL_SAVE_LUMBER then
set a1 = S2I(SubString(Key, 6, 7))
if a1 > 0 then
set LUMBER = SL_CodeToInteger(SubString(CODE, i, i + a1))
set i = i + a1
else
set LUMBER = 0
endif
call SetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER, LUMBER)
endif
if udg_SL_SAVE_COORD then
set X = SL_CodeToInteger(SubString(CODE, i, i + COORD_LEN_X)) - MAX_X
set i = i + COORD_LEN_X
set Y = SL_CodeToInteger(SubString(CODE, i, i + COORD_LEN_Y)) - MAX_Y
set i = i + COORD_LEN_Y
call SetUnitX(u, X)
call SetUnitY(u, Y)
endif
if udg_SL_SAVE_ITEMS then
// we get the item slot, this number is between 0-63 and tell what slot empty or no
set ITEM_SLOT = SL_CodeToInteger(SubString(CODE, i, i + 1))
set i = i + 1
if ITEM_SLOT > 0 then
set a3 = 1
set a3 = SL_GetIntegerSize(udg_SL_MAX_ITEM) //we get the length what need save the items
set a2 = 'flag' //dummy item raw code
set a1 = - 1
loop
set a1 = a1 + 1
if ITEM_SLOT >= Pow2[5 - a1] then
set ITEM_SLOT = ITEM_SLOT - Pow2[5 - a1]
set i2 = SL_CodeToInteger(SubString(CODE, i, i + a3)) //ITEM_TYPE array index
set i = i + a3
set i2 = udg_SL_ITEM_TYPE[i2]
if i2 == 0 then
set i2 = a2
endif
set itm = CreateItem(i2, X, Y)
call UnitAddItem(u, itm)
set c = GetItemCharges(itm)
if c > 1 then
set a4 = SL_GetIntegerSize (c)
set c = SL_CodeToInteger(SubString(CODE, i, i + a4))
set i = i + a4
if c > 0 then
call SetItemCharges(itm, c)
endif
endif
else
set itm = CreateItem(a2, X, Y)
call UnitAddItem(u, itm)
endif
exitwhen a1 == 5
endloop
endif
set a1 = 0
loop
exitwhen a1 == 6
set itm = UnitItemInSlot(u, a1)
if itm != null then
if GetItemTypeId(itm) == a2 then
call RemoveItem(itm)
endif
endif
set a1 = a1 + 1
endloop
endif
call DisplayTextToPlayer ( p, 0, 0, "|cffffff00 Load System:|r Loading completed without error." )
endif
set loc = null
endif
set itm = null
endfunction
function CreateSaveLoadCode takes player p, unit u returns nothing
local string CODE = "" // final code will be stored to this variable
local integer l = StringLength(udg_SL_STRING) //get the string length of the alphabet string
local integer i
local integer array Pow2
local integer array PowL
local integer MinExp // that exp what was needed for your hero current level
local integer MaxExp // that exp what needed for your hero for level up
local integer CurExp // with how much exp hero passed the last level up
local integer CLASS // the hero unit type index in SL_HERO_TYPE array
local integer LV // hero level
local integer EXP // hero exp
local integer STR // hero strength
local integer AGI // hero agility
local integer INT // hero intelligence
local integer GOLD // player gold
local integer LUMBER // player lumber
local integer X // hero x coordinate
local integer Y // hero y coordinate
local integer COORD_LEN_X // how much character needed for save hero location
local integer COORD_LEN_Y // how much character needed for save hero location
local boolean ERROR = true
local string CV_CODE = "" //custom value code
local string H_CODE = "" //hero value code
local integer MAX_X = R2I(GetRectMaxX(bj_mapInitialPlayableArea)) //highest X coordinate on map
local integer MAX_Y = R2I(GetRectMaxY(bj_mapInitialPlayableArea)) //highest Y coordinate on map
local integer ITEM_SLOT
local item itm
local item itm2
local unit d //dummy unit
local location loc //just for location
local string Key = "" //this is a key for saveing lv, exp, stats into 1 character, we will search thsi string in VAR array for get a index
local string s1
local string s2
local string s3
local integer a1
local integer a2
local integer a3
local integer a4
local string PATH
local string HERO_NAME
local string HERO_LV
//----------- just preload the 2 bases, like 1,2,4,8,16,32 ----------------------
set i = 0
loop
set Pow2[i] = R2I(Pow(2, i))
set i = i + 1
exitwhen i > 6
endloop
//-------------------------------------------------------------------------------
//----------- just preload the Alpahabet string bases with max values like 1char length till length-1 ----
set i = 1
loop
set PowL[i] = R2I(Pow(l, i)) - 1
set i = i + 1
exitwhen i == 5
endloop
//-------------------------------------------------------------------------------
//---------- check if 2 character length would be sufficient for hero coord or no ----
set COORD_LEN_X = SL_GetIntegerSize(MAX_X * 2)
set COORD_LEN_Y = SL_GetIntegerSize(MAX_Y * 2)
//------------------------------------------------------------------------------------
// ------ why save custom values to 1st place? because its optional
// if i let custom value first then probabil resource could be lower by 1
if udg_SL_CUSTOM_VALUE_ON then
set i = 1
loop
//we form then variables to avoid the higher numbers then the limit
set a3 = ModuloInteger(udg_SL_CV_ARRAY[i], PowL[4] + 1)
set a4 = ModuloInteger(udg_SL_CV_ARRAY[i + 1], PowL[4] + 1)
set s1 = SL_IntegerToCode(a3, - 1)
set a1 = StringLength(s1)
set s2 = ""
set a2 = 0
if i < udg_SL_CV_MAX then
set s2 = SL_IntegerToCode(a4, - 1)
set a2 = StringLength(s2)
set i = i + 1
endif
set CV_CODE = CV_CODE + SL_IntegerToCode((a1 * 10 + a2), 1) + s1 + s2
set i = i + 1
exitwhen i > udg_SL_CV_MAX
endloop
if not (udg_SL_SAVE_HERO and u != null) then
set ERROR = false
set HERO_NAME = "No hero"
set HERO_LV = "-"
endif
endif
if udg_SL_SAVE_HERO and u != null then
// ----- we get the hero index from hashtable, if it will be 0, then not found
set CLASS = LoadInteger(udg_SL_HASHTABLE, 2, GetUnitTypeId(u))
// --- if isn't 0 then Hero was stored into array and we continue -----
if CLASS != 0 then
// --- we get every data, what we will use that not sure yet ----
set LV = GetHeroLevel(u)
set EXP = GetHeroXP(u)
set STR = GetHeroStr (u, false)
set AGI = GetHeroAgi (u, false)
set INT = GetHeroInt (u, false)
set GOLD = GetPlayerState(p, PLAYER_STATE_RESOURCE_GOLD)
set LUMBER = GetPlayerState(p, PLAYER_STATE_RESOURCE_LUMBER)
//formating the stuff to max value if maybe it is higher
set LV = ModuloInteger(LV, PowL[2] + 1)
set EXP = ModuloInteger(EXP, PowL[4] + 1)
set STR = ModuloInteger(STR, PowL[2] + 1)
set AGI = ModuloInteger(AGI, PowL[2] + 1)
set INT = ModuloInteger(INT, PowL[2] + 1)
set GOLD = ModuloInteger(GOLD, udg_SL_MAX_GOLD + 1)
set LUMBER = ModuloInteger(LUMBER, udg_SL_MAX_GOLD + 1)
//if your hero not maxed level then
if udg_SL_MAX_HERO_LEVEL != LV then
// -- we get the MinExp, MaxExp, CurExp with createing a dummy unit at player 1 start location
set loc = GetStartLocationLoc(GetPlayerStartLocation(Player(0)))
set d = CreateUnit(Player(0), GetUnitTypeId(u), GetLocationX(loc), GetLocationY(loc), 0)
call RemoveLocation(loc)
if LV == 1 then
set MinExp = 0
else
call SetHeroLevel(d, LV, false)
set MinExp = GetHeroXP(d)
endif
call SetHeroLevel(d, LV + 1, false)
set MaxExp = GetHeroXP(d) - 1
call RemoveUnit(d)
set CurExp = EXP - MinExp
else
set MinExp = EXP
set MaxExp = EXP
set CurExp = 0
endif
//lets start build the H_CODE with class then with level
//lets check if max class is higher than the Alpahabet string base
set a1 = 1
if udg_SL_MAX_HERO > PowL[1] then
set a1 = 2
endif
set H_CODE = SL_IntegerToCode(CLASS, a1)
//we check if the SMART_LV was on or off
//if off then easily save the
if not udg_SL_SAVE_SMART_LV or CurExp == 0 or EXP == 0 then
set s1 = SL_IntegerToCode(LV, - 1)
set Key = I2S(StringLength(s1)) + "0"
set H_CODE = H_CODE + s1
else
//we must figure out what better, if we save LV+CurExp or total EXP
set s1 = SL_IntegerToCode(LV, - 1) + SL_IntegerToCode(CurExp, - 1)
set s2 = SL_IntegerToCode(EXP, - 1)
set a1 = StringLength(s1)
set a2 = StringLength(s2)
if a1 > a2 then
set Key = "0" + I2S(a2)
set H_CODE = H_CODE + s2
else
set Key = I2S(StringLength(SL_IntegerToCode(LV, - 1))) + I2S(StringLength(SL_IntegerToCode(CurExp, - 1)))
set H_CODE = H_CODE + s1
endif
endif
//next piece what we save is the stats
if udg_SL_SAVE_STAT then
set s1 = SL_IntegerToCode(STR, - 1)
set s2 = SL_IntegerToCode(AGI, - 1)
set s3 = SL_IntegerToCode(INT, - 1)
set a1 = StringLength(s1)
set a2 = StringLength(s2)
set a3 = StringLength(s3)
set H_CODE = H_CODE + s1 + s2 + s3
set Key = Key + I2S(a1) + I2S(a2) + I2S(a3)
else
//its just a 1st record in array, doesn't matter too much
set Key = Key + "111"
endif
//saveing resource part: gold and lumber
if udg_SL_SAVE_GOLD and udg_SL_SAVE_LUMBER then
if not (GOLD == 0 and LUMBER == 0) then
set s1 = SL_IntegerToCode(GOLD, - 1)
set s2 = SL_IntegerToCode(LUMBER, - 1)
set a1 = StringLength(s1)
set a2 = StringLength(s2)
set H_CODE = H_CODE + SL_IntegerToCode((a1 * 10 + a2), - 1) + s1 + s2
set Key = Key + I2S(a1)
set Key = Key + I2S(a2)
else
set Key = Key + "00"
endif
elseif udg_SL_SAVE_GOLD then
if GOLD > 0 then
set H_CODE = H_CODE + SL_IntegerToCode(GOLD, - 1)
set Key = Key + I2S(StringLength(SL_IntegerToCode(GOLD, - 1)))
else
set Key = Key + "0"
endif
set Key = Key + "0"
elseif udg_SL_SAVE_LUMBER then
set Key = Key + "0"
if LUMBER > 0 then
set H_CODE = H_CODE + SL_IntegerToCode(LUMBER, - 1)
set Key = Key + I2S(StringLength(SL_IntegerToCode(LUMBER, - 1)))
else
set Key = Key + "0"
endif
else
set Key = Key + "00"
endif
//we save hero coordinates (X,Y) with shift
if udg_SL_SAVE_COORD then
set a1 = R2I(GetUnitX(u)) + MAX_X //x coordinate with shift for don't be negative number
set a2 = R2I(GetUnitY(u)) + MAX_Y //y coordinate with shift for don't be negative number
set H_CODE = H_CODE + SL_IntegerToCode(a1, COORD_LEN_X) + SL_IntegerToCode(a2, COORD_LEN_Y)
endif
//--------------------------- Item save -----------------------
// now coming the harder part :D
// saveing the items
if udg_SL_SAVE_ITEMS then
// let's see how much item got the hero
set ITEM_SLOT = 0
set i = 0
set a1 = 0
set s1 = ""
set a2 = SL_GetIntegerSize(udg_SL_MAX_ITEM) //Get how much character long the last items when saved
loop
set itm = UnitItemInSlot(u, i)
if itm != null then
set a1 = LoadInteger(udg_SL_HASHTABLE, 3, GetItemTypeId(itm))
if a1 != 0 then //so item was found from item data base
set ITEM_SLOT = ITEM_SLOT + Pow2[5 - i]
//reminder a1 = item type index, a2 = how much character needed for item type index
set s1 = s1 + SL_IntegerToCode(a1, a2)
if GetItemCharges(itm) != 0 then
//we handle item charges like if it is 1 then not save
//we create a clone item for check how much charge got default
set loc = GetStartLocationLoc(GetPlayerStartLocation(Player(0)))
set itm2 = CreateItem(GetItemTypeId(itm), GetLocationX(loc), GetLocationY(loc))
set a4 = GetItemCharges(itm2)
call RemoveItem(itm2)
call RemoveLocation(loc)
//if charge is too high for able write out with 1 char we use 2
set a4 = ModuloInteger(a4, PowL[4] + 1) //only for avoid a crap if have huge charge number like 2bil
set a3 = SL_GetIntegerSize(a4) //get how much char needed for save charge
if a4 != 1 then
//a4 = item charge, a3=how much char needed for save this item
set s1 = s1 + SL_IntegerToCode(a4, a3)
endif
endif
endif
set itm = null
endif
set i = i + 1
exitwhen i == 6
endloop
set H_CODE = H_CODE + SL_IntegerToCode(ITEM_SLOT, 1) + s1
endif
//we search after Key index in VAR array, when Key == VAR[index] then we save index
set a1 = SL_GetIntegerSize(udg_SL_MAX_VAR)
set a2 = - 1
set i = 0
loop
exitwhen i > udg_SL_MAX_VAR or a2 != - 1
if udg_SL_VAR[i] == Key then
set a2 = i
endif
set i = i + 1
endloop
if a2 != - 1 then
set s1 = SL_IntegerToCode(a2, a1)
set H_CODE = s1 + H_CODE
set ERROR = false
else
call DisplayTextToPlayer ( p, 0, 0, "|cffffff00Warning:|r something went wrong." )
endif
endif
set HERO_NAME = GetUnitName(u)
set HERO_LV = I2S(LV)
endif
if not ERROR then
set CODE = CV_CODE + H_CODE
set CODE = CODE + SL_CodeCheckSum(CODE, p)
set PATH = udg_SL_FOLDER + "\\" + HERO_NAME + " - " + HERO_LV + " by " + GetPlayerName(p) + ".txt"
if StringLength(CODE) < 60 then
call DisplayTextToPlayer ( p, 0, 0, "|cffffff00Code:|r -Load " + Colorized_Code(CODE, "00FF00", "FFFF00", "00FFFF", "FF00FF", 0) )
else
call DisplayTextToPlayer ( p, 0, 0, "|cffffff00Code:|r -Load " + CODE )
endif
call DisplayTextToPlayer ( p, 0, 0, "|cff7777ffNote:|r Code saved into |cffff8888" + PATH + "|r")
if GetLocalPlayer() == p then
call PreloadGenClear()
call PreloadGenStart()
call Preload("\r\n\t\t\t\tHero: " + HERO_NAME + "\r\n\t\t\t\t" + "Level: " + HERO_LV + "\t\t\r\n\t\t\t\t" + "Name: " + GetPlayerName(p) + "\t\t\r\n" + "Code: -Load " + CODE )
call PreloadGenEnd(PATH)
endif
//call SL_LoadCode(CODE, p)
else
call DisplayTextToPlayer ( p, 0, 0, "|cffff7777Warning:|r something went wrong." )
endif
set itm = null
set itm2 = null
set p = null
set loc = null
set d = null
endfunction
Name | Type | is_array | initial_value |
Code | string | No | |
Player | player | No | |
PlayerGroup | force | No | |
SL_BIND_TO_PLAYER | boolean | No | |
SL_CRC_LEN | integer | No | |
SL_CUSTOM_VALUE_ON | boolean | No | |
SL_CV_ARRAY | integer | Yes | |
SL_CV_MAX | integer | No | |
SL_ENCODE_STRING | string | No | |
SL_FOLDER | string | No | |
SL_HASHTABLE | hashtable | No | |
SL_HERO_TYPE | unitcode | Yes | |
SL_ITEM_TYPE | itemcode | Yes | |
SL_MAX_GOLD | integer | No | |
SL_MAX_HERO | integer | No | |
SL_MAX_HERO_LEVEL | integer | No | |
SL_MAX_ITEM | integer | No | |
SL_MAX_VAR | integer | No | |
SL_SAVE_COORD | boolean | No | |
SL_SAVE_GOLD | boolean | No | |
SL_SAVE_HERO | boolean | No | |
SL_SAVE_ITEMS | boolean | No | |
SL_SAVE_LUMBER | boolean | No | |
SL_SAVE_SMART_LV | boolean | No | |
SL_SAVE_STAT | boolean | No | |
SL_STRING | string | No | |
SL_VAR | string | Yes | |
Unit | unit | No |
function Trig_Loading_table_Actions takes nothing returns nothing
//"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$&/+-=[]^_`{}~()*"
//local string ENCODE = "@rh4[N{ym9MlT/Qc1LI2Ja^$5x60_CFdjDqARs=n3+E~(eY}gXuGw`)pSU8WHz#-*kB]!Zv&t7OiPoKbfV"
//local string ENCODE = "@h0oj]LH)!+bAcQtWMr_3#fDR&g1$Cq-uUTXvx5zsYIk4iONEFew^Vm(/86}l9[dna{~J=S*Pp2G7Z`yBK"
local integer i = 0
local integer i2 = 0
local integer l = StringLength(udg_SL_STRING)
local location loc
local string array Key
local string s
local unit u
local integer MaxExp
local integer MaxLvExp
local integer a1 //lv
local integer a2 //exp
local integer a3 //str
local integer a4 //agi
local integer a5 //int
local integer a6 //gold
local integer a7 //lumber
local integer b1 = 0 //minimum lv code length
local integer b2 = 0 //minimum exp code length
local integer b3 = 1 //minimum str code length
local integer b4 = 1 //minimum agi code length
local integer b5 = 1 //minimum int code length
local integer b6 = 0 //minimum gold code length
local integer b7 = 0 //minimum lumber code length
local integer c1 = 2 //maximum lv code length
local integer c2 = 4 //maximum exp code length
local integer c3 = 2 //maximum str code length
local integer c4 = 2 //maximum agi code length
local integer c5 = 2 //maximum int code length
local integer c6 = 4 //maximum gold code length
local integer c7 = 4 //maximum lumber code length
local integer c2_1
set i = 0
loop
exitwhen i == l
set s = SubString(udg_SL_STRING, i, i + 1)
if s != StringCase(s, true) then
call SaveInteger(udg_SL_HASHTABLE, StringHash(s), 2, i)
else
call SaveInteger(udg_SL_HASHTABLE, StringHash(s), 1, i)
endif
//call SaveStr(h, 2, i, s)
set i = i + 1
endloop
set i = 1
loop
exitwhen i > udg_SL_MAX_HERO
call SaveInteger(udg_SL_HASHTABLE, 2, udg_SL_HERO_TYPE[i], i)
set i = i + 1
endloop
set i = 1
loop
exitwhen i > udg_SL_MAX_ITEM
call SaveInteger(udg_SL_HASHTABLE, 3, udg_SL_ITEM_TYPE[i], i)
set i = i + 1
endloop
set loc = GetStartLocationLoc(GetPlayerStartLocation(Player(0)))
set u = CreateUnit(Player(15), 'Hpal', GetLocationX(loc), GetLocationY(loc), 0)
call AddHeroXP(u,2147483647,false)
set MaxExp = GetHeroXP(u)
set i = GetHeroLevel(u)
set udg_SL_MAX_HERO_LEVEL = i
if i > 1 then
call UnitStripHeroLevel(u, -i)
call SetHeroLevel(u, i - 1,false)
endif
set MaxLvExp = MaxExp - GetHeroXP(u) - 1
call RemoveLocation(loc)
call RemoveUnit(u)
//checking if max gold could be lower code length than max
set i = 1
set c1 = SL_GetIntegerSize(udg_SL_MAX_HERO_LEVEL)
set c2 = SL_GetIntegerSize(MaxExp)
set c2_1 = SL_GetIntegerSize(MaxLvExp)
set c6 = SL_GetIntegerSize(udg_SL_MAX_GOLD)
set c7 = SL_GetIntegerSize(udg_SL_MAX_GOLD)
//if something turned off then we dont need loop over all variations
if not udg_SL_SAVE_SMART_LV then
set c2 = b2
endif
if not udg_SL_SAVE_GOLD then
set c6 = b6
endif
if not udg_SL_SAVE_LUMBER then
set c7 = b7
endif
if not udg_SL_SAVE_STAT then
set c3 = b3
set c4 = b4
set c5 = b5
endif
// we make a huge crap :D
set i = (c1+1-b1)*(c2+1-b2)*(c3+1-b3)*(c4+1-b4)*(c5+1-b5)*(c6+1-b6)*(c7+1-b7)
if (i > (l*l-1)) or i > 8191 then
call DisplayTextToPlayer ( GetLocalPlayer(), 0, 0, "|cffff7777Warning:|r too huge max numbers in system." )
else
//call PreloadGenClear()
//call PreloadGenStart()
set i = -1
set a1 = b1
loop
set a2 = b2
if a1 > b1 then
set c2 = c2_1
endif
set Key[1] = I2S(a1)
loop
set a3 = b3
set Key[2] = I2S(a2)
loop
set a4 = b4
set Key[3] = I2S(a3)
loop
set a5 = b5
set Key[4] = I2S(a4)
loop
set a6 = b6
set Key[5] = I2S(a5)
loop
set a7 = b7
set Key[6] = I2S(a6)
loop
set Key[7] = I2S(a7)
set s = Key[1] + Key[2] + Key[3] + Key[4] + Key[5] + Key[6] + Key[7]
set i = i + 1
set udg_SL_VAR[i] = s
//call Preload(s+" i:"+I2S(i))
set a7 = a7 + 1
exitwhen a7 > c7
endloop
set a6 = a6 + 1
exitwhen a6 > c6
endloop
set a5 = a5 + 1
exitwhen a5 > c5
endloop
set a4 = a4 + 1
exitwhen a4 > c4
endloop
set a3 = a3 + 1
exitwhen a3 > c3
endloop
set a2 = a2 +1
exitwhen a2 > c2
endloop
set a1 = a1 + 1
exitwhen a1 > c1
endloop
set udg_SL_MAX_VAR = i
//call PreloadGenEnd("log_shadow.txt")
endif
call DisplayTextToPlayer ( GetLocalPlayer(), 0, 0, "|cffffff00Notice:|r Loading save-load system done." )
set u = null
set loc = null
set s = null
endfunction
//===========================================================================
function InitTrig_Auto_Settings takes nothing returns nothing
set gg_trg_Auto_Settings = CreateTrigger( )
call TriggerAddAction( gg_trg_Auto_Settings, function Trig_Loading_table_Actions )
endfunction
function DeclareItems takes nothing returns nothing
set udg_SL_ITEM_TYPE[0] = 'phea' //Potion of Healing id: 1885889889
set udg_SL_ITEM_TYPE[1] = 'pman' //Potion of Mana id: 1886216558
set udg_SL_ITEM_TYPE[2] = 'pinv' //Potion of Invisibility id:1885957750
set udg_SL_ITEM_TYPE[3] = 'shen' //Enchanted Shield id:1936221550
set udg_SL_ITEM_TYPE[4] = 'rej5' //Lesser Scroll of Replenishment id:1919248949
set udg_SL_ITEM_TYPE[5] = 'rej2' //Lesser Replenishment Potion id:1919248946
set udg_SL_ITEM_TYPE[6] = 'frhg' //Firehand Gauntlets id:1718773863
set udg_SL_ITEM_TYPE[7] = 'asbl' //Assassin's Blade id:1634951788
set udg_SL_ITEM_TYPE[8] = 'arsh' //Arcanite Shield id:1634890600
set udg_SL_ITEM_TYPE[9] = 'rej4' //Greater Replenishment Potion id:1919248948
set udg_SL_ITEM_TYPE[10] = 'rej1' //Minor Replenishment Potion id:1919248945
set udg_SL_ITEM_TYPE[11] = 'rat3' //Claws of Attack + 3 id:1918989363
set udg_SL_ITEM_TYPE[12] = 'mnsf' //Mindstaff id:1835955046
set udg_SL_ITEM_TYPE[13] = 'lnrn' //Lion's Ring id:1819177582
set udg_SL_ITEM_TYPE[14] = 'klmm' //Killmaim id:1802268013
set udg_SL_ITEM_TYPE[15] = 'gvsm' //Gloves of Spell Mastery id:1735816045
set udg_SL_ITEM_TYPE[16] = 'fwss' //Frost Wyrm Skull Shield id:1719104371
set udg_SL_ITEM_TYPE[17] = 'frgd' //Frostguard id:1718773604
set udg_SL_ITEM_TYPE[18] = 'cosl' //Celestial Orb of Souls id:1668248428
set udg_SL_ITEM_TYPE[19] = 'brag' //Bracer of Agility id:1651663207
set udg_SL_ITEM_TYPE[20] = 'blba' //Bladebane Armor id:1651270241
set udg_SL_ITEM_TYPE[21] = 'bfhr' //Bloodfeather's Heart id:1650878578
set udg_SL_ITEM_TYPE[22] = 'rej6' //Greater Scroll of Replenishment id:1919248950
set udg_SL_ITEM_TYPE[23] = 'pspd' //Potion of Speed id:1886613604
set udg_SL_ITEM_TYPE[24] = 'pgin' //Potion of Greater Invisibility id:1885825390
set udg_SL_ITEM_TYPE[25] = 'nspi' //Necklace of Spell Immunity id:1853059177
set udg_SL_ITEM_TYPE[26] = 'lure' //Monster Lure id:1819636325
set udg_SL_ITEM_TYPE[27] = 'iwbr' //Ironwood Branch id:1769431666
set udg_SL_ITEM_TYPE[28] = 'hbth' //Helm of Battlethirst id:1751282792
set udg_SL_ITEM_TYPE[29] = 'grsl' //Grimoire of Souls id:1735553900
set udg_SL_ITEM_TYPE[30] = 'dtsb' //Drek'thar's Spellbook id:1685353314
set udg_SL_ITEM_TYPE[31] = 'drph' //Druid Pouch id:1685221480
set udg_SL_ITEM_TYPE[32] = 'crdt' //Crown of the Deathlord id:1668441204
set udg_SL_ITEM_TYPE[33] = 'wlsd' //Wand of Lightning Shield (3) id:2003596132
set udg_SL_ITEM_TYPE[34] = 'will' //Wand of Illusion (3) id:2003397740
set udg_SL_ITEM_TYPE[35] = 'shar' //Ice Shard (1) id:1936220530
set udg_SL_ITEM_TYPE[36] = 'sand' //Scroll of Animate Dead (1) id:1935765092
set udg_SL_ITEM_TYPE[37] = 'rej3' //Replenishment Potion (1) id:1919248947
set udg_SL_ITEM_TYPE[38] = 'infs' //Inferno Stone (1) id:1768842867
set udg_SL_ITEM_TYPE[39] = 'hlst' //Health Stone (1) id:1751937908
set udg_SL_ITEM_TYPE[40] = 'fgrd' //Red Drake Egg (1) id:1718055524
set udg_SL_ITEM_TYPE[41] = 'wshs' //Wand of Shadowsight (2) id:2004052083
set udg_SL_ITEM_TYPE[42] = 'woms' //Wand of Mana Stealing (2) id:2003791219
set udg_SL_ITEM_TYPE[43] = 'wcyc' //Wand of the Wind (3) id:2003007843
set udg_SL_ITEM_TYPE[44] = 'srrc' //Scroll of Resurrection (1) id:1936880227
set udg_SL_ITEM_TYPE[45] = 'sror' //Scroll of the Beast (1) id:1936879474
set udg_SL_ITEM_TYPE[46] = 'sres' //Scroll of Restoration (1) id:1936876915
set udg_SL_ITEM_TYPE[47] = 'pgma' //Potion of Greater Mana (1) id:1885826401
set udg_SL_ITEM_TYPE[48] = 'pghe' //Potion of Greater Healing (1) id:1885825125
set udg_SL_ITEM_TYPE[49] = 'pdiv' //Potion of Divinity (1) id:1885628790
set udg_SL_ITEM_TYPE[50] = 'mnst' //Mana Stone (1) id:1835955060
set udg_SL_ITEM_TYPE[51] = 'amrc' //Amulet of Recall id:1634562659
set udg_SL_ITEM_TYPE[52] = 'wswd' //Sentry Wards (3) id:2004055908
set udg_SL_ITEM_TYPE[53] = 'totw' //Talisman of the Wild (3) id:1953461367
set udg_SL_ITEM_TYPE[54] = 'pres' //Potion of Restoration (1) id:1886545267
set udg_SL_ITEM_TYPE[55] = 'pomn' //Potion of Omniscience (1) id:1886350702
set udg_SL_ITEM_TYPE[56] = 'pams' //Anti - magic Potion id:1885433203
set udg_SL_ITEM_TYPE[57] = 'fgrg' //Stone Token (1) id:1718055527
set udg_SL_ITEM_TYPE[58] = 'fgfh' //Spiked Collar (1) id:1718052456
set udg_SL_ITEM_TYPE[59] = 'axas' //Ancestral Staff id:1635279219
set udg_SL_ITEM_TYPE[60] = 'arsc' //Arcane Scroll id:1634890595
set udg_SL_ITEM_TYPE[61] = 'anfg' //Ancient Figurine id:1634625127
set udg_SL_ITEM_TYPE[62] = 'ratf' //Claws of Attack + 15 id:1918989414
set udg_SL_ITEM_TYPE[63] = 'desc' //Kelen's Dagger of Escape id:1684370275
set udg_SL_ITEM_TYPE[64] = 'ckng' //Crown of Kings + 5 id:1667984999
set udg_SL_ITEM_TYPE[65] = 'rde4' //Ring of Protection + 5 id:1919182132
set udg_SL_ITEM_TYPE[66] = 'ofro' //Orb of Frost id:1868984943
set udg_SL_ITEM_TYPE[67] = 'modt' //Mask of Death id:1836016756
set udg_SL_ITEM_TYPE[68] = 'fgsk' //Book of the Dead (1) id:1718055787
set udg_SL_ITEM_TYPE[69] = 'ankh' //Ankh of Reincarnation (1) id:1634626408
set udg_SL_ITEM_TYPE[70] = 'whwd' //Healing Wards (3) id:2003335012
set udg_SL_ITEM_TYPE[71] = 'pnvu' //Potion of Invulnerability (1) id:1886287477
set udg_SL_ITEM_TYPE[72] = 'fgdg' //Demonic Figurine (1) id:1718051943
endfunction
set udg_SL_ITEM_TYPE[0] = 'pams' //Anti-magic Potion id:1885433203
set udg_SL_ITEM_TYPE[1] = 'gvsm' //Gloves of Spell Mastery id:1735816045
set udg_SL_ITEM_TYPE[2] = 'gobm' //Goblin Land Mines id:1735352941
set udg_SL_ITEM_TYPE[3] = 'gemt' //Gem of True Seeing id:1734700404
set udg_SL_ITEM_TYPE[4] = 'cosl' //Celestial Orb of Souls id:1668248428
set udg_SL_ITEM_TYPE[5] = 'brag' //Bracer of Agility id:1651663207
set udg_SL_ITEM_TYPE[6] = 'blba' //Bladebane Armor id:1651270241
set udg_SL_ITEM_TYPE[7] = 'bfhr' //Bloodfeather's Heart id:1650878578
set udg_SL_ITEM_TYPE[8] = 'asbl' //Assassin's Blade id:1634951788
set udg_SL_ITEM_TYPE[9] = 'arsh' //Arcanite Shield id:1634890600
set udg_SL_ITEM_TYPE[10] = 'arsc' //Arcane Scroll id:1634890595
set udg_SL_ITEM_TYPE[11] = 'wolg' //Wirt's Other Leg id:2003790951
set udg_SL_ITEM_TYPE[12] = 'shen' //Enchanted Shield id:1936221550
set udg_SL_ITEM_TYPE[13] = 'rat3' //Claws of Attack +3 id:1918989363
set udg_SL_ITEM_TYPE[14] = 'dust' //Dust of Appearance id:1685418868
set udg_SL_ITEM_TYPE[15] = 'dtsb' //Drek'thar's Spellbook id:1685353314
set udg_SL_ITEM_TYPE[16] = 'drph' //Druid Pouch id:1685221480
set udg_SL_ITEM_TYPE[17] = 'crdt' //Crown of the Deathlord id:1668441204
set udg_SL_ITEM_TYPE[18] = 'axas' //Ancestral Staff id:1635279219
set udg_SL_ITEM_TYPE[19] = 'anfg' //Ancient Figurine id:1634625127
set udg_SL_ITEM_TYPE[20] = 'amrc' //Amulet of Recall id:1634562659
set udg_SL_ITEM_TYPE[21] = 'tsct' //Ivory Tower id:1953719156
set udg_SL_ITEM_TYPE[22] = 'rde1' //Ring of Protection +2 id:1919182129
set udg_SL_ITEM_TYPE[23] = 'prvt' //Periapt of Vitality id:1886549620
set udg_SL_ITEM_TYPE[24] = 'pmna' //Pendant of Mana id:1886219873
set udg_SL_ITEM_TYPE[25] = 'plcl' //Lesser Clarity Potion id:1886151532
set udg_SL_ITEM_TYPE[26] = 'penr' //Pendant of Energy id:1885695602
set udg_SL_ITEM_TYPE[27] = 'moon' //Moonstone id:1836019566
set udg_SL_ITEM_TYPE[28] = 'mcri' //Mechanical Critter id:1835233897
set udg_SL_ITEM_TYPE[29] = 'hslv' //Healing Salve id:1752394870
set udg_SL_ITEM_TYPE[30] = 'tels' //Goblin Night Scope id:1952803955
set udg_SL_ITEM_TYPE[31] = 'sor4' //Shadow Orb +4 id:1936683572
set udg_SL_ITEM_TYPE[32] = 'tmsc' //Tome of Sacrifices id:1953330019
set udg_SL_ITEM_TYPE[33] = 'tmmt' //Totem of Might id:1953328500
set udg_SL_ITEM_TYPE[34] = 'srtl' //Serathil id:1936880748
set udg_SL_ITEM_TYPE[35] = 'srbd' //Searing Blade id:1936876132
set udg_SL_ITEM_TYPE[36] = 'sora' //Shadow Orb +10 id:1936683617
set udg_SL_ITEM_TYPE[37] = 'sor9' //Shadow Orb +9 id:1936683577
set udg_SL_ITEM_TYPE[38] = 'sor8' //Shadow Orb +8 id:1936683576
set udg_SL_ITEM_TYPE[39] = 'sor7' //Shadow Orb +7 id:1936683575
set udg_SL_ITEM_TYPE[40] = 'sor6' //Shadow Orb +6 id:1936683574
set udg_SL_ITEM_TYPE[41] = 'sor5' //Shadow Orb +5 id:1936683573
set udg_SL_ITEM_TYPE[42] = 'sor3' //Shadow Orb +3 id:1936683571
set udg_SL_ITEM_TYPE[43] = 'sor2' //Shadow Orb +2 id:1936683570
set udg_SL_ITEM_TYPE[44] = 'sor1' //Shadow Orb +1 id:1936683569
set udg_SL_ITEM_TYPE[45] = 'shcw' //Shaman Claws id:1936221047
set udg_SL_ITEM_TYPE[46] = 'sfog' //Horn of the Clouds id:1936093031
set udg_SL_ITEM_TYPE[47] = 'rej6' //Greater Scroll of Replenishment id:1919248950
set udg_SL_ITEM_TYPE[48] = 'rej4' //Greater Replenishment Potion id:1919248948
set udg_SL_ITEM_TYPE[49] = 'hbth' //Helm of Battlethirst id:1751282792
set udg_SL_ITEM_TYPE[50] = 'grsl' //Grimoire of Souls id:1735553900
set udg_SL_ITEM_TYPE[51] = 'fwss' //Frost Wyrm Skull Shield id:1719104371
set udg_SL_ITEM_TYPE[52] = 'frgd' //Frostguard id:1718773604
set udg_SL_ITEM_TYPE[53] = 'wtlg' //Wirt's Leg id:2004118631
set udg_SL_ITEM_TYPE[54] = 'sehr' //The Heart of Searinox id:1936025714
set udg_SL_ITEM_TYPE[55] = 'scul' //Scroll of the Unholy Legion id:1935897964
set udg_SL_ITEM_TYPE[56] = 'schl' //Scepter of Healing id:1935894636
set udg_SL_ITEM_TYPE[57] = 'rej5' //Lesser Scroll of Replenishment id:1919248949
set udg_SL_ITEM_TYPE[58] = 'rej2' //Lesser Replenishment Potion id:1919248946
set udg_SL_ITEM_TYPE[59] = 'rej1' //Minor Replenishment Potion id:1919248945
set udg_SL_ITEM_TYPE[60] = 'nspi' //Necklace of Spell Immunity id:1853059177
set udg_SL_ITEM_TYPE[61] = 'mnsf' //Mindstaff id:1835955046
set udg_SL_ITEM_TYPE[62] = 'mlst' //Maul of Strength id:1835823988
set udg_SL_ITEM_TYPE[63] = 'lure' //Monster Lure id:1819636325
set udg_SL_ITEM_TYPE[64] = 'ktrm' //Urn of King Terenas id:1802793581
set udg_SL_ITEM_TYPE[65] = 'klmm' //Killmaim id:1802268013
set udg_SL_ITEM_TYPE[66] = 'kgal' //Keg of Ale id:1801937260
set udg_SL_ITEM_TYPE[67] = 'jdrn' //Jade Ring id:1784967790
set udg_SL_ITEM_TYPE[68] = 'iwbr' //Ironwood Branch id:1769431666
set udg_SL_ITEM_TYPE[69] = 'horl' //Sacred Relic id:1752134252
set udg_SL_ITEM_TYPE[70] = 'frhg' //Firehand Gauntlets id:1718773863
set udg_SL_ITEM_TYPE[71] = 'fgun' //Flare Gun id:1718056302
set udg_SL_ITEM_TYPE[72] = 'esaz' //Essence of Aszune id:1702060410
set udg_SL_ITEM_TYPE[73] = 'envl' //Enchanted Vial id:1701738092
set udg_SL_ITEM_TYPE[74] = 'ccmd' //Scepter of Mastery id:1667460452
set udg_SL_ITEM_TYPE[75] = 'rlif' //Ring of Regeneration id:1919707494
set udg_SL_ITEM_TYPE[76] = 'rin1' //Mantle of Intelligence +3 id:1919512113
set udg_SL_ITEM_TYPE[77] = 'rde4' //Ring of Protection +5 id:1919182132
set udg_SL_ITEM_TYPE[78] = 'rde3' //Ring of Protection +4 id:1919182131
set udg_SL_ITEM_TYPE[79] = 'rde2' //Ring of Protection +3 id:1919182130
set udg_SL_ITEM_TYPE[80] = 'pnvl' //Potion of Lesser Invulnerability id:1886287468
set udg_SL_ITEM_TYPE[81] = 'pman' //Potion of Mana id:1886216558
set udg_SL_ITEM_TYPE[82] = 'pinv' //Potion of Invisibility id:1885957750
set udg_SL_ITEM_TYPE[83] = 'phea' //Potion of Healing id:1885889889
set udg_SL_ITEM_TYPE[84] = 'pclr' //Clarity Potion id:1885564018
set udg_SL_ITEM_TYPE[85] = 'ofro' //Orb of Frost id:1868984943
set udg_SL_ITEM_TYPE[86] = 'odef' //Orb of Darkness id:1868850534
set udg_SL_ITEM_TYPE[87] = 'modt' //Mask of Death id:1836016756
set udg_SL_ITEM_TYPE[88] = 'mcou' //Medallion of Courage id:1835233141
set udg_SL_ITEM_TYPE[89] = 'lgdh' //Legion Doom-Horn id:1818715240
set udg_SL_ITEM_TYPE[90] = 'ciri' //Robe of the Magi +6 id:1667854953
set udg_SL_ITEM_TYPE[91] = 'vddl' //Voodoo Doll id:1986290796
set udg_SL_ITEM_TYPE[92] = 'sksh' //Skull Shield id:1936421736
set udg_SL_ITEM_TYPE[93] = 'shtm' //Shamanic Totem id:1936225389
set udg_SL_ITEM_TYPE[94] = 'shrs' //Shimmerglaze Roast id:1936224883
set udg_SL_ITEM_TYPE[95] = 'shhn' //Shield of Honor id:1936222318
set udg_SL_ITEM_TYPE[96] = 'shdt' //Shield of the Deathlord id:1936221300
set udg_SL_ITEM_TYPE[97] = 'rump' //Rusty Mining Pick id:1920298352
set udg_SL_ITEM_TYPE[98] = 'rots' //Scepter of the Sea id:1919906931
set udg_SL_ITEM_TYPE[99] = 'soul' //Soul id:1936684396
set udg_SL_ITEM_TYPE[100] = 'skul' //Sacrificial Skull id:1936422252
set udg_SL_ITEM_TYPE[101] = 'skrt' //Skeletal Artifact id:1936421492
set udg_SL_ITEM_TYPE[102] = 'rugt' //Runed Gauntlets id:1920296820
set udg_SL_ITEM_TYPE[103] = 'rnsp' //Ring of Superiority id:1919841136
set udg_SL_ITEM_TYPE[104] = 'rde0' //Ring of Protection +1 id:1919182128
set udg_SL_ITEM_TYPE[105] = 'ram3' //Ring of the Archmagi id:1918987571
set udg_SL_ITEM_TYPE[106] = 'ram2' //Ring of the Archmagi id:1918987570
set udg_SL_ITEM_TYPE[107] = 'ram1' //Ring of the Archmagi id:1918987569
set udg_SL_ITEM_TYPE[108] = 'pspd' //Potion of Speed id:1886613604
set udg_SL_ITEM_TYPE[109] = 'pgin' //Potion of Greater Invisibility id:1885825390
set udg_SL_ITEM_TYPE[110] = 'oven' //Orb of Venom id:1870030190
set udg_SL_ITEM_TYPE[111] = 'oslo' //Orb of Slow id:1869835375
set udg_SL_ITEM_TYPE[112] = 'olig' //Orb of Lightning id:1869375847
set udg_SL_ITEM_TYPE[113] = 'oli2' //Orb of Lightning id:1869375794
set udg_SL_ITEM_TYPE[114] = 'ofir' //Orb of Fire id:1868982642
set udg_SL_ITEM_TYPE[115] = 'ocor' //Orb of Corruption id:1868787570
set udg_SL_ITEM_TYPE[116] = 'lnrn' //Lion's Ring id:1819177582
set udg_SL_ITEM_TYPE[117] = 'kysn' //Sun Key id:1803121518
set udg_SL_ITEM_TYPE[118] = 'glsk' //Skull of Gul'dan id:1735160683
set udg_SL_ITEM_TYPE[119] = 'gldo' //Orb of Kil'jaeden id:1735156847
set udg_SL_ITEM_TYPE[120] = 'wcyc' //Wand of the Wind (3) id:2003007843
set udg_SL_ITEM_TYPE[121] = 'sman' //Scroll of Mana id:1936548206
set udg_SL_ITEM_TYPE[122] = 'shea' //Scroll of Healing id:1936221537
set udg_SL_ITEM_TYPE[123] = 'sbch' //Scourge Bone Chimes id:1935827816
set udg_SL_ITEM_TYPE[124] = 'rwiz' //Sobi Mask id:1920428410
set udg_SL_ITEM_TYPE[125] = 'rnec' //Rod of Necromancy id:1919837539
set udg_SL_ITEM_TYPE[126] = 'rhth' //Khadgar's Gem of Health id:1919448168
set udg_SL_ITEM_TYPE[127] = 'ratf' //Claws of Attack +15 id:1918989414
set udg_SL_ITEM_TYPE[128] = 'rag1' //Slippers of Agility +3 id:1918986033
set udg_SL_ITEM_TYPE[129] = 'kpin' //Khadgar's Pipe of Insight id:1802529134
set udg_SL_ITEM_TYPE[130] = 'hval' //Helm of Valor id:1752588652
set udg_SL_ITEM_TYPE[131] = 'hcun' //Hood of Cunning id:1751348590
set udg_SL_ITEM_TYPE[132] = 'desc' //Kelen's Dagger of Escape id:1684370275
set udg_SL_ITEM_TYPE[133] = 'ckng' //Crown of Kings +5 id:1667984999
set udg_SL_ITEM_TYPE[134] = 'brac' //Runed Bracers id:1651663203
set udg_SL_ITEM_TYPE[135] = 'tlum' //Tiny Lumber Mill id:1953265005
set udg_SL_ITEM_TYPE[136] = 'thdm' //Thunderlizard Diamond id:1952998509
set udg_SL_ITEM_TYPE[137] = 'tfar' //Tiny Farm id:1952866674
set udg_SL_ITEM_TYPE[138] = 'tbsm' //Tiny Blacksmith id:1952609133
set udg_SL_ITEM_TYPE[139] = 'tbar' //Tiny Barracks id:1952604530
set udg_SL_ITEM_TYPE[140] = 'tbak' //Tiny Altar of Kings id:1952604523
set udg_SL_ITEM_TYPE[141] = 'stwa' //Sturdy War Axe id:1937012577
set udg_SL_ITEM_TYPE[142] = 'stre' //Staff of Reanimation id:1937011301
set udg_SL_ITEM_TYPE[143] = 'sprn' //Spider Ring id:1936749166
set udg_SL_ITEM_TYPE[144] = 'spre' //Staff of Preservation id:1936749157
set udg_SL_ITEM_TYPE[145] = 'sbok' //Spell Book id:1935830891
set udg_SL_ITEM_TYPE[146] = 'ram4' //Ring of the Archmagi id:1918987572
set udg_SL_ITEM_TYPE[147] = 'phlt' //Phat Lewt id:1885891700
set udg_SL_ITEM_TYPE[148] = 'k3m2' //Partial Key of the Three Moons id:1798532402
set udg_SL_ITEM_TYPE[149] = 'k3m1' //Mooncrystal id:1798532401
set udg_SL_ITEM_TYPE[150] = 'jpnt' //Note to Jaina Proudmoore id:1785753204
set udg_SL_ITEM_TYPE[151] = 'gsou' //Soul Gem id:1735618421
set udg_SL_ITEM_TYPE[152] = 'wshs' //Wand of Shadowsight (2) id:2004052083
set udg_SL_ITEM_TYPE[153] = 'woms' //Wand of Mana Stealing (2) id:2003791219
set udg_SL_ITEM_TYPE[154] = 'wlsd' //Wand of Lightning Shield (3) id:2003596132
set udg_SL_ITEM_TYPE[155] = 'ward' //Warsong Battle Drums id:2002874980
set udg_SL_ITEM_TYPE[156] = 'stel' //Staff of Teleportation id:1937007980
set udg_SL_ITEM_TYPE[157] = 'ssil' //Staff of Silence id:1936943468
set udg_SL_ITEM_TYPE[158] = 'sreg' //Scroll of Regeneration id:1936876903
set udg_SL_ITEM_TYPE[159] = 'spro' //Scroll of Protection id:1936749167
set udg_SL_ITEM_TYPE[160] = 'shas' //Scroll of Speed id:1936220531
set udg_SL_ITEM_TYPE[161] = 'rst1' //Gauntlets of Ogre Strength +3 id:1920169009
set udg_SL_ITEM_TYPE[162] = 'lhst' //The Lion Horn of Stormwind id:1818784628
set udg_SL_ITEM_TYPE[163] = 'gcel' //Gloves of Haste id:1734567276
set udg_SL_ITEM_TYPE[164] = 'evtl' //Talisman of Evasion id:1702261868
set udg_SL_ITEM_TYPE[165] = 'dsum' //Diamond of Summoning id:1685288301
set udg_SL_ITEM_TYPE[166] = 'mort' //Mogrin's Report id:1836020340
set udg_SL_ITEM_TYPE[167] = 'mgtk' //Magic Key Chain id:1835496555
set udg_SL_ITEM_TYPE[168] = 'kymn' //Moon Key id:1803119982
set udg_SL_ITEM_TYPE[169] = 'k3m3' //Key of Three Moons id:1798532403
set udg_SL_ITEM_TYPE[170] = 'will' //Wand of Illusion (3) id:2003397740
set udg_SL_ITEM_TYPE[171] = 'wild' //Amulet of the Wild (1) id:2003397732
set udg_SL_ITEM_TYPE[172] = 'totw' //Talisman of the Wild (3) id:1953461367
set udg_SL_ITEM_TYPE[173] = 'stwp' //Scroll of Town Portal id:1937012592
set udg_SL_ITEM_TYPE[174] = 'ssan' //Staff of Sanctuary id:1936941422
set udg_SL_ITEM_TYPE[175] = 'sneg' //Staff of Negation id:1936614759
set udg_SL_ITEM_TYPE[176] = 'silk' //Spider Silk Broach id:1936288875
set udg_SL_ITEM_TYPE[177] = 'rat9' //Claws of Attack +9 id:1918989369
set udg_SL_ITEM_TYPE[178] = 'fgsk' //Book of the Dead (1) id:1718055787
set udg_SL_ITEM_TYPE[179] = 'fgrg' //Stone Token (1) id:1718055527
set udg_SL_ITEM_TYPE[180] = 'fgfh' //Spiked Collar (1) id:1718052456
set udg_SL_ITEM_TYPE[181] = 'fgdg' //Demonic Figurine (1) id:1718051943
set udg_SL_ITEM_TYPE[182] = 'crys' //Crystal Ball id:1668446579
set udg_SL_ITEM_TYPE[183] = 'clsd' //Cloak of Shadows id:1668051812
set udg_SL_ITEM_TYPE[184] = 'clfm' //Cloak of Flames id:1668048493
set udg_SL_ITEM_TYPE[185] = 'ankh' //Ankh of Reincarnation (1) id:1634626408
set udg_SL_ITEM_TYPE[186] = 'uflg' //Undead Flag id:1969646695
set udg_SL_ITEM_TYPE[187] = 'oflg' //Orc Flag id:1868983399
set udg_SL_ITEM_TYPE[188] = 'nflg' //Night Elf Flag id:1852206183
set udg_SL_ITEM_TYPE[189] = 'flag' //Human Flag id:1718378855
set udg_SL_ITEM_TYPE[190] = 'gopr' //Glyph of Purification id:1735356530
set udg_SL_ITEM_TYPE[191] = 'cnhn' //Horn of Cenarius id:1668180078
set udg_SL_ITEM_TYPE[192] = 'azhr' //Heart of Aszune id:1635412082
set udg_SL_ITEM_TYPE[193] = 'wswd' //Sentry Wards (3) id:2004055908
set udg_SL_ITEM_TYPE[194] = 'whwd' //Healing Wards (3) id:2003335012
set udg_SL_ITEM_TYPE[195] = 'vamp' //Vampiric Potion id:1986096496
set udg_SL_ITEM_TYPE[196] = 'tret' //Tome of Retraining id:1953654132
set udg_SL_ITEM_TYPE[197] = 'tgrh' //Tiny Great Hall id:1952936552
set udg_SL_ITEM_TYPE[198] = 'tcas' //Tiny Castle id:1952670067
set udg_SL_ITEM_TYPE[199] = 'srrc' //Scroll of Resurrection (1) id:1936880227
set udg_SL_ITEM_TYPE[200] = 'sror' //Scroll of the Beast (1) id:1936879474
set udg_SL_ITEM_TYPE[201] = 'shar' //Ice Shard (1) id:1936220530
set udg_SL_ITEM_TYPE[202] = 'ratc' //Claws of Attack +12 id:1918989411
set udg_SL_ITEM_TYPE[203] = 'rat6' //Claws of Attack +6 id:1918989366
set udg_SL_ITEM_TYPE[204] = 'infs' //Inferno Stone (1) id:1768842867
set udg_SL_ITEM_TYPE[205] = 'hlst' //Health Stone (1) id:1751937908
set udg_SL_ITEM_TYPE[206] = 'cnob' //Circlet of Nobility id:1668181858
set udg_SL_ITEM_TYPE[207] = 'stpg' //Clockwork Penguin id:1937010791
set udg_SL_ITEM_TYPE[208] = 'sorf' //Shadow Orb Fragment id:1936683622
set udg_SL_ITEM_TYPE[209] = 'btst' //Battle Standard id:1651798900
set udg_SL_ITEM_TYPE[210] = 'thle' //Thunder Lizard Egg id:1953000549
set udg_SL_ITEM_TYPE[211] = 'dthb' //Thunderbloom Bulb id:1685350498
set udg_SL_ITEM_TYPE[212] = 'dphe' //Thunder Phoenix Egg id:1685088357
set udg_SL_ITEM_TYPE[213] = 'ledg' //Gerard's Lost Ledger id:1818584167
set udg_SL_ITEM_TYPE[214] = 'kygh' //Ghost Key id:1803118440
set udg_SL_ITEM_TYPE[215] = 'gmfr' //Gem Fragment id:1735222898
set udg_SL_ITEM_TYPE[216] = 'wneu' //Wand of Neutralization id:2003723637
set udg_SL_ITEM_TYPE[217] = 'wneg' //Wand of Negation id:2003723623
set udg_SL_ITEM_TYPE[218] = 'sres' //Scroll of Restoration (1) id:1936876915
set udg_SL_ITEM_TYPE[219] = 'sand' //Scroll of Animate Dead (1) id:1935765092
set udg_SL_ITEM_TYPE[220] = 'rej3' //Replenishment Potion (1) id:1919248947
set udg_SL_ITEM_TYPE[221] = 'pgma' //Potion of Greater Mana (1) id:1885826401
set udg_SL_ITEM_TYPE[222] = 'pghe' //Potion of Greater Healing (1) id:1885825125
set udg_SL_ITEM_TYPE[223] = 'pdiv' //Potion of Divinity (1) id:1885628790
set udg_SL_ITEM_TYPE[224] = 'mnst' //Mana Stone (1) id:1835955060
set udg_SL_ITEM_TYPE[225] = 'kybl' //Blood Key id:1803117164
set udg_SL_ITEM_TYPE[226] = 'bspd' //Boots of Speed id:1651732580
set udg_SL_ITEM_TYPE[227] = 'bgst' //Belt of Giant Strength +6 id:1650946932
set udg_SL_ITEM_TYPE[228] = 'belv' //Boots of Quel'Thalas +6 id:1650814070
set udg_SL_ITEM_TYPE[229] = 'ajen' //Ancient Janggo of Endurance id:1634362734
set udg_SL_ITEM_TYPE[230] = 'shwd' //Shimmerweed id:1936226148
set udg_SL_ITEM_TYPE[231] = 'sclp' //Secret Level Powerup id:1935895664
set udg_SL_ITEM_TYPE[232] = 'engs' //Enchanted Gemstone id:1701734259
set udg_SL_ITEM_TYPE[233] = 'dkfw' //Keg of Thunderwater id:1684760183
set udg_SL_ITEM_TYPE[234] = 'bzbf' //Full Vial id:1652187750
set udg_SL_ITEM_TYPE[235] = 'spsh' //Amulet of Spell Shield id:1936749416
set udg_SL_ITEM_TYPE[236] = 'pres' //Potion of Restoration (1) id:1886545267
set udg_SL_ITEM_TYPE[237] = 'pomn' //Potion of Omniscience (1) id:1886350702
set udg_SL_ITEM_TYPE[238] = 'pnvu' //Potion of Invulnerability (1) id:1886287477
set udg_SL_ITEM_TYPE[239] = 'fgrd' //Red Drake Egg (1) id:1718055524
set udg_SL_ITEM_TYPE[240] = 'ches' //Cheese id:1667786099
set udg_SL_ITEM_TYPE[241] = 'bzbe' //Empty Vial id:1652187749
set udg_SL_ITEM_TYPE[242] = 'afac' //Alleria's Flute of Accuracy id:1634099555