Try this in triggers cache
Installation:
- Copy the trigger to your map (yes.. thats all)
Usage:
type: -store
to store your hero
type: -restore <code>
to restore your hero
function H2I takes handle h returns integer
return h
return 0
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function I2T takes integer i returns trigger
return i
return null
endfunction
function NumAndNum takes integer i1,integer i2 returns string
local integer num = i1*6+i2+1
if ((i1 == 5) and (i2 == 6)) then
set num = 2
endif
return SubStringBJ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",num,num)
endfunction
function Num2Numbers takes string s returns integer
local integer i = 1
loop
exitwhen i > 36
if (s==SubStringBJ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",i,i)) then
return i-1
endif
set i = i + 1
endloop
return 0
endfunction
function Num2S takes integer i returns string
if (i > 57) then
return SubStringBJ("ABCDEFGHIJKLMNOPQRSTUVWXYZ", i-64, i-64)
endif
return I2S(i-48)
endfunction
function S2Num takes string s returns integer
local integer i = 1
loop
exitwhen i > 36
if (s==SubStringBJ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",i,i)) then
if (i < 11) then
return i + 47
else
return i + 54
endif
endif
set i = i + 1
endloop
return 0
endfunction
function IncDecNum takes string num, string incdec returns string
if (incdec == "+") then
if (num == "0") or (num == "1") or (num == "2") or (num == "3") or (num == "4") or (num == "5") or (num == "6") or (num == "7") or (num == "8") or (num == "9") then
if (num=="9") then
return "A"
else
return I2S(S2I(num) + 1)
endif
else
if (num=="Z") then
return "0"
else
return Num2S(S2Num(num)+1)
endif
endif
else
if (num == "0") or (num == "1") or (num == "2") or (num == "3") or (num == "4") or (num == "5") or (num == "6") or (num == "7") or (num == "8") or (num == "9") then
if (num=="0") then
return "Z"
else
return I2S(S2I(num) - 1)
endif
else
if (num=="A") then
return "9"
else
return Num2S(S2Num(num)-1)
endif
endif
endif
return ""
endfunction
function BigNum2S takes integer i returns string
local integer array n
set n[1] = R2I(i / 1296)
set n[2] = R2I((i-n[1]*1296) / 36)
set n[3] = (i-n[1]*1296)-(n[2]*36)
return IncDecNum(SubStringBJ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n[2]+1,n[2]+1),"-")+IncDecNum(SubStringBJ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n[1]+1,n[1]+1),"+")+IncDecNum(SubStringBJ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",n[3]+1,n[3]+1),"-")
endfunction
function S2BigNum takes string s returns integer
local integer array n
set n[1] = Num2Numbers(IncDecNum(SubStringBJ(s,2,2),"-"))
set n[2] = Num2Numbers(IncDecNum(SubStringBJ(s,1,1),"+"))
set n[3] = Num2Numbers(IncDecNum(SubStringBJ(s,3,3),"+"))
return n[1] * 1296 + n[2] * 36 + n[3]
endfunction
function GetSaveCodeGameCache takes nothing returns gamecache
return gg_trg_SaveCode
return null
endfunction
function SaveCodeGameCache2Trigger takes gamecache g returns trigger
return g
return null
endfunction
function MatchTable takes string ID,string sID,string storetype returns nothing
//All Abilities: 763 normal + 360 custom
local gamecache g = GetSaveCodeGameCache()
local integer i
if (storetype == "Spells") then
set i = 1+GetStoredInteger(g,"i1","i1")
call StoreString(g,"SsID2ID",sID,ID)
call StoreString(g,"SID2sID",ID,sID)
call StoreString(g,"SNum2ID",I2S(i),ID)
call StoreString(g,"SNum2sID",I2S(i),sID)
call StoreInteger(g,"i1","i1",i)
elseif (storetype == "Heros") then
set i = 1+GetStoredInteger(g,"i2","i2")
call StoreString(g,"HsID2ID",sID,ID)
call StoreString(g,"HID2sID",ID,sID)
call StoreString(g,"HNum2ID",I2S(i),ID)
call StoreString(g,"HNum2sID",I2S(i),sID)
call StoreInteger(g,"i2","i2",i)
elseif (storetype == "Items") then
set i = 1+GetStoredInteger(g,"i3","i3")
call StoreString(g,"IsID2ID",sID,ID)
call StoreString(g,"IID2sID",ID,sID)
call StoreString(g,"INum2ID",I2S(i),ID)
call StoreString(g,"INum2sID",I2S(i),sID)
call StoreInteger(g,"i3","i3",i)
endif
endfunction
function MatchHeroes takes integer num returns nothing
local integer i = 0
local integer array x
local integer counter = 0
local gamecache g = GetSaveCodeGameCache()
set x[1] = 48 // 0
set x[2] = 48 // 0
set x[3] = GetStoredInteger(g,"x3","x3")
set x[4] = GetStoredInteger(g,"x4","x4")
loop
exitwhen i > 200
set counter = counter + 1
if (((counter < 11) or ((counter > 17) and (counter < 44))) and (UnitId2String(num+256*x[2]+x[1]) != null) and ( IsUnitIdType(num+256*x[2]+x[1], UNIT_TYPE_HERO) == true ) ) then
call MatchTable(I2S(num+256*x[2]+x[1]), Num2S(x[4]) + Num2S(x[3]), "Heros")
set x[3] = x[3] + 1
if (x[3] == 58) then
set x[3] = 65
elseif (x[3] == 91) then
set x[3] = 48
set x[4] = x[4] + 1
if (x[4] == 58) then
set x[4] = 65
elseif (x[4] == 91) then
set x[4] = 48
endif
endif
elseif (counter > 43) then
set counter = 0
set x[1] = 47
set x[2] = x[2] + 1
endif
set x[1] = x[1] + 1
set i = i + 1
endloop
call StoreInteger(g,"x3","x3",x[3])
call StoreInteger(g,"x4","x4",x[4])
endfunction
function SaveCode_InitItems takes nothing returns nothing
local integer i = 0
local integer array x
local integer counter = 0
local gamecache g = GetSaveCodeGameCache()
call MatchTable(I2S('ckng'), "01", "Items")
call MatchTable(I2S('modt'), "02", "Items")
call MatchTable(I2S('tkno'), "03", "Items")
call MatchTable(I2S('ratf'), "04", "Items")
call MatchTable(I2S('rde4'), "05", "Items")
call MatchTable(I2S('ofro'), "06", "Items")
call MatchTable(I2S('fgdg'), "07", "Items")
call MatchTable(I2S('infs'), "08", "Items")
call MatchTable(I2S('shar'), "09", "Items")
call MatchTable(I2S('sand'), "0A", "Items")
call MatchTable(I2S('sres'), "0B", "Items")
call MatchTable(I2S('wild'), "0C", "Items")
call MatchTable(I2S('srrc'), "0D", "Items")
call MatchTable(I2S('rej6'), "0E", "Items")
call MatchTable(I2S('odef'), "0F", "Items")
call MatchTable(I2S('rde3'), "0G", "Items")
call MatchTable(I2S('pmna'), "0H", "Items")
call MatchTable(I2S('rhth'), "0I", "Items")
call MatchTable(I2S('ssil'), "0J", "Items")
call MatchTable(I2S('spsh'), "0K", "Items")
call MatchTable(I2S('desc'), "0L", "Items")
call MatchTable(I2S('ankh'), "0M", "Items")
call MatchTable(I2S('pdiv'), "0N", "Items")
call MatchTable(I2S('pres'), "0O", "Items")
call MatchTable(I2S('whwd'), "0P", "Items")
call MatchTable(I2S('rej5'), "0Q", "Items")
call MatchTable(I2S('hcun'), "0R", "Items")
call MatchTable(I2S('hval'), "0S", "Items")
call MatchTable(I2S('mcou'), "0T", "Items")
call MatchTable(I2S('belv'), "0U", "Items")
call MatchTable(I2S('bgst'), "0V", "Items")
call MatchTable(I2S('ciri'), "0W", "Items")
call MatchTable(I2S('ajen'), "0X", "Items")
call MatchTable(I2S('clfm'), "0Y", "Items")
call MatchTable(I2S('ratc'), "0Z", "Items")
call MatchTable(I2S('ward'), "10", "Items")
call MatchTable(I2S('kpin'), "11", "Items")
call MatchTable(I2S('crys'), "12", "Items")
call MatchTable(I2S('totw'), "13", "Items")
call MatchTable(I2S('fgfh'), "14", "Items")
call MatchTable(I2S('fgrd'), "15", "Items")
call MatchTable(I2S('fgrg'), "16", "Items")
call MatchTable(I2S('fgsk'), "17", "Items")
call MatchTable(I2S('wcyc'), "18", "Items")
call MatchTable(I2S('hlst'), "19", "Items")
call MatchTable(I2S('mnst'), "1A", "Items")
call MatchTable(I2S('rej4'), "1B", "Items")
call MatchTable(I2S('ram4'), "1C", "Items")
call MatchTable(I2S('lhst'), "1D", "Items")
call MatchTable(I2S('afac'), "1E", "Items")
call MatchTable(I2S('lgdh'), "1F", "Items")
call MatchTable(I2S('sbch'), "1G", "Items")
call MatchTable(I2S('brac'), "1H", "Items")
call MatchTable(I2S('rwiz'), "1I", "Items")
call MatchTable(I2S('dsum'), "1J", "Items")
call MatchTable(I2S('pghe'), "1K", "Items")
call MatchTable(I2S('pgma'), "1L", "Items")
call MatchTable(I2S('pnvu'), "1M", "Items")
call MatchTable(I2S('sror'), "1N", "Items")
call MatchTable(I2S('woms'), "1O", "Items")
call MatchTable(I2S('rej3'), "1P", "Items")
call MatchTable(I2S('ofir'), "1Q", "Items")
call MatchTable(I2S('ocor'), "1R", "Items")
call MatchTable(I2S('oli2'), "1S", "Items")
call MatchTable(I2S('oven'), "1T", "Items")
call MatchTable(I2S('ram3'), "1U", "Items")
call MatchTable(I2S('evtl'), "1V", "Items")
call MatchTable(I2S('penr'), "1W", "Items")
call MatchTable(I2S('prvt'), "1X", "Items")
call MatchTable(I2S('rat9'), "1Y", "Items")
call MatchTable(I2S('rde2'), "1Z", "Items")
call MatchTable(I2S('rlif'), "20", "Items")
call MatchTable(I2S('tret'), "21", "Items")
call MatchTable(I2S('tgrh'), "22", "Items")
call MatchTable(I2S('will'), "23", "Items")
call MatchTable(I2S('wlsd'), "24", "Items")
call MatchTable(I2S('wswd'), "25", "Items")
call MatchTable(I2S('rej2'), "26", "Items")
call MatchTable(I2S('gemt'), "27", "Items")
call MatchTable(I2S('ram2'), "28", "Items")
call MatchTable(I2S('stel'), "29", "Items")
call MatchTable(I2S('cnob'), "2A", "Items")
call MatchTable(I2S('gcel'), "2B", "Items")
call MatchTable(I2S('rat6'), "2C", "Items")
call MatchTable(I2S('rde1'), "2D", "Items")
call MatchTable(I2S('bspd'), "2E", "Items")
call MatchTable(I2S('tdx2'), "2F", "Items")
call MatchTable(I2S('texp'), "2G", "Items")
call MatchTable(I2S('tin2'), "2H", "Items")
call MatchTable(I2S('tpow'), "2I", "Items")
call MatchTable(I2S('tst2'), "2J", "Items")
call MatchTable(I2S('pnvl'), "2K", "Items")
call MatchTable(I2S('stwp'), "2L", "Items")
call MatchTable(I2S('wneg'), "2M", "Items")
call MatchTable(I2S('sneg'), "2N", "Items")
call MatchTable(I2S('wneu'), "2O", "Items")
call MatchTable(I2S('shea'), "2P", "Items")
call MatchTable(I2S('sman'), "2Q", "Items")
call MatchTable(I2S('rej1'), "2R", "Items")
call MatchTable(I2S('pspd'), "2S", "Items")
call MatchTable(I2S('dust'), "2T", "Items")
call MatchTable(I2S('ram1'), "2U", "Items")
call MatchTable(I2S('clsd'), "2V", "Items")
call MatchTable(I2S('rag1'), "2W", "Items")
call MatchTable(I2S('rin1'), "2X", "Items")
call MatchTable(I2S('rst1'), "2Y", "Items")
call MatchTable(I2S('manh'), "2Z", "Items")
call MatchTable(I2S('tdex'), "30", "Items")
call MatchTable(I2S('tint'), "31", "Items")
call MatchTable(I2S('tstr'), "32", "Items")
call MatchTable(I2S('pinv'), "33", "Items")
call MatchTable(I2S('phea'), "34", "Items")
call MatchTable(I2S('pman'), "35", "Items")
call MatchTable(I2S('spro'), "36", "Items")
call MatchTable(I2S('hslv'), "37", "Items")
call MatchTable(I2S('moon'), "38", "Items")
call MatchTable(I2S('shas'), "39", "Items")
call MatchTable(I2S('skul'), "3A", "Items")
call MatchTable(I2S('mcri'), "3B", "Items")
call MatchTable(I2S('rnec'), "3C", "Items")
call MatchTable(I2S('tsct'), "3D", "Items")
call MatchTable(I2S('azhr'), "3E", "Items")
call MatchTable(I2S('bzbe'), "3F", "Items")
call MatchTable(I2S('bzbf'), "3G", "Items")
call MatchTable(I2S('ches'), "3H", "Items")
call MatchTable(I2S('cnhn'), "3I", "Items")
call MatchTable(I2S('glsk'), "3J", "Items")
call MatchTable(I2S('gopr'), "3K", "Items")
call MatchTable(I2S('k3m1'), "3L", "Items")
call MatchTable(I2S('k3m2'), "3M", "Items")
call MatchTable(I2S('k3m3'), "3N", "Items")
call MatchTable(I2S('ktrm'), "3O", "Items")
call MatchTable(I2S('kybl'), "3P", "Items")
call MatchTable(I2S('kygh'), "3Q", "Items")
call MatchTable(I2S('kymn'), "3R", "Items")
call MatchTable(I2S('kysn'), "3S", "Items")
call MatchTable(I2S('ledg'), "3T", "Items")
call MatchTable(I2S('phlt'), "3U", "Items")
call MatchTable(I2S('sehr'), "3V", "Items")
call MatchTable(I2S('engs'), "3W", "Items")
call MatchTable(I2S('sorf'), "3X", "Items")
call MatchTable(I2S('gmfr'), "3Y", "Items")
call MatchTable(I2S('jpnt'), "3Z", "Items")
call MatchTable(I2S('shwd'), "40", "Items")
call MatchTable(I2S('skrt'), "41", "Items")
call MatchTable(I2S('thle'), "42", "Items")
call MatchTable(I2S('pomn'), "43", "Items")
call MatchTable(I2S('wshs'), "44", "Items")
call MatchTable(I2S('fgun'), "45", "Items")
call MatchTable(I2S('lure'), "46", "Items")
call MatchTable(I2S('olig'), "47", "Items")
call MatchTable(I2S('amrc'), "48", "Items")
call MatchTable(I2S('ccmd'), "49", "Items")
call MatchTable(I2S('flag'), "4A", "Items")
call MatchTable(I2S('gobm'), "4B", "Items")
call MatchTable(I2S('gsou'), "4C", "Items")
call MatchTable(I2S('nflg'), "4D", "Items")
call MatchTable(I2S('nspi'), "4E", "Items")
call MatchTable(I2S('oflg'), "4F", "Items")
call MatchTable(I2S('pams'), "4G", "Items")
call MatchTable(I2S('pgin'), "4H", "Items")
call MatchTable(I2S('rat3'), "4I", "Items")
call MatchTable(I2S('rde0'), "4J", "Items")
call MatchTable(I2S('rnsp'), "4K", "Items")
call MatchTable(I2S('soul'), "4L", "Items")
call MatchTable(I2S('tels'), "4M", "Items")
call MatchTable(I2S('tgxp'), "4N", "Items")
call MatchTable(I2S('uflg'), "4O", "Items")
call MatchTable(I2S('anfg'), "4P", "Items")
call MatchTable(I2S('brag'), "4Q", "Items")
call MatchTable(I2S('drph'), "4R", "Items")
call MatchTable(I2S('iwbr'), "4S", "Items")
call MatchTable(I2S('jdrn'), "4T", "Items")
call MatchTable(I2S('lnrn'), "4U", "Items")
call MatchTable(I2S('mlst'), "4V", "Items")
call MatchTable(I2S('oslo'), "4W", "Items")
call MatchTable(I2S('sbok'), "4X", "Items")
call MatchTable(I2S('sksh'), "4Y", "Items")
call MatchTable(I2S('sprn'), "4Z", "Items")
call MatchTable(I2S('tmmt'), "50", "Items")
call MatchTable(I2S('vddl'), "51", "Items")
call MatchTable(I2S('spre'), "52", "Items")
call MatchTable(I2S('sfog'), "53", "Items")
call MatchTable(I2S('sor1'), "54", "Items")
call MatchTable(I2S('sor2'), "55", "Items")
call MatchTable(I2S('sor3'), "56", "Items")
call MatchTable(I2S('sor4'), "57", "Items")
call MatchTable(I2S('sor5'), "58", "Items")
call MatchTable(I2S('sor6'), "59", "Items")
call MatchTable(I2S('sor7'), "5A", "Items")
call MatchTable(I2S('sor8'), "5B", "Items")
call MatchTable(I2S('sor9'), "5C", "Items")
call MatchTable(I2S('sora'), "5D", "Items")
call MatchTable(I2S('fwss'), "5E", "Items")
call MatchTable(I2S('shtm'), "5F", "Items")
call MatchTable(I2S('esaz'), "5G", "Items")
call MatchTable(I2S('btst'), "5H", "Items")
call MatchTable(I2S('gold'), "5I", "Items")
call MatchTable(I2S('lmbr'), "5J", "Items")
call MatchTable(I2S('gfor'), "5K", "Items")
call MatchTable(I2S('guvi'), "5L", "Items")
call MatchTable(I2S('rspl'), "5M", "Items")
call MatchTable(I2S('rre1'), "5N", "Items")
call MatchTable(I2S('rre2'), "5O", "Items")
call MatchTable(I2S('gomn'), "5P", "Items")
call MatchTable(I2S('rsps'), "5Q", "Items")
call MatchTable(I2S('rspd'), "5R", "Items")
call MatchTable(I2S('rman'), "5S", "Items")
call MatchTable(I2S('rma2'), "5T", "Items")
call MatchTable(I2S('rres'), "5U", "Items")
call MatchTable(I2S('rreb'), "5V", "Items")
call MatchTable(I2S('rhe1'), "5W", "Items")
call MatchTable(I2S('rhe2'), "5X", "Items")
call MatchTable(I2S('rhe3'), "5Y", "Items")
call MatchTable(I2S('rdis'), "5Z", "Items")
call MatchTable(I2S('rwat'), "60", "Items")
call MatchTable(I2S('sclp'), "61", "Items")
call MatchTable(I2S('pclr'), "62", "Items")
call MatchTable(I2S('plcl'), "63", "Items")
call MatchTable(I2S('silk'), "64", "Items")
call MatchTable(I2S('vamp'), "65", "Items")
call MatchTable(I2S('sreg'), "66", "Items")
call MatchTable(I2S('ssan'), "67", "Items")
call MatchTable(I2S('tcas'), "68", "Items")
call MatchTable(I2S('tbsm'), "69", "Items")
call MatchTable(I2S('tfar'), "6A", "Items")
call MatchTable(I2S('tlum'), "6B", "Items")
call MatchTable(I2S('tbar'), "6C", "Items")
call MatchTable(I2S('tbak'), "6D", "Items")
call MatchTable(I2S('gldo'), "6E", "Items")
call MatchTable(I2S('wtlg'), "6F", "Items")
call MatchTable(I2S('wolg'), "6G", "Items")
call MatchTable(I2S('mgtk'), "6H", "Items")
call MatchTable(I2S('stre'), "6I", "Items")
call MatchTable(I2S('horl'), "6J", "Items")
call MatchTable(I2S('hbth'), "6K", "Items")
call MatchTable(I2S('blba'), "6L", "Items")
call MatchTable(I2S('rugt'), "6M", "Items")
call MatchTable(I2S('frhg'), "6N", "Items")
call MatchTable(I2S('gvsm'), "6O", "Items")
call MatchTable(I2S('crdt'), "6P", "Items")
call MatchTable(I2S('arsc'), "6Q", "Items")
call MatchTable(I2S('scul'), "6R", "Items")
call MatchTable(I2S('tmsc'), "6S", "Items")
call MatchTable(I2S('dtsb'), "6T", "Items")
call MatchTable(I2S('grsl'), "6U", "Items")
call MatchTable(I2S('arsh'), "6V", "Items")
call MatchTable(I2S('shdt'), "6W", "Items")
call MatchTable(I2S('shhn'), "6X", "Items")
call MatchTable(I2S('shen'), "6Y", "Items")
call MatchTable(I2S('thdm'), "6Z", "Items")
call MatchTable(I2S('stpg'), "70", "Items")
call MatchTable(I2S('shrs'), "71", "Items")
call MatchTable(I2S('bfhr'), "72", "Items")
call MatchTable(I2S('cosl'), "73", "Items")
call MatchTable(I2S('shcw'), "74", "Items")
call MatchTable(I2S('srbd'), "75", "Items")
call MatchTable(I2S('frgd'), "76", "Items")
call MatchTable(I2S('envl'), "77", "Items")
call MatchTable(I2S('rump'), "78", "Items")
call MatchTable(I2S('mort'), "79", "Items")
call MatchTable(I2S('srtl'), "7A", "Items")
call MatchTable(I2S('stwa'), "7B", "Items")
call MatchTable(I2S('klmm'), "7C", "Items")
call MatchTable(I2S('rots'), "7D", "Items")
call MatchTable(I2S('axas'), "7E", "Items")
call MatchTable(I2S('mnsf'), "7F", "Items")
call MatchTable(I2S('schl'), "7G", "Items")
call MatchTable(I2S('asbl'), "7H", "Items")
call MatchTable(I2S('kgal'), "7I", "Items")
call MatchTable(I2S('dphe'), "7J", "Items")
call MatchTable(I2S('dkfw'), "7K", "Items")
call MatchTable(I2S('dthb'), "7L", "Items")
set i = 0
set x[1] = 48 // 0
set x[2] = 48 // 0
set x[3] = 56 // 8
set x[4] = 76 // L
loop
exitwhen i > 438
set counter = counter + 1
if ((counter < 11) or ((counter > 17) and (counter < 44))) then
call MatchTable(I2S(1227882496+256*x[2]+x[1]), Num2S(x[4]) + Num2S(x[3]), "Items")
set x[3] = x[3] + 1
if (x[3] == 58) then
set x[3] = 65
elseif (x[3] == 91) then
set x[3] = 48
set x[4] = x[4] + 1
if (x[4] == 58) then
set x[4] = 65
elseif (x[4] == 91) then
set x[4] = 48
endif
endif
elseif (counter > 43) then
set counter = 0
set x[1] = 47
set x[2] = x[2] + 1
endif
set x[1] = x[1] + 1
set i = i + 1
endloop
endfunction
function SaveCode_InitHeros takes nothing returns nothing
local integer i = 0
local integer array x
local integer counter = 0
local gamecache g = GetSaveCodeGameCache()
call MatchTable(I2S('Hpal'), "01","Heros")
call MatchTable(I2S('Hamg'), "02","Heros")
call MatchTable(I2S('Hmkg'), "03","Heros")
call MatchTable(I2S('Hblm'), "04","Heros")
call MatchTable(I2S('Hapm'), "05","Heros")
call MatchTable(I2S('Hant'), "06","Heros")
call MatchTable(I2S('Hgam'), "07","Heros")
call MatchTable(I2S('Hart'), "08","Heros")
call MatchTable(I2S('Harf'), "09","Heros")
call MatchTable(I2S('Hdgo'), "0A","Heros") //
call MatchTable(I2S('Hhkl'), "0B","Heros")
call MatchTable(I2S('Hjai'), "0C","Heros")
call MatchTable(I2S('Hkal'), "0D","Heros")
call MatchTable(I2S('Hlgr'), "0E","Heros")
call MatchTable(I2S('Hpb1'), "0F","Heros")
call MatchTable(I2S('Hmgd'), "0G","Heros")
call MatchTable(I2S('Hmbr'), "0H","Heros")
call MatchTable(I2S('Hpb2'), "0I","Heros")
call MatchTable(I2S('Hvwd'), "0J","Heros")
call MatchTable(I2S('Huth'), "0K","Heros") //
call MatchTable(I2S('Obla'), "0L","Heros")
call MatchTable(I2S('Ofar'), "0M","Heros")
call MatchTable(I2S('Otch'), "0N","Heros")
call MatchTable(I2S('Oshd'), "0O","Heros")
call MatchTable(I2S('Nbbc'), "0P","Heros")
call MatchTable(I2S('Ocbh'), "0Q","Heros")
call MatchTable(I2S('Ocb2'), "0R","Heros")
call MatchTable(I2S('Nsjs'), "0S","Heros")
call MatchTable(I2S('Odrt'), "0T","Heros")
call MatchTable(I2S('Ogrh'), "0U","Heros") //
call MatchTable(I2S('Opgh'), "0V","Heros")
call MatchTable(I2S('Ogld'), "0W","Heros")
call MatchTable(I2S('Orex'), "0X","Heros")
call MatchTable(I2S('Orkn'), "0Y","Heros")
call MatchTable(I2S('Osam'), "0Z","Heros")
call MatchTable(I2S('Othr'), "10","Heros")
call MatchTable(I2S('Otcc'), "11","Heros")
call MatchTable(I2S('Udea'), "12","Heros")
call MatchTable(I2S('Ulic'), "13","Heros")
call MatchTable(I2S('Udre'), "14","Heros") //
call MatchTable(I2S('Ucrl'), "15","Heros")
call MatchTable(I2S('Nman'), "16","Heros")
call MatchTable(I2S('Uwar'), "17","Heros")
call MatchTable(I2S('Npld'), "18","Heros")
call MatchTable(I2S('Nklj'), "19","Heros")
call MatchTable(I2S('Nmag'), "1A","Heros")
call MatchTable(I2S('Uanb'), "1B","Heros")
call MatchTable(I2S('Uear'), "1C","Heros")
call MatchTable(I2S('Ubal'), "1D","Heros")
call MatchTable(I2S('Uvng'), "1E","Heros") //
call MatchTable(I2S('Udth'), "1F","Heros")
call MatchTable(I2S('Uktl'), "1G","Heros")
call MatchTable(I2S('Umal'), "1H","Heros")
call MatchTable(I2S('Usyl'), "1I","Heros")
call MatchTable(I2S('Utic'), "1J","Heros")
call MatchTable(I2S('Uvar'), "1K","Heros")
call MatchTable(I2S('Nkjx'), "1L","Heros")
call MatchTable(I2S('Uclc'), "1M","Heros")
call MatchTable(I2S('Ekee'), "1N","Heros")
call MatchTable(I2S('Emoo'), "1O","Heros") //
call MatchTable(I2S('Edem'), "1P","Heros")
call MatchTable(I2S('Ewar'), "1Q","Heros")
call MatchTable(I2S('Edmm'), "1R","Heros")
call MatchTable(I2S('Ecen'), "1S","Heros")
call MatchTable(I2S('Efur'), "1T","Heros")
call MatchTable(I2S('Ekgg'), "1U","Heros")
call MatchTable(I2S('Eill'), "1V","Heros")
call MatchTable(I2S('Eevi'), "1W","Heros")
call MatchTable(I2S('Ewrd'), "1X","Heros")
call MatchTable(I2S('Emfr'), "1Y","Heros") //
call MatchTable(I2S('Emns'), "1Z","Heros")
call MatchTable(I2S('Etyr'), "20","Heros")
call MatchTable(I2S('Eidm'), "21","Heros")
call MatchTable(I2S('Eilm'), "22","Heros")
call MatchTable(I2S('Eevm'), "23","Heros")
call MatchTable(I2S('Hvsh'), "24","Heros")
call MatchTable(I2S('Nngs'), "25","Heros")
call MatchTable(I2S('Nbst'), "26","Heros")
call MatchTable(I2S('Nbrn'), "27","Heros")
call MatchTable(I2S('Npbm'), "28","Heros") // 82
call MatchTable(I2S('Nplh'), "29","Heros")
call MatchTable(I2S('Ntin'), "2A","Heros")
call StoreInteger(g,"x3","x3",66)
call StoreInteger(g,"x4","x4",50)
call MatchHeroes(1311768576) //N
call MatchHeroes(1160773632) //E
call MatchHeroes(1429209088) //U
call MatchHeroes(1328545792) //O
call MatchHeroes(1211105280) //H
endfunction
function SaveCode_InitSpells takes nothing returns nothing
local integer i = 0
local integer array x
local integer counter = 0
local gamecache g = GetSaveCodeGameCache()
call MatchTable(I2S('AHbz'), "01","Spells")
call MatchTable(I2S('AHab'), "02","Spells")
call MatchTable(I2S('AHmt'), "03","Spells")
call MatchTable(I2S('AHwe'), "04","Spells")
call MatchTable(I2S('ANst'), "05","Spells")
call MatchTable(I2S('ANsg'), "06","Spells")
call MatchTable(I2S('ANsq'), "07","Spells")
call MatchTable(I2S('ANsw'), "08","Spells")
call MatchTable(I2S('AOww'), "09","Spells")
call MatchTable(I2S('AOcr'), "0A","Spells")
call MatchTable(I2S('AOmi'), "0B","Spells")
call MatchTable(I2S('AOwk'), "0C","Spells")
call MatchTable(I2S('AHbn'), "0D","Spells")
call MatchTable(I2S('AHfs'), "0E","Spells")
call MatchTable(I2S('AHdr'), "0F","Spells")
call MatchTable(I2S('AHpx'), "0G","Spells")
call MatchTable(I2S('AUcb'), "0H","Spells")
call MatchTable(I2S('AUim'), "0I","Spells")
call MatchTable(I2S('AUls'), "0J","Spells")
call MatchTable(I2S('AUts'), "0K","Spells")
call MatchTable(I2S('ANba'), "0L","Spells")
call MatchTable(I2S('ANch'), "0M","Spells")
call MatchTable(I2S('ANdr'), "0N","Spells")
call MatchTable(I2S('ANsi'), "0O","Spells")
call MatchTable(I2S('AUan'), "0P","Spells")
call MatchTable(I2S('AUdc'), "0Q","Spells")
call MatchTable(I2S('AUdp'), "0R","Spells")
call MatchTable(I2S('AUau'), "0S","Spells")
call MatchTable(I2S('AEev'), "0T","Spells")
call MatchTable(I2S('AEim'), "0U","Spells")
call MatchTable(I2S('AEmb'), "0V","Spells")
call MatchTable(I2S('AEme'), "0W","Spells")
call MatchTable(I2S('AUsl'), "0X","Spells")
call MatchTable(I2S('AUav'), "0Y","Spells")
call MatchTable(I2S('AUcs'), "0Z","Spells")
call MatchTable(I2S('AUin'), "10","Spells")
call MatchTable(I2S('AOcl'), "11","Spells")
call MatchTable(I2S('AOeq'), "12","Spells")
call MatchTable(I2S('AOfs'), "13","Spells")
call MatchTable(I2S('AOsf'), "14","Spells")
call MatchTable(I2S('AEer'), "15","Spells")
call MatchTable(I2S('AEfn'), "16","Spells")
call MatchTable(I2S('AEah'), "17","Spells")
call MatchTable(I2S('AEtq'), "18","Spells")
call MatchTable(I2S('AUdr'), "19","Spells")
call MatchTable(I2S('AUdd'), "1A","Spells")
call MatchTable(I2S('AUfa'), "1B","Spells")
call MatchTable(I2S('AUfu'), "1C","Spells")
call MatchTable(I2S('AUfn'), "1D","Spells")
call MatchTable(I2S('AHav'), "1E","Spells")
call MatchTable(I2S('AHbh'), "1F","Spells")
call MatchTable(I2S('AHtb'), "1G","Spells")
call MatchTable(I2S('AHtc'), "1H","Spells")
call MatchTable(I2S('ANfl'), "1I","Spells")
call MatchTable(I2S('ANfa'), "1J","Spells")
call MatchTable(I2S('ANto'), "1K","Spells")
call MatchTable(I2S('ANms'), "1L","Spells")
call MatchTable(I2S('AHad'), "1M","Spells")
call MatchTable(I2S('AHds'), "1N","Spells")
call MatchTable(I2S('AHhb'), "1O","Spells")
call MatchTable(I2S('AHre'), "1P","Spells")
call MatchTable(I2S('ANbf'), "1Q","Spells")
call MatchTable(I2S('ANdb'), "1R","Spells")
call MatchTable(I2S('ANdh'), "1S","Spells")
call MatchTable(I2S('ANef'), "1T","Spells")
call MatchTable(I2S('ANdo'), "1U","Spells")
call MatchTable(I2S('ANht'), "1V","Spells")
call MatchTable(I2S('ANca'), "1W","Spells")
call MatchTable(I2S('ANrf'), "1X","Spells")
call MatchTable(I2S('AHfa'), "1Y","Spells")
call MatchTable(I2S('AEst'), "1Z","Spells")
call MatchTable(I2S('AEsf'), "20","Spells")
call MatchTable(I2S('AEar'), "21","Spells")
call MatchTable(I2S('AOae'), "22","Spells")
call MatchTable(I2S('AOre'), "23","Spells")
call MatchTable(I2S('AOsh'), "24","Spells")
call MatchTable(I2S('AOws'), "25","Spells")
call MatchTable(I2S('AOhw'), "26","Spells")
call MatchTable(I2S('AOhx'), "27","Spells")
call MatchTable(I2S('AOsw'), "28","Spells")
call MatchTable(I2S('AOvd'), "29","Spells")
call MatchTable(I2S('AEbl'), "2A","Spells")
call MatchTable(I2S('AEfk'), "2B","Spells")
call MatchTable(I2S('AEsh'), "2C","Spells")
call MatchTable(I2S('AEsv'), "2D","Spells")
call MatchTable(I2S('ANin'), "2E","Spells")
call MatchTable(I2S('SNin'), "2F","Spells")
call MatchTable(I2S('ANfb'), "2G","Spells")
call MatchTable(I2S('ANfd'), "2H","Spells")
call MatchTable(I2S('ACfd'), "2I","Spells")
call MatchTable(I2S('ACf3'), "2J","Spells")
call MatchTable(I2S('ANdp'), "2K","Spells")
call MatchTable(I2S('ANrc'), "2L","Spells")
call MatchTable(I2S('ANr3'), "2M","Spells")
call MatchTable(I2S('AEsb'), "2N","Spells")
call MatchTable(I2S('ANrn'), "2O","Spells")
call MatchTable(I2S('ANdc'), "2P","Spells")
call MatchTable(I2S('SNdc'), "2Q","Spells")
call MatchTable(I2S('ANsl'), "2R","Spells")
call MatchTable(I2S('AEIl'), "2S","Spells")
call MatchTable(I2S('AEvi'), "2T","Spells")
call MatchTable(I2S('SNeq'), "2U","Spells")
call MatchTable(I2S('SNdd'), "2V","Spells")
call MatchTable(I2S('ANmo'), "2W","Spells")
call MatchTable(I2S('AEpa'), "2X","Spells")
call MatchTable(I2S('ANwm'), "2Y","Spells")
call MatchTable(I2S('AHca'), "2Z","Spells")
call MatchTable(I2S('ANbr'), "30","Spells")
call MatchTable(I2S('Arsg'), "31","Spells")
call MatchTable(I2S('Aamk'), "32","Spells")
call MatchTable(I2S('Arsq'), "33","Spells")
call MatchTable(I2S('Arsp'), "34","Spells")
call MatchTable(I2S('ANsb'), "35","Spells")
call MatchTable(I2S('ANhw'), "36","Spells")
call MatchTable(I2S('Arsw'), "37","Spells")
call MatchTable(I2S('ANhx'), "38","Spells")
call MatchTable(I2S('AOls'), "39","Spells")
call MatchTable(I2S('ANcf'), "3A","Spells")
call MatchTable(I2S('Acdb'), "3B","Spells")
call MatchTable(I2S('Acdh'), "3C","Spells")
call MatchTable(I2S('Acef'), "3D","Spells")
call MatchTable(I2S('AOr2'), "3E","Spells")
call MatchTable(I2S('AOr3'), "3F","Spells")
call MatchTable(I2S('AOs2'), "3G","Spells")
call MatchTable(I2S('AOw2'), "3H","Spells")
call MatchTable(I2S('ANcl'), "3I","Spells")
call MatchTable(I2S('Aadm'), "3J","Spells")
call MatchTable(I2S('Andm'), "3K","Spells")
call MatchTable(I2S('ACdm'), "3L","Spells")
call MatchTable(I2S('ACd2'), "3M","Spells")
call MatchTable(I2S('Aabs'), "3N","Spells")
call MatchTable(I2S('Aaha'), "3O","Spells")
call MatchTable(I2S('ANav'), "3P","Spells")
call MatchTable(I2S('Aalr'), "3Q","Spells")
call MatchTable(I2S('Aall'), "3R","Spells")
call MatchTable(I2S('Aast'), "3S","Spells")
call MatchTable(I2S('ACad'), "3T","Spells")
call MatchTable(I2S('Aams'), "3U","Spells")
call MatchTable(I2S('ACam'), "3V","Spells")
//call MatchTable(I2S('Aatk'), "3W","Spells")
call MatchTable(I2S('ACba'), "3X","Spells")
call MatchTable(I2S('ACac'), "3Y","Spells")
call MatchTable(I2S('ACav'), "3Z","Spells")
call MatchTable(I2S('SCae'), "40","Spells")
call MatchTable(I2S('Aap1'), "41","Spells")
call MatchTable(I2S('Aap2'), "42","Spells")
call MatchTable(I2S('Aap3'), "43","Spells")
call MatchTable(I2S('Aap4'), "44","Spells")
call MatchTable(I2S('Aoar'), "45","Spells")
call MatchTable(I2S('Aabr'), "46","Spells")
call MatchTable(I2S('Aasl'), "47","Spells")
call MatchTable(I2S('ACat'), "48","Spells")
call MatchTable(I2S('Aakb'), "49","Spells")
call MatchTable(I2S('Aave'), "4A","Spells")
call MatchTable(I2S('Aawa'), "4B","Spells")
call MatchTable(I2S('Abof'), "4C","Spells")
call MatchTable(I2S('ACbn'), "4D","Spells")
call MatchTable(I2S('ACbh'), "4E","Spells")
call MatchTable(I2S('ANbh'), "4F","Spells")
call MatchTable(I2S('ANb2'), "4G","Spells")
call MatchTable(I2S('Abtl'), "4H","Spells")
call MatchTable(I2S('Sbtl'), "4I","Spells")
call MatchTable(I2S('Abrf'), "4J","Spells")
call MatchTable(I2S('Absk'), "4K","Spells")
call MatchTable(I2S('Sbsk'), "4L","Spells")
call MatchTable(I2S('ACbk'), "4M","Spells")
call MatchTable(I2S('Abds'), "4N","Spells")
call MatchTable(I2S('Abdl'), "4O","Spells")
call MatchTable(I2S('Abgs'), "4P","Spells")
call MatchTable(I2S('Abgl'), "4Q","Spells")
call MatchTable(I2S('Abgm'), "4R","Spells")
call MatchTable(I2S('ANbl'), "4S","Spells")
call MatchTable(I2S('ACbz'), "4T","Spells")
call MatchTable(I2S('Ablo'), "4U","Spells")
call MatchTable(I2S('ACbl'), "4V","Spells")
call MatchTable(I2S('ACbb'), "4W","Spells")
call MatchTable(I2S('ACbc'), "4X","Spells")
call MatchTable(I2S('ACbf'), "4Y","Spells")
call MatchTable(I2S('ANbu'), "4Z","Spells")
call MatchTable(I2S('AHbu'), "50","Spells")
call MatchTable(I2S('AObu'), "51","Spells")
call MatchTable(I2S('AEbu'), "52","Spells")
call MatchTable(I2S('AUbu'), "53","Spells")
call MatchTable(I2S('AGbu'), "54","Spells")
call MatchTable(I2S('Abur'), "55","Spells")
call MatchTable(I2S('Abu2'), "56","Spells")
call MatchTable(I2S('Abu3'), "57","Spells")
call MatchTable(I2S('Abu5'), "58","Spells")
call MatchTable(I2S('Abdt'), "59","Spells")
call MatchTable(I2S('Acan'), "5A","Spells")
call MatchTable(I2S('Acn2'), "5B","Spells")
call MatchTable(I2S('ACcn'), "5C","Spells")
call MatchTable(I2S('Abun'), "5D","Spells")
call MatchTable(I2S('Advc'), "5E","Spells")
call MatchTable(I2S('Sch2'), "5F","Spells")
call MatchTable(I2S('Sch5'), "5G","Spells")
call MatchTable(I2S('Sch4'), "5H","Spells")
call MatchTable(I2S('Sch3'), "5I","Spells")
call MatchTable(I2S('Aenc'), "5J","Spells")
call MatchTable(I2S('Achd'), "5K","Spells")
call MatchTable(I2S('ACca'), "5L","Spells")
call MatchTable(I2S('ACcv'), "5M","Spells")
call MatchTable(I2S('ACc2'), "5N","Spells")
call MatchTable(I2S('ACc3'), "5O","Spells")
call MatchTable(I2S('ACcl'), "5P","Spells")
call MatchTable(I2S('Ache'), "5Q","Spells")
call MatchTable(I2S('Sca1'), "5R","Spells")
call MatchTable(I2S('Sca2'), "5S","Spells")
call MatchTable(I2S('Sca3'), "5T","Spells")
call MatchTable(I2S('Sca4'), "5U","Spells")
call MatchTable(I2S('Sca5'), "5V","Spells")
call MatchTable(I2S('Sca6'), "5W","Spells")
call MatchTable(I2S('Achl'), "5X","Spells")
call MatchTable(I2S('ACch'), "5Y","Spells")
call MatchTable(I2S('ACce'), "5Z","Spells")
call MatchTable(I2S('Aclf'), "60","Spells")
call MatchTable(I2S('ACcw'), "61","Spells")
call MatchTable(I2S('Acmg'), "62","Spells")
call MatchTable(I2S('Acpf'), "63","Spells")
call MatchTable(I2S('Acor'), "64","Spells")
call MatchTable(I2S('Acoa'), "65","Spells")
call MatchTable(I2S('Acoh'), "66","Spells")
call MatchTable(I2S('Aco2'), "67","Spells")
call MatchTable(I2S('Aco3'), "68","Spells")
call MatchTable(I2S('ACsp'), "69","Spells")
call MatchTable(I2S('Acri'), "6A","Spells")
call MatchTable(I2S('Scri'), "6B","Spells")
call MatchTable(I2S('ACcr'), "6C","Spells")
call MatchTable(I2S('ACct'), "6D","Spells")
call MatchTable(I2S('Acrs'), "6E","Spells")
call MatchTable(I2S('ACcs'), "6F","Spells")
call MatchTable(I2S('Acyc'), "6G","Spells")
call MatchTable(I2S('Acny'), "6H","Spells")
call MatchTable(I2S('ACcy'), "6I","Spells")
call MatchTable(I2S('SCc1'), "6J","Spells")
call MatchTable(I2S('ACdc'), "6K","Spells")
call MatchTable(I2S('Adda'), "6L","Spells")
call MatchTable(I2S('Amnx'), "6M","Spells")
call MatchTable(I2S('Amnz'), "6N","Spells")
call MatchTable(I2S('Adec'), "6O","Spells")
call MatchTable(I2S('Adef'), "6P","Spells")
call MatchTable(I2S('Adt1'), "6Q","Spells")
call MatchTable(I2S('Atru'), "6R","Spells")
call MatchTable(I2S('Adtg'), "6S","Spells")
call MatchTable(I2S('ANtr'), "6T","Spells")
call MatchTable(I2S('Agyv'), "6U","Spells")
call MatchTable(I2S('Adts'), "6V","Spells")
call MatchTable(I2S('Adtn'), "6W","Spells")
call MatchTable(I2S('Adev'), "6X","Spells")
call MatchTable(I2S('ACdv'), "6Y","Spells")
call MatchTable(I2S('Advm'), "6Z","Spells")
call MatchTable(I2S('ACde'), "70","Spells")
call MatchTable(I2S('Adch'), "71","Spells")
call MatchTable(I2S('Adcn'), "72","Spells")
call MatchTable(I2S('Adis'), "73","Spells")
call MatchTable(I2S('Adsm'), "74","Spells")
call MatchTable(I2S('ACds'), "75","Spells")
call MatchTable(I2S('ACdr'), "76","Spells")
call MatchTable(I2S('Adri'), "77","Spells")
call MatchTable(I2S('Adro'), "78","Spells")
call MatchTable(I2S('Sdro'), "79","Spells")
call MatchTable(I2S('Atdp'), "7A","Spells")
call MatchTable(I2S('Aeat'), "7B","Spells")
call MatchTable(I2S('ANen'), "7C","Spells")
call MatchTable(I2S('Aens'), "7D","Spells")
call MatchTable(I2S('ACen'), "7E","Spells")
call MatchTable(I2S('Aent'), "7F","Spells")
call MatchTable(I2S('Aegm'), "7G","Spells")
call MatchTable(I2S('Aenr'), "7H","Spells")
call MatchTable(I2S('Aenw'), "7I","Spells")
call MatchTable(I2S('Aetl'), "7J","Spells")
call MatchTable(I2S('Aetf'), "7K","Spells")
call MatchTable(I2S('ACev'), "7L","Spells")
call MatchTable(I2S('ACes'), "7M","Spells")
call MatchTable(I2S('Aexh'), "7N","Spells")
call MatchTable(I2S('Afae'), "7O","Spells")
call MatchTable(I2S('Afa2'), "7P","Spells")
call MatchTable(I2S('ACff'), "7Q","Spells")
call MatchTable(I2S('Afbk'), "7R","Spells")
call MatchTable(I2S('Afbt'), "7S","Spells")
call MatchTable(I2S('Afbb'), "7T","Spells")
call MatchTable(I2S('ACsf'), "7U","Spells")
call MatchTable(I2S('ACs9'), "7V","Spells")
call MatchTable(I2S('ACs8'), "7W","Spells")
call MatchTable(I2S('ACs7'), "7X","Spells")
call MatchTable(I2S('Afod'), "7Y","Spells")
call MatchTable(I2S('Awfb'), "7Z","Spells")
call MatchTable(I2S('ACfb'), "80","Spells")
call MatchTable(I2S('Aflk'), "81","Spells")
call MatchTable(I2S('Afla'), "82","Spells")
call MatchTable(I2S('ACfs'), "83","Spells")
call MatchTable(I2S('ANfs'), "84","Spells")
call MatchTable(I2S('ACfr'), "85","Spells")
call MatchTable(I2S('ACfl'), "86","Spells")
call MatchTable(I2S('Afsh'), "87","Spells")
call MatchTable(I2S('Afrz'), "88","Spells")
call MatchTable(I2S('Afzy'), "89","Spells")
call MatchTable(I2S('ACfa'), "8A","Spells")
call MatchTable(I2S('ACf2'), "8B","Spells")
call MatchTable(I2S('ACfu'), "8C","Spells")
call MatchTable(I2S('Afra'), "8D","Spells")
call MatchTable(I2S('Afrb'), "8E","Spells")
call MatchTable(I2S('ACfn'), "8F","Spells")
call MatchTable(I2S('ACcb'), "8G","Spells")
call MatchTable(I2S('Agho'), "8H","Spells")
call MatchTable(I2S('Aeth'), "8I","Spells")
call MatchTable(I2S('Agld'), "8J","Spells")
call MatchTable(I2S('Agra'), "8K","Spells")
call MatchTable(I2S('Agyd'), "8L","Spells")
call MatchTable(I2S('Agyb'), "8M","Spells")
call MatchTable(I2S('Assk'), "8N","Spells")
call MatchTable(I2S('Ansk'), "8O","Spells")
call MatchTable(I2S('Ahar'), "8P","Spells")
call MatchTable(I2S('ANha'), "8Q","Spells")
call MatchTable(I2S('Ahrl'), "8R","Spells")
call MatchTable(I2S('Ahr3'), "8S","Spells")
call MatchTable(I2S('Ahr2'), "8T","Spells")
call MatchTable(I2S('Ahea'), "8U","Spells")
call MatchTable(I2S('Anhe'), "8V","Spells")
call MatchTable(I2S('Anh1'), "8W","Spells")
call MatchTable(I2S('Anh2'), "8X","Spells")
call MatchTable(I2S('Ahwd'), "8Y","Spells")
call MatchTable(I2S('AChw'), "8Z","Spells")
call MatchTable(I2S('AChv'), "90","Spells")
call MatchTable(I2S('Ahnl'), "91","Spells")
//call MatchTable(I2S('AHer'), "92","Spells")
call MatchTable(I2S('AChx'), "93","Spells")
call MatchTable(I2S('Acht'), "94","Spells")
call MatchTable(I2S('ACim'), "95","Spells")
call MatchTable(I2S('ACmp'), "96","Spells")
call MatchTable(I2S('Aimp'), "97","Spells")
call MatchTable(I2S('Ainf'), "98","Spells")
call MatchTable(I2S('ACif'), "99","Spells")
call MatchTable(I2S('Aivs'), "9A","Spells")
//call MatchTable(I2S('AInv'), "9B","Spells")
call MatchTable(I2S('Apak'), "9C","Spells")
call MatchTable(I2S('Aion'), "9D","Spells")
call MatchTable(I2S('Aihn'), "9E","Spells")
call MatchTable(I2S('Aien'), "9F","Spells")
call MatchTable(I2S('Aiun'), "9G","Spells")
call MatchTable(I2S('Avul'), "9H","Spells")
call MatchTable(I2S('Alit'), "9I","Spells")
call MatchTable(I2S('Alsh'), "9J","Spells")
call MatchTable(I2S('ACls'), "9K","Spells")
call MatchTable(I2S('Aliq'), "9L","Spells")
call MatchTable(I2S('Aloa'), "9M","Spells")
call MatchTable(I2S('Sloa'), "9N","Spells")
call MatchTable(I2S('Slo2'), "9O","Spells")
call MatchTable(I2S('Slo3'), "9P","Spells")
call MatchTable(I2S('Atlp'), "9Q","Spells")
call MatchTable(I2S('Aloc'), "9R","Spells")
call MatchTable(I2S('Amdf'), "9S","Spells")
call MatchTable(I2S('Amim'), "9T","Spells")
call MatchTable(I2S('ACmi'), "9U","Spells")
call MatchTable(I2S('ACm2'), "9V","Spells")
call MatchTable(I2S('ACm3'), "9W","Spells")
call MatchTable(I2S('Amls'), "9X","Spells")
call MatchTable(I2S('Ambt'), "9Y","Spells")
call MatchTable(I2S('Amb2'), "9Z","Spells")
call MatchTable(I2S('Amnb'), "A0","Spells")
call MatchTable(I2S('Ambd'), "A1","Spells")
call MatchTable(I2S('Ambb'), "A2","Spells")
call MatchTable(I2S('Amfl'), "A3","Spells")
call MatchTable(I2S('ACmf'), "A4","Spells")
call MatchTable(I2S('Amed'), "A5","Spells")
call MatchTable(I2S('Amel'), "A6","Spells")
call MatchTable(I2S('Amil'), "A7","Spells")
call MatchTable(I2S('Amic'), "A8","Spells")
call MatchTable(I2S('ANmr'), "A9","Spells")
call MatchTable(I2S('Amin'), "AA","Spells")
call MatchTable(I2S('ACmo'), "AB","Spells")
call MatchTable(I2S('Amgl'), "AC","Spells")
call MatchTable(I2S('Amgr'), "AD","Spells")
//call MatchTable(I2S('Amov'), "AE","Spells")
call MatchTable(I2S('Aneu'), "AF","Spells")
call MatchTable(I2S('Ane2'), "AG","Spells")
call MatchTable(I2S('Andt'), "AH","Spells")
call MatchTable(I2S('ANre'), "AI","Spells")
call MatchTable(I2S('ACnr'), "AJ","Spells")
call MatchTable(I2S('Ansp'), "AK","Spells")
call MatchTable(I2S('Afak'), "AL","Spells")
call MatchTable(I2S('ANak'), "AM","Spells")
call MatchTable(I2S('Afir'), "AN","Spells")
call MatchTable(I2S('Afih'), "AO","Spells")
call MatchTable(I2S('Afio'), "AP","Spells")
call MatchTable(I2S('Afin'), "AQ","Spells")
call MatchTable(I2S('Afiu'), "AR","Spells")
call MatchTable(I2S('ANpa'), "AS","Spells")
call MatchTable(I2S('ACpa'), "AT","Spells")
call MatchTable(I2S('ANpi'), "AU","Spells")
call MatchTable(I2S('Apmf'), "AV","Spells")
call MatchTable(I2S('Apig'), "AW","Spells")
call MatchTable(I2S('Apiv'), "AX","Spells")
call MatchTable(I2S('Apsh'), "AY","Spells")
call MatchTable(I2S('Aphx'), "AZ","Spells")
call MatchTable(I2S('Apxf'), "B0","Spells")
call MatchTable(I2S('Apts'), "B1","Spells")
call MatchTable(I2S('Apoi'), "B2","Spells")
call MatchTable(I2S('Aply'), "B3","Spells")
call MatchTable(I2S('ACpy'), "B4","Spells")
call MatchTable(I2S('Apos'), "B5","Spells")
call MatchTable(I2S('ACps'), "B6","Spells")
call MatchTable(I2S('Awar'), "B7","Spells")
call MatchTable(I2S('ACpv'), "B8","Spells")
call MatchTable(I2S('Apit'), "B9","Spells")
call MatchTable(I2S('Aprg'), "BA","Spells")
call MatchTable(I2S('ACpu'), "BB","Spells")
call MatchTable(I2S('ACrf'), "BC","Spells")
call MatchTable(I2S('ACrg'), "BD","Spells")
call MatchTable(I2S('Arai'), "BE","Spells")
call MatchTable(I2S('ACrd'), "BF","Spells")
call MatchTable(I2S('ARal'), "BG","Spells")
call MatchTable(I2S('Arav'), "BH","Spells")
call MatchTable(I2S('Amrf'), "BI","Spells")
call MatchTable(I2S('ACrn'), "BJ","Spells")
call MatchTable(I2S('ANr2'), "BK","Spells")
call MatchTable(I2S('Arbr'), "BL","Spells")
call MatchTable(I2S('Arej'), "BM","Spells")
call MatchTable(I2S('ACrj'), "BN","Spells")
call MatchTable(I2S('ACr2'), "BO","Spells")
call MatchTable(I2S('Aren'), "BP","Spells")
call MatchTable(I2S('Ahrp'), "BQ","Spells")
call MatchTable(I2S('Arep'), "BR","Spells")
call MatchTable(I2S('Arpb'), "BS","Spells")
call MatchTable(I2S('Arpl'), "BT","Spells")
call MatchTable(I2S('Arpm'), "BU","Spells")
call MatchTable(I2S('Arsk'), "BV","Spells")
call MatchTable(I2S('ACrk'), "BW","Spells")
call MatchTable(I2S('ACsk'), "BX","Spells")
call MatchTable(I2S('Arst'), "BY","Spells")
call MatchTable(I2S('Argd'), "BZ","Spells")
call MatchTable(I2S('Argl'), "C0","Spells")
call MatchTable(I2S('Arlm'), "C1","Spells")
call MatchTable(I2S('AHta'), "C2","Spells")
call MatchTable(I2S('Arng'), "C3","Spells")
call MatchTable(I2S('Arev'), "C4","Spells")
call MatchTable(I2S('Aroa'), "C5","Spells")
call MatchTable(I2S('Ara2'), "C6","Spells")
call MatchTable(I2S('ACr1'), "C7","Spells")
call MatchTable(I2S('ACro'), "C8","Spells")
call MatchTable(I2S('Aroc'), "C9","Spells")
call MatchTable(I2S('Aro1'), "CA","Spells")
call MatchTable(I2S('Aro2'), "CB","Spells")
call MatchTable(I2S('Asac'), "CC","Spells")
call MatchTable(I2S('Asal'), "CD","Spells")
call MatchTable(I2S('Alam'), "CE","Spells")
call MatchTable(I2S('ACsa'), "CF","Spells")
call MatchTable(I2S('Asds'), "CG","Spells")
call MatchTable(I2S('Asid'), "CH","Spells")
call MatchTable(I2S('Asud'), "CI","Spells")
call MatchTable(I2S('Aesn'), "CJ","Spells")
call MatchTable(I2S('Aesr'), "CK","Spells")
call MatchTable(I2S('Aeye'), "CL","Spells")
call MatchTable(I2S('ACtn'), "CM","Spells")
call MatchTable(I2S('Ashm'), "CN","Spells")
call MatchTable(I2S('Sshm'), "CO","Spells")
call MatchTable(I2S('Ahid'), "CP","Spells")
call MatchTable(I2S('ACss'), "CQ","Spells")
call MatchTable(I2S('ACsh'), "CR","Spells")
call MatchTable(I2S('ACst'), "CS","Spells")
call MatchTable(I2S('ANsh'), "CT","Spells")
call MatchTable(I2S('ACsi'), "CU","Spells")
call MatchTable(I2S('ACsm'), "CV","Spells")
call MatchTable(I2S('ACsl'), "CW","Spells")
call MatchTable(I2S('Asla'), "CX","Spells")
call MatchTable(I2S('Aslo'), "CY","Spells")
call MatchTable(I2S('ACsw'), "CZ","Spells")
call MatchTable(I2S('Aspo'), "D0","Spells")
call MatchTable(I2S('Asod'), "D1","Spells")
call MatchTable(I2S('Assp'), "D2","Spells")
call MatchTable(I2S('Aspd'), "D3","Spells")
call MatchTable(I2S('Aspy'), "D4","Spells")
call MatchTable(I2S('Aspt'), "D5","Spells")
call MatchTable(I2S('Asps'), "D6","Spells")
call MatchTable(I2S('Asph'), "D7","Spells")
call MatchTable(I2S('Asp1'), "D8","Spells")
call MatchTable(I2S('Asp2'), "D9","Spells")
call MatchTable(I2S('Asp3'), "DA","Spells")
call MatchTable(I2S('Asp4'), "DB","Spells")
call MatchTable(I2S('Asp5'), "DC","Spells")
call MatchTable(I2S('Asp6'), "DD","Spells")
call MatchTable(I2S('Aspa'), "DE","Spells")
call MatchTable(I2S('Aspi'), "DF","Spells")
call MatchTable(I2S('Aspl'), "DG","Spells")
call MatchTable(I2S('Astd'), "DH","Spells")
call MatchTable(I2S('Asta'), "DI","Spells")
call MatchTable(I2S('Astn'), "DJ","Spells")
call MatchTable(I2S('Asth'), "DK","Spells")
call MatchTable(I2S('Asb1'), "DL","Spells")
call MatchTable(I2S('Asb2'), "DM","Spells")
call MatchTable(I2S('Asb3'), "DN","Spells")
call MatchTable(I2S('Aslp'), "DO","Spells")
call MatchTable(I2S('ACwe'), "DP","Spells")
call MatchTable(I2S('Attu'), "DQ","Spells")
call MatchTable(I2S('Srtt'), "DR","Spells")
call MatchTable(I2S('Atau'), "DS","Spells")
call MatchTable(I2S('ANta'), "DT","Spells")
call MatchTable(I2S('ANth'), "DU","Spells")
call MatchTable(I2S('ANt2'), "DV","Spells")
call MatchTable(I2S('ACah'), "DW","Spells")
call MatchTable(I2S('ACtb'), "DX","Spells")
call MatchTable(I2S('ACtc'), "DY","Spells")
call MatchTable(I2S('ACt2'), "DZ","Spells")
call MatchTable(I2S('Atdg'), "E0","Spells")
call MatchTable(I2S('Atsp'), "E1","Spells")
call MatchTable(I2S('Atwa'), "E2","Spells")
call MatchTable(I2S('Atol'), "E3","Spells")
call MatchTable(I2S('Ault'), "E4","Spells")
call MatchTable(I2S('ACua'), "E5","Spells")
call MatchTable(I2S('Auhf'), "E6","Spells")
call MatchTable(I2S('Suhf'), "E7","Spells")
call MatchTable(I2S('ACuf'), "E8","Spells")
call MatchTable(I2S('Auco'), "E9","Spells")
call MatchTable(I2S('Auns'), "EA","Spells")
call MatchTable(I2S('SCva'), "EB","Spells")
call MatchTable(I2S('ACvp'), "EC","Spells")
call MatchTable(I2S('Avng'), "ED","Spells")
call MatchTable(I2S('Awan'), "EE","Spells")
call MatchTable(I2S('Awrs'), "EF","Spells")
call MatchTable(I2S('Awrg'), "EG","Spells")
call MatchTable(I2S('Awrh'), "EH","Spells")
call MatchTable(I2S('ANwk'), "EI","Spells")
call MatchTable(I2S('Awha'), "EJ","Spells")
call MatchTable(I2S('Awh2'), "EK","Spells")
call MatchTable(I2S('Aven'), "EL","Spells")
call MatchTable(I2S('ACvs'), "EM","Spells")
call MatchTable(I2S('Awrp'), "EN","Spells")
call MatchTable(I2S('Aweb'), "EO","Spells")
call MatchTable(I2S('ACwb'), "EP","Spells")
call MatchTable(I2S('AIa1'), "EQ","Spells")
call MatchTable(I2S('AIa3'), "ER","Spells")
call MatchTable(I2S('AIa4'), "ES","Spells")
call MatchTable(I2S('AIa6'), "ET","Spells")
call MatchTable(I2S('AIx5'), "EU","Spells")
call MatchTable(I2S('AIx1'), "EV","Spells")
call MatchTable(I2S('AIx2'), "EW","Spells")
call MatchTable(I2S('AIs1'), "EX","Spells")
call MatchTable(I2S('AIs3'), "EY","Spells")
call MatchTable(I2S('AIs4'), "EZ","Spells")
call MatchTable(I2S('AIs6'), "F0","Spells")
call MatchTable(I2S('AIi1'), "F1","Spells")
call MatchTable(I2S('AIi3'), "F2","Spells")
call MatchTable(I2S('AIi4'), "F3","Spells")
call MatchTable(I2S('AIi6'), "F4","Spells")
call MatchTable(I2S('AIxm'), "F5","Spells")
call MatchTable(I2S('AIam'), "F6","Spells")
call MatchTable(I2S('AIim'), "F7","Spells")
call MatchTable(I2S('AIsm'), "F8","Spells")
call MatchTable(I2S('AIgm'), "F9","Spells")
call MatchTable(I2S('AItm'), "FA","Spells")
call MatchTable(I2S('AInm'), "FB","Spells")
call MatchTable(I2S('AIaa'), "FC","Spells")
call MatchTable(I2S('AIat'), "FD","Spells")
call MatchTable(I2S('AIt6'), "FE","Spells")
call MatchTable(I2S('AIt9'), "FF","Spells")
call MatchTable(I2S('AItc'), "FG","Spells")
call MatchTable(I2S('AItf'), "FH","Spells")
call MatchTable(I2S('AItg'), "FI","Spells")
call MatchTable(I2S('AIth'), "FJ","Spells")
call MatchTable(I2S('AIti'), "FK","Spells")
call MatchTable(I2S('AItj'), "FL","Spells")
call MatchTable(I2S('AItk'), "FM","Spells")
call MatchTable(I2S('AItl'), "FN","Spells")
call MatchTable(I2S('AItn'), "FO","Spells")
call MatchTable(I2S('AIva'), "FP","Spells")
call MatchTable(I2S('AIbk'), "FQ","Spells")
call MatchTable(I2S('AIbl'), "FR","Spells")
call MatchTable(I2S('AIbg'), "FS","Spells")
call MatchTable(I2S('AIbt'), "FT","Spells")
call MatchTable(I2S('AIbb'), "FU","Spells")
call MatchTable(I2S('AIbf'), "FV","Spells")
call MatchTable(I2S('AIbr'), "FW","Spells")
call MatchTable(I2S('AIbs'), "FX","Spells")
call MatchTable(I2S('AIbh'), "FY","Spells")
call MatchTable(I2S('AIcy'), "FZ","Spells")
call MatchTable(I2S('AId1'), "G0","Spells")
call MatchTable(I2S('AId2'), "G1","Spells")
call MatchTable(I2S('AId3'), "G2","Spells")
call MatchTable(I2S('AId4'), "G3","Spells")
call MatchTable(I2S('AId5'), "G4","Spells")
call MatchTable(I2S('AIgf'), "G5","Spells")
call MatchTable(I2S('AIgu'), "G6","Spells")
call MatchTable(I2S('AIem'), "G7","Spells")
call MatchTable(I2S('AIe2'), "G8","Spells")
call MatchTable(I2S('AIfd'), "G9","Spells")
call MatchTable(I2S('AIff'), "GA","Spells")
call MatchTable(I2S('AIfr'), "GB","Spells")
call MatchTable(I2S('AIfu'), "GC","Spells")
call MatchTable(I2S('AIfh'), "GD","Spells")
call MatchTable(I2S('AIfs'), "GE","Spells")
call MatchTable(I2S('AIir'), "GF","Spells")
call MatchTable(I2S('AIuw'), "GG","Spells")
call MatchTable(I2S('AIfl'), "GH","Spells")
call MatchTable(I2S('AIfm'), "GI","Spells")
call MatchTable(I2S('AIfo'), "GJ","Spells")
call MatchTable(I2S('AIfn'), "GK","Spells")
call MatchTable(I2S('AIfe'), "GL","Spells")
call MatchTable(I2S('AIfx'), "GM","Spells")
call MatchTable(I2S('AIfa'), "GN","Spells")
call MatchTable(I2S('AIin'), "GO","Spells")
call MatchTable(I2S('AIlm'), "GP","Spells")
call MatchTable(I2S('AIlp'), "GQ","Spells")
call MatchTable(I2S('AIlf'), "GR","Spells")
call MatchTable(I2S('AIl1'), "GS","Spells")
call MatchTable(I2S('AIl2'), "GT","Spells")
call MatchTable(I2S('AIms'), "GU","Spells")
call MatchTable(I2S('ANbs'), "GV","Spells")
call MatchTable(I2S('AIdf'), "GW","Spells")
call MatchTable(I2S('AIcb'), "GX","Spells")
call MatchTable(I2S('AIdn'), "GY","Spells")
call MatchTable(I2S('AIfb'), "GZ","Spells")
call MatchTable(I2S('AIgd'), "H0","Spells")
call MatchTable(I2S('AIzb'), "H1","Spells")
call MatchTable(I2S('AIob'), "H2","Spells")
call MatchTable(I2S('AIll'), "H3","Spells")
call MatchTable(I2S('AIlb'), "H4","Spells")
call MatchTable(I2S('AIsb'), "H5","Spells")
call MatchTable(I2S('AIpb'), "H6","Spells")
call MatchTable(I2S('Apo2'), "H7","Spells")
call MatchTable(I2S('AInd'), "H8","Spells")
call MatchTable(I2S('Arel'), "H9","Spells")
call MatchTable(I2S('Arll'), "HA","Spells")
call MatchTable(I2S('AIsi'), "HB","Spells")
call MatchTable(I2S('AIos'), "HC","Spells")
call MatchTable(I2S('AIso'), "HD","Spells")
call MatchTable(I2S('Asou'), "HE","Spells")
call MatchTable(I2S('AIcf'), "HF","Spells")
call MatchTable(I2S('AIco'), "HG","Spells")
call MatchTable(I2S('AIdm'), "HH","Spells")
call MatchTable(I2S('AIda'), "HI","Spells")
call MatchTable(I2S('AIdb'), "HJ","Spells")
call MatchTable(I2S('AIta'), "HK","Spells")
call MatchTable(I2S('AIdi'), "HL","Spells")
call MatchTable(I2S('AIds'), "HM","Spells")
call MatchTable(I2S('APdi'), "HN","Spells")
call MatchTable(I2S('AIh1'), "HO","Spells")
call MatchTable(I2S('AIh2'), "HP","Spells")
call MatchTable(I2S('AIh3'), "HQ","Spells")
call MatchTable(I2S('AIha'), "HR","Spells")
call MatchTable(I2S('AIhb'), "HS","Spells")
call MatchTable(I2S('APh1'), "HT","Spells")
call MatchTable(I2S('APh2'), "HU","Spells")
call MatchTable(I2S('APh3'), "HV","Spells")
call MatchTable(I2S('AIhw'), "HW","Spells")
call MatchTable(I2S('AIsw'), "HX","Spells")
call MatchTable(I2S('AIil'), "HY","Spells")
call MatchTable(I2S('AIv1'), "HZ","Spells")
call MatchTable(I2S('AIv2'), "I0","Spells")
call MatchTable(I2S('AIvu'), "I1","Spells")
call MatchTable(I2S('AIvl'), "I2","Spells")
call MatchTable(I2S('AIm1'), "I3","Spells")
call MatchTable(I2S('AIm2'), "I4","Spells")
call MatchTable(I2S('AImr'), "I5","Spells")
call MatchTable(I2S('APmr'), "I6","Spells")
call MatchTable(I2S('APmg'), "I7","Spells")
call MatchTable(I2S('AIpm'), "I8","Spells")
call MatchTable(I2S('AIrt'), "I9","Spells")
call MatchTable(I2S('AIrm'), "IA","Spells")
call MatchTable(I2S('AIrn'), "IB","Spells")
call MatchTable(I2S('AIrc'), "IC","Spells")
call MatchTable(I2S('AIre'), "ID","Spells")
call MatchTable(I2S('AIra'), "IE","Spells")
call MatchTable(I2S('APra'), "IF","Spells")
call MatchTable(I2S('AIsp'), "IG","Spells")
call MatchTable(I2S('AIsa'), "IH","Spells")
call MatchTable(I2S('APsa'), "II","Spells")
call MatchTable(I2S('AItp'), "IJ","Spells")
call MatchTable(I2S('AIad'), "IK","Spells")
call MatchTable(I2S('AIcd'), "IL","Spells")
call MatchTable(I2S('AIba'), "IM","Spells")
call MatchTable(I2S('AIav'), "IN","Spells")
call MatchTable(I2S('AIar'), "IO","Spells")
call MatchTable(I2S('AIae'), "IP","Spells")
call MatchTable(I2S('AIau'), "IQ","Spells")
call MatchTable(I2S('AIuv'), "IR","Spells")
call MatchTable(I2S('AIls'), "IS","Spells")
call MatchTable(I2S('AIxs'), "IT","Spells")
call MatchTable(I2S('AIan'), "IU","Spells")
call MatchTable(I2S('AIrs'), "IV","Spells")
call MatchTable(I2S('AIrr'), "IW","Spells")
call MatchTable(I2S('AIev'), "IX","Spells")
call MatchTable(I2S('AImx'), "IY","Spells")
call MatchTable(I2S('AImh'), "IZ","Spells")
call MatchTable(I2S('AImb'), "J0","Spells")
call MatchTable(I2S('AIbm'), "J1","Spells")
call MatchTable(I2S('AIsx'), "J2","Spells")
call MatchTable(I2S('AIs2'), "J3","Spells")
call MatchTable(I2S('AIrl'), "J4","Spells")
call MatchTable(I2S('AIpr'), "J5","Spells")
call MatchTable(I2S('AIsl'), "J6","Spells")
call MatchTable(I2S('AIpl'), "J7","Spells")
call MatchTable(I2S('AIp1'), "J8","Spells")
call MatchTable(I2S('AIp2'), "J9","Spells")
call MatchTable(I2S('AIp3'), "JA","Spells")
call MatchTable(I2S('AIp4'), "JB","Spells")
call MatchTable(I2S('AIp5'), "JC","Spells")
call MatchTable(I2S('AIp6'), "JD","Spells")
call MatchTable(I2S('AIgo'), "JE","Spells")
call MatchTable(I2S('AIlu'), "JF","Spells")
call MatchTable(I2S('AIrv'), "JG","Spells")
call MatchTable(I2S('AIdc'), "JH","Spells")
call MatchTable(I2S('AIwb'), "JI","Spells")
call MatchTable(I2S('AImo'), "JJ","Spells")
call MatchTable(I2S('AIct'), "JK","Spells")
call MatchTable(I2S('AIri'), "JL","Spells")
call MatchTable(I2S('AIsr'), "JM","Spells")
call MatchTable(I2S('Ablp'), "JN","Spells")
call MatchTable(I2S('AIpv'), "JO","Spells")
call MatchTable(I2S('Aste'), "JP","Spells")
call MatchTable(I2S('Amec'), "JQ","Spells")
call MatchTable(I2S('Ashs'), "JR","Spells")
call MatchTable(I2S('ANpr'), "JS","Spells")
call MatchTable(I2S('ANsa'), "JT","Spells")
call MatchTable(I2S('ANss'), "JU","Spells")
call MatchTable(I2S('ANse'), "JV","Spells")
call MatchTable(I2S('Aret'), "JW","Spells")
call MatchTable(I2S('AImt'), "JX","Spells")
call MatchTable(I2S('Aspb'), "JY","Spells")
call MatchTable(I2S('AIrd'), "JZ","Spells")
call MatchTable(I2S('AItb'), "K0","Spells")
call MatchTable(I2S('AIdv'), "K1","Spells")
call MatchTable(I2S('AIse'), "K2","Spells")
call MatchTable(I2S('AIpg'), "K3","Spells")
call MatchTable(I2S('AIps'), "K4","Spells")
call MatchTable(I2S('AIfg'), "K5","Spells")
call MatchTable(I2S('APrl'), "K6","Spells")
call MatchTable(I2S('APrr'), "K7","Spells")
call MatchTable(I2S('AIrb'), "K8","Spells")
call MatchTable(I2S('Aspp'), "K9","Spells")
call MatchTable(I2S('AUds'), "KA","Spells")
call MatchTable(I2S('APwt'), "KB","Spells")
call MatchTable(I2S('AIuf'), "KC","Spells")
call MatchTable(I2S('AId0'), "KD","Spells")
call MatchTable(I2S('AIcm'), "KE","Spells")
call MatchTable(I2S('AImz'), "KF","Spells")
call MatchTable(I2S('AIfz'), "KG","Spells")
call MatchTable(I2S('AIdp'), "KH","Spells")
call MatchTable(I2S('AImv'), "KI","Spells")
call MatchTable(I2S('AIpx'), "KJ","Spells")
call MatchTable(I2S('AIdd'), "KK","Spells")
call MatchTable(I2S('AId7'), "KL","Spells")
call MatchTable(I2S('AId8'), "KM","Spells")
call MatchTable(I2S('AIlz'), "KN","Spells")
call MatchTable(I2S('AIhx'), "KO","Spells")
call MatchTable(I2S('AIaz'), "KP","Spells")
call MatchTable(I2S('AIrx'), "KQ","Spells")
call MatchTable(I2S('AIbx'), "KR","Spells")
call MatchTable(I2S('AItx'), "KS","Spells")
call MatchTable(I2S('AIwm'), "KT","Spells")
call MatchTable(I2S('AIsh'), "KU","Spells")
call MatchTable(I2S('AI2m'), "KV","Spells")
call MatchTable(I2S('AIgx'), "KW","Spells")
call MatchTable(I2S('AIhl'), "KX","Spells")
call MatchTable(I2S('AIsz'), "KY","Spells")
call MatchTable(I2S('AIpz'), "KZ","Spells")
call MatchTable(I2S('AIfw'), "L0","Spells")
call MatchTable(I2S('AIft'), "L1","Spells")
call MatchTable(I2S('AIlx'), "L2","Spells")
call MatchTable(I2S('AIcs'), "L3","Spells")
call MatchTable(I2S('AIcl'), "L4","Spells")
call MatchTable(I2S('AIx3'), "L5","Spells")
call MatchTable(I2S('AIx4'), "L6","Spells")
call MatchTable(I2S('AIxk'), "L7","Spells")
set i = 0
set x[1] = 48 // 0
set x[2] = 48 // 0
set x[3] = 56 // 8
set x[4] = 76 // L
loop
exitwhen i > 438
set counter = counter + 1
if ((counter < 11) or ((counter > 17) and (counter < 44))) then
call MatchTable(I2S(1093664768+256*x[2]+x[1]), Num2S(x[4]) + Num2S(x[3]), "Spells")
set x[3] = x[3] + 1
if (x[3] == 58) then
set x[3] = 65
elseif (x[3] == 91) then
set x[3] = 48
set x[4] = x[4] + 1
if (x[4] == 58) then
set x[4] = 65
elseif (x[4] == 91) then
set x[4] = 48
endif
endif
elseif (counter > 43) then
set counter = 0
set x[1] = 47
set x[2] = x[2] + 1
endif
set x[1] = x[1] + 1
set i = i + 1
endloop
endfunction
function LearnSpell takes nothing returns nothing
local gamecache g = GetSaveCodeGameCache()
local integer spell = GetStoredInteger(g,"spellid","learnspell")
local integer level = GetStoredInteger(g,"level","learnspell")
local integer i = 1
local unit u = I2U(GetStoredInteger(g,"unit","learnspell"))
loop
exitwhen i > level
call SelectHeroSkill( u, spell )
set i = i + 1
endloop
endfunction
function SetUnitHP takes unit u, integer hp returns nothing
local real handycap
local player owner = GetOwningPlayer(u)
local unit tu
set tu = CreateUnit(Player(0),GetUnitTypeId(u),0,0,0)
call ModifyHeroStat( bj_HEROSTAT_STR, tu, bj_MODIFYMETHOD_SET, 1 )
call SetPlayerHandicapBJ(Player(15),100)
call SetUnitOwner(u, Player(15),false)
set handycap = (((R2I(GetUnitStateSwap(UNIT_STATE_MAX_LIFE, tu)) - 25) + hp)*100) / (R2I(GetUnitStateSwap(UNIT_STATE_MAX_LIFE, tu)) - 25)
call SetPlayerHandicapBJ(Player(15),handycap)
call SetUnitOwner(u, owner,false)
call SetPlayerHandicapBJ(Player(15),100)
call RemoveUnit(tu)
endfunction
function Restore_Unit takes string ecodestr returns unit
local gamecache g = GetSaveCodeGameCache()
local string codestr = StringCase(ecodestr, true)
local integer utype = S2I(GetStoredString(g,"HsID2ID",IncDecNum(SubStringBJ(codestr,4,4),"+")+IncDecNum(SubStringBJ(codestr,2,2),"-")))
local integer array positions
local integer array items
local integer i = 1
local integer num
local integer spellID
local integer spellLevel