globals
trigger gg_trg_README=null
trigger gg_trg_Dump=null
trigger gg_trg_TRSImp=null
trigger gg_trg_TRSGeneric=null
trigger gg_trg_TRSCore=null
trigger gg_trg_TRSSetups=null
trigger gg_trg_TRSItems=null
trigger gg_trg_TRSDisplayModule=null
trigger gg_trg_TRSAffixes=null
trigger gg_trg_TRSAPI=null
trigger gg_trg_TRSShowItemStats=null
trigger gg_trg_TRSInvSetups=null
trigger gg_trg_TRSInv=null
trigger gg_trg_TRSMerchant=null
trigger gg_trg_TRSEnterInv=null
trigger gg_trg_TRSLeaveInv=null
trigger gg_trg_EquipItem=null
trigger gg_trg_UnequipItem=null
trigger gg_trg_lolll=null
trigger gg_trg_TRSLoadSupport=null
trigger gg_trg_CreateSpecialItems=null
trigger gg_trg_MerchantItems=null
trigger gg_trg_ExtraInits=null
trigger gg_trg_LimitInvSize=null
trigger gg_trg_save=null
trigger gg_trg_load=null
trigger gg_trg_Mathadv=null
trigger gg_trg_OnHitActs=null
trigger gg_trg_ItemManipulations=null
trigger gg_trg_asdasdasdasd=null
trigger gg_trg_Ally=null
trigger gg_trg_InvControl=null
trigger gg_trg_ListInv=null
unit gg_unit_Hmkg_0362=null
unit gg_unit_Hpal_0235=null
unit gg_unit_Othr_0230=null
unit gg_unit_hfoo_0232=null
integer ax=0
string sx=null
real rx=0
boolean bx=false
unit ux=null
timer tx=null
item ix=null
effect ex=null
group gx=null
integer eax=0
integer eax2=0
integer eax3=0
string esx=null
real erx=0
boolean ebx=false
unit eux=null
timer etx=null
item eix=null
effect eex=null
group egx=null
integer eaxx=0
string esxx=null
real erxx=0
boolean ebxx=false
unit euxx=null
timer etxx=null
item eixx=null
effect eexx=null
group egxx=null
boolean dbg=false
hashtable trs_chars=null
hashtable TRS_hash=null
multiboarditem tmpmbi=null
location tmploc=null
real tmplocZ=0
integer array Xgroup
integer XMaxg=0
integer array XFreegroup
integer XMaxFreeg=0
integer XMaxs=0
integer array XFreeslots
integer XMaxFrees=0
unit array Xgunits
integer array XMaxCount
integer array XLastIndex
integer array XPrevIndex
integer array XNextIndex
gamecache XDG=null
integer eax00=0
integer eax01=0
integer eax02=0
integer eax03=0
integer eax04=0
integer eax05=0
integer eax06=0
integer eax07=0
integer eax08=0
integer eax09=0
integer eax10=0
integer eax11=0
integer eax12=0
integer eax13=0
integer eax14=0
integer eax15=0
integer eax16=0
integer eax17=0
integer eax18=0
integer eax19=0
integer eax20=0
integer eax21=0
integer eax22=0
integer eax23=0
integer eax24=0
integer eax25=0
integer eax26=0
integer eax27=0
integer eax28=0
integer eax29=0
integer eax30=0
integer eax31=0
integer eax32=0
real erx00=0
real erx01=0
real erx02=0
real erx03=0
real erx04=0
real erx05=0
real erx06=0
real erx07=0
real erx08=0
real erx09=0
real erx10=0
real erx11=0
real erx12=0
real erx13=0
real erx14=0
real erx15=0
real erx16=0
real erx17=0
real erx18=0
real erx19=0
real erx20=0
real erx21=0
real erx22=0
real erx23=0
real erx24=0
real erx25=0
real erx26=0
real erx27=0
real erx28=0
real erx29=0
real erx30=0
real erx31=0
real erx32=0
unit eux00=null
unit eux01=null
unit eux02=null
unit eux03=null
unit eux04=null
unit eux05=null
unit eux06=null
unit eux07=null
unit eux08=null
unit eux09=null
unit eux10=null
unit eux11=null
unit eux12=null
unit eux13=null
unit eux14=null
unit eux15=null
unit eux16=null
unit eux17=null
unit eux18=null
unit eux19=null
unit eux20=null
unit eux21=null
unit eux22=null
unit eux23=null
unit eux24=null
unit eux25=null
unit eux26=null
unit eux27=null
unit eux28=null
unit eux29=null
unit eux30=null
unit eux31=null
unit eux32=null
string esx00=null
string esx01=null
string esx02=null
string esx03=null
string esx04=null
string esx05=null
string esx06=null
string esx07=null
string esx08=null
string esx09=null
string esx10=null
string esx11=null
string esx12=null
string esx13=null
string esx14=null
string esx15=null
string esx16=null
string esx17=null
string esx18=null
string esx19=null
string esx20=null
string esx21=null
string esx22=null
string esx23=null
string esx24=null
string esx25=null
string esx26=null
string esx27=null
string esx28=null
string esx29=null
string esx30=null
string esx31=null
string esx32=null
boolean ebx00=false
boolean ebx01=false
boolean ebx02=false
boolean ebx03=false
boolean ebx04=false
boolean ebx05=false
boolean ebx06=false
boolean ebx07=false
boolean ebx08=false
boolean ebx09=false
boolean ebx10=false
boolean ebx11=false
boolean ebx12=false
boolean ebx13=false
boolean ebx14=false
boolean ebx15=false
boolean ebx16=false
boolean ebx17=false
boolean ebx18=false
boolean ebx19=false
boolean ebx20=false
boolean ebx21=false
boolean ebx22=false
boolean ebx23=false
boolean ebx24=false
boolean ebx25=false
boolean ebx26=false
boolean ebx27=false
boolean ebx28=false
boolean ebx29=false
boolean ebx30=false
boolean ebx31=false
boolean ebx32=false
trigger etrgx00=null
trigger etrgx01=null
trigger etrgx02=null
trigger etrgx03=null
trigger etrgx04=null
trigger etrgx05=null
trigger etrgx06=null
trigger etrgx07=null
trigger etrgx08=null
trigger etrgx09=null
trigger etrgx10=null
trigger etrgx11=null
trigger etrgx12=null
trigger etrgx13=null
trigger etrgx14=null
trigger etrgx15=null
trigger etrgx16=null
trigger etrgx17=null
trigger etrgx18=null
trigger etrgx19=null
trigger etrgx20=null
trigger etrgx21=null
trigger etrgx22=null
trigger etrgx23=null
trigger etrgx24=null
trigger etrgx25=null
trigger etrgx26=null
trigger etrgx27=null
trigger etrgx28=null
trigger etrgx29=null
trigger etrgx30=null
trigger etrgx31=null
trigger etrgx32=null
timer etx00=null
timer etx01=null
timer etx02=null
timer etx03=null
timer etx04=null
timer etx05=null
timer etx06=null
timer etx07=null
timer etx08=null
timer etx09=null
timer etx10=null
timer etx11=null
timer etx12=null
timer etx13=null
timer etx14=null
timer etx15=null
timer etx16=null
timer etx17=null
timer etx18=null
timer etx19=null
timer etx20=null
timer etx21=null
timer etx22=null
timer etx23=null
timer etx24=null
timer etx25=null
timer etx26=null
timer etx27=null
timer etx28=null
timer etx29=null
timer etx30=null
timer etx31=null
timer etx32=null
location elx00=null
location elx01=null
location elx02=null
location elx03=null
location elx04=null
location elx05=null
location elx06=null
location elx07=null
location elx08=null
location elx09=null
location elx10=null
location elx11=null
location elx12=null
location elx13=null
location elx14=null
location elx15=null
location elx16=null
location elx17=null
location elx18=null
location elx19=null
location elx20=null
location elx21=null
location elx22=null
location elx23=null
location elx24=null
location elx25=null
location elx26=null
location elx27=null
location elx28=null
location elx29=null
location elx30=null
location elx31=null
location elx32=null
integer eaX00=0
integer eaX01=0
integer eaX02=0
integer eaX03=0
integer eaX04=0
integer eaX05=0
integer eaX06=0
integer eaX07=0
integer eaX08=0
integer eaX09=0
integer eaX10=0
integer eaX11=0
integer eaX12=0
integer eaX13=0
integer eaX14=0
integer eaX15=0
integer eaX16=0
integer eaX17=0
integer eaX18=0
integer eaX19=0
integer eaX20=0
integer eaX21=0
integer eaX22=0
integer eaX23=0
integer eaX24=0
integer eaX25=0
integer eaX26=0
integer eaX27=0
integer eaX28=0
integer eaX29=0
integer eaX30=0
integer eaX31=0
integer eaX32=0
real erX00=0
real erX01=0
real erX02=0
real erX03=0
real erX04=0
real erX05=0
real erX06=0
real erX07=0
real erX08=0
real erX09=0
real erX10=0
real erX11=0
real erX12=0
real erX13=0
real erX14=0
real erX15=0
real erX16=0
real erX17=0
real erX18=0
real erX19=0
real erX20=0
real erX21=0
real erX22=0
real erX23=0
real erX24=0
real erX25=0
real erX26=0
real erX27=0
real erX28=0
real erX29=0
real erX30=0
real erX31=0
real erX32=0
unit euX00=null
unit euX01=null
unit euX02=null
unit euX03=null
unit euX04=null
unit euX05=null
unit euX06=null
unit euX07=null
unit euX08=null
unit euX09=null
unit euX10=null
unit euX11=null
unit euX12=null
unit euX13=null
unit euX14=null
unit euX15=null
unit euX16=null
unit euX17=null
unit euX18=null
unit euX19=null
unit euX20=null
unit euX21=null
unit euX22=null
unit euX23=null
unit euX24=null
unit euX25=null
unit euX26=null
unit euX27=null
unit euX28=null
unit euX29=null
unit euX30=null
unit euX31=null
unit euX32=null
string esX00=null
string esX01=null
string esX02=null
string esX03=null
string esX04=null
string esX05=null
string esX06=null
string esX07=null
string esX08=null
string esX09=null
string esX10=null
string esX11=null
string esX12=null
string esX13=null
string esX14=null
string esX15=null
string esX16=null
string esX17=null
string esX18=null
string esX19=null
string esX20=null
string esX21=null
string esX22=null
string esX23=null
string esX24=null
string esX25=null
string esX26=null
string esX27=null
string esX28=null
string esX29=null
string esX30=null
string esX31=null
string esX32=null
boolean ebX00=false
boolean ebX01=false
boolean ebX02=false
boolean ebX03=false
boolean ebX04=false
boolean ebX05=false
boolean ebX06=false
boolean ebX07=false
boolean ebX08=false
boolean ebX09=false
boolean ebX10=false
boolean ebX11=false
boolean ebX12=false
boolean ebX13=false
boolean ebX14=false
boolean ebX15=false
boolean ebX16=false
boolean ebX17=false
boolean ebX18=false
boolean ebX19=false
boolean ebX20=false
boolean ebX21=false
boolean ebX22=false
boolean ebX23=false
boolean ebX24=false
boolean ebX25=false
boolean ebX26=false
boolean ebX27=false
boolean ebX28=false
boolean ebX29=false
boolean ebX30=false
boolean ebX31=false
boolean ebX32=false
trigger etrgX00=null
trigger etrgX01=null
trigger etrgX02=null
trigger etrgX03=null
trigger etrgX04=null
trigger etrgX05=null
trigger etrgX06=null
trigger etrgX07=null
trigger etrgX08=null
trigger etrgX09=null
trigger etrgX10=null
trigger etrgX11=null
trigger etrgX12=null
trigger etrgX13=null
trigger etrgX14=null
trigger etrgX15=null
trigger etrgX16=null
trigger etrgX17=null
trigger etrgX18=null
trigger etrgX19=null
trigger etrgX20=null
trigger etrgX21=null
trigger etrgX22=null
trigger etrgX23=null
trigger etrgX24=null
trigger etrgX25=null
trigger etrgX26=null
trigger etrgX27=null
trigger etrgX28=null
trigger etrgX29=null
trigger etrgX30=null
trigger etrgX31=null
trigger etrgX32=null
timer etX00=null
timer etX01=null
timer etX02=null
timer etX03=null
timer etX04=null
timer etX05=null
timer etX06=null
timer etX07=null
timer etX08=null
timer etX09=null
timer etX10=null
timer etX11=null
timer etX12=null
timer etX13=null
timer etX14=null
timer etX15=null
timer etX16=null
timer etX17=null
timer etX18=null
timer etX19=null
timer etX20=null
timer etX21=null
timer etX22=null
timer etX23=null
timer etX24=null
timer etX25=null
timer etX26=null
timer etX27=null
timer etX28=null
timer etX29=null
timer etX30=null
timer etX31=null
timer etX32=null
location elX00=null
location elX01=null
location elX02=null
location elX03=null
location elX04=null
location elX05=null
location elX06=null
location elX07=null
location elX08=null
location elX09=null
location elX10=null
location elX11=null
location elX12=null
location elX13=null
location elX14=null
location elX15=null
location elX16=null
location elX17=null
location elX18=null
location elX19=null
location elX20=null
location elX21=null
location elX22=null
location elX23=null
location elX24=null
location elX25=null
location elX26=null
location elX27=null
location elX28=null
location elX29=null
location elX30=null
location elX31=null
location elX32=null
integer deax00=0
integer deax01=0
integer deax02=0
integer deax03=0
integer deax04=0
integer deax05=0
integer deax06=0
integer deax07=0
integer deax08=0
integer deax09=0
integer deax10=0
integer deax11=0
integer deax12=0
integer deax13=0
integer deax14=0
integer deax15=0
integer deax16=0
integer deax17=0
integer deax18=0
integer deax19=0
integer deax20=0
integer deax21=0
integer deax22=0
integer deax23=0
integer deax24=0
integer deax25=0
integer deax26=0
integer deax27=0
integer deax28=0
integer deax29=0
integer deax30=0
integer deax31=0
integer deax32=0
real derx00=0
real derx01=0
real derx02=0
real derx03=0
real derx04=0
real derx05=0
real derx06=0
real derx07=0
real derx08=0
real derx09=0
real derx10=0
real derx11=0
real derx12=0
real derx13=0
real derx14=0
real derx15=0
real derx16=0
real derx17=0
real derx18=0
real derx19=0
real derx20=0
real derx21=0
real derx22=0
real derx23=0
real derx24=0
real derx25=0
real derx26=0
real derx27=0
real derx28=0
real derx29=0
real derx30=0
real derx31=0
real derx32=0
unit deux00=null
unit deux01=null
unit deux02=null
unit deux03=null
unit deux04=null
unit deux05=null
unit deux06=null
unit deux07=null
unit deux08=null
unit deux09=null
unit deux10=null
unit deux11=null
unit deux12=null
unit deux13=null
unit deux14=null
unit deux15=null
unit deux16=null
unit deux17=null
unit deux18=null
unit deux19=null
unit deux20=null
unit deux21=null
unit deux22=null
unit deux23=null
unit deux24=null
unit deux25=null
unit deux26=null
unit deux27=null
unit deux28=null
unit deux29=null
unit deux30=null
unit deux31=null
unit deux32=null
string desx00=null
string desx01=null
string desx02=null
string desx03=null
string desx04=null
string desx05=null
string desx06=null
string desx07=null
string desx08=null
string desx09=null
string desx10=null
string desx11=null
string desx12=null
string desx13=null
string desx14=null
string desx15=null
string desx16=null
string desx17=null
string desx18=null
string desx19=null
string desx20=null
string desx21=null
string desx22=null
string desx23=null
string desx24=null
string desx25=null
string desx26=null
string desx27=null
string desx28=null
string desx29=null
string desx30=null
string desx31=null
string desx32=null
boolean debx00=false
boolean debx01=false
boolean debx02=false
boolean debx03=false
boolean debx04=false
boolean debx05=false
boolean debx06=false
boolean debx07=false
boolean debx08=false
boolean debx09=false
boolean debx10=false
boolean debx11=false
boolean debx12=false
boolean debx13=false
boolean debx14=false
boolean debx15=false
boolean debx16=false
boolean debx17=false
boolean debx18=false
boolean debx19=false
boolean debx20=false
boolean debx21=false
boolean debx22=false
boolean debx23=false
boolean debx24=false
boolean debx25=false
boolean debx26=false
boolean debx27=false
boolean debx28=false
boolean debx29=false
boolean debx30=false
boolean debx31=false
boolean debx32=false
integer bax=0
real brx=0
string bsx=null
boolean bbx=false
code bcx=null
timer btx=null
location blx=null
unit bux=null
trigger btrgx=null
integer bax00=0
integer bax01=0
integer bax02=0
integer bax03=0
integer bax04=0
integer bax05=0
integer bax06=0
integer bax07=0
integer bax08=0
integer bax09=0
integer bax10=0
integer bax11=0
integer bax12=0
integer bax13=0
integer bax14=0
integer bax15=0
integer bax16=0
integer bax17=0
integer bax18=0
integer bax19=0
integer bax20=0
integer bax21=0
integer bax22=0
integer bax23=0
integer bax24=0
integer bax25=0
integer bax26=0
integer bax27=0
integer bax28=0
integer bax29=0
integer bax30=0
integer bax31=0
integer bax32=0
real brx00=0
real brx01=0
real brx02=0
real brx03=0
real brx04=0
real brx05=0
real brx06=0
real brx07=0
real brx08=0
real brx09=0
real brx10=0
real brx11=0
real brx12=0
real brx13=0
real brx14=0
real brx15=0
real brx16=0
real brx17=0
real brx18=0
real brx19=0
real brx20=0
real brx21=0
real brx22=0
real brx23=0
real brx24=0
real brx25=0
real brx26=0
real brx27=0
real brx28=0
real brx29=0
real brx30=0
real brx31=0
real brx32=0
string bsx00=null
string bsx01=null
string bsx02=null
string bsx03=null
string bsx04=null
string bsx05=null
string bsx06=null
string bsx07=null
string bsx08=null
string bsx09=null
string bsx10=null
string bsx11=null
string bsx12=null
string bsx13=null
string bsx14=null
string bsx15=null
string bsx16=null
string bsx17=null
string bsx18=null
string bsx19=null
string bsx20=null
string bsx21=null
string bsx22=null
string bsx23=null
string bsx24=null
string bsx25=null
string bsx26=null
string bsx27=null
string bsx28=null
string bsx29=null
string bsx30=null
string bsx31=null
string bsx32=null
boolean bbx00=false
boolean bbx01=false
boolean bbx02=false
boolean bbx03=false
boolean bbx04=false
boolean bbx05=false
boolean bbx06=false
boolean bbx07=false
boolean bbx08=false
boolean bbx09=false
boolean bbx10=false
boolean bbx11=false
boolean bbx12=false
boolean bbx13=false
boolean bbx14=false
boolean bbx15=false
boolean bbx16=false
boolean bbx17=false
boolean bbx18=false
boolean bbx19=false
boolean bbx20=false
boolean bbx21=false
boolean bbx22=false
boolean bbx23=false
boolean bbx24=false
boolean bbx25=false
boolean bbx26=false
boolean bbx27=false
boolean bbx28=false
boolean bbx29=false
boolean bbx30=false
boolean bbx31=false
boolean bbx32=false
code bcx00=null
code bcx01=null
code bcx02=null
code bcx03=null
code bcx04=null
code bcx05=null
code bcx06=null
code bcx07=null
code bcx08=null
code bcx09=null
code bcx10=null
code bcx11=null
code bcx12=null
code bcx13=null
code bcx14=null
code bcx15=null
code bcx16=null
code bcx17=null
code bcx18=null
code bcx19=null
code bcx20=null
code bcx21=null
code bcx22=null
code bcx23=null
code bcx24=null
code bcx25=null
code bcx26=null
code bcx27=null
code bcx28=null
code bcx29=null
code bcx30=null
code bcx31=null
code bcx32=null
timer btx00=null
timer btx01=null
timer btx02=null
timer btx03=null
timer btx04=null
timer btx05=null
timer btx06=null
timer btx07=null
timer btx08=null
timer btx09=null
timer btx10=null
timer btx11=null
timer btx12=null
timer btx13=null
timer btx14=null
timer btx15=null
timer btx16=null
timer btx17=null
timer btx18=null
timer btx19=null
timer btx20=null
timer btx21=null
timer btx22=null
timer btx23=null
timer btx24=null
timer btx25=null
timer btx26=null
timer btx27=null
timer btx28=null
timer btx29=null
timer btx30=null
timer btx31=null
timer btx32=null
location blx00=null
location blx01=null
location blx02=null
location blx03=null
location blx04=null
location blx05=null
location blx06=null
location blx07=null
location blx08=null
location blx09=null
location blx10=null
location blx11=null
location blx12=null
location blx13=null
location blx14=null
location blx15=null
location blx16=null
location blx17=null
location blx18=null
location blx19=null
location blx20=null
location blx21=null
location blx22=null
location blx23=null
location blx24=null
location blx25=null
location blx26=null
location blx27=null
location blx28=null
location blx29=null
location blx30=null
location blx31=null
location blx32=null
unit bux00=null
unit bux01=null
unit bux02=null
unit bux03=null
unit bux04=null
unit bux05=null
unit bux06=null
unit bux07=null
unit bux08=null
unit bux09=null
unit bux10=null
unit bux11=null
unit bux12=null
unit bux13=null
unit bux14=null
unit bux15=null
unit bux16=null
unit bux17=null
unit bux18=null
unit bux19=null
unit bux20=null
unit bux21=null
unit bux22=null
unit bux23=null
unit bux24=null
unit bux25=null
unit bux26=null
unit bux27=null
unit bux28=null
unit bux29=null
unit bux30=null
unit bux31=null
unit bux32=null
trigger btrgx00=null
trigger btrgx01=null
trigger btrgx02=null
trigger btrgx03=null
trigger btrgx04=null
trigger btrgx05=null
trigger btrgx06=null
trigger btrgx07=null
trigger btrgx08=null
trigger btrgx09=null
trigger btrgx10=null
trigger btrgx11=null
trigger btrgx12=null
trigger btrgx13=null
trigger btrgx14=null
trigger btrgx15=null
trigger btrgx16=null
trigger btrgx17=null
trigger btrgx18=null
trigger btrgx19=null
trigger btrgx20=null
trigger btrgx21=null
trigger btrgx22=null
trigger btrgx23=null
trigger btrgx24=null
trigger btrgx25=null
trigger btrgx26=null
trigger btrgx27=null
trigger btrgx28=null
trigger btrgx29=null
trigger btrgx30=null
trigger btrgx31=null
trigger btrgx32=null
integer array Tmrs
terraindeformation array TmrTDS
lightning array Blitze
timer array BlitzeTmr
unit array BlitzeUnt00
unit array BlitzeUnt01
unit array BlitzeUnt02
unit array BlitzeUnt03
unit array BlitzeUnt04
unit array BlitzeUnt05
unit array BlitzeUnt06
unit array BlitzeUnt07
real array BlitzeReal00
real array BlitzeReal01
real array BlitzeReal02
real array BlitzeReal03
real array BlitzeReal04
real array BlitzeReal05
real array BlitzeReal06
real array BlitzeReal07
real array BlitzeReal08
real array BlitzeReal09
real array BlitzeReal10
real array BlitzeReal11
real array BlitzeReal12
real array BlitzeReal13
real array BlitzeReal14
real array BlitzeReal15
integer array BlitzeInt00
integer array BlitzeInt01
integer array BlitzeInt02
integer array BlitzeInt03
integer array BlitzeInt04
integer array BlitzeInt05
integer array BlitzeInt06
integer array BlitzeInt07
integer array BlitzeInt08
integer array BlitzeInt09
integer array BlitzeInt10
integer array BlitzeInt11
integer array BlitzeInt12
integer array BlitzeInt13
integer array BlitzeInt14
integer array BlitzeInt15
trigger array AETrg
triggeraction array AETa
triggercondition array AETc
boolean IsAttacked=false
unit AMCaster=null
unit AMDummy=null
unit array AM_Targets
timer array AM_Tmrs
real array AM_Dmg
real array AM_Speed
integer stackindex=0
integer array stack
integer stackrindex=0
real array stackr
integer stacksindex=0
string array stacks
integer stackuindex=0
unit array stacku
unit stackU=null
image array stack_images
timer array stack_images_tmr
integer array stack_images_pos
integer array stack_images_ref
integer stack_images_max=0
image tmpimg=null
boolean dis_msg=true
gamecache cache=null
gamecache TRS=null
gamecache TRSInv=null
gamecache TRSItems=null
gamecache AECache=null
multiboard array XMB
integer XMBColumns=1
integer mb_max_plr=12
trigger Executer=null
triggercondition ExecuterCond=null
boolean ExecResult=false
unit array TRSCDunit
string array TRSCDId
string array DisStr
integer array DisStrR
integer array DisStrG
integer array DisStrB
integer DisStrMax=0
fogmodifier array TRSVisibility
boolean TRSInvClearMessages=true
trackable array Trk
integer TrkMax=0
integer InvMax=0
real array TrkX
real array TrkY
real array TrkZ
integer array TrkNum
integer array TrkIndex
integer array TrkInvId
integer array TrkExId
integer array TrkNatIconId
real array TrkNatIconSize
integer array InvFirstTrk
integer array InvFirstMerchTrk
string array TrkSide
string array TrkType
destructable array TrkIcon
destructable array TrkBackIcon
boolexpr array TrkReq
string array TrkItem
string array InvUserId
string array InvCurItem
string array InvCurMerchItem
integer array InvLastTrk
destructable array InvCurIcon
destructable array InvCurMerchIcon
unit array InvUser
unit array InvMerchant
unit array InvShareInv
unit array InvCurSelectedHero
real array InvPlayerX
real array InvPlayerY
string InvCurSide
integer array InvMinChargedSlot
integer array InvMaxChargedSlot
real MapBoundMinX
real MapBoundMinY
real MapBoundMaxX
real MapBoundMaxY
camerasetup array InvCamSetups
integer array InvCamCon
integer array InvCamPP
integer array InvPageDown
integer array InvPageUp
integer InvCamMax=0
boolean array InvCamUsed
timer InvCamTimer=null
integer TRSSubAbilsCount=0
integer TRSSubAbilsCurPointer=1
string array TRSCusFuncs
integer array TRSSubAbils
real array TRSAbilsRarity
string array TRSAbilsMultId
integer array TRSSubAbilsPointer
integer array TRSSubAbilsId
integer array TRSSubAbilsNum
integer array TRSSubAbilsParam
integer array TRSSubAbilsMin
integer array TRSSubAbilsMax
integer array TRSSubAbilsMinVal
integer array TRSSubAbilsMaxVal
integer array TRSSubAbilsSize
integer array TRSAbilsToUpdate
boolean array TRSAbilsToUpdateUsed
integer TRSAbilsToUpdateMax=0
trigger array TRSAbilsToDisplayStringCompiler
string array TRSAbilsToDisplayReady
integer array TRSAbilsToDisplay
integer array TRSAbilsToDisplayPar
integer array TRSAbilsToDisplayMin
integer array TRSAbilsToDisplayMax
integer array TRSAbilsToDisplayAbilCount
integer array TRSAbilsToDisplayOrdered
boolean array TRSAbilsToDisplayUsed
boolean array TRSAbilsDisplayNotDisp
boolean array TRSAbilsDisplayReqNotDisp
integer TRSAbilsToDisplayCount=0
trigger array TRSRequires
boolean array TRSRequiresOk
integer array TRSRequiresStack
integer TRSRequiresMax=0
integer TRSRequiresVal=0
unit TRSRequiresUnit=null
string TRSRequiresItem=null
boolexpr array TRSRequiresFuncs
unit TRSUnit=null
string TRSItem=null
integer TRSMod=0
boolean TRSInsert=false
boolean TRSCopying=false
integer array TRSPar1
integer array TRSMin1
integer array TRSMax1
integer array TRSCount1
integer array TRSParS1
integer array TRSMinS1
integer array TRSMaxS1
integer array TRSCountS1
integer TRSPar=0
integer TRSMin=0
integer TRSMax=0
integer TRSCount=0
integer TRSParS=0
integer TRSMinS=0
integer TRSMaxS=0
integer TRSCountS=0
unit TRSDisUnit=null
string TRSDisItem=null
string TRSDisItemID=null
multiboard array TRSDisMB
timer TRSRefreshTimer=null
integer array TRSToExec
integer array TRSToExecPos
boolean array TRSToExecExist
integer TRSToExecMax=0
integer array TrkAttachInt0x00
integer array TrkAttachInt0x01
integer array TrkAttachInt0x02
integer array TrkAttachInt0x03
integer array TrkAttachInt0x04
integer array TrkAttachInt0x05
integer array TrkAttachInt0x06
integer array TrkAttachInt0x07
integer array TrkAttachInt0x08
integer array TrkAttachInt0x09
integer array TrkAttachInt0x10
integer array TrkAttachInt0x11
integer array TrkAttachInt0x12
integer array TrkAttachInt0x13
integer array TrkAttachInt0x14
integer array TrkAttachInt0x15
integer array HWFreeStack
boolean array HWFreeUsed
integer HWFreeMax=0
integer HWMax=0
gamecache HW=null
timer HWTimer=null
integer HWXG=0
integer array Pow2
group array OPCGroups
boolean array OPCGroupsUsed
timer array OPCTimers
boolean array OPCTimersUsed
integer array OPCTimersRefCount
unit array OPCUnits
boolean array OPCUnitsUsed
unit array OPCUnits2
boolean array OPCUnitsUsed2
multiboard array OPCMbs
boolean array OPCMBUsed
integer OPCGroupsCur=0
integer OPCGroupsToInit=0
integer OPCGroupsMinIndex=999999999
integer OPCTimersCur=0
integer OPCTimersToInit=0
integer OPCTimersMinIndex=999999999
integer OPCTimersMaxIndex=0
integer OPCUnitsCur=0
integer OPCUnitsToInit=0
integer OPCUnitsMinIndex=999999999
integer OPCUnitsCur2=0
integer OPCUnitsToInit2=0
integer OPCUnitsMinIndex2=999999999
integer OPCMbsCur=0
integer OPCMbsCurMin=0
integer OPCMbsCurMax=0
integer OPCMbsToInit=0
integer OPCMbsMinIndex=999999999
boolean OPCMbsFront=true
integer OPCMaxtimers=0
integer OPCMaxunits=0
integer OPCMaxunits2=0
image array Img
integer array ImgHndl
integer Img_max=0
unit array QUCDummyCasters
integer array QUCAbilId
integer QUCUnitId=1697656885
integer QUCUnit2Id=1697656881
integer DummyMarker
real QUCDummyX=0
real QUCDummyY=0
gamecache USPData=null
integer array ANSI2
integer array HEX2
string array ANSI
string array HEX
boolean USPInited=false
boolean USParray=false
string USPStat=null
string USPsval=null
integer USParrayindex=0
integer USPimin=0
integer USPimax=0
integer USPival=0
real USPrmin=0
real USPrmax=0
real USPrval=0
boolean USPdyn=false
integer USPid=0
boolean USPAdd=false
boolean USPMinus=false
string USPIsStringPointer="$"
string USPDataSetPointer="^"
string USPSetPointer="="
string USPHexPointer="0x"
string USPRealPointer="."
string USPRAWPointer="'"
string USPRandomPointer="~"
string USPDynRandomPointer="?"
string USPEndPointer=";"
integer TPCSetup_Pierce=0
integer TPCSetup_EndSplash=0
integer TPCSetup_Jump=0
integer TPCSetup_JumpNoCalc=0
integer TPCSetup_NoFaceChange=0
integer TPCSetup_Suicide=0
integer TPCSetup_UseFacing=0
integer TPCSetup_SetFacing=0
integer TPCSetup_NoGravity=0
integer TPCSetup_IgnoreZ=0
integer TPCSetup_NoZCalc=0
integer TPCSetup_3DInRange=0
integer TPCSetup_3DInRangeAOE=0
integer TPCSetup_3DDamage=0
integer TPCSetup_TargetEffect=0
integer TPCSetup_AllowZero=0
integer TPCSetup_AdvArc=0
integer TPCSetup_UseArc=0
integer TPCSetup_UsePathing=0
integer TPCSetup_SmoothZ=0
boolexpr TPCSetup_BoolExpCon=null
boolexpr TPCSetup_BoolExpAOE=null
real TPCSetup_ProjectilePeriodicalInt=0
real TPCSetup_ProjectileSpeed=0
integer TPCSetup_Projectile=0
real TPCSetup_LaunchOffset=0
integer TPCSetup_Collision=0
integer TPCSetup_CollisionZ=0
integer TPCSetup_AOE=0
real TPCSetup_Arc=0
real TPCSetup_ArcStep=0
real TPCSetup_WindRes=0
real TPCSetup_Friction=0
real TPCSetup_FallAccelLimit=0
real TPCSetup_Mass=0
real TPCSetup_JumpPower=0
integer TPCSetup_Damage=0
integer TPCSetup_DamagePierce=0
unit TPCSetup_Parent=null
string TPCSetup_CustomModel=null
string TPCSetup_Custom=null
string TPCSetup_CustomPierce=null
string TPCSetup_CustomGround=null
string TPCSetup_CustomMove=null
string TPCSetup_CustomEnd=null
real TPCVecX=0
real TPCVecY=0
real TPCVecZ=0
real MapMinX=0
real MapMinY=0
real MapMaxX=0
real MapMaxY=0
integer TPCProjCount=0
boolean TPCShowCount=false
gamecache TPC=null
real TIPBeginX=0
real TIPBeginY=0
real TIPBeginZ=0
real TIPX=0
real TIPY=0
real TIPZ=0
unit TIPparent=null
unit TIPtarget=null
integer TPCMax=0
integer array TPCFree
boolean array TPCFreeUsed
integer TPCFreeMax=0
integer TPCMaxProj=1023
location TPCLoc=null
location TPCLoc0x1=null
location TPCLoc0x2=null
location TPCLoc0x3=null
location TPCLoc0x4=null
timer array TPCFinishTmr
unit TPCProj=null
unit TPCCaster=null
unit TPCTarget=null


//JASSHelper struct globals:

endglobals

function InitGlobals takes nothing returns nothing
endfunction
function CreateAllItems takes nothing returns nothing
local integer itemID
call CreateItem(1227894832 , - 434.8 , 12.0)
call CreateItem(1227894832 , - 601.5 , 6.0)
call CreateItem(1227894832 , - 600.5 , 60.7)
call CreateItem(1227894832 , - 555.9 , 123.1)
call CreateItem(1227894832 , - 553.9 , 65.9)
call CreateItem(1227894832 , - 554.9 , 11.1)
call CreateItem(1227894832 , - 556.7 , - 45.2)
call CreateItem(1227894832 , - 498.1 , 121.9)
call CreateItem(1227894832 , - 496.1 , 64.7)
call CreateItem(1227894832 , - 497.1 , 9.9)
call CreateItem(1227894832 , - 498.9 , - 46.4)
call CreateItem(1227894832 , - 435.8 , 124.0)
call CreateItem(1227894832 , - 602.6 , 117.9)
call CreateItem(1227894832 , - 436.6 , - 44.4)
call CreateItem(1227894832 , - 603.3 , - 50.4)
call CreateItem(1227894832 , - 433.8 , 66.7)
call CreateItem(1227894833 , - 541.8 , - 403.5)
call CreateItem(1227894833 , - 552.7 , - 290.0)
call CreateItem(1227894833 , - 498.1 , - 290.0)
call CreateItem(1227894833 , - 435.2 , - 293.5)
call CreateItem(1227894833 , - 484.4 , - 403.5)
call CreateItem(1227894833 , - 422.9 , - 401.6)
call CreateItem(1227894833 , - 429.8 , - 348.8)
call CreateItem(1227894833 , - 489.9 , - 348.8)
call CreateItem(1227894833 , - 549.8 , - 352.6)
call CreateItem(1227894833 , - 530.9 , - 459.3)
call CreateItem(1227894833 , - 476.2 , - 459.3)
call CreateItem(1227894833 , - 451.6 , - 179.5)
call CreateItem(1227894833 , - 563.6 , - 234.2)
call CreateItem(1227894833 , - 506.3 , - 234.2)
call CreateItem(1227894833 , - 444.7 , - 232.4)
call CreateItem(1227894833 , - 413.4 , - 462.8)
call CreateItem(1227894833 , - 511.8 , - 179.5)
call CreateItem(1227894833 , - 571.6 , - 183.3)
call CreateItem(1227894834 , 29.6 , 614.5)
call CreateItem(1227894834 , - 136.3 , 608.1)
call CreateItem(1227894834 , - 129.9 , 551.8)
call CreateItem(1227894834 , - 127.6 , 502.0)
call CreateItem(1227894834 , 38.3 , 508.4)
call CreateItem(1227894834 , - 149.9 , 777.8)
call CreateItem(1227894834 , 16.0 , 784.1)
call CreateItem(1227894834 , - 145.8 , 723.9)
call CreateItem(1227894834 , 20.0 , 730.3)
call CreateItem(1227894834 , 36.0 , 558.1)
call CreateItem(1227894834 , 27.4 , 670.8)
call CreateItem(1227894834 , - 138.5 , 664.5)
call CreateItem(1227894835 , 80.4 , 738.1)
call CreateItem(1227894835 , - 69.5 , 559.6)
call CreateItem(1227894835 , 76.3 , 791.9)
call CreateItem(1227894835 , - 89.5 , 785.6)
call CreateItem(1227894835 , 98.6 , 516.2)
call CreateItem(1227894835 , - 67.2 , 509.8)
call CreateItem(1227894835 , - 78.1 , 672.3)
call CreateItem(1227894835 , 90.0 , 622.3)
call CreateItem(1227894835 , 96.4 , 565.9)
call CreateItem(1227894835 , - 85.5 , 731.7)
call CreateItem(1227894835 , 87.8 , 678.6)
call CreateItem(1227894835 , - 75.9 , 615.9)
call CreateItem(1227894836 , 782.1 , 181.8)
call CreateItem(1227894836 , 778.9 , 128.9)
call CreateItem(1227894836 , 671.1 , 229.6)
call CreateItem(1227894836 , 776.2 , 231.3)
call CreateItem(1227894836 , 674.3 , 282.6)
call CreateItem(1227894836 , 771.8 , 434.6)
call CreateItem(1227894836 , 779.3 , 284.2)
call CreateItem(1227894836 , 775.0 , 487.5)
call CreateItem(1227894836 , 726.4 , 229.6)
call CreateItem(1227894836 , 667.4 , 333.1)
call CreateItem(1227894836 , 671.7 , 129.9)
call CreateItem(1227894836 , 728.7 , 282.6)
call CreateItem(1227894836 , 729.4 , 182.8)
call CreateItem(1227894836 , 777.7 , 385.1)
call CreateItem(1227894836 , 727.0 , 129.9)
call CreateItem(1227894836 , 674.9 , 182.8)
call CreateItem(1227894836 , 774.6 , 332.2)
call CreateItem(1227894836 , 666.7 , 432.9)
call CreateItem(1227894836 , 669.9 , 485.8)
call CreateItem(1227894836 , 722.0 , 432.9)
call CreateItem(1227894836 , 724.4 , 485.8)
call CreateItem(1227894836 , 670.6 , 386.0)
call CreateItem(1227894836 , 722.7 , 333.1)
call CreateItem(1227894836 , 725.0 , 386.0)
call CreateItem(1227894837 , 23.5 , - 560.8)
call CreateItem(1227894837 , 17.5 , - 521.6)
call CreateItem(1227894837 , 134.7 , - 609.2)
call CreateItem(1227894837 , 134.2 , - 558.9)
call CreateItem(1227894837 , 15.6 , - 473.4)
call CreateItem(1227894837 , 78.4 , - 609.2)
call CreateItem(1227894837 , 125.8 , - 421.3)
call CreateItem(1227894837 , 126.3 , - 471.6)
call CreateItem(1227894837 , 128.2 , - 519.8)
call CreateItem(1227894837 , 77.9 , - 558.9)
call CreateItem(1227894837 , 15.1 , - 423.1)
call CreateItem(1227894837 , 125.2 , - 371.0)
call CreateItem(1227894837 , 14.6 , - 372.8)
call CreateItem(1227894837 , 24.1 , - 611.0)
call CreateItem(1227894837 , 69.5 , - 421.3)
call CreateItem(1227894837 , 70.0 , - 471.6)
call CreateItem(1227894837 , 69.0 , - 371.0)
call CreateItem(1227894837 , 71.9 , - 519.8)
call CreateItem(1227894838 , - 372.3 , 678.4)
call CreateItem(1227894838 , - 497.5 , 677.4)
call CreateItem(1227894838 , - 558.2 , 673.0)
call CreateItem(1227894838 , - 366.9 , 616.1)
call CreateItem(1227894838 , - 427.9 , 613.6)
call CreateItem(1227894838 , - 492.1 , 615.0)
call CreateItem(1227894838 , - 556.7 , 725.6)
call CreateItem(1227894838 , - 496.0 , 729.9)
call CreateItem(1227894838 , - 372.1 , 847.1)
call CreateItem(1227894838 , - 431.8 , 728.5)
call CreateItem(1227894838 , - 370.8 , 731.0)
call CreateItem(1227894838 , - 433.1 , 844.7)
call CreateItem(1227894838 , - 552.9 , 610.7)
call CreateItem(1227894838 , - 552.7 , 779.4)
call CreateItem(1227894838 , - 492.0 , 783.7)
call CreateItem(1227894838 , - 427.7 , 782.3)
call CreateItem(1227894838 , - 366.8 , 784.8)
call CreateItem(1227894838 , - 558.1 , 841.7)
call CreateItem(1227894838 , - 433.2 , 676.0)
call CreateItem(1227894838 , - 497.3 , 846.1)
call CreateItem(1227894839 , 610.0 , - 239.6)
call CreateItem(1227894839 , 665.5 , - 233.9)
call CreateItem(1227894839 , 545.8 , - 47.1)
call CreateItem(1227894839 , 548.6 , - 196.8)
call CreateItem(1227894839 , 654.1 , - 97.5)
call CreateItem(1227894839 , 655.1 , - 137.0)
call CreateItem(1227894839 , 655.9 , - 190.8)
call CreateItem(1227894839 , 653.1 , - 41.1)
call CreateItem(1227894839 , 598.5 , - 103.2)
call CreateItem(1227894839 , 599.5 , - 142.7)
call CreateItem(1227894839 , 600.3 , - 196.5)
call CreateItem(1227894839 , 597.5 , - 46.8)
call CreateItem(1227894839 , 546.8 , - 103.5)
call CreateItem(1227894839 , 547.8 , - 143.0)
call CreateItem(1227894839 , 558.2 , - 239.9)
call CreateItem(1227894840 , - 18.4 , 671.9)
call CreateItem(1227894840 , - 16.3 , 615.5)
call CreateItem(1227894840 , 140.0 , 737.7)
call CreateItem(1227894840 , 147.4 , 678.2)
call CreateItem(1227894840 , - 7.6 , 509.4)
call CreateItem(1227894840 , - 29.9 , 785.2)
call CreateItem(1227894840 , 149.6 , 621.9)
call CreateItem(1227894840 , - 25.8 , 731.3)
call CreateItem(1227894840 , 158.3 , 515.8)
call CreateItem(1227894840 , - 9.8 , 559.2)
call CreateItem(1227894840 , 156.0 , 565.5)
call CreateItem(1227894840 , 136.0 , 791.5)
call CreateItem(1227894841 , - 127.8 , - 236.0)
call CreateItem(1227894841 , - 182.7 , - 241.3)
call CreateItem(1227894841 , - 240.0 , - 246.4)
call CreateItem(1227894851 , 537.9 , 670.8)
call CreateItem(1227894851 , 433.3 , 668.6)
call CreateItem(1227894851 , 380.6 , 667.7)
call CreateItem(1227894851 , 385.4 , 621.7)
call CreateItem(1227894851 , 594.3 , 622.2)
call CreateItem(1227894851 , 423.9 , 766.0)
call CreateItem(1227894851 , 479.8 , 764.6)
call CreateItem(1227894851 , 528.4 , 768.1)
call CreateItem(1227894851 , 542.7 , 624.8)
call CreateItem(1227894851 , 485.0 , 717.0)
call CreateItem(1227894851 , 533.7 , 720.5)
call CreateItem(1227894851 , 585.3 , 717.9)
call CreateItem(1227894851 , 580.0 , 765.5)
call CreateItem(1227894851 , 367.7 , 810.8)
call CreateItem(1227894851 , 429.1 , 718.4)
call CreateItem(1227894851 , 420.5 , 811.8)
call CreateItem(1227894851 , 376.4 , 717.4)
call CreateItem(1227894851 , 494.0 , 621.3)
call CreateItem(1227894851 , 476.4 , 810.4)
call CreateItem(1227894851 , 589.5 , 668.1)
call CreateItem(1227894851 , 489.2 , 667.2)
call CreateItem(1227894851 , 525.0 , 813.9)
call CreateItem(1227894851 , 576.7 , 811.3)
call CreateItem(1227894851 , 371.1 , 765.0)
call CreateItem(1227894851 , 438.1 , 622.7)
call CreateItem(1227894853 , - 489.0 , 438.8)
call CreateItem(1227894853 , - 529.4 , 266.4)
call CreateItem(1227894853 , - 591.8 , 269.0)
call CreateItem(1227894853 , - 601.6 , 387.0)
call CreateItem(1227894853 , - 543.0 , 384.1)
call CreateItem(1227894853 , - 547.1 , 441.1)
call CreateItem(1227894853 , - 601.8 , 443.9)
call CreateItem(1227894853 , - 598.0 , 330.5)
call CreateItem(1227894853 , - 535.6 , 327.9)
call CreateItem(1227894853 , - 436.8 , 388.8)
call CreateItem(1227894853 , - 488.9 , 386.2)
call CreateItem(1227894853 , - 489.0 , 327.8)
call CreateItem(1227894853 , - 440.7 , 328.0)
call CreateItem(1227894853 , - 482.8 , 266.3)
call CreateItem(1227894853 , - 434.5 , 266.5)
call CreateItem(1227894853 , - 442.6 , 439.3)
call CreateItem(1227894854 , 190.6 , 418.3)
call CreateItem(1227894854 , 253.4 , 372.2)
call CreateItem(1227894854 , 190.2 , 358.9)
call CreateItem(1227894854 , 243.9 , 426.2)
call CreateItem(1227894855 , - 166.0 , - 436.9)
call CreateItem(1227894855 , - 127.1 , - 384.6)
call CreateItem(1227894855 , - 174.4 , - 391.3)
call CreateItem(1227894855 , - 119.0 , - 434.6)
call CreateItem(1227894855 , - 222.6 , - 438.5)
call CreateItem(1227894855 , - 223.2 , - 400.1)
call CreateItem(1227894856 , - 263.9 , 285.6)
call CreateItem(1227894856 , - 203.4 , 288.3)
call CreateItem(1227894856 , - 205.4 , 342.8)
call CreateItem(1227894856 , - 265.5 , 340.4)
call CreateItem(1227894857 , 645.9 , - 382.5)
call CreateItem(1227894857 , 598.5 , - 453.1)
call CreateItem(1227894857 , 653.8 , - 444.3)
call CreateItem(1227894857 , 586.4 , - 389.8)
call CreateItem(1227894858 , 235.3 , - 456.7)
call CreateItem(1227894858 , 288.3 , - 453.9)
call CreateItem(1227894858 , 299.6 , - 505.9)
call CreateItem(1227894858 , 246.7 , - 511.6)
call CreateItem(1227894858 , - 270.6 , - 39.2)
call CreateItem(1227894858 , - 269.2 , - 82.8)
call CreateItem(1227894858 , - 318.2 , - 92.8)
call CreateItem(1227894858 , - 318.6 , - 46.8)
call CreateItem(1227894858 , - 278.2 , 21.1)
call CreateItem(1227894858 , - 318.9 , 0.3)
call CreateItem(1227894859 , 571.3 , 397.9)
call CreateItem(1227894859 , 514.4 , 459.6)
call CreateItem(1227894859 , 562.2 , 455.7)
call CreateItem(1227894859 , 518.4 , 396.0)
call CreateItem(1227894859 , 577.1 , 344.3)
call CreateItem(1227894859 , 528.1 , 343.1)
call CreateItem(1227894860 , 452.3 , - 163.8)
call CreateItem(1227894860 , 447.7 , - 117.4)
call CreateItem(1227894860 , 393.8 , - 120.8)
call CreateItem(1227894860 , 400.6 , - 167.8)
endfunction
function CreateUnitsForPlayer0 takes nothing returns nothing
local player p=Player(0)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , - 363.2 , - 485.9 , 178.800)
call UnitAddItemToSlotById(u , 1227894849 , 5)
set u = CreateUnit(p , 1215324524 , 402.7 , - 341.2 , 328.150)
call SetHeroLevel(u , 3 , false)
call UnitAddItemToSlotById(u , 1227894849 , 5)
set u = CreateUnit(p , 1215324524 , - 29.6 , 416.2 , 301.080)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
set u = CreateUnit(p , 1214344551 , 502.1 , 145.6 , 273.950)
call SetHeroLevel(u , 10 , false)
call UnitAddItemToSlotById(u , 1227894852 , 5)
set gg_unit_Hmkg_0362 = CreateUnit(p , 1215130471 , 373.5 , 434.8 , 242.860)
call SetHeroLevel(gg_unit_Hmkg_0362 , 8 , false)
call UnitAddItemToSlotById(gg_unit_Hmkg_0362 , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer1 takes nothing returns nothing
local player p=Player(1)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 935.8 , 83.0 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer2 takes nothing returns nothing
local player p=Player(2)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1036.8 , 79.5 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer3 takes nothing returns nothing
local player p=Player(3)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1134.6 , 83.9 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer4 takes nothing returns nothing
local player p=Player(4)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1234.1 , 102.8 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer5 takes nothing returns nothing
local player p=Player(5)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1341.8 , 104.1 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer6 takes nothing returns nothing
local player p=Player(6)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1447.2 , 104.1 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer7 takes nothing returns nothing
local player p=Player(7)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1547.5 , 98.9 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer8 takes nothing returns nothing
local player p=Player(8)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1649.5 , 99.4 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer9 takes nothing returns nothing
local player p=Player(9)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1736.7 , 96.7 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer10 takes nothing returns nothing
local player p=Player(10)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1821.3 , 90.2 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateUnitsForPlayer11 takes nothing returns nothing
local player p=Player(11)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1215324524 , 1907.0 , 95.1 , 179.370)
call SetHeroLevel(u , 10 , false)
call SetHeroStr(u , 46 , true)
call SetHeroAgi(u , 50 , true)
call SetHeroInt(u , 33 , true)
call UnitAddItemToSlotById(u , 1227894849 , 5)
endfunction
function CreateNeutralHostile takes nothing returns nothing
local player p=Player(PLAYER_NEUTRAL_AGGRESSIVE)
local unit u
local integer unitID
local trigger t
local real life
set u = CreateUnit(p , 1852467042 , 2079.9 , 2801.1 , 54.032)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2169.6 , 2539.8 , 33.861)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2232.8 , 2352.8 , 205.220)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2182.1 , 2140.2 , 260.670)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2365.7 , 1922.0 , 159.362)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2854.9 , 2351.3 , 76.764)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2764.1 , 2229.7 , 73.435)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2656.1 , 2313.8 , 14.997)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1818.2 , 2323.9 , 34.707)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1736.6 , 2400.6 , 51.956)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1891.4 , 3281.6 , 39.475)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1989.1 , 2544.6 , 162.405)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2552.6 , 2095.7 , 252.375)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2633.8 , 2163.4 , 170.447)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1797.7 , 2636.4 , 177.127)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1646.5 , 3252.0 , 94.189)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1747.6 , 3287.6 , 118.612)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2589.1 , 2418.6 , 209.977)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2091.6 , 2267.5 , 57.241)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1938.8 , 2327.5 , 205.286)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2241.9 , 3019.0 , 206.066)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2492.2 , 2706.9 , 192.464)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2696.4 , 2673.1 , 289.663)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1732.1 , 3000.4 , 299.859)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1549.1 , 2893.6 , 160.350)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2382.4 , 2135.3 , 91.838)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1587.2 , 2597.3 , 196.398)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1917.4 , 2852.1 , 29.159)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2431.3 , 2322.5 , 17.040)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2085.7 , 2018.5 , 102.835)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set gg_unit_Hpal_0235 = CreateUnit(p , 1215324524 , 1905.9 , 2175.0 , 230.840)
call SetHeroLevel(gg_unit_Hpal_0235 , 10 , false)
call SetHeroStr(gg_unit_Hpal_0235 , 500 , true)
call SetHeroAgi(gg_unit_Hpal_0235 , 500 , true)
call SetHeroInt(gg_unit_Hpal_0235 , 500 , true)
call SetUnitState(gg_unit_Hpal_0235 , UNIT_STATE_MANA , 0)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095264354)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095264354)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095264354)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095263347)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095263347)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095263347)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095262564)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095262564)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095262564)
call SelectHeroSkill(gg_unit_Hpal_0235 , 1095266917)
set u = CreateUnit(p , 1852467042 , 2703.2 , 4207.2 , 54.032)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2792.9 , 3945.9 , 33.861)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2514.7 , 4687.7 , 39.475)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2612.5 , 3950.7 , 162.405)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2421.0 , 4042.5 , 177.127)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2269.9 , 4658.1 , 94.189)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2371.0 , 4693.7 , 118.612)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2865.3 , 4425.1 , 206.066)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2355.5 , 4406.5 , 299.859)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2172.4 , 4299.7 , 160.350)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2210.6 , 4003.5 , 196.398)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2540.7 , 4258.2 , 29.159)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3013.9 , 3197.6 , 54.032)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3103.6 , 2936.3 , 33.861)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2825.4 , 3678.1 , 39.475)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2923.1 , 2941.1 , 162.405)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2731.7 , 3032.9 , 177.127)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2580.6 , 3648.5 , 94.189)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2681.7 , 3684.1 , 118.612)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3175.9 , 3415.5 , 206.066)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2666.1 , 3396.9 , 299.859)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2483.1 , 3290.1 , 160.350)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2521.2 , 2993.8 , 196.398)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 2851.4 , 3248.6 , 29.159)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1761.8 , 3977.5 , 54.032)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1851.4 , 3716.1 , 33.861)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1573.3 , 4458.0 , 39.475)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1671.0 , 3720.9 , 162.405)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1479.6 , 3812.8 , 177.127)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1328.4 , 4428.3 , 94.189)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1429.5 , 4463.9 , 118.612)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1923.8 , 4195.3 , 206.066)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1414.0 , 4176.8 , 299.859)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1230.9 , 4070.0 , 160.350)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1269.1 , 3773.7 , 196.398)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1599.2 , 4028.4 , 29.159)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3534.3 , 1174.0 , 54.032)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3624.0 , 912.7 , 33.861)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3345.8 , 1654.5 , 39.475)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3443.5 , 917.5 , 162.405)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3252.1 , 1009.4 , 177.127)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3101.0 , 1624.9 , 94.189)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3202.1 , 1660.5 , 118.612)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3696.3 , 1391.9 , 206.066)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3186.5 , 1373.4 , 299.859)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3003.5 , 1266.6 , 160.350)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3041.6 , 970.3 , 196.398)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 3371.8 , 1225.0 , 29.159)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1025.6 , 3495.9 , 54.032)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1115.3 , 3234.6 , 33.861)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 837.1 , 3976.4 , 39.475)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 934.9 , 3239.4 , 162.405)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 743.4 , 3331.2 , 177.127)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 592.3 , 3946.8 , 94.189)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 693.4 , 3982.4 , 118.612)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 1187.7 , 3713.8 , 206.066)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 677.9 , 3695.3 , 299.859)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 494.8 , 3588.4 , 160.350)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 533.0 , 3292.2 , 196.398)
call SetUnitState(u , UNIT_STATE_MANA , 0)
set u = CreateUnit(p , 1852467042 , 863.1 , 3546.9 , 29.159)
call SetUnitState(u , UNIT_STATE_MANA , 0)
endfunction
function CreateNeutralPassive takes nothing returns nothing
local player p=Player(PLAYER_NEUTRAL_PASSIVE)
local unit u
local integer unitID
local trigger t
local real life
set gg_unit_Othr_0230 = CreateUnit(p , 1333028978 , 864.7 , - 410.8 , 129.730)
set gg_unit_hfoo_0232 = CreateUnit(p , 1751543663 , 698.3 , - 722.9 , 137.220)
endfunction
function CreatePlayerBuildings takes nothing returns nothing
endfunction
function CreatePlayerUnits takes nothing returns nothing
call CreateUnitsForPlayer0()
call CreateUnitsForPlayer1()
call CreateUnitsForPlayer2()
call CreateUnitsForPlayer3()
call CreateUnitsForPlayer4()
call CreateUnitsForPlayer5()
call CreateUnitsForPlayer6()
call CreateUnitsForPlayer7()
call CreateUnitsForPlayer8()
call CreateUnitsForPlayer9()
call CreateUnitsForPlayer10()
call CreateUnitsForPlayer11()
endfunction
function CreateAllUnits takes nothing returns nothing
call CreatePlayerBuildings()
call CreateNeutralHostile()
call CreateNeutralPassive()
call CreatePlayerUnits()
endfunction
function h2i takes handle h returns integer
return GetHandleId(h)
endfunction
constant function b2i takes boolean b returns integer
if b then
return 1
endif
return 0
endfunction
constant function i2b takes integer i returns boolean
if i >= 1 then
return true
endif
return false
endfunction
function echo takes string s returns nothing
if dis_msg then
call DisplayTextToPlayer(GetLocalPlayer() , 0 , 0 , s)
endif
endfunction
function echoAdv takes string s returns nothing
call DisplayTimedTextToPlayer(GetLocalPlayer() , 0 , 0 , 99999999 , s)
endfunction
function align takes integer i returns nothing
loop
exitwhen i < 1
call Location(0 , 0)
set i = i - 1
endloop
endfunction
function PlaySoundBR takes sound s,real x,real y,real z,string file,boolean looping,integer volume,integer cutoff returns sound
set s = CreateSound(file , looping , true , false , 10 , 10 , "")
call SetSoundVolume(s , volume)
call SetSoundDistances(s , 600 , cutoff)
call SetSoundDistanceCutoff(s , cutoff)
call SetSoundPosition(s , x , y , z)
return s
endfunction
function PlaySoundUnitBR takes sound s,unit u,string file,boolean looping,integer volume,integer cutoff returns sound
set s = CreateSound(file , looping , true , false , 10 , 10 , "")
call SetSoundVolume(s , volume)
call SetSoundDistances(s , 600 , cutoff)
call SetSoundDistanceCutoff(s , cutoff)
call AttachSoundToUnit(s , u)
return s
endfunction
function IsTrue takes nothing returns boolean
return true
endfunction
function IsFalse takes nothing returns boolean
return false
endfunction
function UnitEvent takes trigger t,playerunitevent e returns nothing
local integer i=0
loop
call TriggerRegisterPlayerUnitEvent(t , Player(i) , e , Condition(function IsTrue))
set i = i + 1
exitwhen i > 15
endloop
endfunction
function CreateTextTagBR takes string s,real x,real y,real z,real fsize,integer r,integer g,integer b,integer a,real VelX,real VelY,real fadepoint,real lifespan returns texttag
local texttag tt=CreateTextTag()
call SetTextTagText(tt , s , fsize * 0.023 / 10)
call SetTextTagPos(tt , x , y , z)
call SetTextTagColor(tt , r , g , b , a)
call SetTextTagVelocity(tt , VelX , VelY)
if lifespan > 0.0 then
call SetTextTagPermanent(tt , false)
call SetTextTagSuspended(tt , false)
call SetTextTagLifespan(tt , lifespan)
call SetTextTagFadepoint(tt , fadepoint)
endif
return tt
endfunction
function RAbs takes real a returns real
if ( a >= 0 ) then
return a
else
return - a
endif
endfunction
function GetRandomIntBR takes integer i,integer i2 returns integer
if i > i2 then
return i
endif
return GetRandomInt(i , i2)
endfunction
function GetRandomRealBR takes real r,real r2 returns real
if r > r2 then
return r
endif
return GetRandomReal(r , r2)
endfunction
function GetChance takes real r returns boolean
if GetRandomReal(0.001 , 100) <= r then
return true
endif
return false
endfunction
function IsTrueBR takes boolean b1,boolean b2 returns boolean
if b1 then
return b2
endif
return false
endfunction
function AddPercentBonus takes real b,real perc returns real
return b + ( b * ( perc * 0.01 ) )
endfunction
function LimitToBR takes real r,real limit returns real
if r > limit then
return limit
endif
return r
endfunction
function NotLessBR takes real r,real limit returns real
if r < limit then
return limit
endif
return r
endfunction
function AddEffect takes string s,real x,real y returns nothing
call DestroyEffect(AddSpecialEffect(s , x , y))
endfunction
function AddEffectTarget takes string s,widget w,string a returns nothing
call DestroyEffect(AddSpecialEffectTarget(s , w , a))
endfunction
function IsUnitDeadBX takes unit u returns boolean
return GetUnitTypeId(u) == 0 or IsUnitType(u , UNIT_TYPE_DEAD)
endfunction
function CineFilterBR takes player p,real duration,blendmode bmode,texmapflags tmf,string tex,integer red0,integer green0,integer blue0,integer trans0,integer red1,integer green1,integer blue1,integer trans1 returns nothing
if GetLocalPlayer() == p then
call DisplayCineFilter(false)
call SetCineFilterTexture(tex)
call SetCineFilterBlendMode(bmode)
call SetCineFilterTexMapFlags(tmf)
call SetCineFilterStartUV(0 , 0 , 1 , 1)
call SetCineFilterEndUV(0 , 0 , 1 , 1)
call SetCineFilterStartColor(red0 , green0 , blue0 , 255 - trans0)
call SetCineFilterEndColor(red1 , green1 , blue1 , 255 - trans1)
call SetCineFilterDuration(duration)
call DisplayCineFilter(true)
endif
endfunction
function round takes real r returns integer
return R2I(r + 0.5)
endfunction
function MBSetItemStyleBR takes multiboard mb,integer col,integer row,boolean showValue,boolean showIcon returns nothing
set tmpmbi = MultiboardGetItem(mb , row - 1 , col - 1)
call MultiboardSetItemStyle(tmpmbi , showValue , showIcon)
call MultiboardReleaseItem(tmpmbi)
set tmpmbi = null
endfunction
function MBSetItemValueBR takes multiboard mb,integer col,integer row,string Val returns nothing
set tmpmbi = MultiboardGetItem(mb , row - 1 , col - 1)
call MultiboardSetItemValue(tmpmbi , Val)
call MultiboardReleaseItem(tmpmbi)
set tmpmbi = null
endfunction
function MBSetItemColorBR takes multiboard mb,integer col,integer row,integer r,integer g,integer b,integer alpha returns nothing
set tmpmbi = MultiboardGetItem(mb , row - 1 , col - 1)
call MultiboardSetItemValueColor(tmpmbi , r , g , b , 255 - alpha)
call MultiboardReleaseItem(tmpmbi)
set tmpmbi = null
endfunction
function MBSetItemWidthBR takes multiboard mb,integer col,integer row,real width returns nothing
set tmpmbi = MultiboardGetItem(mb , row - 1 , col - 1)
call MultiboardSetItemWidth(tmpmbi , width / 100)
call MultiboardReleaseItem(tmpmbi)
set tmpmbi = null
endfunction
function MBSetItemIconBR takes multiboard mb,integer col,integer row,string icon returns nothing
set tmpmbi = MultiboardGetItem(mb , row - 1 , col - 1)
call MultiboardSetItemIcon(tmpmbi , icon)
call MultiboardReleaseItem(tmpmbi)
set tmpmbi = null
endfunction
function DistanceBetweenCord takes real X,real Y returns real
return SquareRoot(X * X + Y * Y)
endfunction
function DistanceIn3D takes real X,real Y,real Z returns real
return SquareRoot(X * X + Y * Y + Z * Z)
endfunction
function AngleBetweenCord takes real X,real Y returns real
return 57.296 * Atan2(Y , X)
endfunction
function MoveX takes real x,real Dist,real Angle returns real
return x + Dist * Cos(Angle * 0.0175)
endfunction
function MoveY takes real x,real Dist,real Angle returns real
return x + Dist * Sin(Angle * 0.0175)
endfunction
function MoveLocBR takes location l,real x,real y returns location
call MoveLocation(l , x , y)
return l
endfunction
function GetUnitZ takes unit u returns real
return GetLocationZ(MoveLocBR(tmploc , GetUnitX(u) , GetUnitY(u))) + GetUnitFlyHeight(u)
endfunction
function SetUnitZ takes unit u,real z returns nothing
set tmplocZ = GetLocationZ(MoveLocBR(tmploc , GetUnitX(u) , GetUnitY(u)))
call SetUnitFlyHeight(u , z - tmplocZ , 0)
endfunction
constant function Modulo takes integer h,integer d returns integer
return h - ( h / d ) * d
endfunction
function ModuloR takes real h,real d returns real
return h - R2I(h / d) * d
endfunction
function UnitAddAbilityBR takes unit u,integer id returns nothing
call UnitAddAbility(u , id)
call UnitMakeAbilityPermanent(u , true , id)
endfunction
function log2 takes integer val returns integer
if val > 4194304 then
return Pow2[val / 1000000 + 2]
elseif val > 1024 then
return Pow2[val / 1000 + 1]
else
return Pow2[val]
endif
return 0
endfunction
function Initlog2 takes nothing returns nothing
set Pow2[0]=0
set Pow2[1]=0
set Pow2[2]=1
set Pow2[4]=2
set Pow2[8]=3
set Pow2[16]=4
set Pow2[32]=5
set Pow2[64]=6
set Pow2[128]=7
set Pow2[256]=8
set Pow2[512]=9
set Pow2[1024]=10
set Pow2[3]=11
set Pow2[5]=12
set Pow2[9]=13
set Pow2[17]=14
set Pow2[33]=15
set Pow2[66]=16
set Pow2[132]=17
set Pow2[263]=18
set Pow2[525]=19
set Pow2[1049]=20
set Pow2[2098]=21
set Pow2[4195]=22
set Pow2[10]=23
set Pow2[18]=24
set Pow2[35]=25
set Pow2[69]=26
set Pow2[136]=27
set Pow2[270]=28
set Pow2[538]=29
set Pow2[1075]=30
set Pow2[2149]=31
set Pow2[4296]=32
endfunction
function TrkAttachBR takes integer h,integer i returns nothing
set h = Modulo(h , 0x1FFF0)
if h < 0x1FFF then
set TrkAttachInt0x00[h]=i
elseif h < 0x3FFE then
set TrkAttachInt0x01[h - 0x1FFF]=i
elseif h < 0x5FFD then
set TrkAttachInt0x02[h - 0x3FFE]=i
elseif h < 0x7FFC then
set TrkAttachInt0x03[h - 0x5FFD]=i
elseif h < 0x9FFB then
set TrkAttachInt0x04[h - 0x7FFC]=i
elseif h < 0xBFFA then
set TrkAttachInt0x05[h - 0x9FFB]=i
elseif h < 0xDFF9 then
set TrkAttachInt0x06[h - 0xBFFA]=i
elseif h < 0xFFF8 then
set TrkAttachInt0x07[h - 0xDFF9]=i
elseif h < 0x11FF7 then
set TrkAttachInt0x08[h - 0xFFF8]=i
elseif h < 0x13FF6 then
set TrkAttachInt0x09[h - 0x11FF7]=i
elseif h < 0x15FF5 then
set TrkAttachInt0x10[h - 0x13FF6]=i
elseif h < 0x17FF4 then
set TrkAttachInt0x11[h - 0x15FF5]=i
elseif h < 0x19FF3 then
set TrkAttachInt0x12[h - 0x17FF4]=i
elseif h < 0x1BFF2 then
set TrkAttachInt0x13[h - 0x19FF3]=i
elseif h < 0x1DFF1 then
set TrkAttachInt0x14[h - 0x1BFF2]=i
elseif h < 0x1FFF0 then
set TrkAttachInt0x15[h - 0x1DFF1]=i
endif
endfunction
function TrkGetAttachBR takes integer h returns integer
set h = Modulo(h , 0x1FFF0)
if h < 0x1FFF then
return TrkAttachInt0x00[h]
elseif h < 0x3FFE then
return TrkAttachInt0x01[h - 0x1FFF]
elseif h < 0x5FFD then
return TrkAttachInt0x02[h - 0x3FFE]
elseif h < 0x7FFC then
return TrkAttachInt0x03[h - 0x5FFD]
elseif h < 0x9FFB then
return TrkAttachInt0x04[h - 0x7FFC]
elseif h < 0xBFFA then
return TrkAttachInt0x05[h - 0x9FFB]
elseif h < 0xDFF9 then
return TrkAttachInt0x06[h - 0xBFFA]
elseif h < 0xFFF8 then
return TrkAttachInt0x07[h - 0xDFF9]
elseif h < 0x11FF7 then
return TrkAttachInt0x08[h - 0xFFF8]
elseif h < 0x13FF6 then
return TrkAttachInt0x09[h - 0x11FF7]
elseif h < 0x15FF5 then
return TrkAttachInt0x10[h - 0x13FF6]
elseif h < 0x17FF4 then
return TrkAttachInt0x11[h - 0x15FF5]
elseif h < 0x19FF3 then
return TrkAttachInt0x12[h - 0x17FF4]
elseif h < 0x1BFF2 then
return TrkAttachInt0x13[h - 0x19FF3]
elseif h < 0x1DFF1 then
return TrkAttachInt0x14[h - 0x1BFF2]
elseif h < 0x1FFF0 then
return TrkAttachInt0x15[h - 0x1DFF1]
endif
return 0
endfunction
function GetTimerBR takes nothing returns timer
local timer t=null
local integer i=OPCTimersCur
if i > 0 then
set OPCTimersCur = OPCTimersCur - 1
set t = OPCTimers[i]
set OPCTimersUsed[(GetHandleId((t))) - OPCTimersMinIndex]=true // INLINED!!
set OPCTimers[i]=null
set OPCMaxtimers = OPCMaxtimers + 1
return t
endif
if dbg then
call echo("|cffff0000Create A New Timer !|r")
endif
return CreateTimer()
endfunction
function GetUnitBR takes nothing returns unit
local unit u=null
local integer i=OPCUnitsCur
if i > 0 then
set OPCUnitsCur = OPCUnitsCur - 1
set u = OPCUnits[i]
call ShowUnit(u , true)
call SetUnitPathing(u , false)
call UnitRemoveAbility(u , 1097625443)
call UnitAddAbility(u , 1097625443)
set OPCUnitsUsed[(GetHandleId((u))) - OPCUnitsMinIndex]=true // INLINED!!
set OPCUnits[i]=null
set OPCMaxunits = OPCMaxunits + 1
return u
endif
if dbg then
call echo("|cffff0000Create A New Unit !|r")
endif
return CreateUnit(Player(15) , QUCUnitId , 0 , 0 , 0)
endfunction
function GetUnit2BR takes nothing returns unit
local unit u=null
local integer i=OPCUnitsCur2
if i > 0 then
set OPCUnitsCur2 = OPCUnitsCur2 - 1
set u = OPCUnits2[i]
call UnitRemoveAbility(u , 1097625443)
call ShowUnit(u , true)
call PauseUnit(u , false)
set OPCUnitsUsed2[(GetHandleId((u))) - OPCUnitsMinIndex2]=true // INLINED!!
set OPCUnits2[i]=null
set OPCMaxunits2 = OPCMaxunits2 + 1
return u
endif
if dbg then
call echo("|cffff0000Create A New Unit X2!|r")
endif
return CreateUnit(Player(15) , QUCUnit2Id , 0 , 0 , 0)
endfunction
function GetGroupBR takes nothing returns group
local group g=null
local integer i=OPCGroupsCur
if i > 0 then
set OPCGroupsCur = OPCGroupsCur - 1
set g = OPCGroups[i]
set OPCGroupsUsed[(GetHandleId((g))) - OPCGroupsMinIndex]=true // INLINED!!
set OPCGroups[i]=null
return g
endif
if dbg then
call echo("|cffff0000Create A New Group !|r")
endif
return CreateGroup()
endfunction
function RecycleTimer takes timer t returns nothing
local integer i=OPCTimersCur + 1
if OPCTimersUsed[(GetHandleId((t))) - OPCTimersMinIndex] then // INLINED!!
if i < 0x1fff and t != null then
call TimerStart(t , 0 , false , null)
set OPCTimersCur = i
set OPCTimers[i]=t
set OPCTimersUsed[(GetHandleId((t))) - OPCTimersMinIndex]=false // INLINED!!
set OPCMaxtimers = OPCMaxtimers - 1
else
if t != null then
call DestroyTimer(t)
endif
endif
endif
endfunction
function RecycleUnit takes unit u returns nothing
local integer i=OPCUnitsCur + 1
if OPCUnitsUsed[(GetHandleId((u))) - OPCUnitsMinIndex] then // INLINED!!
if i < 0x1fff and u != null then
call ShowUnit(u , false)
call IssueImmediateOrder(u , "stop")
call SetUnitScale(u , 1 , 1 , 1)
call SetUnitTimeScale(u , 1)
call SetUnitVertexColor(u , 255 , 255 , 255 , 255)
call SetUnitFlyHeight(u , GetUnitDefaultFlyHeight(u) , 0)
call SetUnitOwner(u , Player(15) , true)
call SetUnitX(u , QUCDummyX)
call SetUnitY(u , QUCDummyY)
set OPCUnitsCur = i
set OPCUnits[i]=u
set OPCUnitsUsed[(GetHandleId((u))) - OPCUnitsMinIndex]=false // INLINED!!
set OPCMaxunits = OPCMaxunits - 1
else
if u != null then
call RemoveUnit(u)
endif
endif
endif
endfunction
function RecycleUnit2 takes unit u returns nothing
local integer i=OPCUnitsCur2 + 1
if OPCUnitsUsed2[(GetHandleId((u))) - OPCUnitsMinIndex2] then // INLINED!!
if i < 0x1fff and u != null then
call ShowUnit(u , false)
call IssueImmediateOrder(u , "stop")
call SetUnitTimeScale(u , 1)
call SetUnitFlyHeight(u , GetUnitDefaultFlyHeight(u) , 0)
call SetUnitOwner(u , Player(15) , true)
call UnitRemoveAbility(u , 1097625443)
call PauseUnit(u , true)
set OPCUnitsCur2 = i
set OPCUnits2[i]=u
set OPCUnitsUsed2[(GetHandleId((u))) - OPCUnitsMinIndex2]=false // INLINED!!
set OPCMaxunits2 = OPCMaxunits2 - 1
else
if u != null then
call RemoveUnit(u)
endif
endif
endif
endfunction
function RecycleGroup takes group g returns nothing
local integer i=OPCGroupsCur + 1
if OPCGroupsUsed[(GetHandleId((g))) - OPCGroupsMinIndex] then // INLINED!!
if i < 0x1fff and g != null then
call GroupClear(g)
set OPCGroupsCur = i
set OPCGroups[i]=g
set OPCGroupsUsed[(GetHandleId((g))) - OPCGroupsMinIndex]=false // INLINED!!
else
if g != null then
call DestroyGroup(g)
endif
endif
endif
endfunction
function InitTimer takes nothing returns nothing
local timer t=CreateTimer()
local integer h=(GetHandleId((t))) // INLINED!!
local integer i=OPCTimersCur + 1
if h < OPCTimersMinIndex then
set OPCTimersMinIndex = h
endif
if h > OPCTimersMaxIndex then
set OPCTimersMaxIndex = h
endif
set OPCTimersCur = i
set OPCTimers[i]=t
set t = null
endfunction
function InitUnit takes nothing returns nothing
local unit u=CreateUnit(Player(15) , QUCUnitId , QUCDummyX , QUCDummyY , 0)
local integer h=(GetHandleId((u))) // INLINED!!
local integer i=OPCUnitsCur + 1
call ShowUnit(u , false)
call SetUnitPathing(u , false)
if h < OPCUnitsMinIndex then
set OPCUnitsMinIndex = h
endif
set OPCUnitsCur = i
set OPCUnits[i]=u
set u = null
endfunction
function InitUnit2 takes nothing returns nothing
local unit u=CreateUnit(Player(15) , QUCUnit2Id , 0 , 0 , 0)
local integer h=(GetHandleId((u))) // INLINED!!
local integer i=OPCUnitsCur2 + 1
call ShowUnit(u , false)
call SetUnitPathing(u , false)
if h < OPCUnitsMinIndex2 then
set OPCUnitsMinIndex2 = h
endif
set OPCUnitsCur2 = i
set OPCUnits2[i]=u
set u = null
endfunction
function InitGroup takes nothing returns nothing
local group g=CreateGroup()
local integer h=(GetHandleId((g))) // INLINED!!
local integer i=OPCGroupsCur + 1
if h < OPCGroupsMinIndex then
set OPCGroupsMinIndex = h
endif
set OPCGroupsCur = i
set OPCGroups[i]=g
set g = null
endfunction
function TimerInitExec takes nothing returns nothing
local integer i=1
loop
exitwhen i > OPCTimersToInit or i > 0x1ffe
call ExecuteFunc("InitTimer")
set i = i + 1
endloop
endfunction
function TimerInit takes integer c returns nothing
set OPCTimersToInit = c
call ExecuteFunc("TimerInitExec")
endfunction
function UnitInitExec takes nothing returns nothing
local integer i=1
loop
exitwhen i > OPCUnitsToInit or i > 0x1ffe
call ExecuteFunc("InitUnit")
set i = i + 1
endloop
endfunction
function UnitInit takes integer c returns nothing
set OPCUnitsToInit = c
call ExecuteFunc("UnitInitExec")
endfunction
function UnitInit2Exec takes nothing returns nothing
local integer i=1
loop
exitwhen i > OPCUnitsToInit or i > 0x1ffe
call ExecuteFunc("InitUnit2")
set i = i + 1
endloop
endfunction
function UnitInit2 takes integer c returns nothing
set OPCUnitsToInit = c
call ExecuteFunc("UnitInit2Exec")
endfunction
function GroupInitExec takes nothing returns nothing
local integer i=1
loop
exitwhen i > OPCGroupsToInit or i > 0x1ffe
call ExecuteFunc("InitGroup")
set i = i + 1
endloop
endfunction
function GroupInit takes integer c returns nothing
set OPCGroupsToInit = c
call ExecuteFunc("GroupInitExec")
endfunction
function QUCRecycle takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer tid=(GetHandleId((t))) - OPCTimersMinIndex // INLINED!!
local unit u=QUCDummyCasters[tid]
call UnitRemoveAbility(u , QUCAbilId[tid])
set QUCDummyCasters[tid]=null
set QUCAbilId[tid]=0
call RecycleUnit(u)
call RecycleTimer(t)
endfunction
function RecycleUnitTimed takes unit u,real timeout returns nothing
if OPCUnitsUsed[(GetHandleId((u))) - OPCUnitsMinIndex] then // INLINED!!
set etxx = GetTimerBR()
set eaxx = (GetHandleId((etxx))) - OPCTimersMinIndex // INLINED!!
set QUCDummyCasters[eaxx]=u
set QUCAbilId[eaxx]=0
call TimerStart(etxx , timeout , false , function QUCRecycle)
endif
endfunction
function QUCRecycle2 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer tid=(GetHandleId((t))) - OPCTimersMinIndex // INLINED!!
local unit u=QUCDummyCasters[tid]
set QUCDummyCasters[tid]=null
call RecycleUnit2(u)
call RecycleTimer(t)
endfunction
function RecycleUnitTimed2 takes unit u,real timeout returns nothing
if OPCUnitsUsed2[(GetHandleId((u))) - OPCUnitsMinIndex2] then // INLINED!!
set etxx = GetTimerBR()
set eaxx = ( (GetHandleId((etxx))) - OPCTimersMinIndex ) // INLINED!!
set QUCDummyCasters[eaxx]=u
call TimerStart(etxx , timeout , false , function QUCRecycle2)
endif
endfunction
function CastTargetBR takes player owner,widget target,real x,real y,integer id,string order,integer lvl,real timeout returns boolean
local unit u=GetUnitBR()
local timer t=GetTimerBR()
local integer tid=(GetHandleId((t))) - OPCTimersMinIndex // INLINED!!
call SetUnitOwner(u , owner , true)
call SetUnitX(u , x)
call SetUnitY(u , y)
call UnitAddAbility(u , id)
call SetUnitAbilityLevel(u , id , lvl)
set QUCDummyCasters[tid]=u
set QUCAbilId[tid]=id
call TimerStart(t , timeout , false , function QUCRecycle)
if IssueTargetOrder(u , order , target) then
return true
endif
return false
endfunction
function CastPointBR takes player owner,real TarX,real TarY,real x,real y,integer id,string order,integer lvl,real timeout returns boolean
local unit u=GetUnitBR()
local timer t=GetTimerBR()
local integer tid=(GetHandleId((t))) - OPCTimersMinIndex // INLINED!!
call SetUnitOwner(u , owner , true)
call SetUnitX(u , x)
call SetUnitY(u , y)
call UnitAddAbility(u , id)
call SetUnitAbilityLevel(u , id , lvl)
set QUCDummyCasters[tid]=u
set QUCAbilId[tid]=id
call TimerStart(t , timeout , false , function QUCRecycle)
if IssuePointOrder(u , order , TarX , TarY) then
return true
endif
return false
endfunction
function CastInstantBR takes player owner,real x,real y,integer id,string order,integer lvl,real timeout returns boolean
local unit u=GetUnitBR()
local timer t=GetTimerBR()
local integer tid=(GetHandleId((t))) - OPCTimersMinIndex // INLINED!!
call SetUnitOwner(u , owner , true)
call SetUnitX(u , x)
call SetUnitY(u , y)
call UnitAddAbility(u , id)
call SetUnitAbilityLevel(u , id , lvl)
set QUCDummyCasters[tid]=u
set QUCAbilId[tid]=id
call TimerStart(t , timeout , false , function QUCRecycle)
if IssueImmediateOrder(u , order) then
return true
endif
return false
endfunction
function InitUSPBR takes nothing returns nothing
if USPData == null then
set USPData = InitGameCache("USPDataStore.bx")
endif
if trs_chars == null then
set trs_chars = InitHashtable()
endif
set ANSI[48]="0"
set ANSI[49]="1"
set ANSI[50]="2"
set ANSI[51]="3"
set ANSI[52]="4"
set ANSI[53]="5"
set ANSI[54]="6"
set ANSI[55]="7"
set ANSI[56]="8"
set ANSI[57]="9"
call SaveInteger(trs_chars , 256 , StringHash("0") , 48)
call SaveInteger(trs_chars , 256 , StringHash("1") , 49)
call SaveInteger(trs_chars , 256 , StringHash("2") , 50)
call SaveInteger(trs_chars , 256 , StringHash("3") , 51)
call SaveInteger(trs_chars , 256 , StringHash("4") , 52)
call SaveInteger(trs_chars , 256 , StringHash("5") , 53)
call SaveInteger(trs_chars , 256 , StringHash("6") , 54)
call SaveInteger(trs_chars , 256 , StringHash("7") , 55)
call SaveInteger(trs_chars , 256 , StringHash("8") , 56)
call SaveInteger(trs_chars , 256 , StringHash("9") , 57)
set ANSI[65]="A"
set ANSI[66]="B"
set ANSI[67]="C"
set ANSI[68]="D"
set ANSI[69]="E"
set ANSI[70]="F"
set ANSI[71]="G"
set ANSI[72]="H"
set ANSI[73]="I"
set ANSI[74]="J"
set ANSI[75]="K"
set ANSI[76]="L"
set ANSI[77]="M"
set ANSI[78]="N"
set ANSI[79]="O"
set ANSI[80]="P"
set ANSI[81]="Q"
set ANSI[82]="R"
set ANSI[83]="S"
set ANSI[84]="T"
set ANSI[85]="U"
set ANSI[86]="V"
set ANSI[87]="W"
set ANSI[88]="X"
set ANSI[89]="Y"
set ANSI[90]="Z"
call SaveInteger(trs_chars , 256 , StringHash("A") , 65)
call SaveInteger(trs_chars , 256 , StringHash("B") , 66)
call SaveInteger(trs_chars , 256 , StringHash("C") , 67)
call SaveInteger(trs_chars , 256 , StringHash("D") , 68)
call SaveInteger(trs_chars , 256 , StringHash("E") , 69)
call SaveInteger(trs_chars , 256 , StringHash("F") , 70)
call SaveInteger(trs_chars , 256 , StringHash("G") , 71)
call SaveInteger(trs_chars , 256 , StringHash("H") , 72)
call SaveInteger(trs_chars , 256 , StringHash("I") , 73)
call SaveInteger(trs_chars , 256 , StringHash("J") , 74)
call SaveInteger(trs_chars , 256 , StringHash("K") , 75)
call SaveInteger(trs_chars , 256 , StringHash("L") , 76)
call SaveInteger(trs_chars , 256 , StringHash("M") , 77)
call SaveInteger(trs_chars , 256 , StringHash("N") , 78)
call SaveInteger(trs_chars , 256 , StringHash("O") , 79)
call SaveInteger(trs_chars , 256 , StringHash("P") , 80)
call SaveInteger(trs_chars , 256 , StringHash("Q") , 81)
call SaveInteger(trs_chars , 256 , StringHash("R") , 82)
call SaveInteger(trs_chars , 256 , StringHash("S") , 83)
call SaveInteger(trs_chars , 256 , StringHash("T") , 84)
call SaveInteger(trs_chars , 256 , StringHash("U") , 85)
call SaveInteger(trs_chars , 256 , StringHash("V") , 86)
call SaveInteger(trs_chars , 256 , StringHash("W") , 87)
call SaveInteger(trs_chars , 256 , StringHash("X") , 88)
call SaveInteger(trs_chars , 256 , StringHash("Y") , 89)
call SaveInteger(trs_chars , 256 , StringHash("Z") , 90)
set ANSI[97]="a"
set ANSI[98]="b"
set ANSI[99]="c"
set ANSI[100]="d"
set ANSI[101]="e"
set ANSI[102]="f"
set ANSI[103]="g"
set ANSI[104]="h"
set ANSI[105]="i"
set ANSI[106]="j"
set ANSI[107]="k"
set ANSI[108]="l"
set ANSI[109]="m"
set ANSI[110]="n"
set ANSI[111]="o"
set ANSI[112]="p"
set ANSI[113]="q"
set ANSI[114]="r"
set ANSI[115]="s"
set ANSI[116]="t"
set ANSI[117]="u"
set ANSI[118]="v"
set ANSI[119]="w"
set ANSI[120]="x"
set ANSI[121]="y"
set ANSI[122]="z"
call SaveInteger(trs_chars , 256 , StringHash("a") , 97)
call SaveInteger(trs_chars , 256 , StringHash("b") , 98)
call SaveInteger(trs_chars , 256 , StringHash("c") , 99)
call SaveInteger(trs_chars , 256 , StringHash("d") , 100)
call SaveInteger(trs_chars , 256 , StringHash("e") , 101)
call SaveInteger(trs_chars , 256 , StringHash("f") , 102)
call SaveInteger(trs_chars , 256 , StringHash("g") , 103)
call SaveInteger(trs_chars , 256 , StringHash("h") , 104)
call SaveInteger(trs_chars , 256 , StringHash("i") , 105)
call SaveInteger(trs_chars , 256 , StringHash("j") , 106)
call SaveInteger(trs_chars , 256 , StringHash("k") , 107)
call SaveInteger(trs_chars , 256 , StringHash("l") , 108)
call SaveInteger(trs_chars , 256 , StringHash("m") , 109)
call SaveInteger(trs_chars , 256 , StringHash("n") , 110)
call SaveInteger(trs_chars , 256 , StringHash("o") , 111)
call SaveInteger(trs_chars , 256 , StringHash("p") , 112)
call SaveInteger(trs_chars , 256 , StringHash("q") , 113)
call SaveInteger(trs_chars , 256 , StringHash("r") , 114)
call SaveInteger(trs_chars , 256 , StringHash("s") , 115)
call SaveInteger(trs_chars , 256 , StringHash("t") , 116)
call SaveInteger(trs_chars , 256 , StringHash("u") , 117)
call SaveInteger(trs_chars , 256 , StringHash("v") , 118)
call SaveInteger(trs_chars , 256 , StringHash("w") , 119)
call SaveInteger(trs_chars , 256 , StringHash("x") , 120)
call SaveInteger(trs_chars , 256 , StringHash("y") , 121)
call SaveInteger(trs_chars , 256 , StringHash("z") , 122)
set HEX[0]="0"
set HEX[1]="1"
set HEX[2]="2"
set HEX[3]="3"
set HEX[4]="4"
set HEX[5]="5"
set HEX[6]="6"
set HEX[7]="7"
set HEX[8]="8"
set HEX[9]="9"
set HEX[10]="a"
set HEX[11]="b"
set HEX[12]="c"
set HEX[13]="d"
set HEX[14]="e"
set HEX[15]="f"
call SaveInteger(trs_chars , 16 , StringHash("0") , 0)
call SaveInteger(trs_chars , 16 , StringHash("1") , 1)
call SaveInteger(trs_chars , 16 , StringHash("2") , 2)
call SaveInteger(trs_chars , 16 , StringHash("3") , 3)
call SaveInteger(trs_chars , 16 , StringHash("4") , 4)
call SaveInteger(trs_chars , 16 , StringHash("5") , 5)
call SaveInteger(trs_chars , 16 , StringHash("6") , 6)
call SaveInteger(trs_chars , 16 , StringHash("7") , 7)
call SaveInteger(trs_chars , 16 , StringHash("8") , 8)
call SaveInteger(trs_chars , 16 , StringHash("9") , 9)
call SaveInteger(trs_chars , 16 , StringHash("a") , 10)
call SaveInteger(trs_chars , 16 , StringHash("A") , 10)
call SaveInteger(trs_chars , 16 , StringHash("b") , 11)
call SaveInteger(trs_chars , 16 , StringHash("B") , 11)
call SaveInteger(trs_chars , 16 , StringHash("c") , 12)
call SaveInteger(trs_chars , 16 , StringHash("C") , 12)
call SaveInteger(trs_chars , 16 , StringHash("d") , 13)
call SaveInteger(trs_chars , 16 , StringHash("D") , 13)
call SaveInteger(trs_chars , 16 , StringHash("e") , 14)
call SaveInteger(trs_chars , 16 , StringHash("E") , 14)
call SaveInteger(trs_chars , 16 , StringHash("f") , 15)
call SaveInteger(trs_chars , 16 , StringHash("F") , 15)
set USPInited = true
endfunction
function I2ASCExec takes nothing returns nothing
local integer i=eax
set esx = ANSI[i / 0x1000000] + ANSI[Modulo(i / 0x10000 , 0x100)] + ANSI[Modulo(i / 0x100 , 0x100)] + ANSI[Modulo(i , 0x100)]
endfunction
function I2ASC takes integer i returns string
set eax = i
call ExecuteFunc("I2ASCExec")
return esx
endfunction
function ASC2IExec takes nothing returns nothing
local string s=esx
set eax = LoadInteger(trs_chars , 256 , StringHash(SubString(s , 0 , 1))) * 0x1000000 + LoadInteger(trs_chars , 256 , StringHash(SubString(s , 1 , 2))) * 0x10000 + LoadInteger(trs_chars , 256 , StringHash(SubString(s , 2 , 3))) * 0x100 + LoadInteger(trs_chars , 256 , StringHash(SubString(s , 3 , 4)))
endfunction
function ASC2I takes string s returns integer
set esx = s
call ExecuteFunc("ASC2IExec")
return eax
endfunction
function S2HEXExec takes nothing returns nothing
local string s=esx
local integer sl=StringLength(s)
local integer i=1
local integer i2=0
local integer pow=0
loop
exitwhen i > sl
set pow = R2I(Pow(0x10 , sl - i))
set i2 = i2 + LoadInteger(trs_chars , 16 , StringHash(SubString(s , i - 1 , i))) * pow
set i = i + 1
endloop
set eax = i2
endfunction
function S2HEX takes string s returns integer
set esx = s
call ExecuteFunc("S2HEXExec")
return eax
endfunction
function S2HEXExec2 takes nothing returns nothing
local string s=esx
local integer sl=eax - eaxx
local integer i=1
local integer i2=0
local integer pow=0
loop
exitwhen i > sl
set pow = R2I(Pow(0x10 , sl - i))
set i2 = i2 + LoadInteger(trs_chars , 16 , StringHash(SubString(s , eaxx + i - 2 , eaxx + i - 1))) * pow
set i = i + 1
endloop
set eax = i2
endfunction
function S2HEX2 takes string s,integer min,integer max returns integer
set esx = s
set eaxx = min
set eax = max
call ExecuteFunc("S2HEXExec2")
return eax
endfunction
function ASC2IExec2 takes nothing returns nothing
local string s=esx
set eax = LoadInteger(trs_chars , 256 , StringHash(SubString(s , eaxx - 1 , eaxx))) * 0x1000000 + LoadInteger(trs_chars , 256 , StringHash(SubString(s , eaxx , eaxx + 1))) * 0x10000 + LoadInteger(trs_chars , 256 , StringHash(SubString(s , eaxx + 1 , eaxx + 2))) * 0x100 + LoadInteger(trs_chars , 256 , StringHash(SubString(s , eaxx + 2 , eaxx + 3)))
endfunction
function ASC2I2 takes string s,integer min returns integer
set esx = s
set eaxx = min
call ExecuteFunc("ASC2IExec2")
return eax
endfunction
function GetIntBitwiseBR takes string STR,integer a,integer b returns integer
local integer bc=b
local integer m=1
local integer t=0
local string s=null
loop
exitwhen bc <= a
set s = SubString(STR , bc - 1 , bc)
set t = t + ( S2I(s) * m )
if s == "-" then
set t = t * ( - 1 )
endif
set m = m * 10
set bc = bc - 1
endloop
return t
endfunction
function GetRealBitwiseBR takes string STR,integer a,integer b returns real
local integer bc=b
local real m=1.0
local real t=0.0
local real t2=0.0
local string s=null
loop
exitwhen bc <= a
set s = SubString(STR , bc - 1 , bc)
if s == "-" then
set t = t * ( - 1.0 )
set t2 = t2 * ( - 1.0 )
elseif s == "." then
set t2 = t / ( m )
set bc = bc - 1
set s = SubString(STR , bc - 1 , bc)
set m = 1.0
set t = 0.0
endif
set t = t + ( S2R(s) * m )
set m = m * 10.0
set bc = bc - 1
endloop
set t = t + t2
return t
endfunction
function DefaultPointersBR takes nothing returns nothing
set USPIsStringPointer = "$"
set USPDataSetPointer = "^"
set USPSetPointer = "="
set USPHexPointer = "0x"
set USPRealPointer = "."
set USPRAWPointer = "'"
set USPRandomPointer = "~"
set USPDynRandomPointer = "?"
set USPEndPointer = ";"
endfunction
function TcUSPBR takes integer h,string Exh,string STR,boolean Add,boolean Minus,string CusInt,string CusReal,string CusStr,boolean bitwise,gamecache gc returns nothing
local string CurToken=null
local string x2=null
local string temp=null
local string s2=null
local string Stat=null
local string sh=I2S(h) + Exh
local integer dset=0
local integer dn=0
local integer itemp=0
local integer imin=0
local integer imax=0
local integer pointer=0
local integer i=0
local integer lng=StringLength(STR)
local boolean min=false
local boolean hex=false
local boolean float=false
local boolean ansi=false
local boolean dyn=false
local boolean b=false
local real rmin=0
local real rmax=0
local real rtemp=0
if USPInited == false then
call ExecuteFunc("InitUSPBR")
endif
if gc == null then
set gc = USPData
endif
loop
exitwhen i > lng
set USParray = false
set USPStat = null
set USPsval = null
set USParrayindex = 0
set USPimin = 0
set USPimax = 0
set USPival = 0
set USPrmin = 0
set USPrmax = 0
set USPrval = 0
set USPdyn = false
set USPid = 0
set USPAdd = false
set USPMinus = false
set CurToken = SubString(STR , i , i + 1)
set s2 = SubString(STR , pointer , pointer + 1)
set x2 = SubString(STR , i , i + 2)
set b = s2 != USPIsStringPointer
if dset == 0 then
if CurToken == USPDataSetPointer then
set temp = SubString(STR , 0 , i)
if temp != "" then
call StoreString(gc , sh , "LongString" , temp)
endif
set pointer = i + 1
set dset = 1
endif
elseif dset == 1 then
if CurToken == USPDataSetPointer and b then
set pointer = i + 1
set dset = 2
elseif CurToken == USPSetPointer and b then
set Stat = SubString(STR , pointer , i)
set pointer = i + 1
elseif x2 == USPHexPointer and b then
set pointer = i + 2
set hex = true
elseif CurToken == USPRealPointer and b then
set float = true
elseif CurToken == USPRAWPointer and b then
if ansi == false then
set pointer = i + 1
endif
set ansi = true
elseif ( CurToken == USPRandomPointer or CurToken == USPDynRandomPointer ) and b then
if CurToken == USPDynRandomPointer then
set dyn = true
endif
if hex then
set imin = S2HEX2(STR , pointer + 1 , i + 1)
set rmin = imin
set hex = false
elseif ansi then
set imin = ASC2I2(STR , pointer + 1)
set rmin = imin
set ansi = false
elseif float then
if bitwise then
set rmin = GetRealBitwiseBR(STR , pointer , i)
else
set rmin = S2R(SubString(STR , pointer , i))
endif
else
if bitwise then
set imin = GetIntBitwiseBR(STR , pointer , i)
else
set imin = S2I(SubString(STR , pointer , i))
endif
set rmin = imin
endif
set pointer = i + 1
set min = true
elseif CurToken == USPEndPointer then
if b then
if hex then
set imax = S2HEX2(STR , pointer + 1 , i + 1)
set rmax = imax
set hex = false
elseif ansi then
set imax = ASC2I2(STR , pointer + 1)
set rmax = imax
set ansi = false
elseif float then
if bitwise then
set rmax = GetRealBitwiseBR(STR , pointer , i)
else
set rmax = S2R(SubString(STR , pointer , i))
endif
else
if bitwise then
set imax = GetIntBitwiseBR(STR , pointer , i)
else
set imax = S2I(SubString(STR , pointer , i))
endif
endif
if min then
if dyn then
if float then
if CusReal == null then
if Add then
if Minus then
call StoreReal(gc , sh , Stat + "min" , GetStoredReal(gc , sh , Stat + "min") - rmin)
call StoreReal(gc , sh , Stat + "max" , GetStoredReal(gc , sh , Stat + "max") - rmax)
else
call StoreReal(gc , sh , Stat + "min" , GetStoredReal(gc , sh , Stat + "min") + rmin)
call StoreReal(gc , sh , Stat + "max" , GetStoredReal(gc , sh , Stat + "max") + rmax)
endif
else
if Minus then
call StoreReal(gc , sh , Stat + "min" , - rmin)
call StoreReal(gc , sh , Stat + "max" , - rmax)
else
call StoreReal(gc , sh , Stat + "min" , rmin)
call StoreReal(gc , sh , Stat + "max" , rmax)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPival = 0
set USPrmin = rmin
set USPrmax = rmax
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = false
call ExecuteFunc(CusReal)
endif
else
if CusInt == null then
if Add then
if Minus then
call StoreInteger(gc , sh , Stat + "min" , GetStoredInteger(gc , sh , Stat + "min") - imin)
call StoreInteger(gc , sh , Stat + "max" , GetStoredInteger(gc , sh , Stat + "max") - imax)
else
call StoreInteger(gc , sh , Stat + "min" , GetStoredInteger(gc , sh , Stat + "min") + imin)
call StoreInteger(gc , sh , Stat + "max" , GetStoredInteger(gc , sh , Stat + "max") + imax)
endif
else
if Minus then
call StoreInteger(gc , sh , Stat + "min" , - imin)
call StoreInteger(gc , sh , Stat + "max" , - imax)
else
call StoreInteger(gc , sh , Stat + "min" , imin)
call StoreInteger(gc , sh , Stat + "max" , imax)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPimin = imin
set USPimax = imax
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = false
call ExecuteFunc(CusInt)
endif
endif
else
if float then
set rtemp = GetRandomReal(rmin , rmax)
else
set itemp = GetRandomInt(imin , imax)
endif
endif
else
if float then
set rtemp = rmax
else
set itemp = imax
endif
endif
if float then
if CusReal == null then
if Add then
if Minus then
call StoreReal(gc , sh , Stat , GetStoredReal(gc , sh , Stat) - rtemp)
else
call StoreReal(gc , sh , Stat , GetStoredReal(gc , sh , Stat) + rtemp)
endif
else
if Minus then
call StoreReal(gc , sh , Stat , - rtemp)
else
call StoreReal(gc , sh , Stat , rtemp)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPival = 0
set USPrval = rtemp
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = false
call ExecuteFunc(CusReal)
endif
else
if CusInt == null then
if Add then
if Minus then
call StoreInteger(gc , sh , Stat , GetStoredInteger(gc , sh , Stat) - itemp)
else
call StoreInteger(gc , sh , Stat , GetStoredInteger(gc , sh , Stat) + itemp)
endif
else
if Minus then
call StoreInteger(gc , sh , Stat , - itemp)
else
call StoreInteger(gc , sh , Stat , itemp)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPrval = 0
set USPival = itemp
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = false
call ExecuteFunc(CusInt)
endif
endif
else
if not b then
set temp = SubString(STR , pointer + 1 , i)
else
set temp = SubString(STR , pointer , i)
endif
if CusStr == null then
call StoreString(gc , sh , Stat , temp)
else
set USPStat = Stat
set USPival = 0
set USPrval = 0
set USPsval = temp
set USPid = h
set USParray = false
call ExecuteFunc(CusStr)
endif
endif
if dyn then
call StoreBoolean(gc , sh , Stat , true)
else
call StoreBoolean(gc , sh , Stat , false)
endif
set imin = 0
set imax = 0
set float = false
set min = false
set dyn = false
set pointer = i + 1
endif
elseif dset == 2 then
if CurToken == USPSetPointer and b then
set Stat = SubString(STR , pointer , i)
set dn = 1
set pointer = i + 1
elseif x2 == USPHexPointer and b then
set pointer = i + 2
set hex = true
elseif CurToken == USPRealPointer and b then
set float = true
elseif CurToken == USPRAWPointer and b then
if ansi == false then
set pointer = i + 1
endif
set ansi = true
elseif ( CurToken == USPRandomPointer or CurToken == USPDynRandomPointer ) and b then
if CurToken == USPDynRandomPointer then
set dyn = true
endif
if hex then
set imin = S2HEX2(STR , pointer + 1 , i + 1)
set rmin = imin
set hex = false
elseif ansi then
set imin = ASC2I2(STR , pointer + 1)
set rmin = imin
set ansi = false
elseif float then
if bitwise then
set rmin = GetRealBitwiseBR(STR , pointer , i)
else
set rmin = S2R(SubString(STR , pointer , i))
endif
else
if bitwise then
set imin = GetIntBitwiseBR(STR , pointer , i)
else
set imin = S2I(SubString(STR , pointer , i))
endif
set rmin = imin
endif
set pointer = i + 1
set min = true
elseif CurToken == USPEndPointer then
if b then
if hex then
set imax = S2HEX2(STR , pointer + 1 , i + 1)
set rmax = imax
set hex = false
elseif ansi then
set imax = ASC2I2(STR , pointer + 1)
set rmax = imax
set ansi = false
elseif float then
if bitwise then
set rmax = GetRealBitwiseBR(STR , pointer , i)
else
set rmax = S2R(SubString(STR , pointer , i))
endif
else
if bitwise then
set imax = GetIntBitwiseBR(STR , pointer , i)
else
set imax = S2I(SubString(STR , pointer , i))
endif
endif
if min then
if dyn then
if float then
if CusReal == null then
if Add then
if Minus then
call StoreReal(gc , sh , Stat + I2S(dn) + "min" , GetStoredReal(gc , sh , Stat + I2S(dn) + "min") - rmin)
call StoreReal(gc , sh , Stat + I2S(dn) + "max" , GetStoredReal(gc , sh , Stat + I2S(dn) + "max") - rmax)
else
call StoreReal(gc , sh , Stat + I2S(dn) + "min" , GetStoredReal(gc , sh , Stat + I2S(dn) + "min") + rmin)
call StoreReal(gc , sh , Stat + I2S(dn) + "max" , GetStoredReal(gc , sh , Stat + I2S(dn) + "max") + rmax)
endif
else
if Minus then
call StoreReal(gc , sh , Stat + I2S(dn) + "min" , - rmin)
call StoreReal(gc , sh , Stat + I2S(dn) + "max" , - rmax)
else
call StoreReal(gc , sh , Stat + I2S(dn) + "min" , rmin)
call StoreReal(gc , sh , Stat + I2S(dn) + "max" , rmax)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPrmin = rmin
set USPrmax = rmax
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = true
set USParrayindex = dn
call ExecuteFunc(CusReal)
endif
else
if CusInt == null then
if Add then
if Minus then
call StoreInteger(gc , sh , Stat + I2S(dn) + "min" , GetStoredInteger(gc , sh , Stat + I2S(dn) + "min") - imin)
call StoreInteger(gc , sh , Stat + I2S(dn) + "max" , GetStoredInteger(gc , sh , Stat + I2S(dn) + "max") - imax)
else
call StoreInteger(gc , sh , Stat + I2S(dn) + "min" , GetStoredInteger(gc , sh , Stat + I2S(dn) + "min") + imin)
call StoreInteger(gc , sh , Stat + I2S(dn) + "max" , GetStoredInteger(gc , sh , Stat + I2S(dn) + "max") + imax)
endif
else
if Minus then
call StoreInteger(gc , sh , Stat + I2S(dn) + "min" , - imin)
call StoreInteger(gc , sh , Stat + I2S(dn) + "max" , - imax)
else
call StoreInteger(gc , sh , Stat + I2S(dn) + "min" , imin)
call StoreInteger(gc , sh , Stat + I2S(dn) + "max" , imax)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPimin = imin
set USPimax = imax
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = true
set USParrayindex = dn
call ExecuteFunc(CusInt)
endif
endif
else
if float then
set rtemp = GetRandomReal(rmin , rmax)
else
set itemp = GetRandomInt(imin , imax)
endif
endif
else
if float then
set rtemp = rmax
else
set itemp = imax
endif
endif
if float then
if CusReal == null then
if Add then
if Minus then
call StoreReal(gc , sh , Stat + I2S(dn) , GetStoredReal(gc , sh , Stat + I2S(dn)) - rtemp)
else
call StoreReal(gc , sh , Stat + I2S(dn) , GetStoredReal(gc , sh , Stat + I2S(dn)) + rtemp)
endif
else
if Minus then
call StoreReal(gc , sh , Stat + I2S(dn) , - rtemp)
else
call StoreReal(gc , sh , Stat + I2S(dn) , rtemp)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPrval = rtemp
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = true
set USParrayindex = dn
call ExecuteFunc(CusInt)
endif
else
if CusInt == null then
if Add then
if Minus then
call StoreInteger(gc , sh , Stat + I2S(dn) , GetStoredInteger(gc , sh , Stat + I2S(dn)) - itemp)
else
call StoreInteger(gc , sh , Stat + I2S(dn) , GetStoredInteger(gc , sh , Stat + I2S(dn)) + itemp)
endif
else
if Minus then
call StoreInteger(gc , sh , Stat + I2S(dn) , - itemp)
else
call StoreInteger(gc , sh , Stat + I2S(dn) , itemp)
endif
endif
else
set USPStat = Stat
set USPsval = null
set USPival = itemp
set USPdyn = dyn
set USPid = h
set USPAdd = Add
set USPMinus = Minus
set USParray = true
set USParrayindex = dn
call ExecuteFunc(CusInt)
endif
endif
else
if not b then
set temp = SubString(STR , pointer + 1 , i)
else
set temp = SubString(STR , pointer , i)
endif
if CusStr == null then
call StoreString(gc , sh , Stat + I2S(dn) , temp)
else
set USPStat = Stat
set USPsval = temp
set USPid = h
set USParray = true
set USParrayindex = dn
call ExecuteFunc(CusStr)
endif
endif
if dyn then
call StoreBoolean(gc , sh , Stat + I2S(dn) , true)
else
call StoreBoolean(gc , sh , Stat + I2S(dn) , false)
endif
set imin = 0
set imax = 0
set float = false
set min = false
set dyn = false
set pointer = i + 1
set dn = dn + 1
endif
endif
set i = i + 1
endloop
endfunction
function SetupBRExec takes nothing returns nothing
call TcUSPBR(ax , null , sx , false , false , null , null , null , false , null)
endfunction
function SetupBR takes integer i,string s returns nothing
set sx = s
set ax = i
call ExecuteFunc("SetupBRExec")
endfunction
function GetIntBR takes integer i,string stat returns integer
local string s=I2S(i)
if GetStoredBoolean(USPData , s , stat) then
return GetRandomInt(GetStoredInteger(USPData , s , stat + "min") , GetStoredInteger(USPData , s , stat + "max"))
else
return GetStoredInteger(USPData , s , stat)
endif
return 0
endfunction
function GetSubIntBR takes integer i,string stat,integer i2 returns integer
local string s=I2S(i)
if GetStoredBoolean(USPData , s , stat + I2S(i2)) then
return GetRandomInt(GetStoredInteger(USPData , s , stat + I2S(i2) + "min") , GetStoredInteger(USPData , s , stat + I2S(i2) + "max"))
else
return GetStoredInteger(USPData , s , stat + I2S(i2))
endif
return 0
endfunction
function GetRealBR takes integer i,string stat returns real
local string s=I2S(i)
if GetStoredBoolean(USPData , s , stat) then
return GetRandomReal(GetStoredReal(USPData , s , stat + "min") , GetStoredReal(USPData , s , stat + "max"))
else
return GetStoredReal(USPData , s , stat)
endif
return 0.0
endfunction
function GetSubRealBR takes integer i,string stat,integer i2 returns real
local string s=I2S(i)
local string s2=stat + I2S(i2)
if GetStoredBoolean(USPData , s , s2) then
return GetRandomReal(GetStoredReal(USPData , s , s2 + "min") , GetStoredReal(USPData , s , s2 + "max"))
else
return GetStoredReal(USPData , s , s2)
endif
return 0.0
endfunction
function GetStrBR takes integer i,string stat returns string
return GetStoredString(USPData , I2S(i) , stat)
endfunction
function GetExtraStrBR takes integer i returns string
return GetStoredString(USPData , I2S(i) , "LongString")
endfunction
function GetSubStrBR takes integer i,string stat,integer i2 returns string
return GetStoredString(USPData , I2S(i) , stat + I2S(i2))
endfunction
function CustomMBsInitsBR takes nothing returns nothing
local integer i=1
local integer i2=1
local integer max=40 * mb_max_plr
loop
exitwhen i > max
set XMB[i]=CreateMultiboard()
call MultiboardSetRowCount(XMB[i] , i2)
call MultiboardSetColumnCount(XMB[i] , XMBColumns)
call MultiboardMinimize(XMB[i] , true)
set i = i + 1
set i2 = i2 + 1
if i2 > 40 then
set i2 = 1
endif
endloop
call DestroyTimer(GetExpiredTimer())
endfunction
function CustomInitializationBR takes nothing returns nothing
set XDG = InitGameCache("XDG.bx")
set cache = InitGameCache("DefaultGameCache.bx")
set TRS = InitGameCache("TRS.bx")
set TRSInv = InitGameCache("TRSInv.bx")
set TRSItems = InitGameCache("TRSItems.bx")
set TPC = InitGameCache("TPC.bx")
set TRS_hash = InitHashtable()
set MapBoundMinX = GetCameraBoundMinX()
set MapBoundMinY = GetCameraBoundMinY()
set MapBoundMaxX = GetCameraBoundMaxX()
set MapBoundMaxY = GetCameraBoundMaxY()
set tmploc = Location(0 , 0)
call TimerStart(CreateTimer() , 0 , false , function CustomMBsInitsBR)
endfunction
function DefaultPointersBR2 takes nothing returns nothing
set USPIsStringPointer = "$"
set USPDataSetPointer = "^"
set USPSetPointer = "="
set USPHexPointer = "0x"
set USPRealPointer = "."
set USPRAWPointer = "'"
set USPRandomPointer = "~"
set USPDynRandomPointer = "?"
set USPEndPointer = ";"
endfunction
function EvalFunc takes boolexpr be returns boolean
if Executer == null then
set Executer = CreateTrigger()
endif
set ExecuterCond = TriggerAddCondition(Executer , be)
set ExecResult = TriggerEvaluate(Executer)
call TriggerRemoveCondition(Executer , ExecuterCond)
set ExecuterCond = null
return ExecResult
endfunction
constant function nonull takes string s returns string
if s == null then
set s = ""
endif
return s
endfunction
constant function s2s takes string s returns string
return s
endfunction
function UpdateParamBR takes unit u,integer param,integer i returns nothing
local integer abil=TRSSubAbils[param]
local integer id=TRSSubAbilsId[abil]
local integer t=0
local integer d=TRSSubAbilsMaxVal[abil]
local integer count=TRSSubAbilsSize[param]
if TRSAbilsMultId[param] != null then
set i = R2I(AddPercentBonus(i , GetStoredInteger(TRSItems , I2S((GetHandleId((u)))) , TRSAbilsMultId[param]))) // INLINED!!
endif
if i > - 1 then
loop
exitwhen count < 1
set t = id + 0x1 + log2(d)
call UnitRemoveAbility(u , TRSSubAbilsParam[t])
call UnitRemoveAbility(u , TRSSubAbilsParam[id - 0x1 - log2(d)])
if i >= d then
call UnitAddAbilityBR(u , TRSSubAbilsParam[t])
set i = i - d
endif
set d = d / 2
set count = count - 1
endloop
elseif i < 0 then
set d = TRSSubAbilsMinVal[abil]
loop
exitwhen count < 1
set t = id - 0x1 - log2(- d)
call UnitRemoveAbility(u , TRSSubAbilsParam[t])
call UnitRemoveAbility(u , TRSSubAbilsParam[id + 0x1 + log2(- d)])
if i <= d then
call UnitAddAbilityBR(u , TRSSubAbilsParam[t])
set i = i - d
endif
set d = d / 2
set count = count - 1
endloop
endif
endfunction
function AbilParserBR takes unit u returns nothing
local integer i=1
local integer count=TRSSubAbilsCount
loop
exitwhen i > count
call UpdateParamBR(u , TRSSubAbilsNum[i] , GetStoredInteger(TRSItems , I2S((GetHandleId((u)))) , "Prop" + I2S(TRSSubAbilsNum[i]) + "Par")) // INLINED!!
set i = i + 1
endloop
endfunction
function ItemAbilParserBR takes unit u,boolean update returns nothing
local integer i=1
local integer prop=0
local integer count=TRSAbilsToUpdateMax
loop
exitwhen i > count
set prop = TRSAbilsToUpdate[i]
set TRSAbilsToUpdate[i]=0
set TRSAbilsToUpdateUsed[prop]=false
if update then
call UpdateParamBR(u , prop , GetStoredInteger(TRSItems , I2S((GetHandleId((u)))) , "Prop" + I2S(prop) + "Par")) // INLINED!!
endif
set i = i + 1
endloop
endfunction
function FreeCustomItemID takes integer i returns nothing
if i > 0 and GetStoredBoolean(TRS , "CustomId" , "Used" + I2S(i)) == true then
call StoreInteger(TRS , "CustomId" , "MaxFree" , GetStoredInteger(TRS , "CustomId" , "MaxFree") + 1)
call StoreInteger(TRS , "CustomId" , "MaxFreeSlot" + I2S(GetStoredInteger(TRS , "CustomId" , "MaxFree")) , i)
call StoreBoolean(TRS , "CustomId" , "Used" + I2S(i) , false)
endif
endfunction
function GetCustomItemID takes nothing returns integer
local integer i=0
if GetStoredInteger(TRS , "CustomId" , "MaxFree") > 0 then
set i = GetStoredInteger(TRS , "CustomId" , "MaxFreeSlot" + I2S(GetStoredInteger(TRS , "CustomId" , "MaxFree")))
call StoreInteger(TRS , "CustomId" , "MaxFree" , GetStoredInteger(TRS , "CustomId" , "MaxFree") - 1)
call StoreBoolean(TRS , "CustomId" , "Used" + I2S(i) , true)
return i
endif
call StoreInteger(TRS , "CustomId" , "Max" , GetStoredInteger(TRS , "CustomId" , "Max") + 1)
call StoreBoolean(TRS , "CustomId" , "Used" + I2S(GetStoredInteger(TRS , "CustomId" , "Max")) , true)
return GetStoredInteger(TRS , "CustomId" , "Max")
endfunction
function FreeCustomInvID takes integer i returns nothing
if i > 0 and GetStoredBoolean(TRS , "CustomInvId" , "Used" + I2S(i)) == true then
call StoreInteger(TRS , "CustomInvId" , "MaxFree" , GetStoredInteger(TRS , "CustomInvId" , "MaxFree") + 1)
call StoreInteger(TRS , "CustomInvId" , "MaxFreeSlot" + I2S(GetStoredInteger(TRS , "CustomInvId" , "MaxFree")) , i)
call StoreBoolean(TRS , "CustomInvId" , "Used" + I2S(i) , false)
endif
endfunction
function GetCustomInvID takes nothing returns integer
local integer i=0
if GetStoredInteger(TRS , "CustomInvId" , "MaxFree") > 0 then
set i = GetStoredInteger(TRS , "CustomInvId" , "MaxFreeSlot" + I2S(GetStoredInteger(TRS , "CustomInvId" , "MaxFree")))
call StoreInteger(TRS , "CustomInvId" , "MaxFree" , GetStoredInteger(TRS , "CustomInvId" , "MaxFree") - 1)
call StoreBoolean(TRS , "CustomInvId" , "Used" + I2S(i) , true)
return i
endif
if GetStoredInteger(TRS , "CustomInvId" , "Max") == 0 then
call StoreInteger(TRS , "CustomInvId" , "Max" , 1000000)
endif
call StoreInteger(TRS , "CustomInvId" , "Max" , GetStoredInteger(TRS , "CustomInvId" , "Max") + 1)
call StoreBoolean(TRS , "CustomInvId" , "Used" + I2S(GetStoredInteger(TRS , "CustomInvId" , "Max")) , true)
return GetStoredInteger(TRS , "CustomInvId" , "Max")
endfunction
function TRSGetInvBR takes unit u returns string
local string su=I2S((GetHandleId((u)))) // INLINED!!
local string s=GetStoredString(TRSInv , su , "BXTRSINV")
if s == null then
set s = "Inv" + I2S(GetCustomInvID())
call StoreString(TRSInv , su , "BXTRSINV" , s)
endif
return s
endfunction
function GetFreeParamStackIndexBR takes string s,string pro returns integer
local string s1=pro + "StackMax"
call StoreInteger(TRSItems , s , s1 , GetStoredInteger(TRSItems , s , s1) + 1)
return GetStoredInteger(TRSItems , s , s1)
endfunction
function SetFreeParamStackIndexBR takes string s,string pro,integer slot returns nothing
local string s1=pro + "Stack"
local integer i=GetStoredInteger(TRSItems , s , pro + "StackMax")
if slot < i then
call StoreInteger(TRSItems , s , pro + "s" + I2S(GetStoredInteger(TRSItems , s , s1 + I2S(i))) + "Slot" , slot)
call StoreInteger(TRSItems , s , s1 + I2S(slot) , GetStoredInteger(TRSItems , s , s1 + I2S(i)))
endif
call StoreInteger(TRSItems , s , s1 + I2S(i) , 0)
call StoreInteger(TRSItems , s , pro + "StackMax" , i - 1)
endfunction
function SetParamBR takes string s,string id,integer prop,integer num,integer mod returns nothing
local string pro=I2S(prop)
local string pro2="Prop" + I2S(num)
local integer i2=0
local integer i3=0
local integer i4=0
local integer i5=0
local integer par=GetStoredInteger(TRSItems , id , pro2 + "Par")
local integer min=GetStoredInteger(TRSItems , id , pro2 + "Min")
local integer max=GetStoredInteger(TRSItems , id , pro2 + "Max")
local integer t=GetIntBR(0x3E78 , pro)
set pro = "Prop" + pro
if mod == 1 then
if t == 1 or t == 0 then
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") + min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") + par)
if TRSSubAbils[prop] > 0 and not TRSAbilsToUpdateUsed[prop] then
set TRSAbilsToUpdateUsed[prop]=true
set TRSAbilsToUpdateMax = TRSAbilsToUpdateMax + 1
set TRSAbilsToUpdate[TRSAbilsToUpdateMax]=prop
endif
elseif t == 2 then
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") + par)
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") + min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") + max)
set i3 = GetStoredInteger(TRSItems , id , pro + "Count")
if i3 <= 0 then
set i3 = 1
endif
call StoreInteger(TRSItems , s , pro + "Count" , GetStoredInteger(TRSItems , s , pro + "Count") + i3)
elseif t == 3 or t == 4 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Slot" , i2)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") + GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count"))
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") + min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
elseif t == 5 or t == 7 then
set i5 = GetIntBR(0x3E77 , I2S(prop))
if i5 < 1 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Slot" , i2)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") + GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count"))
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") + min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
endif
if TRSToExecExist[par] then
set TRSToExecMax = TRSToExecPos[par]
set TRSMin1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Min")
set TRSMax1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Max")
set TRSParS1[TRSToExecMax]=par
set TRSMinS1[TRSToExecMax]=min
set TRSMaxS1[TRSToExecMax]=max
else
set TRSToExecMax = TRSToExecMax + 1
set TRSToExecPos[par]=TRSToExecMax
set TRSToExecExist[par]=true
set TRSPar1[TRSToExecMax]=par
set TRSMin1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Min")
set TRSMax1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Max")
set TRSParS1[TRSToExecMax]=par
set TRSMinS1[TRSToExecMax]=min
set TRSMaxS1[TRSToExecMax]=max
endif
elseif t == 6 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Slot" , i2)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") + GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count"))
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") + min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") + max)
set min = ASC2I(GetAbilityEffectById(par , EFFECT_TYPE_EFFECT , 2))
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
if GetUnitAbilityLevel(TRSUnit , par) == 0 then
call UnitAddAbilityBR(TRSUnit , par)
endif
if GetStoredInteger(TRSItems , s , pro2 + "Max") > 0 then
if min > 0 then
call SetUnitAbilityLevel(TRSUnit , min , GetStoredInteger(TRSItems , s , pro2 + "Max"))
call UnitMakeAbilityPermanent(TRSUnit , true , min)
else
call SetUnitAbilityLevel(TRSUnit , par , GetStoredInteger(TRSItems , s , pro2 + "Max"))
endif
else
call UnitRemoveAbility(TRSUnit , par)
endif
endif
elseif mod == 2 then
if t == 1 or t == 0 then
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") - min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") - max)
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") - par)
if TRSSubAbils[prop] > 0 and not TRSAbilsToUpdateUsed[prop] then
set TRSAbilsToUpdateUsed[prop]=true
set TRSAbilsToUpdateMax = TRSAbilsToUpdateMax + 1
set TRSAbilsToUpdate[TRSAbilsToUpdateMax]=prop
endif
elseif t == 2 then
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") - par)
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") - min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") - max)
set i3 = GetStoredInteger(TRSItems , id , pro + "Count")
if i3 <= 0 then
set i3 = 1
endif
call StoreInteger(TRSItems , s , pro + "Count" , GetStoredInteger(TRSItems , s , pro + "Count") - i3)
elseif t == 3 or t == 4 then
set pro2 = pro + "s" + I2S(par)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") - GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count"))
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") - min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") - max)
if GetStoredInteger(TRSItems , s , pro2 + "Count") <= 0 then
call SetFreeParamStackIndexBR(s , pro , GetStoredInteger(TRSItems , s , pro2 + "Slot"))
endif
elseif t == 5 or t == 7 then
set i5 = GetIntBR(0x3E77 , I2S(prop))
if i5 < 1 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") - GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count"))
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") - min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") - max)
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
endif
if TRSToExecExist[par] then
set TRSToExecMax = TRSToExecPos[par]
set TRSMin1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Min")
set TRSMax1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Max")
set TRSParS1[TRSToExecMax]=par
set TRSMinS1[TRSToExecMax]=min
set TRSMaxS1[TRSToExecMax]=max
else
set TRSToExecMax = TRSToExecMax + 1
set TRSToExecPos[par]=TRSToExecMax
set TRSToExecExist[par]=true
set TRSPar1[TRSToExecMax]=par
set TRSMin1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Min")
set TRSMax1[TRSToExecMax]=GetStoredInteger(TRSItems , s , pro2 + "Max")
set TRSParS1[TRSToExecMax]=par
set TRSMinS1[TRSToExecMax]=min
set TRSMaxS1[TRSToExecMax]=max
endif
if GetStoredInteger(TRSItems , s , pro2 + "Count") <= 0 then
call SetFreeParamStackIndexBR(s , pro , GetStoredInteger(TRSItems , s , pro2 + "Slot"))
endif
elseif t == 6 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") - GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count"))
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") - min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") - max)
set min = ASC2I(GetAbilityEffectById(par , EFFECT_TYPE_EFFECT , 2))
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
if GetUnitAbilityLevel(TRSUnit , par) == 0 then
call UnitAddAbilityBR(TRSUnit , par)
endif
if GetStoredInteger(TRSItems , s , pro2 + "Max") > 0 then
if min > 0 then
call SetUnitAbilityLevel(TRSUnit , min , GetStoredInteger(TRSItems , s , pro2 + "Max"))
call UnitMakeAbilityPermanent(TRSUnit , true , min)
else
call SetUnitAbilityLevel(TRSUnit , par , GetStoredInteger(TRSItems , s , pro2 + "Max"))
endif
else
call UnitRemoveAbility(TRSUnit , par)
endif
if GetStoredInteger(TRSItems , s , pro2 + "Count") <= 0 then
call SetFreeParamStackIndexBR(s , pro , GetStoredInteger(TRSItems , s , pro2 + "Slot"))
endif
endif
endif
endfunction
function UnitAddBonusBR takes unit u,integer prop,integer par,integer min,integer max,integer mod returns nothing
local string s=I2S((GetHandleId((u)))) // INLINED!!
local string pro=I2S(prop)
local string pro2=null
local integer i2=0
local integer i3=0
local integer i4=0
local integer i5=0
local integer t=GetIntBR(0x3E78 , pro)
set pro = "Prop" + pro
if mod == 1 then
if t == 1 or t == 0 then
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") + min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") + par)
elseif t == 2 then
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") + par)
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") + min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Count" , GetStoredInteger(TRSItems , s , pro + "Count") + 1)
elseif t == 3 or t == 4 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Slot" , i2)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") + 1)
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") + min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
elseif t == 5 or t == 7 then
set i5 = GetIntBR(0x3E77 , I2S(prop))
if i5 < 1 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Slot" , i2)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") + 1)
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") + min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") + max)
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
endif
set TRSPar = par
set TRSMin = GetStoredInteger(TRSItems , s , pro2 + "Min")
set TRSMax = GetStoredInteger(TRSItems , s , pro2 + "Max")
set TRSParS = par
set TRSMinS = min
set TRSMaxS = max
if TRSCusFuncs[par] != null then
call ExecuteFunc(TRSCusFuncs[TRSPar])
endif
elseif t == 6 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Slot" , i2)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") + 1)
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") + min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") + max)
set min = ASC2I(GetAbilityEffectById(par , EFFECT_TYPE_EFFECT , 2))
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
if GetUnitAbilityLevel(u , par) == 0 then
call UnitAddAbilityBR(u , par)
endif
if GetStoredInteger(TRSItems , s , pro2 + "Max") > 0 then
if min > 0 then
call SetUnitAbilityLevel(u , min , GetStoredInteger(TRSItems , s , pro2 + "Max"))
call UnitMakeAbilityPermanent(u , true , min)
else
call SetUnitAbilityLevel(u , par , GetStoredInteger(TRSItems , s , pro2 + "Max"))
endif
else
call UnitRemoveAbility(u , par)
endif
endif
elseif mod == 2 then
if t == 1 or t == 0 then
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") - min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") - max)
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") - par)
elseif t == 2 then
call StoreInteger(TRSItems , s , pro + "Par" , GetStoredInteger(TRSItems , s , pro + "Par") - par)
call StoreInteger(TRSItems , s , pro + "Min" , GetStoredInteger(TRSItems , s , pro + "Min") - min)
call StoreInteger(TRSItems , s , pro + "Max" , GetStoredInteger(TRSItems , s , pro + "Max") - max)
call StoreInteger(TRSItems , s , pro + "Count" , GetStoredInteger(TRSItems , s , pro + "Count") - 1)
elseif t == 3 or t == 4 then
set pro2 = pro + "s" + I2S(par)
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") - 1)
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") - min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") - max)
if GetStoredInteger(TRSItems , s , pro2 + "Count") <= 0 then
call SetFreeParamStackIndexBR(s , pro , GetStoredInteger(TRSItems , s , pro2 + "Slot"))
endif
elseif t == 5 or t == 7 then
set i5 = GetIntBR(0x3E77 , I2S(prop))
if i5 < 1 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") - 1)
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") - min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") - max)
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
endif
set TRSPar = par
set TRSMin = GetStoredInteger(TRSItems , s , pro2 + "Min")
set TRSMax = GetStoredInteger(TRSItems , s , pro2 + "Max")
set TRSParS = par
set TRSMinS = min
set TRSMaxS = max
if TRSCusFuncs[par] != null then
call ExecuteFunc(TRSCusFuncs[TRSPar])
endif
if GetStoredInteger(TRSItems , s , pro2 + "Count") <= 0 then
call SetFreeParamStackIndexBR(s , pro , GetStoredInteger(TRSItems , s , pro2 + "Slot"))
endif
elseif t == 6 then
set pro2 = pro + "s" + I2S(par)
if GetStoredInteger(TRSItems , s , pro2 + "Count") > 0 then
set i2 = GetStoredInteger(TRSItems , s , pro2 + "Slot")
else
set i2 = GetFreeParamStackIndexBR(s , pro)
endif
call StoreInteger(TRSItems , s , pro2 + "Count" , GetStoredInteger(TRSItems , s , pro2 + "Count") - 1)
call StoreInteger(TRSItems , s , pro2 + "Par" , par)
call StoreInteger(TRSItems , s , pro2 + "Min" , GetStoredInteger(TRSItems , s , pro2 + "Min") - min)
call StoreInteger(TRSItems , s , pro2 + "Max" , GetStoredInteger(TRSItems , s , pro2 + "Max") - max)
set min = ASC2I(GetAbilityEffectById(par , EFFECT_TYPE_EFFECT , 2))
call StoreInteger(TRSItems , s , pro + "Stack" + I2S(i2) , par)
if GetUnitAbilityLevel(u , par) == 0 then
call UnitAddAbilityBR(u , par)
endif
if GetStoredInteger(TRSItems , s , pro2 + "Max") > 0 then
if min > 0 then
call SetUnitAbilityLevel(u , min , GetStoredInteger(TRSItems , s , pro2 + "Max"))
call UnitMakeAbilityPermanent(u , true , min)
else
call SetUnitAbilityLevel(u , par , GetStoredInteger(TRSItems , s , pro2 + "Max"))
endif
else
call UnitRemoveAbility(u , par)
endif
if GetStoredInteger(TRSItems , s , pro2 + "Count") <= 0 then
call SetFreeParamStackIndexBR(s , pro , GetStoredInteger(TRSItems , s , pro2 + "Slot"))
endif
endif
endif
endfunction
function TRSAddPropItem takes string id,integer istat,integer Par,integer Min,integer Max,integer mod returns nothing
local string stat=I2S(istat)
local integer t=GetIntBR(0x3E78 , stat)
local integer i=GetStoredInteger(TRSItems , id , "maxstats")
local integer temp=0
local string prop=""
local string prop2=stat + "s" + I2S(Par)
if i < 1 then
set i = 1
endif
set prop = "Prop" + I2S(i)
if mod == 1 then
if t == 0 or t == 1 or t == 2 then
if GetStoredInteger(TRSItems , id , stat) > 0 then
set i = GetStoredInteger(TRSItems , id , stat)
else
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , prop , istat)
endif
set prop = "Prop" + I2S(i)
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") + Min)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") + Max)
if t == 1 and not TRSCopying then
call StoreInteger(TRSItems , id , prop + "Par" , GetStoredInteger(TRSItems , id , prop + "Par") + GetRandomInt(Min , Max))
else
call StoreInteger(TRSItems , id , prop + "Par" , GetStoredInteger(TRSItems , id , prop + "Par") + Par)
endif
call StoreInteger(TRSItems , id , prop + "Count" , GetStoredInteger(TRSItems , id , prop + "Count") + 1)
elseif t == 3 or t == 5 then
if GetStoredInteger(TRSItems , id , prop2) > 0 then
set i = GetStoredInteger(TRSItems , id , prop2)
else
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , prop , istat)
endif
set prop = "Prop" + I2S(i)
call StoreInteger(TRSItems , id , prop2 , i)
call StoreInteger(TRSItems , id , prop + "Par" , Par)
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") + Min)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") + Max)
call StoreInteger(TRSItems , id , prop + "Count" , GetStoredInteger(TRSItems , id , prop + "Count") + 1)
elseif t == 4 or t == 7 or t == 6 then
if GetStoredInteger(TRSItems , id , prop2) > 0 then
set i = GetStoredInteger(TRSItems , id , prop2)
else
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , prop , istat)
endif
set prop = "Prop" + I2S(i)
call StoreInteger(TRSItems , id , prop2 , i)
call StoreInteger(TRSItems , id , prop + "Par" , Par)
if not TRSCopying then
set temp = GetRandomInt(Min , Max)
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") + temp)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") + temp)
else
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") + Min)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") + Max)
endif
call StoreInteger(TRSItems , id , prop + "Count" , GetStoredInteger(TRSItems , id , prop + "Count") + 1)
endif
elseif mod == 2 then
if t == 0 or t == 1 or t == 2 then
if GetStoredInteger(TRSItems , id , stat) > 0 then
set i = GetStoredInteger(TRSItems , id , stat)
else
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , prop , istat)
endif
set prop = "Prop" + I2S(i)
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") - Min)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") - Max)
if t == 1 and not TRSCopying then
call StoreInteger(TRSItems , id , prop + "Par" , GetStoredInteger(TRSItems , id , prop + "Par") - GetRandomInt(Min , Max))
else
call StoreInteger(TRSItems , id , prop + "Par" , GetStoredInteger(TRSItems , id , prop + "Par") - Par)
endif
call StoreInteger(TRSItems , id , prop + "Count" , GetStoredInteger(TRSItems , id , prop + "Count") - 1)
elseif t == 3 or t == 5 then
if GetStoredInteger(TRSItems , id , prop2) > 0 then
set i = GetStoredInteger(TRSItems , id , prop2)
else
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , prop , istat)
endif
set prop = "Prop" + I2S(i)
call StoreInteger(TRSItems , id , prop2 , i)
call StoreInteger(TRSItems , id , prop + "Par" , Par)
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") - Min)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") - Max)
call StoreInteger(TRSItems , id , prop + "Count" , GetStoredInteger(TRSItems , id , prop + "Count") - 1)
elseif t == 4 or t == 7 or t == 6 then
if GetStoredInteger(TRSItems , id , prop2) > 0 then
set i = GetStoredInteger(TRSItems , id , prop2)
else
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , prop , istat)
endif
set prop = "Prop" + I2S(i)
call StoreInteger(TRSItems , id , prop2 , i)
call StoreInteger(TRSItems , id , prop + "Par" , Par)
if not TRSCopying then
set temp = GetRandomInt(Min , Max)
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") - temp)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") - temp)
else
call StoreInteger(TRSItems , id , prop + "Min" , GetStoredInteger(TRSItems , id , prop + "Min") - Min)
call StoreInteger(TRSItems , id , prop + "Max" , GetStoredInteger(TRSItems , id , prop + "Max") - Max)
endif
call StoreInteger(TRSItems , id , prop + "Count" , GetStoredInteger(TRSItems , id , prop + "Count") - 1)
endif
endif
endfunction
function CleanItemParBR takes string h,boolean incgen returns nothing
local integer i=GetStoredInteger(TRSItems , h , "MaxGems")
local integer c=0
local string s=h + "Soc"
call FlushStoredMission(TRSItems , h)
call FlushStoredMission(TRSInv , h)
if incgen then
call FlushStoredMission(TRSItems , h + "Gen")
endif
call FlushStoredMission(TRSItems , h + "Ex")
loop
exitwhen c > i
call FlushStoredMission(TRSItems , s + I2S(c))
call FlushStoredMission(TRSItems , s + I2S(c) + "Gen")
call FlushStoredMission(TRSItems , s + I2S(c) + "Ex")
set c = c + 1
endloop
endfunction
function PreGenerateParBR takes string id,string h returns nothing
local integer i=1
local integer i2=0
local integer t=0
local string sh=nonull(h) + "Gen"
local string p=""
local integer count=GetStoredInteger(TRSItems , id , "maxstats")
if count > 0 and not GetStoredBoolean(TRSItems , sh , "IsPregen") then
loop
exitwhen i >= count
set p = "Prop" + I2S(i)
set i2 = GetStoredInteger(TRSItems , id , p)
set t = GetIntBR(0x3E78 , I2S(i2))
if t == 1 then
if not GetStoredBoolean(TRSItems , sh , p + "IsGen") then
call StoreInteger(TRSItems , sh , p + "Par" , GetRandomInt(GetStoredInteger(TRSItems , id , p + "Min") , GetStoredInteger(TRSItems , id , p + "Max")))
call StoreInteger(TRSItems , sh , p + "Count" , GetStoredInteger(TRSItems , sh , p + "Count") + 1)
call StoreBoolean(TRSItems , sh , p + "IsGen" , true)
endif
elseif t == 4 or t == 6 or t == 7 then
if not GetStoredBoolean(TRSItems , sh , p + "IsGen") then
set t = GetRandomInt(GetStoredInteger(TRSItems , id , p + "Min") , GetStoredInteger(TRSItems , id , p + "Max"))
call StoreInteger(TRSItems , sh , p + "Par" , GetStoredInteger(TRSItems , id , p + "Par"))
call StoreInteger(TRSItems , sh , p + "Min" , t)
call StoreInteger(TRSItems , sh , p + "Max" , t)
call StoreInteger(TRSItems , sh , p + "Count" , GetStoredInteger(TRSItems , sh , p + "Count") + 1)
call StoreBoolean(TRSItems , sh , p + "IsGen" , true)
endif
endif
set i = i + 1
endloop
endif
if not GetStoredBoolean(TRSItems , sh , "IsPregen") then
set i = GetRandomInt(GetStoredInteger(TRSItems , id , "minstock") , GetStoredInteger(TRSItems , id , "maxstock"))
if i > GetStoredInteger(TRSItems , id , "stack") then
set i = GetStoredInteger(TRSItems , id , "stack")
endif
if GetStoredInteger(TRSItems , h , "quantity") < 1 then
call StoreInteger(TRSItems , h , "quantity" , i)
endif
if GetStoredInteger(TRSItems , id , "maxicons") > 0 and GetStoredInteger(TRSItems , h , "icon") == 0 then
call StoreInteger(TRSItems , h , "icon" , GetStoredInteger(TRSItems , id , "icon" + I2S(GetRandomInt(1 , GetStoredInteger(TRSItems , id , "maxicons")))))
endif
endif
call StoreBoolean(TRSItems , sh , "IsPregen" , true)
call StoreString(TRSItems , h , "ID" , id)
endfunction
function PreGenerateParSingleBR takes string id,string h,integer i,integer t returns nothing
local string sh=h + "Gen"
local string p=null
if not GetStoredBoolean(TRSItems , sh , "IsPregen") then
set p = "Prop" + I2S(i)
if t == 1 then
if not GetStoredBoolean(TRSItems , sh , p + "IsGen") then
call StoreInteger(TRSItems , sh , p + "Par" , GetRandomInt(GetStoredInteger(TRSItems , id , p + "Min") , GetStoredInteger(TRSItems , id , p + "Max")))
call StoreInteger(TRSItems , sh , p + "Count" , GetStoredInteger(TRSItems , sh , p + "Count") + 1)
call StoreBoolean(TRSItems , sh , p + "IsGen" , true)
endif
elseif t == 4 or t == 6 or t == 7 then
if not GetStoredBoolean(TRSItems , sh , p + "IsGen") then
set t = GetRandomInt(GetStoredInteger(TRSItems , id , p + "Min") , GetStoredInteger(TRSItems , id , p + "Max"))
call StoreInteger(TRSItems , sh , p + "Par" , GetStoredInteger(TRSItems , id , p + "Par"))
call StoreInteger(TRSItems , sh , p + "Min" , t)
call StoreInteger(TRSItems , sh , p + "Max" , t)
call StoreInteger(TRSItems , sh , p + "Count" , GetStoredInteger(TRSItems , sh , p + "Count") + 1)
call StoreBoolean(TRSItems , sh , p + "IsGen" , true)
endif
endif
endif
endfunction
function ItemParamParserBR takes string u,string id,string h,integer mod returns nothing
local integer i=1
local integer i2=0
local integer i3=0
local integer count=GetStoredInteger(TRSItems , id , "maxstats")
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , id , "Prop" + I2S(i))
set i3 = GetIntBR(0x3E78 , I2S(i2))
if i3 == 1 then
call SetParamBR(u , id , i2 , i , mod)
call PreGenerateParSingleBR(id , h , i , i3)
call SetParamBR(u , h + "Gen" , i2 , i , mod)
elseif i3 == 4 or i3 == 6 or i3 == 7 then
call PreGenerateParSingleBR(id , h , i , i3)
call SetParamBR(u , h + "Gen" , i2 , i , mod)
else
call SetParamBR(u , id , i2 , i , mod)
endif
set i = i + 1
endloop
call StoreBoolean(TRSItems , h + "Gen" , "IsPregen" , true)
endif
set count = GetStoredInteger(TRSItems , h , "maxstats")
set i = 1
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , h , "Prop" + I2S(i))
call SetParamBR(u , h , i2 , i , mod)
set i = i + 1
endloop
endif
set h = h + "Ex"
set count = GetStoredInteger(TRSItems , h , "maxstats")
set i = 1
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , h , "Prop" + I2S(i))
call SetParamBR(u , h , i2 , i , mod)
set i = i + 1
endloop
endif
endfunction
function ItemParamParserBaseBR takes string u,string id,string h,integer mod returns nothing
local integer i=1
local integer i2=0
local integer i3=0
local integer count=GetStoredInteger(TRSItems , id , "maxstats")
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , id , "Prop" + I2S(i))
set i3 = GetIntBR(0x3E78 , I2S(i2))
if i3 == 1 then
call SetParamBR(u , id , i2 , i , mod)
call PreGenerateParSingleBR(id , h , i , i3)
call SetParamBR(u , h + "Gen" , i2 , i , mod)
elseif i3 == 4 or i3 == 6 or i3 == 7 then
call PreGenerateParSingleBR(id , h , i , i3)
call SetParamBR(u , h + "Gen" , i2 , i , mod)
else
call SetParamBR(u , id , i2 , i , mod)
endif
set i = i + 1
endloop
call StoreBoolean(TRSItems , h + "Gen" , "IsPregen" , true)
endif
endfunction
function ItemParserBR takes string u,string id,string h,integer mod returns nothing
local integer max=GetStoredInteger(TRSItems , h , "MaxGems")
local integer i=1
local string t=""
set TRSAbilsToUpdateMax = 0
set TRSToExecMax = 0
call ItemParamParserBR(u , id , h , mod)
loop
exitwhen i > max
set t = h + "Soc" + I2S(i)
call ItemParamParserBR(u , GetStoredString(TRSItems , t , "ID") + GetStoredString(TRSItems , t , "IDEx") , t , mod)
set i = i + 1
endloop
endfunction
function PassParamToItemBR takes string id,string h,integer mod,boolean requires returns nothing
local integer i=1
local integer i2=0
local integer i3=0
local integer i4=0
local string prop=""
local string req=""
local integer count=GetStoredInteger(TRSItems , h , "maxstats")
loop
exitwhen i >= count
set prop = "Prop" + I2S(i)
set i2 = GetStoredInteger(TRSItems , h , prop)
call TRSAddPropItem(id , i2 , GetStoredInteger(TRSItems , h , prop + "Par") , GetStoredInteger(TRSItems , h , prop + "Min") , GetStoredInteger(TRSItems , h , prop + "Max") , mod)
set i = i + 1
endloop
if requires then
set count = GetStoredInteger(TRSItems , h , "maxreq")
set i = 1
loop
exitwhen i >= count
set i3 = GetStoredInteger(TRSItems , h , "Require" + I2S(i))
set req = "req" + I2S(i3)
set i2 = GetStoredInteger(TRSItems , h , req)
if GetStoredInteger(TRSItems , id , req) < i2 then
call StoreInteger(TRSItems , id , req , i2)
endif
set i4 = GetStoredInteger(TRSItems , id , "maxreq")
if i4 < 1 then
set i4 = 1
endif
if GetStoredBoolean(TRSItems , id , req) == false then
call StoreInteger(TRSItems , id , "Require" + I2S(i4) , i3)
call StoreInteger(TRSItems , id , "maxreq" , i4 + 1)
call StoreBoolean(TRSItems , id , req , true)
endif
set i = i + 1
endloop
endif
if GetStoredInteger(TRSItems , h , "Model") > 0 then
call StoreInteger(TRSItems , id , "Model" , GetStoredInteger(TRSItems , h , "Model"))
endif
if GetStoredInteger(TRSItems , h , "EquipModel") > 0 then
call StoreInteger(TRSItems , id , "EquipModel" , GetStoredInteger(TRSItems , h , "EquipModel"))
endif
if GetStoredString(TRSItems , h , "EquipModelEx") != null then
call StoreString(TRSItems , id , "EquipModelEx" , GetStoredString(TRSItems , h , "EquipModelEx"))
endif
if GetStoredInteger(TRSItems , h , "Icon") > 0 then
call StoreInteger(TRSItems , id , "Icon" , GetStoredInteger(TRSItems , h , "Icon"))
endif
endfunction
function PassGenParamsToItemBR takes string h,string id,string hid returns nothing
local integer i=1
local integer i2=0
local string p=""
local integer t=0
local integer count=GetStoredInteger(TRSItems , hid , "maxstats")
if not GetStoredBoolean(TRSItems , h , "IsPregen") then
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , hid , "Prop" + I2S(i))
set p = "Prop" + I2S(i)
set t = GetIntBR(0x3E78 , I2S(i2))
if t == 1 then
if not GetStoredBoolean(TRSItems , h , p + "IsGen") then
call StoreInteger(TRSItems , h , p + "Par" , GetStoredInteger(TRSItems , id , p + "Par"))
call StoreInteger(TRSItems , h , p + "Count" , GetStoredInteger(TRSItems , h , p + "Count") + 1)
call StoreBoolean(TRSItems , h , p + "IsGen" , true)
endif
elseif t == 4 or t == 6 or t == 7 then
if not GetStoredBoolean(TRSItems , h , p + "IsGen") then
call StoreInteger(TRSItems , h , p + "Par" , GetStoredInteger(TRSItems , id , p + "Par"))
call StoreInteger(TRSItems , h , p + "Min" , GetStoredInteger(TRSItems , id , p + "Min"))
call StoreInteger(TRSItems , h , p + "Max" , GetStoredInteger(TRSItems , id , p + "Max"))
call StoreInteger(TRSItems , h , p + "Count" , GetStoredInteger(TRSItems , h , p + "Count") + 1)
call StoreBoolean(TRSItems , h , p + "IsGen" , true)
endif
endif
set i = i + 1
endloop
endif
endif
endfunction
function CopyItemBR takes string id,string h,integer mod,boolean req,boolean includeEx returns nothing
local integer i=1
local integer max=GetStoredInteger(TRSItems , h , "MaxGems")
local string id2=""
local string h2=""
local string hid=GetStoredString(TRSItems , h , "ID")
set TRSCopying = true
call PassGenParamsToItemBR(id + "Gen" , h + "Gen" , hid)
call PassParamToItemBR(id , h , mod , req)
if includeEx then
call PassParamToItemBR(id + "Ex" , h + "Ex" , mod , req)
endif
call StoreInteger(TRSItems , id , "cost" , GetStoredInteger(TRSItems , h , "cost"))
call StoreInteger(TRSItems , id , "quantity" , GetStoredInteger(TRSItems , h , "quantity"))
call StoreInteger(TRSItems , id , "icon" , GetStoredInteger(TRSItems , h , "icon"))
call StoreInteger(TRSItems , id , "model" , GetStoredInteger(TRSItems , h , "model"))
call StoreString(TRSItems , id , "SetItemName" , GetStoredString(TRSItems , h , "SetItemName"))
call StoreString(TRSItems , id , "RunesInSockets" , GetStoredString(TRSItems , h , "RunesInSockets"))
call StoreString(TRSItems , id , "ID" , GetStoredString(TRSItems , h , "ID"))
call StoreString(TRSItems , id , "IDEx" , GetStoredString(TRSItems , h , "IDEx"))
call StoreString(TRSItems , id , "name" , GetStoredString(TRSItems , h , "name"))
call StoreString(TRSItems , id , "Prefix" , GetStoredString(TRSItems , h , "Prefix"))
call StoreString(TRSItems , id , "Suffix" , GetStoredString(TRSItems , h , "Suffix"))
call StoreString(TRSItems , id , "nameEX" , GetStoredString(TRSItems , h , "nameEX"))
call StoreString(TRSItems , id , "PrefixEX" , GetStoredString(TRSItems , h , "PrefixEX"))
call StoreString(TRSItems , id , "SuffixEX" , GetStoredString(TRSItems , h , "SuffixEX"))
call StoreString(TRSItems , id , "Specialname" , GetStoredString(TRSItems , h , "Specialname"))
call StoreInteger(TRSItems , id , "ItemQuality" , GetStoredInteger(TRSItems , h , "ItemQuality"))
call StoreBoolean(TRSItems , id , "IsRuneword" , GetStoredBoolean(TRSItems , h , "IsRuneword"))
if max > 0 then
call StoreInteger(TRSItems , id , "MaxGems" , max)
loop
exitwhen i > max
set id2 = id + "Soc" + I2S(i)
set h2 = h + "Soc" + I2S(i)
call PassGenParamsToItemBR(id2 + "Gen" , h2 + "Gen" , GetStoredString(TRSItems , h2 , "ID"))
call PassParamToItemBR(id2 , h2 , mod , req)
if includeEx then
call PassParamToItemBR(id2 + "Ex" , h2 + "Ex" , mod , req)
endif
call StoreInteger(TRSItems , id2 , "cost" , GetStoredInteger(TRSItems , h2 , "cost"))
call StoreInteger(TRSItems , id2 , "quantity" , GetStoredInteger(TRSItems , h2 , "quantity"))
call StoreInteger(TRSItems , id2 , "icon" , GetStoredInteger(TRSItems , h2 , "icon"))
call StoreInteger(TRSItems , id2 , "model" , GetStoredInteger(TRSItems , h2 , "model"))
call StoreString(TRSItems , id2 , "ID" , GetStoredString(TRSItems , h2 , "ID"))
call StoreString(TRSItems , id2 , "IDEx" , GetStoredString(TRSItems , h2 , "IDEx"))
call StoreString(TRSItems , id2 , "name" , GetStoredString(TRSItems , h2 , "name"))
call StoreString(TRSItems , id2 , "Prefix" , GetStoredString(TRSItems , h2 , "Prefix"))
call StoreString(TRSItems , id2 , "Suffix" , GetStoredString(TRSItems , h2 , "Suffix"))
call StoreString(TRSItems , id2 , "nameEX" , GetStoredString(TRSItems , h2 , "nameEX"))
call StoreString(TRSItems , id2 , "PrefixEX" , GetStoredString(TRSItems , h2 , "PrefixEX"))
call StoreString(TRSItems , id2 , "SuffixEX" , GetStoredString(TRSItems , h2 , "SuffixEX"))
call StoreString(TRSItems , id2 , "Specialname" , GetStoredString(TRSItems , h2 , "Specialname"))
call StoreInteger(TRSItems , id2 , "ItemQuality" , GetStoredInteger(TRSItems , h2 , "ItemQuality"))
set i = i + 1
endloop
endif
set TRSCopying = false
endfunction
function CheckRequimentsBR takes unit u,string id,string h returns boolean
local string req=null
local integer i=1
local integer i2=0
local integer i3=0
local integer i4=1
local integer i5=1
local integer val=0
local string s1=id
local string s2=h
local string s3=""
local string st=""
local integer max=GetStoredInteger(TRSItems , h , "MaxGems")
local integer count=GetStoredInteger(TRSItems , id , "maxreq")
local integer maxreq=1
local boolean array allreadyused
local integer array existreq
local integer c=1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , id , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set req = h + "Gen"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set req = h
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set req = h + "Ex"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
loop
exitwhen i > max
set h = s2 + "Soc" + I2S(i)
set id = GetStoredString(TRSItems , h , "ID") + GetStoredString(TRSItems , h , "IDEx")
set count = GetStoredInteger(TRSItems , id , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , id , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set req = h + "Gen"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set req = h
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set req = h + "Ex"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
set c = c + 1
endloop
set i = i + 1
endloop
set i = 1
set count = maxreq
set id = s1
set h = s2
loop
exitwhen i >= count
set i3 = existreq[i]
set req = "req" + I2S(i3)
set val = GetStoredInteger(TRSItems , id , req)
set i2 = GetStoredInteger(TRSItems , h + "Gen" , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , h , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , h + "Ex" , req)
if val < i2 then
set val = i2
endif
set i4 = 1
loop
exitwhen i4 > max
set st = h + "Soc" + I2S(i4)
set s3 = GetStoredString(TRSItems , st , "ID") + GetStoredString(TRSItems , h , "IDEx")
set i2 = GetStoredInteger(TRSItems , s3 , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , st + "Gen" , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , st , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , st + "Ex" , req)
if val < i2 then
set val = i2
endif
set i4 = i4 + 1
endloop
set maxreq = val
set i5 = i5 + 1
set eux10 = u
set eax11 = val
if EvalFunc(TRSRequiresFuncs[i3]) == false then
set eux10 = null
return false
endif
set eux10 = null
set i = i + 1
endloop
return true
endfunction
function GetItemCostBR takes string it returns integer
local string id=GetStoredString(TRSItems , it , "ID")
local integer i=1
local integer cost=GetStoredInteger(TRSItems , id , "cost")
local integer max=GetStoredInteger(TRSItems , it , "MaxGems")
local string s=null
set cost = cost + GetStoredInteger(TRSItems , it , "cost")
loop
exitwhen i > max
set s = it + "Soc" + I2S(i)
set cost = cost + GetStoredInteger(TRSItems , s , "cost") + GetStoredInteger(TRSItems , GetStoredString(TRSItems , s , "ID") , "cost")
set i = i + 1
endloop
return cost
endfunction
function GetUnitBonusDataBR takes string su,string par,string what returns integer
return GetStoredInteger(TRSItems , su , "Prop" + I2S(GetIntBR(0x3E80 , par)) + what)
endfunction
function SetItemCalcAdvBonusBR takes string su,string itemset,string sh returns nothing
local integer itemcount=GetStoredInteger(TRSItems , su + itemset , "ItemCount")
local integer realcount=GetStoredInteger(TRSItems , su , itemset + "SetCount")
local integer c=1
local integer i=0
local string h=""
local string s=""
loop
exitwhen c > itemcount
set h = GetStoredString(TRSItems , su + itemset , "Item" + I2S(c))
set i = GetStoredInteger(TRSItems , h , "PreviousBonus")
if i != realcount or sh == h then
set s = GetStoredString(TRSItems , h , "SetItemName")
call ItemParamParserBaseBR(su , GetStoredString(TRSItems , h , "ID") + s + I2S(i) , h + "Set" , 2)
call FlushStoredMission(TRSItems , h + "SetGen")
if sh != h then
call ItemParamParserBaseBR(su , GetStoredString(TRSItems , h , "ID") + s + I2S(realcount) , h + "Set" , 1)
endif
endif
call StoreInteger(TRSItems , h , "PreviousBonus" , realcount)
set c = c + 1
endloop
endfunction
function TRSParseCusFuncsBR takes nothing returns nothing
local integer i=1
loop
exitwhen i > TRSToExecMax
if TRSCusFuncs[TRSPar1[i]] != null then
set TRSPar = TRSPar1[i]
set TRSMin = TRSMin1[i]
set TRSMax = TRSMax1[i]
set TRSParS = TRSParS1[i]
set TRSMinS = TRSMinS1[i]
set TRSMaxS = TRSMaxS1[i]
set TRSToExecExist[TRSPar]=false
set TRSToExecPos[TRSPar]=0
if TRSCusFuncs[TRSPar] != null then
call ExecuteFunc(TRSCusFuncs[TRSPar])
endif
endif
set i = i + 1
endloop
set TRSToExecMax = 0
endfunction
function EquipItemBR takes unit u,string id,string h,boolean update returns boolean
local string s=GetStoredString(TRSItems , id , "Type")
local string su=I2S((GetHandleId((u)))) // INLINED!!
local string s1=null
local string s2=null
local string s3=null
local string s4=null
local string s5=null
local integer i=0
local integer i2=0
call StoreString(TRSItems , h , "ID" , id)
set TRSUnit = u
set TRSItem = h
set TRSMod = 1
if GetStoredInteger(TRSItems , id , "notequip") < 1 and GetStoredBoolean(TRSItems , h , "Equiped") == false then
if CheckRequimentsBR(u , id , h) then
call ItemParserBR(su , id , h , 1)
if GetStoredInteger(TRSItems , h , "ItemQuality") == 6 then
set s1 = GetStoredString(TRSItems , h , "SetItemName")
set s2 = GetStoredString(TRSItems , id + s1 , "ItemSet")
set i = GetStoredInteger(TRSItems , su , s1 + "Count")
set i2 = GetStoredInteger(TRSItems , su , s2 + "SetCount")
set s3 = "1" + s2
set s4 = su + s2 + "Bonus"
if i <= 0 then
call StoreInteger(TRSItems , su , s2 + "SetCount" , i2 + 1)
call ItemParamParserBaseBR(su , s3 + I2S(i2) , s4 , 2)
call FlushStoredMission(TRSItems , s4)
call FlushStoredMission(TRSItems , s4 + "Gen")
call ItemParamParserBaseBR(su , s3 + I2S(i2 + 1) , s4 , 1)
endif
call StoreInteger(TRSItems , su , s1 + "Count" , i + 1)
set s5 = su + s2
call StoreInteger(TRSItems , s5 , "ItemCount" , GetStoredInteger(TRSItems , s5 , "ItemCount") + 1)
call StoreInteger(TRSItems , h , "CurSetItemPos" , GetStoredInteger(TRSItems , s5 , "ItemCount"))
call StoreString(TRSItems , s5 , "Item" + I2S(GetStoredInteger(TRSItems , s5 , "ItemCount")) , h)
call StoreInteger(TRSItems , h , "PreviousBonus" , 0)
call SetItemCalcAdvBonusBR(su , s2 , null)
endif
call StoreBoolean(TRSItems , h , "Equiped" , true)
call TRSParseCusFuncsBR()
call ItemAbilParserBR(u , update)
set TRSUnit = null
return true
endif
endif
set TRSUnit = null
return false
endfunction
function UnequipItemBR takes unit u,string id,string h,boolean update returns nothing
local string su=I2S((GetHandleId((u)))) // INLINED!!
local string s1=null
local string s2=null
local string s3=null
local string s4=null
local string s5=null
local string s6=null
local integer i=0
local integer i2=0
local integer i3=0
local integer i4=0
set TRSUnit = u
set TRSItem = h
set TRSMod = 2
if GetStoredBoolean(TRSItems , h , "Equiped") then
call ItemParserBR(su , id , h , 2)
if GetStoredInteger(TRSItems , h , "ItemQuality") == 6 then
set s1 = GetStoredString(TRSItems , h , "SetItemName")
set s2 = GetStoredString(TRSItems , id + s1 , "ItemSet")
set i = GetStoredInteger(TRSItems , su , s1 + "Count")
set i2 = GetStoredInteger(TRSItems , su , s2 + "SetCount")
set s3 = "1" + s2
set s4 = su + s2 + "Bonus"
if i <= 1 then
call StoreInteger(TRSItems , su , s2 + "SetCount" , i2 - 1)
call ItemParamParserBaseBR(su , s3 + I2S(i2) , s4 , 2)
call FlushStoredMission(TRSItems , s4)
call FlushStoredMission(TRSItems , s4 + "Gen")
call ItemParamParserBaseBR(su , s3 + I2S(i2 - 1) , s4 , 1)
endif
call StoreInteger(TRSItems , su , s1 + "Count" , i - 1)
call SetItemCalcAdvBonusBR(su , s2 , h)
set s5 = su + s2
set i3 = GetStoredInteger(TRSItems , h , "CurSetItemPos")
set i4 = GetStoredInteger(TRSItems , s5 , "ItemCount")
set s6 = GetStoredString(TRSItems , s5 , "Item" + I2S(i4))
call StoreString(TRSItems , s5 , "Item" + I2S(i4) , null)
call StoreInteger(TRSItems , s5 , "ItemCount" , i4 - 1)
if i4 != i3 then
call StoreInteger(TRSItems , s6 , "CurSetItemPos" , i3)
call StoreString(TRSItems , s5 , "Item" + I2S(i3) , s6)
endif
call StoreInteger(TRSItems , h , "CurSetItemPos" , 0)
call StoreInteger(TRSItems , h , "PreviousBonus" , 0)
endif
call StoreBoolean(TRSItems , h , "Equiped" , false)
call TRSParseCusFuncsBR()
call ItemAbilParserBR(u , update)
endif
set TRSUnit = null
endfunction
function ItemCooldownBR takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer i=(GetHandleId((t))) - OPCTimersMinIndex // INLINED!!
call StoreBoolean(TRSItems , I2S((GetHandleId((TRSCDunit[i])))) , TRSCDId[i] , false) // INLINED!!
set TRSCDunit[i]=null
set TRSCDId[i]=null
call RecycleTimer(t)
endfunction
function UseItemBR takes unit u,string id,string h returns boolean
local string s=GetStoredString(TRSItems , id , "Type")
local string su=I2S((GetHandleId((u)))) // INLINED!!
local string s1="CDTimer" + GetStoredString(TRSItems , id , "cooldownid")
local integer i=0
local integer i2=0
local timer tmr=null
local boolean ready=GetStoredBoolean(TRSItems , su , s1)
call StoreString(TRSItems , h , "ID" , id)
set TRSUnit = u
set TRSItem = h
set TRSMod = 1
if s == "charged" and GetStoredBoolean(TRSItems , h , "Equiped") == false and ( GetStoredInteger(TRSItems , id , "stack") < 1 or GetStoredInteger(TRSItems , h , "quantity") > 0 ) and ready == false then
if CheckRequimentsBR(u , id , h) then
call ItemParserBR(su , id , h , 1)
call TRSParseCusFuncsBR()
call ItemAbilParserBR(u , true)
if GetStoredInteger(TRSItems , h , "quantity") > 0 then
call StoreInteger(TRSItems , h , "quantity" , GetStoredInteger(TRSItems , h , "quantity") - 1)
endif
set tmr = GetTimerBR()
set i = (GetHandleId((tmr))) - OPCTimersMinIndex // INLINED!!
set TRSCDunit[i]=u
set TRSCDId[i]=s1
call TimerStart(tmr , GetStoredReal(TRSItems , id , "cooldown") , false , function ItemCooldownBR)
call StoreBoolean(TRSItems , su , s1 , true)
set TRSUnit = null
return true
endif
endif
set TRSUnit = null
return false
endfunction
function InsertGemBR takes unit u,string id,string h,string gem returns boolean
local string sock=I2S(GetIntBR(0x3E80 , "sock"))
local integer max=GetStoredInteger(TRSItems , id , "Prop" + I2S(GetStoredInteger(TRSItems , id , sock)) + "Par") + GetStoredInteger(TRSItems , h + "Gen" , "Prop" + I2S(GetStoredInteger(TRSItems , id , sock)) + "Par") + GetStoredInteger(TRSItems , h , "Prop" + I2S(GetStoredInteger(TRSItems , h , sock)) + "Par")
local integer used=GetStoredInteger(TRSItems , h , "MaxGems")
local integer i=1
local integer c=0
local string s=""
local string s1=""
local string gemid=""
local string runes=""
local boolean b=false
if max > GetStoredInteger(TRSItems , id , "maxsock") then
set max = GetStoredInteger(TRSItems , id , "maxsock")
endif
set TRSUnit = u
set TRSInsert = true
if used < max then
loop
exitwhen i > used
set gemid = GetStoredString(TRSItems , h + "Soc" + I2S(i) , "ID")
set runes = runes + GetStoredString(TRSItems , gemid , "runename")
set i = i + 1
endloop
set gemid = GetStoredString(TRSItems , gem , "ID")
set runes = runes + GetStoredString(TRSItems , gemid , "runename")
call StoreString(TRSItems , h , "RunesInSockets" , runes)
if GetStoredBoolean(TRSItems , h , "Equiped") then
call UnequipItemBR(u , id , h , true)
set s = h + "Soc" + I2S(used + 1)
call CleanItemParBR(s , true)
call CopyItemBR(s , gem , 1 , true , true)
set s1 = GetStoredString(TRSItems , id , "type")
if GetStoredBoolean(TRSItems , GetStoredString(TRSItems , s , "ID") + s1 , "Exist") then
call StoreString(TRSItems , s , "IDEx" , s1)
else
call StoreString(TRSItems , s , "IDEx" , null)
endif
set gemid = "2runewords" + runes
if used + 1 == max and GetStoredInteger(TRSItems , gemid , "runecount") == max then
set i = 1
loop
set s1 = GetStoredString(TRSItems , gemid , "itype" + I2S(i))
exitwhen s1 == null
set c = c + 1
set b = b or GetStoredString(TRSItems , id , "type") == s1
exitwhen b
set i = i + 1
endloop
set i = 1
loop
set s1 = GetStoredString(TRSItems , gemid , "iclass" + I2S(i))
exitwhen s1 == null
set c = c + 1
set b = b or GetStoredString(TRSItems , id , "class") == s1
exitwhen b
set i = i + 1
endloop
set i = 1
loop
set s1 = GetStoredString(TRSItems , gemid , "isclass" + I2S(i))
exitwhen s1 == null
set c = c + 1
set b = b or GetStoredString(TRSItems , id , "sclass") == s1
exitwhen b
set i = i + 1
endloop
if GetStoredBoolean(TRSItems , "2runewords" + runes , "Exist") and ( b or c == 0 ) and GetStoredInteger(TRSItems , h , "ItemQuality") < 3 then
call PassParamToItemBR(h + "Ex" , "2runewords" + runes , 1 , true)
call StoreInteger(TRSItems , h , "icon" , GetStoredInteger(TRSItems , "2runewords" + runes , "icon"))
call StoreString(TRSItems , h , "nameEX" , GetStoredString(TRSItems , "2runewords" + runes , "name"))
call StoreBoolean(TRSItems , h , "IsRuneword" , true)
call StoreString(TRSItems , h , "RunewordId" , "2runewords" + runes)
endif
endif
call StoreInteger(TRSItems , h , "MaxGems" , used + 1)
call EquipItemBR(u , id , h , true)
else
set s = h + "Soc" + I2S(used + 1)
call CleanItemParBR(s , true)
call CopyItemBR(s , gem , 1 , true , true)
set s1 = GetStoredString(TRSItems , id , "type")
if GetStoredBoolean(TRSItems , GetStoredString(TRSItems , s , "ID") + s1 , "Exist") then
call StoreString(TRSItems , s , "IDEx" , s1)
else
call StoreString(TRSItems , s , "IDEx" , null)
endif
call StoreInteger(TRSItems , h , "MaxGems" , used + 1)
set gemid = "2runewords" + runes
if used + 1 == max and GetStoredInteger(TRSItems , gemid , "runecount") == max then
set i = 1
loop
set s1 = GetStoredString(TRSItems , gemid , "itype" + I2S(i))
exitwhen s1 == null
set c = c + 1
set b = b or GetStoredString(TRSItems , id , "type") == s1
exitwhen b
set i = i + 1
endloop
set i = 1
loop
set s1 = GetStoredString(TRSItems , gemid , "iclass" + I2S(i))
exitwhen s1 == null
set c = c + 1
set b = b or GetStoredString(TRSItems , id , "class") == s1
exitwhen b
set i = i + 1
endloop
set i = 1
loop
set s1 = GetStoredString(TRSItems , gemid , "isclass" + I2S(i))
exitwhen s1 == null
set c = c + 1
set b = b or GetStoredString(TRSItems , id , "sclass") == s1
exitwhen b
set i = i + 1
endloop
if GetStoredBoolean(TRSItems , "2runewords" + runes , "Exist") and ( b or c == 0 ) and GetStoredInteger(TRSItems , h , "ItemQuality") < 3 then
call PassParamToItemBR(h + "Ex" , "2runewords" + runes , 1 , true)
call StoreInteger(TRSItems , h , "icon" , GetStoredInteger(TRSItems , "2runewords" + runes , "icon"))
call StoreString(TRSItems , h , "nameEX" , GetStoredString(TRSItems , "2runewords" + runes , "name"))
call StoreBoolean(TRSItems , h , "IsRuneword" , true)
call StoreString(TRSItems , h , "RunewordId" , "2runewords" + runes)
endif
endif
endif
set TRSUnit = null
set TRSInsert = false
return true
endif
set TRSUnit = null
set TRSInsert = false
return false
endfunction
function RemoveInsertedGemBR takes unit u,string id,string h,boolean recreate,code act returns boolean
local integer used=GetStoredInteger(TRSItems , h , "MaxGems")
local string gem=h + "Soc" + I2S(used)
local string gemid=""
local string runes=""
local integer i=1
set TRSUnit = u
set TRSInsert = true
if used > 0 then
if GetStoredBoolean(TRSItems , h , "Equiped") then
call UnequipItemBR(u , id , h , true)
loop
exitwhen i >= used
set gemid = GetStoredString(TRSItems , h + "Soc" + I2S(i) , "ID")
set runes = runes + GetStoredString(TRSItems , gemid , "runename")
set i = i + 1
endloop
call StoreString(TRSItems , h , "RunesInSockets" , runes)
set TRSUnit = u
if recreate then
set esx24 = gem
if act != null then
call EvalFunc(Condition(act))
endif
else
call CleanItemParBR(gem , true)
endif
if GetStoredBoolean(TRSItems , h , "IsRuneword") then
call StoreString(TRSItems , h , "nameEX" , null)
call StoreInteger(TRSItems , h , "icon" , 0)
call FlushStoredMission(TRSItems , h + "Ex")
call StoreBoolean(TRSItems , h , "IsRuneword" , false)
call StoreString(TRSItems , h , "RunewordId" , null)
endif
call StoreInteger(TRSItems , h , "MaxGems" , used - 1)
call EquipItemBR(u , id , h , true)
else
loop
exitwhen i >= used
set gemid = GetStoredString(TRSItems , h + "Soc" + I2S(i) , "ID")
set runes = runes + GetStoredString(TRSItems , gemid , "runename")
set i = i + 1
endloop
call StoreString(TRSItems , h , "RunesInSockets" , runes)
set TRSUnit = u
if recreate then
set esx24 = gem
if act != null then
call EvalFunc(Condition(act))
endif
else
call CleanItemParBR(gem , true)
endif
if GetStoredBoolean(TRSItems , h , "IsRuneword") then
call StoreString(TRSItems , h , "nameEX" , null)
call StoreInteger(TRSItems , h , "icon" , 0)
call FlushStoredMission(TRSItems , h + "Ex")
call StoreBoolean(TRSItems , h , "IsRuneword" , false)
call StoreString(TRSItems , h , "RunewordId" , null)
endif
call StoreInteger(TRSItems , h , "MaxGems" , used - 1)
endif
set TRSUnit = null
set TRSInsert = false
return true
endif
set TRSUnit = null
set TRSInsert = false
return false
endfunction
function InitSubAbilBRExec takes nothing returns nothing
call TcUSPBR(eax , null , esx , false , false , "TRSSubAbilParser" , "TRSSubAbilParser" , "TRSSubAbilParser" , true , null)
endfunction
function InitSubAbilBR takes integer h,string STR returns nothing
set eax = h
set esx = STR
call ExecuteFunc("InitSubAbilBRExec")
endfunction
function InitCusFuncsBaseExecBR takes nothing returns nothing
call TcUSPBR(0x6DF9 , null , esx31 , false , false , "TRSInitSpecialFuncs" , "TRSInitSpecialFuncs" , "TRSInitSpecialFuncs" , true , null)
endfunction
function InitCusAbilMultExecBR takes nothing returns nothing
call TcUSPBR(0x6DF8 , null , esx31 , false , false , "TRSInitAbilMultFuncs" , "TRSInitAbilMultFuncs" , "TRSInitAbilMultFuncs" , true , null)
endfunction
function InitCusFuncsBaseBR takes string STR returns nothing
set esx31 = STR
call ExecuteFunc("InitCusFuncsBaseExecBR")
endfunction
function InitCusAbilMultBR takes string STR returns nothing
set esx31 = STR
call ExecuteFunc("InitCusAbilMultExecBR")
endfunction
function InitItemBaseExecBR takes nothing returns nothing
set esx32 = ""
call TcUSPBR(eax30 , null , esx31 , false , false , "TRSIntParser" , "TRSIntParser" , "TRSIntParser" , true , TRSItems)
endfunction
function InitItemBaseBR takes integer h,string STR returns nothing
set eax30 = h
set esx31 = STR
call ExecuteFunc("InitItemBaseExecBR")
endfunction
function InitAdvBaseExecBR takes nothing returns nothing
call TcUSPBR(0 , esx32 , esx31 , false , false , "TRSIntParserAdv" , "TRSIntParserAdv" , "TRSIntParserAdv" , true , TRSItems)
endfunction
function InitGemBaseExecBR takes nothing returns nothing
call TcUSPBR(eax30 , esx32 , esx31 , false , false , "TRSIntParser" , "TRSIntParser" , "TRSIntParser" , true , TRSItems)
endfunction
function InitGemBaseBR takes integer h,string part,string STR returns nothing
set eax30 = h
set esx31 = STR
set esx32 = part
call ExecuteFunc("InitGemBaseExecBR")
endfunction
function InitGemExtrazExecBR takes nothing returns nothing
call TcUSPBR(eax30 , esx32 , esx31 , false , false , "TRSIntParser" , "TRSIntParser" , "TRSIntParser" , true , TRSItems)
endfunction
function InitGemExtrazBR takes integer h,string part,string STR returns nothing
local string sh=I2S(h)
set eax30 = h
set esx31 = STR
set esx32 = part
call StoreInteger(TRSItems , sh , "GemExtraz" , GetStoredInteger(TRSItems , sh , "GemExtraz") + 1)
call StoreString(TRSItems , sh , "Extraz" + I2S(GetStoredInteger(TRSItems , sh , "GemExtraz")) , part)
call ExecuteFunc("InitGemExtrazExecBR")
endfunction
function InitSetItemBR takes integer h,string name,string setname,string STR returns nothing
local string s=I2S(h)
set eax30 = h
set esx31 = STR
set esx32 = name
call StoreString(TRSItems , s + setname , "name" , name)
call StoreInteger(TRSItems , s , "SetCount" , GetStoredInteger(TRSItems , s , "SetCount") + 1)
call StoreString(TRSItems , s , "SetItem" + I2S(GetStoredInteger(TRSItems , s , "SetCount")) , name)
call StoreString(TRSItems , s + name , "ItemSet" , setname)
call StoreInteger(TRSItems , "Sets" + setname , "Itemcount" , GetStoredInteger(TRSItems , "Sets" + setname , "Itemcount") + 1)
call StoreString(TRSItems , setname , "Item" + I2S(GetStoredInteger(TRSItems , "Sets" + setname , "Itemcount")) , name)
call StoreInteger(TRSItems , setname , "ItemID" + I2S(GetStoredInteger(TRSItems , "Sets" + setname , "Itemcount")) , h)
call StoreInteger(TRSItems , "SetItem" + name , "ItemID" , h)
call StoreString(TRSItems , s , setname , name)
call ExecuteFunc("InitGemBaseExecBR")
endfunction
function InitUniqueItemBR takes integer h,string name,string STR returns nothing
local string s=I2S(h)
set eax30 = h
set esx31 = STR
set esx32 = name
call StoreInteger(TRSItems , s , "UniqueCount" , GetStoredInteger(TRSItems , s , "UniqueCount") + 1)
call StoreString(TRSItems , s , "UniqueItem" + I2S(GetStoredInteger(TRSItems , s , "UniqueCount")) , name)
call StoreInteger(TRSItems , "UniqueItem" + name , "ItemID" , h)
call ExecuteFunc("InitGemBaseExecBR")
endfunction
function InitItemSetBonusBR takes string name,integer c,string STR returns nothing
set eax30 = 1
set esx31 = STR
set esx32 = name + I2S(c)
call ExecuteFunc("InitGemBaseExecBR")
endfunction
function InitSetItemBonusBR takes integer h,string name,integer c,string STR returns nothing
set eax30 = h
set esx31 = STR
set esx32 = name + I2S(c)
call ExecuteFunc("InitGemBaseExecBR")
endfunction
function InitRunewordBonusBR takes string name,string STR returns nothing
set eax30 = 2
set esx31 = STR
set esx32 = "runewords" + name
call ExecuteFunc("InitGemBaseExecBR")
endfunction
function InitDisplayNoDispExecBR takes nothing returns nothing
call TcUSPBR(0x6DFA , null , esx31 , false , false , "TRSInitDisplayNoDisp" , "TRSInitDisplayNoDisp" , "TRSInitDisplayNoDisp" , true , null)
endfunction
function InitDisplayNoDispBR takes string STR returns nothing
set esx31 = STR
call ExecuteFunc("InitDisplayNoDispExecBR")
endfunction
function InitDisplayNoReqDispExecBR takes nothing returns nothing
call TcUSPBR(0x6DFB , null , esx31 , false , false , "TRSInitDisplayNoReqDisp" , "TRSInitDisplayNoReqDisp" , "TRSInitDisplayNoReqDisp" , true , null)
endfunction
function InitDisplayNoReqDispBR takes string STR returns nothing
set esx31 = STR
call ExecuteFunc("InitDisplayNoReqDispExecBR")
endfunction
function AbilName2I takes integer d,string TagStr returns integer
return GetIntBR(d , TagStr)
endfunction
function I2AbilName takes integer d,integer i returns string
return (GetStoredString(USPData , I2S((d )) , ( I2S(i)))) // INLINED!!
endfunction
function TagStr2I takes string TagStr returns integer
return GetIntBR(0x3E81 , TagStr)
endfunction
function I2TagStr takes integer i returns string
return (GetStoredString(USPData , I2S((0x3E81 )) , ( I2S(i)))) // INLINED!!
endfunction
function Prop2I takes string prop returns integer
local integer i=S2I(prop)
if i > 0 then
return i
else
return GetIntBR(0x3E80 , prop)
endif
return 0
endfunction
function TRSIntParser takes nothing returns nothing
local integer istat=Prop2I(USPStat)
local string stat=I2S(istat)
local string id=I2S(USPid) + esx32
local integer i=GetStoredInteger(TRSItems , id , "maxstats")
call StoreBoolean(TRSItems , id , "Exist" , true)
if i < 1 then
set i = 1
endif
if USPStat != null then
if USParray then
if USParrayindex == 1 then
if USPsval == null then
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Par" , USPival)
else
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Par" , GetIntBR(0x3E81 , USPsval))
endif
elseif USParrayindex == 2 then
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Min" , USPival)
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Count" , 1)
elseif USParrayindex == 3 then
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Count" , 1)
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Max" , USPival)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , "Prop" + I2S(i) , istat)
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
endif
else
if USPsval != null then
call StoreString(TRSItems , id , USPStat , USPsval)
elseif USPrval != 0 then
call StoreReal(TRSItems , id , USPStat , USPrval)
elseif USPival != 0 then
set istat = GetIntBR(0x3E79 , USPStat)
if istat == 0 then
call StoreInteger(TRSItems , id , USPStat , USPival)
else
set stat = "req" + I2S(istat)
call StoreInteger(TRSItems , id , stat , USPival)
call StoreBoolean(TRSItems , id , stat , true)
set i = GetStoredInteger(TRSItems , id , "maxreq")
if i < 1 then
set i = 1
endif
call StoreInteger(TRSItems , id , "Req" + stat , i)
call StoreInteger(TRSItems , id , "Require" + I2S(i) , istat)
call StoreInteger(TRSItems , id , "maxreq" , i + 1)
endif
endif
endif
endif
endfunction
function TRSIntParserAdv takes nothing returns nothing
local integer istat=Prop2I(USPStat)
local string stat=I2S(istat)
local string id=esx32
local integer i=GetStoredInteger(TRSItems , id , "maxstats")
call StoreBoolean(TRSItems , id , "Exist" , true)
if i < 1 then
set i = 1
endif
if USPStat != null then
if USParray then
if USParrayindex == 1 then
if USPsval == null then
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Par" , USPival)
else
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Par" , GetIntBR(0x3E81 , USPsval))
endif
elseif USParrayindex == 2 then
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Min" , USPival)
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Count" , 1)
elseif USParrayindex == 3 then
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Count" , 1)
call StoreInteger(TRSItems , id , "Prop" + I2S(i) + "Max" , USPival)
call StoreInteger(TRSItems , id , stat , i)
call StoreInteger(TRSItems , id , "Prop" + I2S(i) , istat)
call StoreInteger(TRSItems , id , "maxstats" , i + 1)
endif
else
if USPsval != null then
call StoreString(TRSItems , id , USPStat , USPsval)
elseif USPrval != 0 then
call StoreReal(TRSItems , id , USPStat , USPrval)
elseif USPival != 0 then
set istat = GetIntBR(0x3E79 , USPStat)
if istat == 0 then
call StoreInteger(TRSItems , id , USPStat , USPival)
else
set stat = "req" + I2S(istat)
call StoreInteger(TRSItems , id , stat , USPival)
call StoreBoolean(TRSItems , id , stat , true)
set i = GetStoredInteger(TRSItems , id , "maxreq")
if i < 1 then
set i = 1
endif
call StoreInteger(TRSItems , id , "Req" + stat , i)
call StoreInteger(TRSItems , id , "Require" + I2S(i) , istat)
call StoreInteger(TRSItems , id , "maxreq" , i + 1)
endif
endif
endif
endif
endfunction
function TRSSubAbilParser takes nothing returns nothing
local integer i=S2I(USPStat)
local integer id=USPid
local integer val=USPival
local string s=""
if i == 0 then
set s = USPStat
endif
if s == "Size" then
set TRSSubAbilsCurPointer = TRSSubAbilsCurPointer + val + 1
set TRSSubAbilsCount = TRSSubAbilsCount + 1
set TRSSubAbils[id]=TRSSubAbilsCount
set TRSSubAbilsSize[id]=val
set TRSSubAbilsNum[TRSSubAbilsCount]=id
set TRSSubAbilsId[TRSSubAbilsCount]=TRSSubAbilsCurPointer
set TRSSubAbilsCurPointer = TRSSubAbilsCurPointer + val + 1
elseif s == "maxval" then
set i = TRSSubAbils[id]
set TRSSubAbilsMax[i]=val * 2 - 1
set TRSSubAbilsMaxVal[i]=val
elseif s == "minval" then
set i = TRSSubAbils[id]
set TRSSubAbilsMin[i]=val * 2 + 1
set TRSSubAbilsMinVal[i]=val
elseif s == "Rarity" then
set TRSAbilsRarity[id]=USPrval
elseif i > 0 then
set TRSSubAbilsParam[TRSSubAbilsId[TRSSubAbils[id]] + 0x1 + log2(i)]=val
elseif SubString(USPStat , 0 , 1) == "-" then
set TRSSubAbilsParam[TRSSubAbilsId[TRSSubAbils[id]] - 0x1 - log2(S2I(SubString(USPStat , 1 , 16)))]=val
endif
endfunction
function TRSInitSpecialFuncs takes nothing returns nothing
set TRSCusFuncs[S2I(USPStat)]=USPsval
endfunction
function TRSInitAbilMultFuncs takes nothing returns nothing
set TRSAbilsMultId[S2I(USPStat)]=USPsval
endfunction
function TRSInitDisplayNoDisp takes nothing returns nothing
if USPival >= 1 then
set TRSAbilsDisplayNotDisp[S2I(USPStat)]=true
else
set TRSAbilsDisplayNotDisp[S2I(USPStat)]=false
endif
endfunction
function TRSInitDisplayNoReqDisp takes nothing returns nothing
if USPival >= 1 then
set TRSAbilsDisplayReqNotDisp[S2I(USPStat)]=true
else
set TRSAbilsDisplayReqNotDisp[S2I(USPStat)]=false
endif
endfunction
function TRS2Init takes nothing returns nothing
call SetCameraBounds(GetCameraBoundMinX() , GetCameraBoundMinY() + 650 , GetCameraBoundMaxX() , GetCameraBoundMaxY() , GetCameraBoundMinX() , GetCameraBoundMaxY() , GetCameraBoundMaxX() , GetCameraBoundMinY() + 650)
call FlushGameCache(InitGameCache("TRSInv.bx"))
call FlushGameCache(InitGameCache("TRSItems.bx"))
call ExecuteFunc("CustomInitializationBR")
call TimerInit(1000)
call ExecuteFunc("Initlog2")
call ExecuteFunc("TRSInitAbilitys")
call ExecuteFunc("TRSRequiresInit")
call ExecuteFunc("TRSInitItems")
call ExecuteFunc("TRSInitPreSufixes")
call ExecuteFunc("TRSInitAffixes")
call ExecuteFunc("CreateGridAction")
endfunction
function InitTrig_TRSCore takes nothing returns nothing
call ExecuteFunc("TRS2Init")
endfunction
function TRSPawnItemRate takes nothing returns real
return 0.5
endfunction
function TRSMaxItemCostReduction takes nothing returns real
return 50.
endfunction
function TRSMaxItemTradingSkill takes nothing returns real
return 50.
endfunction
function TRSExInvId takes nothing returns integer
return 1093677141
endfunction
function TRSInitAbilitys takes nothing returns nothing
call InitSubAbilBR(1 , "^Size=16;Rarity=2.25;maxval=32768;minval=-32768;-32768=1415655472;-16384=1415655473;-8192=1415655474;-4096=1415655475;-2048=1415655476;-1024=1415655477;-512=1415655478;-256=1415655479;-128=1415655480;-64=1415655481;-32=1415655728;-16=1415655729;-8=1415655730;-4=1415655731;-2=1415655732;-1=1415655733;1=1415655734;2=1415655735;4=1415655736;8=1415655737;16=1415655984;32=1415655985;64=1415655986;128=1415655987;256=1415655988;512=1415655989;1024=1415655990;2048=1415655991;4096=1415655992;8192=1415655993;16384=1415656240;32768=1415656241;")
call InitSubAbilBR(2 , "^Size=16;Rarity=1.85;maxval=32768;minval=-32768;-32768=1415721008;-16384=1415721009;-8192=1415721010;-4096=1415721011;-2048=1415721012;-1024=1415721013;-512=1415721014;-256=1415721015;-128=1415721016;-64=1415721017;-32=1415721264;-16=1415721265;-8=1415721266;-4=1415721267;-2=1415721268;-1=1415721269;1=1415721270;2=1415721271;4=1415721272;8=1415721273;16=1415721520;32=1415721521;64=1415721522;128=1415721523;256=1415721524;512=1415721525;1024=1415721526;2048=1415721527;4096=1415721528;8192=1415721529;16384=1415721776;32768=1415721777;")
call InitSubAbilBR(3 , "^Size=16;Rarity=4.0;maxval=32768;minval=-32768;-32768=1415786544;-16384=1415786545;-8192=1415786546;-4096=1415786547;-2048=1415786548;-1024=1415786549;-512=1415786550;-256=1415786551;-128=1415786552;-64=1415786553;-32=1415786800;-16=1415786801;-8=1415786802;-4=1415786803;-2=1415786804;-1=1415786805;1=1415786806;2=1415786807;4=1415786808;8=1415786809;16=1415787056;32=1415787057;64=1415787058;128=1415787059;256=1415787060;512=1415787061;1024=1415787062;2048=1415787063;4096=1415787064;8192=1415787065;16384=1415787312;32768=1415787313;")
call InitSubAbilBR(4 , "^Size=16;Rarity=1.95;maxval=32768;minval=-32768;-32768=1415852080;-16384=1415852081;-8192=1415852082;-4096=1415852083;-2048=1415852084;-1024=1415852085;-512=1415852086;-256=1415852087;-128=1415852088;-64=1415852089;-32=1415852336;-16=1415852337;-8=1415852338;-4=1415852339;-2=1415852340;-1=1415852341;1=1415852342;2=1415852343;4=1415852344;8=1415852345;16=1415852592;32=1415852593;64=1415852594;128=1415852595;256=1415852596;512=1415852597;1024=1415852598;2048=1415852599;4096=1415852600;8192=1415852601;16384=1415852848;32768=1415852849;")
call InitSubAbilBR(5 , "^Size=16;Rarity=1.6;maxval=32768;minval=-32768;-32768=1415917616;-16384=1415917617;-8192=1415917618;-4096=1415917619;-2048=1415917620;-1024=1415917621;-512=1415917622;-256=1415917623;-128=1415917624;-64=1415917625;-32=1415917872;-16=1415917873;-8=1415917874;-4=1415917875;-2=1415917876;-1=1415917877;1=1415917878;2=1415917879;4=1415917880;8=1415917881;16=1415918128;32=1415918129;64=1415918130;128=1415918131;256=1415918132;512=1415918133;1024=1415918134;2048=1415918135;4096=1415918136;8192=1415918137;16384=1415918384;32768=1415918385;")
call InitSubAbilBR(6 , "^Size=16;Rarity=1.6;maxval=32768;minval=-32768;-32768=1415983152;-16384=1415983153;-8192=1415983154;-4096=1415983155;-2048=1415983156;-1024=1415983157;-512=1415983158;-256=1415983159;-128=1415983160;-64=1415983161;-32=1415983408;-16=1415983409;-8=1415983410;-4=1415983411;-2=1415983412;-1=1415983413;1=1415983414;2=1415983415;4=1415983416;8=1415983417;16=1415983664;32=1415983665;64=1415983666;128=1415983667;256=1415983668;512=1415983669;1024=1415983670;2048=1415983671;4096=1415983672;8192=1415983673;16384=1415983920;32768=1415983921;")
call InitSubAbilBR(7 , "^Size=16;Rarity=1.6;maxval=32768;minval=-32768;-32768=1416048688;-16384=1416048689;-8192=1416048690;-4096=1416048691;-2048=1416048692;-1024=1416048693;-512=1416048694;-256=1416048695;-128=1416048696;-64=1416048697;-32=1416048944;-16=1416048945;-8=1416048946;-4=1416048947;-2=1416048948;-1=1416048949;1=1416048950;2=1416048951;4=1416048952;8=1416048953;16=1416049200;32=1416049201;64=1416049202;128=1416049203;256=1416049204;512=1416049205;1024=1416049206;2048=1416049207;4096=1416049208;8192=1416049209;16384=1416049456;32768=1416049457;")
call InitSubAbilBR(8 , "^Size=16;Rarity=1.1;maxval=32768;minval=-32768;-32768=1416114224;-16384=1416114225;-8192=1416114226;-4096=1416114227;-2048=1416114228;-1024=1416114229;-512=1416114230;-256=1416114231;-128=1416114232;-64=1416114233;-32=1416114480;-16=1416114481;-8=1416114482;-4=1416114483;-2=1416114484;-1=1416114485;1=1416114486;2=1416114487;4=1416114488;8=1416114489;16=1416114736;32=1416114737;64=1416114738;128=1416114739;256=1416114740;512=1416114741;1024=1416114742;2048=1416114743;4096=1416114744;8192=1416114745;16384=1416114992;32768=1416114993;")
call InitSubAbilBR(9 , "^Size=16;Rarity=1.2;maxval=32768;minval=-32768;-32768=1416179760;-16384=1416179761;-8192=1416179762;-4096=1416179763;-2048=1416179764;-1024=1416179765;-512=1416179766;-256=1416179767;-128=1416179768;-64=1416179769;-32=1416180016;-16=1416180017;-8=1416180018;-4=1416180019;-2=1416180020;-1=1416180021;1=1416180022;2=1416180023;4=1416180024;8=1416180025;16=1416180272;32=1416180273;64=1416180274;128=1416180275;256=1416180276;512=1416180277;1024=1416180278;2048=1416180279;4096=1416180280;8192=1416180281;16384=1416180528;32768=1416180529;")
call InitSubAbilBR(10 , "^Size=16;Rarity=1.35;maxval=32768;minval=-32768;-32768=1416245296;-16384=1416245297;-8192=1416245298;-4096=1416245299;-2048=1416245300;-1024=1416245301;-512=1416245302;-256=1416245303;-128=1416245304;-64=1416245305;-32=1416245552;-16=1416245553;-8=1416245554;-4=1416245555;-2=1416245556;-1=1416245557;1=1416245558;2=1416245559;4=1416245560;8=1416245561;16=1416245808;32=1416245809;64=1416245810;128=1416245811;256=1416245812;512=1416245813;1024=1416245814;2048=1416245815;4096=1416245816;8192=1416245817;16384=1416246064;32768=1416246065;")
call InitSubAbilBR(11 , "^Size=16;Rarity=1.2;maxval=32768;minval=-32768;-32768=1416310832;-16384=1416310833;-8192=1416310834;-4096=1416310835;-2048=1416310836;-1024=1416310837;-512=1416310838;-256=1416310839;-128=1416310840;-64=1416310841;-32=1416311088;-16=1416311089;-8=1416311090;-4=1416311091;-2=1416311092;-1=1416311093;1=1416311094;2=1416311095;4=1416311096;8=1416311097;16=1416311344;32=1416311345;64=1416311346;128=1416311347;256=1416311348;512=1416311349;1024=1416311350;2048=1416311351;4096=1416311352;8192=1416311353;16384=1416311600;32768=1416311601;")
call InitSubAbilBR(12 , "^Size=16;Rarity=1.5;maxval=32768;minval=-32768;-32768=1416376368;-16384=1416376369;-8192=1416376370;-4096=1416376371;-2048=1416376372;-1024=1416376373;-512=1416376374;-256=1416376375;-128=1416376376;-64=1416376377;-32=1416376624;-16=1416376625;-8=1416376626;-4=1416376627;-2=1416376628;-1=1416376629;1=1416376630;2=1416376631;4=1416376632;8=1416376633;16=1416376880;32=1416376881;64=1416376882;128=1416376883;256=1416376884;512=1416376885;1024=1416376886;2048=1416376887;4096=1416376888;8192=1416376889;16384=1416377136;32768=1416377137;")
call InitSubAbilBR(13 , "^Size=5;Rarity=1.3;maxval=16;minval=-16;-16=1416441904;-8=1416441905;-4=1416441906;-2=1416441907;-1=1416441908;1=1416441909;2=1416441910;4=1416441911;8=1416441912;16=1416441913;")
call InitSubAbilBR(14 , "^Size=7;Rarity=1.12;maxval=64;minval=-64;-64=1416507440;-32=1416507441;-16=1416507442;-8=1416507443;-4=1416507444;-2=1416507445;-1=1416507446;1=1416507447;2=1416507448;4=1416507449;8=1416507696;16=1416507697;32=1416507698;64=1416507699;")
call SetupBR(0x3E77 , "^21=1;22=1;23=1;24=1;")
call SetupBR(0x3E78 , "^1=1;2=1;3=1;4=1;5=1;6=1;7=1;8=1;9=1;10=1;11=1;12=1;13=1;14=1;15=3;16=1;17=6;18=5;19=6;20=3;21=5;22=5;23=5;24=5;25=1;26=1;27=2;28=2;29=2;30=2;31=1;32=1;33=1;34=1;35=1;36=1;37=1;38=1;39=1;40=1;41=1;42=1;43=1;44=2;45=2;46=2;47=2;48=1;49=1;50=1;51=1;52=1;53=1;54=1;55=1;56=1;57=1;58=1;59=1;60=1;61=1;62=1;63=1;64=1;65=1;66=1;67=1;68=1;69=1;70=1;71=1;72=1;73=1;74=1;75=1;76=1;77=1;78=1;79=1;80=1;81=1;82=1;83=1;84=1;85=1;86=1;87=1;88=1;89=1;90=1;91=1;92=1;93=1;94=1;95=1;96=1;97=1;98=1;99=1;100=1;101=1;102=1;103=1;104=1;105=1;106=1;107=1;108=1;109=1;110=1;111=1;112=1;113=1;114=1;115=1;116=1;117=1;118=1;119=1;120=1;121=1;122=1;123=1;")
call InitDisplayNoDispBR("^19=1;")
call InitDisplayNoReqDispBR("^")
call SetupBR(0x3E79 , "^1=$lvl;2=$str;3=$agi;4=$int;5=$utype;6=$uabil;7=$uabil1;8=$uabil2;9=$uabil3;10=$uabil4;11=$uabil5;")
call SetupBR(0x3E79 , "^lvl=1;str=2;agi=3;int=4;utype=5;uabil=6;uabil1=7;uabil2=8;uabil3=9;uabil4=10;uabil5=11;")
call SetupBR(0x3E80 , "^1=$dmg;2=$def;3=$HP;4=$mana;5=$str;6=$int;7=$agi;8=$lich;9=$ias;10=$lifereg;11=$manareg;12=$move;13=$light;14=$sda;15=$onstruck;16=$sock;17=$AddAbil;18=$Cus;19=$AbilSil;20=$onhit;21=$PotHP;22=$pstr;23=$pagi;24=$pint;25=$cheap;26=$trade;27=$dmgpois;28=$dmgcold;29=$dmgltng;30=$dmgfire;31=$dmg%;32=$def%;33=$HP%;34=$mana%;35=$str%;36=$int%;37=$agi%;38=$ias%;39=$lifereg%;40=$manareg%;41=$move%;42=$light%;43=$sda%;44=$dmgmag;45=$dmgholy;46=$dmgdark;47=$dmgphys;48=$coldlen;49=$poislen;50=$firemin;51=$coldmin;52=$ltngmin;53=$poismin;54=$magmin;55=$holymin;56=$darkmin;57=$physmin;58=$firemax;59=$coldmax;60=$ltngmax;61=$poismax;62=$magmax;63=$holymax;64=$darkmax;65=$physmax;66=$dmgfire%;67=$dmgcold%;68=$dmgltng%;69=$dmgpois%;70=$dmgmag%;71=$dmgholy%;72=$dmgdark%;73=$dmgphys%;74=$piercefire;75=$piercecold;76=$pierceltng;77=$piercepois;78=$piercemag;79=$pierceholy;")
call SetupBR(0x3E80 , "^80=$piercedark;81=$piercefire%;82=$piercecold%;83=$pierceltng%;84=$piercepois%;85=$piercemag%;86=$pierceholy%;87=$piercedark%;88=$resfire;89=$rescold;90=$resltng;91=$respois;92=$resmag;93=$resholy;94=$resdark;95=$resfiremax;96=$rescoldmax;97=$resltngmax;98=$respoismax;99=$resmagmax;100=$resholymax;101=$resdarkmax;102=$resall;103=$resallmax;104=$absfire;105=$abscold;106=$absltng;107=$abspois;108=$absmag;109=$absholy;110=$absdark;111=$absfire%;112=$abscold%;113=$absltng%;114=$abspois%;115=$absmag%;116=$absholy%;117=$absdark%;118=$redpois;119=$redcold;120=$nofreeze;121=$redstun;122=$block;123=$crit;")
call SetupBR(0x3E80 , "^dmg=1;def=2;HP=3;mana=4;str=5;int=6;agi=7;lich=8;ias=9;lifereg=10;manareg=11;move=12;light=13;sda=14;onstruck=15;sock=16;AddAbil=17;Cus=18;AbilSil=19;onhit=20;PotHP=21;pstr=22;pagi=23;pint=24;cheap=25;trade=26;dmgpois=27;dmgcold=28;dmgltng=29;dmgfire=30;dmg%=31;def%=32;HP%=33;mana%=34;str%=35;int%=36;agi%=37;ias%=38;lifereg%=39;manareg%=40;move%=41;light%=42;sda%=43;dmgmag=44;dmgholy=45;dmgdark=46;dmgphys=47;coldlen=48;poislen=49;firemin=50;coldmin=51;ltngmin=52;poismin=53;magmin=54;holymin=55;darkmin=56;physmin=57;firemax=58;coldmax=59;ltngmax=60;poismax=61;magmax=62;holymax=63;darkmax=64;physmax=65;dmgfire%=66;dmgcold%=67;dmgltng%=68;dmgpois%=69;dmgmag%=70;dmgholy%=71;dmgdark%=72;dmgphys%=73;piercefire=74;piercecold=75;pierceltng=76;piercepois=77;piercemag=78;pierceholy=79;piercedark=80;piercefire%=81;piercecold%=82;pierceltng%=83;piercepois%=84;")
call SetupBR(0x3E80 , "^piercemag%=85;pierceholy%=86;piercedark%=87;resfire=88;rescold=89;resltng=90;respois=91;resmag=92;resholy=93;resdark=94;resfiremax=95;rescoldmax=96;resltngmax=97;respoismax=98;resmagmax=99;resholymax=100;resdarkmax=101;resall=102;resallmax=103;absfire=104;abscold=105;absltng=106;abspois=107;absmag=108;absholy=109;absdark=110;absfire%=111;abscold%=112;absltng%=113;abspois%=114;absmag%=115;absholy%=116;absdark%=117;redpois=118;redcold=119;nofreeze=120;redstun=121;block=122;crit=123;")
call InitCusAbilMultBR("^1=$Prop31Par;2=$Prop32Par;3=$Prop33Par;4=$Prop34Par;5=$Prop35Par;6=$Prop36Par;7=$Prop37Par;9=$Prop38Par;10=$Prop39Par;11=$Prop40Par;12=$Prop41Par;13=$Prop42Par;14=$Prop43Par;")
call SetupBR(0x3E81 , "^4000=$blizzard;4001=$inferno;4002=$acid;")
call SetupBR(0x3E81 , "^blizzard=4000;inferno=4001;acid=4002;")
call SetupBR(0x3E81 , "^1=$Hallo;")
call SetupBR(0x3E81 , "^Hallo=1;")
call SetupBR(0x3E82 , "^4000=$Blizzard;4001=$Inferno;4002=$Acid Bomb;")
call SetupBR(0x3E83 , "^weapon=$Weapons;helm=$Helms;armor=$Armor;shield=$Shields;shoulder=$Pauldrons;")
call SetupBR(0x3E84 , "^weapon=$Item type: Weapon;helm=$Item type: Helm;armor=$Item type: Armor;shield=$Item type: Shield;gems=$Can be inserted into socketed items;charm=$Keep in Inventory to gain bonus;belt=$Item type: Belt;charged=$Can be actively used;amulet=$Item type: Amulet;shoulder=$Item type: Pauldron;gloves=$Item type: Gloves;bracers=$Item type: Bracers;pants=$Item type: Pants;boots=$Item type: Boots;ring=$Item type: Ring;")
call SetupBR(0x3E85 , "^sword1h=$Class: One-Hand Sword;sword2h=$Class: Two-Hand Sword;axe1h=$Class: One-Hand Axe;axe2h=$Class: Two-Hand Axe;rune=$Class: Rune;armor=$Class: Armor;helm=$Class: Helm;shield=$Class: Shield;charm=$Class: Charm;belt=$Class: Belt;potion=$Class: Potion;shoulder=$Class: Pauldron;gloves=$Class: Gloves;bracers=$Class: Bracers;pants=$Class: Pants;boots=$Class: Boots;ring=$Class: Ring;amulet=$Class: Amulet;")
call SetupBR(0x3E86 , "^charged=$Charged Item Slot;armor=$Armor Slot;amulet=$Amulet Slot;shoulder=$Pauldron Slot;weapon=$Main Hand Slot;shield=$Secondary Hand Slot;helm=$Helm Slot;gloves=$Gloves Slot;belt=$Belt Slot;bracers=$Bracers Slot;pants=$Pants Slot;boots=$Boots Slot;ring=$Ring Slot;pagedown=$Inventory Page Down;pageup=$Inventory Page Up;exit=$Exit Inventory;drop=$Drop Current Selected Item;pagedownmerch=$Next Page;pageupmerch=$Previous Page;sellitem=$Sell Current Selected Item;buyitem=$Buy Current Selected Item;")
call InitCusFuncsBaseBR("^1=$TestHallo;2=$FullDTSet;3=$TRSPotionsRestoreHP;4=$TRSPerStr;5=$TRSPerAgi;6=$TRSPerInt;7=$AddEffectToTarget;8=$CustomBLA;")
endfunction
function TestHallo takes nothing returns nothing
if TRSMod == 1 and not TRSInsert then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl" , TRSUnit , "origin"))
elseif TRSMod == 2 and not TRSInsert then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" , TRSUnit , "origin"))
endif
endfunction
function CustomBLA takes nothing returns nothing
call echo("WHAT'S UP !")
endfunction
function FullDTSet takes nothing returns nothing
if TRSMod == 1 and not TRSInsert then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl" , TRSUnit , "origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl" , TRSUnit , "origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl" , TRSUnit , "origin"))
if GetOwningPlayer(TRSUnit) == GetLocalPlayer() then
call DisplayTimedTextToPlayer(GetLocalPlayer() , 0 , 0 , 128 , "|cfffedaac                  T H E Y   R U L E S  ! ! !|r")
call DisplayTimedTextToPlayer(GetLocalPlayer() , 0 , 0 , 0.1 , " ")
endif
endif
endfunction
function AddEffectToTarget takes nothing returns nothing
if TRSMod == 1 and not TRSInsert then
if InvCurSide == "left" then
elseif InvCurSide == "right" then
endif
elseif TRSMod == 2 and not TRSInsert then
if TRSMin < 1 then
if InvCurSide == "left" then
elseif InvCurSide == "right" then
endif
endif
endif
endfunction
function TRSPotionsRestoreHP takes nothing returns nothing
local integer i=GetRandomInt(TRSMinS , TRSMaxS)
local effect e=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Heal\\HealTarget.mdl" , TRSUnit , "origin")
call SetUnitState(TRSUnit , UNIT_STATE_LIFE , GetUnitState(TRSUnit , UNIT_STATE_LIFE) + i)
call TriggerSleepAction(1)
call DestroyEffect(e)
set e = null
endfunction
function TRSPerStr takes nothing returns nothing
local integer i=GetRandomInt(TRSMinS , TRSMaxS)
if IsUnitType(TRSUnit , UNIT_TYPE_HERO) then
call SetHeroStr(TRSUnit , GetHeroStr(TRSUnit , false) + i , true)
endif
endfunction
function TRSPerAgi takes nothing returns nothing
local integer i=GetRandomInt(TRSMinS , TRSMaxS)
if IsUnitType(TRSUnit , UNIT_TYPE_HERO) then
call SetHeroAgi(TRSUnit , GetHeroAgi(TRSUnit , false) + i , true)
endif
endfunction
function TRSPerInt takes nothing returns nothing
local integer i=GetRandomInt(TRSMinS , TRSMaxS)
if IsUnitType(TRSUnit , UNIT_TYPE_HERO) then
call SetHeroInt(TRSUnit , GetHeroInt(TRSUnit , false) + i , true)
endif
endfunction
function TRSReqCheckLvl takes nothing returns boolean
if eax12 > 0 and eax11 > 0 then
set esx30 = "Required Level: " + I2S(eax11)
endif
return GetUnitLevel(eux10) >= eax11
endfunction
function TRSReqCheckStr takes nothing returns boolean
if eax12 > 0 and eax11 > 0 then
set esx30 = "Required Strength: " + I2S(eax11)
endif
if IsUnitType(eux10 , UNIT_TYPE_HERO) then
return GetHeroStr(eux10 , true) >= eax11
endif
return false
endfunction
function TRSReqCheckAgi takes nothing returns boolean
if eax12 > 0 and eax11 > 0 then
set esx30 = "Required Agility: " + I2S(eax11)
endif
if IsUnitType(eux10 , UNIT_TYPE_HERO) then
return GetHeroAgi(eux10 , true) >= eax11
endif
return false
endfunction
function TRSReqCheckInt takes nothing returns boolean
if eax12 > 0 and eax11 > 0 then
set esx30 = "Required Intelligence: " + I2S(eax11)
endif
if IsUnitType(eux10 , UNIT_TYPE_HERO) then
return GetHeroInt(eux10 , true) >= eax11
endif
return false
endfunction
function TRSReqCheckUnitType takes nothing returns boolean
if eax12 > 0 and eax11 > 0 then
set esx30 = GetObjectName(eax11) + " Only"
endif
return GetUnitTypeId(eux10) == eax11
endfunction
function TRSReqCheckUnitAbility takes nothing returns boolean
if eax12 > 0 and eax11 > 0 then
set esx30 = "Requires " + GetObjectName(eax11)
endif
return GetUnitAbilityLevel(eux10 , eax11) > 0
endfunction
function TRSRequiresInit takes nothing returns nothing
set TRSRequiresFuncs[0x1]=Condition(function TRSReqCheckLvl)
set TRSRequiresFuncs[0x2]=Condition(function TRSReqCheckStr)
set TRSRequiresFuncs[0x3]=Condition(function TRSReqCheckAgi)
set TRSRequiresFuncs[0x4]=Condition(function TRSReqCheckInt)
set TRSRequiresFuncs[0x5]=Condition(function TRSReqCheckUnitType)
set TRSRequiresFuncs[0x6]=Condition(function TRSReqCheckUnitAbility)
set TRSRequiresFuncs[0x7]=Condition(function TRSReqCheckUnitAbility)
set TRSRequiresFuncs[0x8]=Condition(function TRSReqCheckUnitAbility)
set TRSRequiresFuncs[0x9]=Condition(function TRSReqCheckUnitAbility)
set TRSRequiresFuncs[0xa]=Condition(function TRSReqCheckUnitAbility)
set TRSRequiresFuncs[0xb]=Condition(function TRSReqCheckUnitAbility)
endfunction
function InitTrig_TRSSetups takes nothing returns nothing
endfunction
function TRSInitSetItems takes nothing returns nothing
call StoreString(TRSItems , "BuranSet" , "name" , "Buran.ru Overwhelming")
call InitSetItemBR(1227894832 , "CelebrateCharge" , "Buran" , "^lvl=7;name=$Celebrate's Charge;cost=145;^str=0;25;25;dmg=0;35;45;ias=0;5;5;agi=0;10;10;onhit=$blizzard;8;4;lich=0;25;25;sock=0;0;2;")
call InitSetItemBonusBR(1227894832 , "CelebrateCharge" , 2 , "^^dmg=10;;;")
call InitSetItemBonusBR(1227894832 , "CelebrateCharge" , 3 , "^^dmg=20;;;ias=10;;;")
call InitSetItemBonusBR(1227894832 , "CelebrateCharge" , 4 , "^^dmg=30;;;ias=20;;;AddAbil=1093677108;2;2;")
call InitSetItemBR(1227894833 , "DioDWard" , "Buran" , "^lvl=7;name=$DioD's Ward;cost=135;^def=0;15;20;int=0;35;35;manareg=0;200;200;lifereg=0;5;5;sda=0;5;5;AddAbil=1093677124;2;3;move=0;35;35;")
call InitSetItemBonusBR(1227894833 , "DioDWard" , 2 , "^^hp=150;;;")
call InitSetItemBonusBR(1227894833 , "DioDWard" , 3 , "^^hp=250;;;mana=125;;;")
call InitSetItemBonusBR(1227894833 , "DioDWard" , 4 , "^^hp=450;;;mana=300;;;AddAbil=1093677110;2;2;")
call InitSetItemBR(1227894838 , "AlexeyWisdom" , "Buran" , "^lvl=6;name=$Alexey2005's Wisdom;cost=150;^def=0;20;20;int=0;35;35;agi=0;15;15;mana=0;200;250;sock=0;1;3;sda=0;10;10;AddAbil=1093677105;2;4;")
call InitSetItemBonusBR(1227894838 , "AlexeyWisdom" , 2 , "^^int=10;;;")
call InitSetItemBonusBR(1227894838 , "AlexeyWisdom" , 3 , "^^int=20;;;sda=5;;;")
call InitSetItemBonusBR(1227894838 , "AlexeyWisdom" , 4 , "^^int=30;;;sda=10;;;onhit=$acid;5;2;")
call InitSetItemBR(1227894837 , "TcMight" , "Buran" , "^lvl=8;agi=35;name=$Tc's Might;icon=1110454577;cost=140;^def=0;10;30;sda=0;5;10;sock=0;0;2;dmg=0;25;35;lifereg=0;5;8;ias=0;10;15;AddAbil=1093677108;2;3;str=0;15;15;")
call InitSetItemBonusBR(1227894837 , "TcMight" , 2 , "^^def=10;;;")
call InitSetItemBonusBR(1227894837 , "TcMight" , 3 , "^^def=20;;;onhit=$inferno;4;2;")
call InitSetItemBonusBR(1227894837 , "TcMight" , 4 , "^^def=40;;;onhit=$inferno;6;3;AddAbil=1093677109;2;2;")
call InitItemSetBonusBR("Buran" , 2 , "^^dmg=20;;;agi=10;;;int=10;;;str=10;;;")
call InitItemSetBonusBR("Buran" , 3 , "^^dmg=40;;;agi=20;;;int=20;;;str=20;;;")
call InitItemSetBonusBR("Buran" , 4 , "^^dmg=80;;;agi=40;;;int=40;;;str=40;;;AddAbil=1093677128;5;5;Cus=1;;;lifereg=20;;;")
call StoreString(TRSItems , "DreamTeamSet" , "name" , "MuZ DreamTeam")
call InitSetItemBR(1227894832 , "Rammstein" , "DreamTeam" , "^lvl=7;name=$Ramms+ein;cost=750;^dmg=;250;250;str=;100;100;ias=;100;100;sock=;2;4;")
call InitSetItemBonusBR(1227894832 , "Rammstein" , 2 , "^^dmg=25;;;")
call InitSetItemBonusBR(1227894832 , "Rammstein" , 3 , "^^dmg=50;;;")
call InitSetItemBonusBR(1227894832 , "Rammstein" , 4 , "^^dmg=100;;;")
call InitSetItemBonusBR(1227894832 , "Rammstein" , 5 , "^^dmg=250;;;ias=500;;;")
call InitSetItemBR(1227894833 , "Tiesto" , "DreamTeam" , "^lvl=8;name=$Tiesto;cost=725;^int=;100;100;def=;100;100;mana=;2000;2000;manareg=;200;200;sock=;1;2;")
call InitSetItemBonusBR(1227894833 , "Tiesto" , 2 , "^^def=25;;;")
call InitSetItemBonusBR(1227894833 , "Tiesto" , 3 , "^^def=50;;;")
call InitSetItemBonusBR(1227894833 , "Tiesto" , 4 , "^^def=100;;;")
call InitSetItemBonusBR(1227894833 , "Tiesto" , 5 , "^^def=250;;;int=100;;;")
call InitSetItemBR(1227894838 , "Tomcraft" , "DreamTeam" , "^lvl=7;name=$Tomcraft;icon=1110454578;cost=740;^def=;50;50;agi=;100;100;hp=;2000;2000;lifereg=;20;20;sock=;1;2;")
call InitSetItemBonusBR(1227894838 , "Tomcraft" , 2 , "^^agi=50;;;")
call InitSetItemBonusBR(1227894838 , "Tomcraft" , 3 , "^^agi=100;;;")
call InitSetItemBonusBR(1227894838 , "Tomcraft" , 4 , "^^agi=200;;;")
call InitSetItemBonusBR(1227894838 , "Tomcraft" , 5 , "^^agi=500;;;hp=4000;;;")
call InitSetItemBR(1227894837 , "PaulOakenfold" , "DreamTeam" , "^lvl=7;name=$Paul Oakenfold;cost=715;^def=;75;75;move=;50;50;AddAbil=1093677111;2;5;AddAbil=1093677126;3;5;sock=;1;3;")
call InitSetItemBonusBR(1227894837 , "PaulOakenfold" , 2 , "^^str=35;;;")
call InitSetItemBonusBR(1227894837 , "PaulOakenfold" , 3 , "^^str=70;;;")
call InitSetItemBonusBR(1227894837 , "PaulOakenfold" , 4 , "^^str=150;;;")
call InitSetItemBonusBR(1227894837 , "PaulOakenfold" , 5 , "^^str=300;;;AddAbil=1093677110;4;4;")
call InitSetItemBR(1227894841 , "FerryCorsten" , "DreamTeam" , "^lvl=8;name=$Ferry Corsten;cost=725;^lifereg=;20;20;def=;50;50;dmg=;100;100;sda=;20;20;AddAbil=1093677109;5;5;")
call InitSetItemBonusBR(1227894841 , "FerryCorsten" , 2 , "^^int=40;;;")
call InitSetItemBonusBR(1227894841 , "FerryCorsten" , 3 , "^^int=80;;;")
call InitSetItemBonusBR(1227894841 , "FerryCorsten" , 4 , "^^int=160;;;")
call InitSetItemBonusBR(1227894841 , "FerryCorsten" , 5 , "^^int=350;;;AddAbil=1093677124;5;5;")
call InitItemSetBonusBR("DreamTeam" , 2 , "^^def=10;;;dmg=10;;;")
call InitItemSetBonusBR("DreamTeam" , 3 , "^^def=100;;;dmg=100;;;")
call InitItemSetBonusBR("DreamTeam" , 4 , "^^def=1000;;;dmg=1000;;;")
call InitItemSetBonusBR("DreamTeam" , 5 , "^^def=10000;;;dmg=10000;;;lifereg=100;;;manareg=1000;;;AddAbil=1095660131;3;3;Cus=2;;;dmgfire=;1000;1000;dmgcold=;1000;1000;dmgltng=;1;10000;")
endfunction
function TRSInitUniqueItems takes nothing returns nothing
call InitUniqueItemBR(1227894832 , "bloodletter" , "^lvl=6;name=$Blood Letter;cost=150;^dmg=0;25;35;lich=0;25;35;ias=0;30;35;AddAbil=1093677108;2;2;hp=0;350;350;lifereg=0;-3;-1;")
call InitUniqueItemBR(1227894832 , "bloodmoon" , "^lvl=10;name=$Bloodmoon;icon=1110454576;cost=350;^dmg=0;65;85;lich=0;55;65;ias=0;60;75;AddAbil=1093677109;2;3;AddAbil=1093677110;1;2;hp=0;500;500;lifereg=0;5;10;dmgfire=;15;25;")
call InitUniqueItemBR(1227894833 , "blinkbatform" , "^lvl=5;name=$Blinkbat's Form;cost=135;^def=0;6;14;lich=0;15;15;sda=0;5;5;move=0;50;50;AddAbil=1093677125;1;3;lifereg=0;3;5;")
call InitUniqueItemBR(1227894833 , "lichward" , "^lvl=10;name=$Lich Ward;cost=450;^def=0;45;55;lich=0;35;35;sda=0;15;15;manareg=0;200;250;mana=0;350;350;AddAbil=1093677113;2;5;AddAbil=1093677112;3;5;AddAbil=1093677121;1;5;dmg=0;25;25;AddAbil=1093677110;4;5;dmgcold=;10;20;")
call InitUniqueItemBR(1227894855 , "hunter" , "^lvl=10;name=$HunTers Glory;cost=850;^def=0;145;255;sda=0;25;45;lifereg=0;10;20;hp=0;350;500;AddAbil=1093677144;1;5;AddAbil=1093677109;1;5;AddAbil=1093677110;1;5;dmg=0;45;65;dmgpois=5;100;200;move=0;20;60;ias=;10;20;sock=;0;3;")
endfunction
function TRSInitRunewordItems takes nothing returns nothing
call InitRunewordBonusBR("OrtRalOrt" , "^isclass1=$melee;name=$Corpse Explosion;lvl=8;icon=1110454362;runecount=3;^AddAbil=1093677128;3;5;dmg=0;25;35;lifereg=0;6;12;ias=0;15;20;dmgpois=8;50;80;")
call InitRunewordBonusBR("TalRalOrtTal" , "^itype1=$armor;name=$Flame Guard;lvl=10;icon=1110454361;runecount=4;^AddAbil=1093677123;2;4;def=0;10;20;hp=0;150;150;sda=0;5;10;AddAbil=1093677127;2;3;dmgfire=;25;45;")
endfunction
function TRSInitGemsItems takes nothing returns nothing
call InitItemBaseBR(1227894834 , "^name=$Rune Ort;runename=$Ort;type=$gems;class=$rune;notequip=1;lvl=5;icon=1110454345;cost=40;")
call InitGemExtrazBR(1227894834 , "weapon" , "^^AddAbil=1093677105;1;1;dmg=10;0;0;dmgltng=;1;32;")
call InitGemExtrazBR(1227894834 , "helm" , "^^hp=25;0;0;def=1;0;0;")
call InitGemExtrazBR(1227894834 , "armor" , "^^hp=50;0;0;def=2;0;0;lifereg=2;0;0;")
call InitGemExtrazBR(1227894834 , "shield" , "^^hp=100;0;0;def=5;0;0;")
call InitGemExtrazBR(1227894834 , "shoulder" , "^^hp=75;0;0;def=7;0;0;")
call InitItemBaseBR(1227894835 , "^name=$Rune Ral;runename=$Ral;type=$gems;class=$rune;notequip=1;lvl=4;icon=1110454346;cost=35;")
call InitGemExtrazBR(1227894835 , "weapon" , "^^AddAbil=1093677106;1;1;dmg=10;0;0;dmgfire=;8;20;")
call InitGemExtrazBR(1227894835 , "helm" , "^^mana=25;0;0;sda=4;0;0;")
call InitGemExtrazBR(1227894835 , "armor" , "^^mana=50;0;0;sda=3;0;0;manareg=25;0;0;")
call InitGemExtrazBR(1227894835 , "shield" , "^^mana=100;0;0;def=5;0;0;")
call InitGemExtrazBR(1227894835 , "shoulder" , "^^mana=75;0;0;def=7;0;0;")
call InitItemBaseBR(1227894840 , "^name=$Rune Tal;runename=$Tal;type=$gems;class=$rune;notequip=1;lvl=4;icon=1110454347;cost=30;")
call InitGemExtrazBR(1227894840 , "weapon" , "^^AddAbil=1093677111;1;1;dmg=5;0;0;ias=0;5;5;dmgpois=300;12;24;")
call InitGemExtrazBR(1227894840 , "helm" , "^^move=25;0;0;hp=50;0;0;")
call InitGemExtrazBR(1227894840 , "armor" , "^^move=35;0;0;AddAbil=1093677111;1;1;")
call InitGemExtrazBR(1227894840 , "shield" , "^^move=25;0;0;def=8;0;0;")
call InitGemExtrazBR(1227894840 , "shoulder" , "^^move=30;0;0;def=5;0;0;")
call InitItemBaseBR(1227894836 , "^name=$Jewel;type=$gems;class=$jewel;notequip=1;lvl=5;int=25;icon=1110454323;cost=25;^dmg=5;2;5;int=1;-1;4;hp=25;5;25;ias=1;-1;4;$pstr=4;3;5;")
endfunction
function TRSInitMiscItems takes nothing returns nothing
call InitItemBaseBR(1227894839 , "^lvl=4;name=$Small Charm;type=$charm;class=$charm;sclass=$charm;icon=1110454349;cost=30;^mana=0;25;50;manareg=0;50;100;int=5;0;5;cus=8;;;")
call InitItemBaseBR(1227894851 , "^lvl=4;name=$Health Potion;type=$charged;class=$potion;sclass=$potion;notequip=1;stack=10;minstock=1;maxstock=3;icon=1110454325;cost=10;cooldownid=$hppotion;cooldown=0.5;nouse=1;^PotHP=3;100;200;pstr=4;3;5;pagi=5;3;5;pint=6;3;5;")
endfunction
function TRSInitItems2 takes nothing returns nothing
endfunction
function TRSInitItems takes nothing returns nothing
call InitItemBaseBR(1227894832 , "^lvl=2;agi=15;str=20;name=$Short Sword;type=$weapon;class=$sword1h;sclass=$melee;maxsock=5;icon=1110454348;cost=10;^dmg=10;1;8;ias=10;0;10;sock=0;0;3;")
call InitItemBaseBR(1227894853 , "^lvl=4;agi=20;str=35;name=$Two Hander;utype=1215324524;uabil=1093677138;type=$weapon;class=$sword2h;sclass=$melee;2handed=1;maxsock=6;icon=1110454581;cost=15;^dmg=20;2;12;ias=0;-10;0;sock=0;0;6;$pstr=4;5;10;")
call InitItemBaseBR(1227894833 , "^lvl=2;str=12;name=$Leather Armor;type=$armor;class=$armor;sclass=$armor;maxsock=4;icon=1110454324;cost=14;^def=3;-1;2;sock=0;0;4;")
call InitItemBaseBR(1227894837 , "^lvl=2;str=20;name=$Small Shield;type=$shield;class=$shield;sclass=$shield;maxsock=4;icon=1110454350;cost=12;^def=5;-2;2;sda=4;-4;4;")
call InitItemBaseBR(1227894838 , "^lvl=2;str=15;int=15;name=$Helm;type=$helm;class=$helm;sclass=$helm;maxsock=3;icon=1110454321;cost=13;^def=5;-3;2;int=3;-1;2;")
call InitItemBaseBR(1227894841 , "^lvl=2;str=25;name=$Belt;type=$belt;class=$belt;sclass=$belt;icon=1110454322;cost=10;^def=3;1;2;lifereg=1;-1;4;")
call InitItemBaseBR(1227894856 , "^lvl=3;str=10;int=20;name=$Leather Gloves;type=$gloves;class=$gloves;sclass=$gloves;icon=1110454328;cost=11;^def=;1;4;ias=;1;5;")
call InitItemBaseBR(1227894857 , "^lvl=2;str=20;agi=10;name=$Bracers;type=$bracers;class=$bracers;sclass=$bracers;icon=1110454339;cost=15;^def=;1;3;sda=;0;5;str=;0;2;")
call InitItemBaseBR(1227894858 , "^lvl=4;str=20;name=$Leather Skirt;type=$pants;class=$pants;sclass=$pants;icon=1110454597;cost=12;^def=;2;6;lifereg=;0;2;")
call InitItemBaseBR(1227894855 , "^lvl=5;str=30;name=$Pauldron;type=$shoulder;class=$shoulder;sclass=$shoulder;maxsock=3;icon=1110454598;cost=16;^def=;5;8;str=;0;4;sock=;;3;")
call InitItemBaseBR(1227894860 , "^lvl=4;str=10;agi=20;name=$Boots;type=$boots;class=$boots;sclass=$boots;icon=1110454602;cost=13;^def=;1;4;agi=;0;2;move=;;40;")
call InitItemBaseBR(1227894854 , "^lvl=5;name=$Amulet;type=$amulet;class=$amulet;sclass=$amulet;icon=1110454329;icon1=1110454329;icon2=1110454337;icon3=1110454338;maxicons=3;cost=50;^int=;1;8;cheap=;;15;")
call InitItemBaseBR(1227894859 , "The result of a collapsed star entombed within a field of elemental magic, Darchrow is one of the most dangerous beings in existence, consuming hundreds of worlds into the void of his hate and hunger. Now serving the Sentinel for an unknown purpose, Darchrow turns his hatred upon the Undead Scourge, yet is not above using his own allies as portals for his own servants to come through. Capable of manipulating both void and shadow in combat, his greatest pleasure is to release the oblivion within him upon the world, creating an abyss that draws enemies ever closer to destruction.^lvl=3;name=$Ring;type=$ring;class=$ring;sclass=$ring;icon=1110454599;icon1=1110454600;icon2=1110454599;icon3=1110454601;maxicons=3;cost=35;^def=;;2;manareg=;10;50;trade=;;10;")
call ExecuteFunc("TRSInitSetItems")
call ExecuteFunc("TRSInitUniqueItems")
call ExecuteFunc("TRSInitRunewordItems")
call ExecuteFunc("TRSInitGemsItems")
call ExecuteFunc("TRSInitMiscItems")
endfunction
function InitTrig_TRSItems takes nothing returns nothing
endfunction
function TRSDisMod_MBWidth takes nothing returns real
return .315
endfunction
function GetStringCutBR takes integer CutLength,integer Sl,integer offset,string s returns integer
local integer c=offset + CutLength
if SubString(s , c - 1 , c) != " " then
loop
exitwhen SubString(s , c - 1 , c) == " " or c >= Sl
set c = c + 1
endloop
endif
return c
endfunction
function AddParamToDisListBR takes string s,string id,boolean Added,integer prop,integer num returns nothing
local string pro=I2S(prop)
local string pro2="Prop" + I2S(num)
local integer i2=0
local integer i3=0
local integer i4=0
local integer par=GetStoredInteger(TRSItems , id , pro2 + "Par")
local integer min=GetStoredInteger(TRSItems , id , pro2 + "Min")
local integer max=GetStoredInteger(TRSItems , id , pro2 + "Max")
local integer t=GetIntBR(0x3E78 , pro)
set pro = "Prop" + pro
if t == 1 or t == 0 then
if not GetStoredBoolean(TRSItems , "DisplayVals" , pro) then
call StoreBoolean(TRSItems , "DisplayVals" , pro , true)
set TRSAbilsToDisplayCount = TRSAbilsToDisplayCount + 1
set TRSAbilsToDisplay[TRSAbilsToDisplayCount]=prop
set TRSAbilsToDisplayPar[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMin[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMax[TRSAbilsToDisplayCount]=0
call StoreInteger(TRSItems , "DisplayVals" , pro , TRSAbilsToDisplayCount)
endif
set i4 = GetStoredInteger(TRSItems , "DisplayVals" , pro)
set TRSAbilsToDisplayPar[i4]=TRSAbilsToDisplayPar[i4] + par
set TRSAbilsToDisplayMin[i4]=TRSAbilsToDisplayMin[i4] + min
set TRSAbilsToDisplayMax[i4]=TRSAbilsToDisplayMax[i4] + max
elseif t == 2 then
if not GetStoredBoolean(TRSItems , "DisplayVals" , pro) then
call StoreBoolean(TRSItems , "DisplayVals" , pro , true)
set TRSAbilsToDisplayCount = TRSAbilsToDisplayCount + 1
set TRSAbilsToDisplay[TRSAbilsToDisplayCount]=prop
set TRSAbilsToDisplayPar[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMin[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMax[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayAbilCount[TRSAbilsToDisplayCount]=0
call StoreInteger(TRSItems , "DisplayVals" , pro , TRSAbilsToDisplayCount)
endif
set i4 = GetStoredInteger(TRSItems , "DisplayVals" , pro)
set TRSAbilsToDisplayPar[i4]=TRSAbilsToDisplayPar[i4] + par
set TRSAbilsToDisplayMin[i4]=TRSAbilsToDisplayMin[i4] + min
set TRSAbilsToDisplayMax[i4]=TRSAbilsToDisplayMax[i4] + max
set i3 = GetStoredInteger(TRSItems , id , pro + "Count")
if i3 <= 0 then
set i3 = 1
endif
set TRSAbilsToDisplayAbilCount[i4]=TRSAbilsToDisplayAbilCount[i4] + i3
elseif t == 3 or t == 4 or t == 5 or t == 7 then
set pro = pro + "s" + I2S(par)
if not GetStoredBoolean(TRSItems , "DisplayVals" , pro) then
call StoreBoolean(TRSItems , "DisplayVals" , pro , true)
set TRSAbilsToDisplayCount = TRSAbilsToDisplayCount + 1
set TRSAbilsToDisplay[TRSAbilsToDisplayCount]=prop
set TRSAbilsToDisplayPar[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMin[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMax[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayAbilCount[TRSAbilsToDisplayCount]=0
call StoreInteger(TRSItems , "DisplayVals" , pro , TRSAbilsToDisplayCount)
endif
set i4 = GetStoredInteger(TRSItems , "DisplayVals" , pro)
set TRSAbilsToDisplayPar[i4]=par
set TRSAbilsToDisplayMin[i4]=TRSAbilsToDisplayMin[i4] + min
set TRSAbilsToDisplayMax[i4]=TRSAbilsToDisplayMax[i4] + max
set i3 = GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count")
if i3 <= 0 then
set i3 = 1
endif
set TRSAbilsToDisplayAbilCount[i4]=TRSAbilsToDisplayAbilCount[i4] + i3
elseif t == 6 then
set pro = pro + "s" + I2S(par)
if not GetStoredBoolean(TRSItems , "DisplayVals" , pro) then
call StoreBoolean(TRSItems , "DisplayVals" , pro , true)
set TRSAbilsToDisplayCount = TRSAbilsToDisplayCount + 1
set TRSAbilsToDisplay[TRSAbilsToDisplayCount]=prop
set TRSAbilsToDisplayPar[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMin[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayMax[TRSAbilsToDisplayCount]=0
set TRSAbilsToDisplayAbilCount[TRSAbilsToDisplayCount]=0
call StoreInteger(TRSItems , "DisplayVals" , pro , TRSAbilsToDisplayCount)
endif
set i4 = GetStoredInteger(TRSItems , "DisplayVals" , pro)
set TRSAbilsToDisplayPar[i4]=par
set TRSAbilsToDisplayMin[i4]=ASC2I(GetAbilityEffectById(par , EFFECT_TYPE_EFFECT , 2))
set TRSAbilsToDisplayMax[i4]=TRSAbilsToDisplayMax[i4] + max
set i3 = GetStoredInteger(TRSItems , id , "Prop" + I2S(num) + "Count")
if i3 <= 0 then
set i3 = 1
endif
set TRSAbilsToDisplayAbilCount[i4]=TRSAbilsToDisplayAbilCount[i4] + i3
endif
set TRSAbilsToDisplayUsed[i4]=Added
endfunction
function DisplayParamParserBR takes string u,string id,string h,boolean sock returns nothing
local integer i=1
local integer i2=0
local integer i3=0
local integer count=GetStoredInteger(TRSItems , id , "maxstats")
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , id , "Prop" + I2S(i))
if not TRSAbilsDisplayNotDisp[i2] then
set i3 = GetIntBR(0x3E78 , I2S(i2))
if i3 == 1 then
call AddParamToDisListBR(u , id , sock , i2 , i)
call PreGenerateParSingleBR(id , h , i , i3)
call AddParamToDisListBR(u , h + "Gen" , sock , i2 , i)
elseif i3 == 4 or i3 == 6 or i3 == 7 then
call PreGenerateParSingleBR(id , h , i , i3)
call AddParamToDisListBR(u , h + "Gen" , sock , i2 , i)
else
call AddParamToDisListBR(u , id , sock , i2 , i)
endif
endif
set i = i + 1
endloop
endif
set count = GetStoredInteger(TRSItems , h , "maxstats")
set i = 1
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , h , "Prop" + I2S(i))
if not TRSAbilsDisplayNotDisp[i2] then
if not TRSAbilsDisplayNotDisp[i2] then
call AddParamToDisListBR(u , h , true , i2 , i)
endif
endif
set i = i + 1
endloop
endif
set h = h + "Ex"
set count = GetStoredInteger(TRSItems , h , "maxstats")
set i = 1
if count > 0 then
loop
exitwhen i >= count
set i2 = GetStoredInteger(TRSItems , h , "Prop" + I2S(i))
if not TRSAbilsDisplayNotDisp[i2] then
if not TRSAbilsDisplayNotDisp[i2] then
call AddParamToDisListBR(u , h , true , i2 , i)
endif
endif
set i = i + 1
endloop
endif
endfunction
function CompileDisplayStringBR takes integer id returns string
set esx20 = null
call TriggerEvaluate(TRSAbilsToDisplayStringCompiler[id])
return esx20
endfunction
function AddItemPropDisplayBR takes string val,integer r,integer g,integer b returns nothing
if val != null and val != "" then
set DisStrMax = DisStrMax + 1
set DisStr[DisStrMax]=val
set DisStrR[DisStrMax]=r
set DisStrG[DisStrMax]=g
set DisStrB[DisStrMax]=b
endif
endfunction
function AddItemPropDisplayFakeBR takes nothing returns nothing
set DisStrMax = DisStrMax + 1
set DisStr[DisStrMax]=""
set DisStrR[DisStrMax]=255
set DisStrG[DisStrMax]=255
set DisStrB[DisStrMax]=255
endfunction
function RedBR takes integer i returns integer
if i == 1 then
return 225
elseif i == 2 then
return 65
elseif i == 3 then
return 65
endif
return 0
endfunction
function GreenBR takes integer i returns integer
if i == 1 then
return 65
elseif i == 2 then
return 225
elseif i == 3 then
return 65
endif
return 0
endfunction
function BlueBR takes integer i returns integer
if i == 1 then
return 120
elseif i == 2 then
return 120
elseif i == 3 then
return 220
endif
return 0
endfunction
function GoldBR takes integer i returns integer
if i == 1 then
return 238
elseif i == 2 then
return 193
elseif i == 3 then
return 152
endif
return 0
endfunction
function WhiteBR takes integer i returns integer
if i == 1 then
return 245
elseif i == 2 then
return 245
elseif i == 3 then
return 245
endif
return 0
endfunction
function GrayBR takes integer i returns integer
if i == 1 then
return 145
elseif i == 2 then
return 145
elseif i == 3 then
return 145
endif
return 0
endfunction
function AddReqToDisListBR takes unit u,string id,string h returns nothing
local string req=null
local integer i=1
local integer i2=0
local integer i3=0
local integer i4=1
local integer i5=1
local integer val=0
local string s1=id
local string s2=h
local string s3=null
local string st=null
local integer max=GetStoredInteger(TRSItems , h , "MaxGems")
local integer count=GetStoredInteger(TRSItems , id , "maxreq")
local integer maxreq=1
local boolean array allreadyused
local integer array existreq
local integer c=1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , id , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set req = h + "Gen"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set req = h
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set req = h + "Ex"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
loop
exitwhen i > max
set h = s2 + "Soc" + I2S(i)
set id = GetStoredString(TRSItems , h , "ID") + GetStoredString(TRSItems , h , "IDEx")
set count = GetStoredInteger(TRSItems , id , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , id , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set req = h + "Gen"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set req = h
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set req = h + "Ex"
set count = GetStoredInteger(TRSItems , req , "maxreq")
set c = 1
loop
exitwhen c >= count
set i3 = GetStoredInteger(TRSItems , req , "Require" + I2S(c))
if not TRSAbilsDisplayReqNotDisp[i3] then
if not allreadyused[i3] then
set existreq[maxreq]=i3
set allreadyused[i3]=true
set maxreq = maxreq + 1
endif
endif
set c = c + 1
endloop
set i = i + 1
endloop
set i = 1
set count = maxreq
set id = s1
set h = s2
loop
exitwhen i >= count
set i3 = existreq[i]
set req = "req" + I2S(i3)
set val = GetStoredInteger(TRSItems , id , req)
set i2 = GetStoredInteger(TRSItems , h + "Gen" , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , h , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , h + "Ex" , req)
if val < i2 then
set val = i2
endif
set i4 = 1
loop
exitwhen i4 > max
set st = h + "Soc" + I2S(i4)
set s3 = GetStoredString(TRSItems , st , "ID") + GetStoredString(TRSItems , h , "IDEx")
set i2 = GetStoredInteger(TRSItems , s3 , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , st + "Gen" , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , st , req)
if val < i2 then
set val = i2
endif
set i2 = GetStoredInteger(TRSItems , st + "Ex" , req)
if val < i2 then
set val = i2
endif
set i4 = i4 + 1
endloop
set maxreq = val
set i5 = i5 + 1
set eux10 = u
set eax11 = val
set eax12 = 1
if not TRSAbilsDisplayReqNotDisp[i3] then
if EvalFunc(TRSRequiresFuncs[i3]) == false then
call AddItemPropDisplayBR(esx30 , RedBR(1) , RedBR(2) , RedBR(3))
else
call AddItemPropDisplayBR(esx30 , WhiteBR(1) , WhiteBR(2) , WhiteBR(3))
endif
endif
set i = i + 1
endloop
set eux10 = null
set eax12 = 0
endfunction
function DisplayItemParamsBR takes multiboard mb,string su,string id,string h returns multiboard
local integer max=GetStoredInteger(TRSItems , h , "MaxGems")
local integer i=1
local integer i2=0
local integer i3=0
local integer r=WhiteBR(1)
local integer g=WhiteBR(2)
local integer b=WhiteBR(3)
local integer pn=GetPlayerId(GetOwningPlayer(TRSDisUnit))
local string s1=GetStoredString(TRSItems , id , "class")
local string s2=null
local string s3=null
local string t=null
local real r2=0
local real r3=0
local string sock=I2S(GetIntBR(0x3E80 , "sock"))
local integer maxsockets=GetStoredInteger(TRSItems , id , "Prop" + I2S(GetStoredInteger(TRSItems , id , sock)) + "Par") + GetStoredInteger(TRSItems , h + "Gen" , "Prop" + I2S(GetStoredInteger(TRSItems , id , sock)) + "Par") + GetStoredInteger(TRSItems , h , "Prop" + I2S(GetStoredInteger(TRSItems , h , sock)) + "Par")
local integer itype=GetStoredInteger(TRSItems , h , "ItemQuality")
call FlushStoredMission(TRSItems , "DisplayVals")
call FlushStoredMission(TRSItems , "DisplayDummy")
set DisStrMax = 0
set TRSAbilsToDisplayCount = 0
set esx15 = id
set esx16 = h
if GetStoredInteger(TRSItems , id , "NOEX") == 0 then
if itype == 7 then
set r = GoldBR(1)
set g = GoldBR(2)
set b = GoldBR(3)
elseif itype == 6 then
set r = GreenBR(1)
set g = GreenBR(2)
set b = GreenBR(3)
elseif itype == 3 then
set r = BlueBR(1)
set g = BlueBR(2)
set b = BlueBR(3)
elseif GetStoredString(TRSItems , id , "type") == "gems" or maxsockets > 0 then
set r = GrayBR(1)
set g = GrayBR(2)
set b = GrayBR(3)
endif
if InvMerchant[pn] != null then
set t = GetStoredString(TRSInv , su , "BXTRSINV")
if GetStoredString(TRSInv , h , "CurOwner") == t then
if GetStoredInteger(TRSItems , h , "unsell") > 0 or GetStoredInteger(TRSItems , id , "unsell") > 0 then
call AddItemPropDisplayBR("This Item cannot be sold" , RedBR(1) , RedBR(2) , RedBR(3))
else
set i = R2I(I2R(GetItemCostBR(h)) * (0.5)) // INLINED!!
if GetStoredString(TRSItems , id , "type") == "charged" then
set r3 = GetStoredInteger(TRSItems , id , "stack")
if r3 > 0 then
set r2 = ( r3 - ( r3 - I2R(GetStoredInteger(TRSItems , h , "quantity")) ) ) / r3
set r2 = I2R(i) * r2
endif
else
set r2 = i
endif
set r2 = AddPercentBonus(r2 , LimitToBR(GetUnitBonusDataBR(su , "trade" , "Par") , (50.))) // INLINED!!
call AddItemPropDisplayBR("Sell Value: " + I2S((R2I(((r2)*1.0) + 0.5))) , r , g , b) // INLINED!!
endif
else
set i = GetItemCostBR(h)
if GetStoredString(TRSItems , id , "type") == "charged" then
set r3 = GetStoredInteger(TRSItems , id , "stack")
if r3 > 0 then
set r2 = ( r3 - ( r3 - I2R(GetStoredInteger(TRSItems , h , "quantity")) ) ) / r3
set r2 = I2R(i) * r2
endif
else
set r2 = i
endif
set r2 = AddPercentBonus(r2 , - LimitToBR(GetUnitBonusDataBR(su , "cheap" , "Par") , (50.))) // INLINED!!
call AddItemPropDisplayBR("Cost: " + I2S((R2I(((r2)*1.0) + 0.5))) , r , g , b) // INLINED!!
endif
endif
set i = 1
set t = null
if GetStoredBoolean(TRSItems , h , "IsRuneword") then
call AddItemPropDisplayBR(GetStoredString(TRSItems , h , "PrefixEX") + GetStoredString(TRSItems , h , "nameEX") + GetStoredString(TRSItems , h , "SuffixEX") , GoldBR(1) , GoldBR(2) , GoldBR(3))
else
call AddItemPropDisplayBR(GetStoredString(TRSItems , h , "PrefixEX") + GetStoredString(TRSItems , h , "nameEX") + GetStoredString(TRSItems , h , "SuffixEX") , r , g , b)
endif
call AddItemPropDisplayBR(GetStoredString(TRSItems , h , "Prefix") + GetStoredString(TRSItems , id , "name") + GetStoredString(TRSItems , h , "Suffix") , r , g , b)
set t = GetStoredString(TRSItems , h , "RunesInSockets")
if t != null and t != "" then
call AddItemPropDisplayBR("'" + t + "'" , GoldBR(1) , GoldBR(2) , GoldBR(3))
endif
if GetStoredInteger(TRSItems , h , "undrop") > 0 or GetStoredInteger(TRSItems , id , "undrop") > 0 then
call AddItemPropDisplayBR("This Item cannot be droped" , RedBR(1) , RedBR(2) , RedBR(3))
endif
if GetStoredBoolean(TRSItems , h , "Equiped") then
call AddItemPropDisplayBR(" - Equiped" , GreenBR(1) , GreenBR(2) , GreenBR(3))
endif
if GetStoredInteger(TRSItems , h , "quantity") > 0 and GetStoredInteger(TRSItems , id , "stack") > 0 then
call AddItemPropDisplayBR("Quantity: " + I2S(GetStoredInteger(TRSItems , h , "quantity")) , GrayBR(1) , GrayBR(2) , GrayBR(3))
endif
call AddReqToDisListBR(TRSDisUnit , id , h)
call AddItemPropDisplayBR((GetStoredString(USPData , I2S((0x3E84 )) , ( GetStoredString(TRSItems , id , "type")))) , GoldBR(1) , GoldBR(2) , GoldBR(3)) // INLINED!!
call AddItemPropDisplayBR((GetStoredString(USPData , I2S((0x3E85 )) , ( GetStoredString(TRSItems , id , "class")))) , GoldBR(1) , GoldBR(2) , GoldBR(3)) // INLINED!!
call AddItemPropDisplayBR(" " , 0 , 0 , 0)
if not ( s1 == "rune" or s1 == "gem" ) then
call DisplayParamParserBR("DisplayDummy" , id , h , false)
loop
exitwhen i > max
set t = h + "Soc" + I2S(i)
call DisplayParamParserBR("DisplayDummy" , GetStoredString(TRSItems , t , "ID") + GetStoredString(TRSItems , t , "IDEx") , t , true)
set i = i + 1
endloop
set i = 1
loop
exitwhen i > TRSAbilsToDisplayCount
set eax20 = i
set TRSAbilsToDisplayReady[i]=CompileDisplayStringBR(TRSAbilsToDisplay[i])
if not ebx10 then
if TRSAbilsToDisplayUsed[i] then
call AddItemPropDisplayBR(TRSAbilsToDisplayReady[i] , BlueBR(1) , BlueBR(2) , BlueBR(3))
else
call AddItemPropDisplayBR(TRSAbilsToDisplayReady[i] , WhiteBR(1) , WhiteBR(2) , WhiteBR(3))
endif
endif
set i = i + 1
endloop
if itype == 6 then
set i = 1
call FlushStoredMission(TRSItems , "DisplayVals")
call FlushStoredMission(TRSItems , "DisplayDummy")
set TRSAbilsToDisplayCount = 0
call DisplayParamParserBR("DisplayDummy" , id + GetStoredString(TRSItems , h , "SetItemName") + I2S(GetStoredInteger(TRSItems , h , "PreviousBonus")) , h + "Set" , false)
set i = 1
loop
exitwhen i > TRSAbilsToDisplayCount
set eax20 = i
set TRSAbilsToDisplayReady[i]=CompileDisplayStringBR(TRSAbilsToDisplay[i])
if not ebx10 then
call AddItemPropDisplayBR(TRSAbilsToDisplayReady[i] , GreenBR(1) , GreenBR(2) , GreenBR(3))
endif
set i = i + 1
endloop
if GetStoredBoolean(TRSItems , h , "Equiped") then
set i = 1
call FlushStoredMission(TRSItems , "DisplayVals")
call FlushStoredMission(TRSItems , "DisplayDummy")
set TRSAbilsToDisplayCount = 0
set s1 = GetStoredString(TRSItems , id + GetStoredString(TRSItems , h , "SetItemName") , "ItemSet")
set i2 = GetStoredInteger(TRSItems , su , s1 + "SetCount")
set s2 = "1" + s1
set s3 = su + s1 + "Bonus"
call DisplayParamParserBR("DisplayDummy" , s2 + I2S(i2) , s3 , false)
set i = 1
if TRSAbilsToDisplayCount > 0 then
call AddItemPropDisplayBR(" " , 0 , 0 , 0)
endif
loop
exitwhen i > TRSAbilsToDisplayCount
set eax20 = i
set TRSAbilsToDisplayReady[i]=CompileDisplayStringBR(TRSAbilsToDisplay[i])
if not ebx10 then
call AddItemPropDisplayBR(TRSAbilsToDisplayReady[i] , GoldBR(1) , GoldBR(2) , GoldBR(3))
endif
set i = i + 1
endloop
endif
set s2 = GetStoredString(TRSItems , h , "LongString")
set s3 = GetStoredString(TRSItems , id , "LongString")
if s2 != null or s3 != null then
call AddItemPropDisplayBR(" " , 0 , 0 , 0)
if s2 != null then
set s2 = GetStoredString(TRSItems , h , "LongString")
else
set s2 = s3
endif
set i2 = StringLength(s2)
set i3 = 1
set s3 = null
set i = 0
loop
exitwhen i >= i2
set i3 = GetStringCutBR(48 , i2 , i , s2)
set s3 = SubString(s2 , i , i3)
call AddItemPropDisplayBR(s3 , r , g , b)
set i = i3
endloop
endif
call AddItemPropDisplayBR(" " , 0 , 0 , 0)
set i = 1
set s1 = GetStoredString(TRSItems , id + GetStoredString(TRSItems , h , "SetItemName") , "ItemSet")
set TRSAbilsToDisplayCount = GetStoredInteger(TRSItems , "Sets" + s1 , "Itemcount")
set i2 = GetStoredInteger(TRSItems , su , s1 + "SetCount")
call AddItemPropDisplayBR(GetStoredString(TRSItems , s1 + "Set" , "name") , GoldBR(1) , GoldBR(2) , GoldBR(3))
set i = 1
loop
exitwhen i > TRSAbilsToDisplayCount
set s2 = I2S(GetStoredInteger(TRSItems , s1 , "ItemID" + I2S(i)))
set s3 = GetStoredString(TRSItems , s1 , "Item" + I2S(i))
if GetStoredInteger(TRSItems , su , s3 + "Count") > 0 then
call AddItemPropDisplayBR(GetStoredString(TRSItems , s2 + s3 , "name") , GreenBR(1) , GreenBR(2) , GreenBR(3))
else
call AddItemPropDisplayBR(GetStoredString(TRSItems , s2 + s3 , "name") , RedBR(1) , RedBR(2) , RedBR(3))
endif
set i = i + 1
endloop
else
set s2 = GetStoredString(TRSItems , h , "LongString")
set s3 = GetStoredString(TRSItems , id , "LongString")
if s2 != null or s3 != null then
call AddItemPropDisplayBR(" " , 0 , 0 , 0)
if s2 != null then
set s2 = GetStoredString(TRSItems , h , "LongString")
else
set s2 = s3
endif
set i2 = StringLength(s2)
set i3 = 1
set s3 = null
set i = 0
loop
exitwhen i >= i2
set i3 = GetStringCutBR(48 , i2 , i , s2)
set s3 = SubString(s2 , i , i3)
call AddItemPropDisplayBR(s3 , r , g , b)
set i = i3
endloop
endif
endif
else
set i2 = 1
set i3 = GetStoredInteger(TRSItems , id , "GemExtraz")
loop
exitwhen i2 > i3
set s3 = GetStoredString(TRSItems , id , "Extraz" + I2S(i2))
call AddItemPropDisplayBR((GetStoredString(USPData , I2S((0x3E83 )) , ( s3))) + ":" , GreenBR(1) , GreenBR(2) , GreenBR(3)) // INLINED!!
call FlushStoredMission(TRSItems , "DisplayVals")
call FlushStoredMission(TRSItems , "DisplayExtraz")
call FlushStoredMission(TRSItems , "DisplayExtrazGen")
call FlushStoredMission(TRSItems , "DisplayDummy")
set TRSAbilsToDisplayCount = 0
call DisplayParamParserBR("DisplayDummy" , id + s3 , "DisplayExtraz" , false)
set i = 1
loop
exitwhen i > TRSAbilsToDisplayCount
set eax20 = i
set TRSAbilsToDisplayReady[i]=CompileDisplayStringBR(TRSAbilsToDisplay[i])
if not ebx10 then
call AddItemPropDisplayBR(TRSAbilsToDisplayReady[i] , WhiteBR(1) , WhiteBR(2) , WhiteBR(3))
endif
set i = i + 1
endloop
set i2 = i2 + 1
endloop
set s2 = GetStoredString(TRSItems , h , "LongString")
if s2 == null or s2 == "" then
set s2 = GetStoredString(TRSItems , id , "LongString")
endif
if s2 != null and s2 != "" then
call AddItemPropDisplayFakeBR()
set i2 = StringLength(s2)
set i3 = 1
set s3 = null
set i = 0
loop
exitwhen i >= i2
set i3 = GetStringCutBR(48 , i2 , i , s2)
set s3 = SubString(s2 , i , i3)
call AddItemPropDisplayBR(s3 , WhiteBR(1) , WhiteBR(2) , WhiteBR(3))
set i = i3
endloop
endif
endif
else
set s2 = GetStoredString(TRSItems , h , "LongString")
if s2 == null or s2 == "" then
set s2 = GetStoredString(TRSItems , id , "LongString")
endif
set i2 = StringLength(s2)
set i3 = 1
set s3 = null
set i = 0
loop
exitwhen i >= i2
set i3 = GetStringCutBR(48 , i2 , i , s2)
set s3 = SubString(s2 , i , i3)
call AddItemPropDisplayBR(s3 , WhiteBR(1) , WhiteBR(2) , WhiteBR(3))
set i = i3
endloop
endif
if DisStrMax > 40 then
set DisStrMax = 40
endif
if DisStrMax > 0 then
set mb = XMB[40 * pn + DisStrMax]
set i = 1
call MultiboardSetItemsStyle(mb , true , false)
call MultiboardSetItemsWidth(mb , (.315)) // INLINED!!
loop
exitwhen i > DisStrMax
call MBSetItemValueBR(mb , 1 , i , DisStr[i])
call MBSetItemColorBR(mb , 1 , i , DisStrR[i] , DisStrG[i] , DisStrB[i] , 255)
set i = i + 1
endloop
return mb
endif
return null
endfunction
function StrComAbilDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Damage"
endif
endfunction
function StrComAbilDefBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Defense"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Defense"
endif
endfunction
function StrComAbilHPBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Life"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Life"
endif
endfunction
function StrComAbilManaBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Mana"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Mana"
endif
endfunction
function StrComAbilStrBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Strength"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Strength"
endif
endfunction
function StrComAbilIntBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Intelligence"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Intelligence"
endif
endfunction
function StrComAbilAgiBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Agility"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Agility"
endif
endfunction
function StrComAbilLichBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Life stolen per hit"
endfunction
function StrComAbilIASBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Increased attack speed"
endfunction
function StrComAbilLifeRegBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Regenerate " + I2S(TRSAbilsToDisplayPar[eax20]) + " Hit Points per second"
endfunction
function StrComAbilManaRegBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Increase mana regeneration by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endfunction
function StrComAbilMoveBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Increase movement speed by " + I2S(TRSAbilsToDisplayPar[eax20])
endfunction
function StrComAbilLightBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Light radius"
endfunction
function StrComAbilSDABR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to spell damage absorbing"
endfunction
function StrComAbilOnStruckBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 or TRSAbilsToDisplayMin[eax20] == 0 or TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = I2S(TRSAbilsToDisplayMin[eax20]) + "% chance to cast level " + I2S(TRSAbilsToDisplayMax[eax20]) + " " + (GetStoredString(USPData , I2S(((0x3E82 ) )) , ( I2S(( TRSAbilsToDisplayPar[eax20]))))) + " when struck" // INLINED!!
endfunction
function StrComAbilSockBR takes nothing returns nothing
local integer i
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set i = TRSAbilsToDisplayPar[eax20]
if i > GetStoredInteger(TRSItems , esx15 , "maxsock") then
set i = GetStoredInteger(TRSItems , esx15 , "maxsock")
endif
if i > 0 then
set esx20 = "Socketed [" + I2S(i) + ": " + I2S(GetStoredInteger(TRSItems , TRSDisItem , "MaxGems")) + " Used]"
endif
endfunction
function StrComAbilAddAbilBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 or TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMin[eax20] != 0 then
if TRSAbilsToDisplayMax[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayMax[eax20]) + " to " + GetObjectName(TRSAbilsToDisplayMin[eax20])
else
set esx20 = I2S(TRSAbilsToDisplayMax[eax20]) + " to " + GetObjectName(TRSAbilsToDisplayMin[eax20])
endif
else
if TRSAbilsToDisplayMax[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayMax[eax20]) + " to " + GetObjectName(TRSAbilsToDisplayPar[eax20])
else
set esx20 = I2S(TRSAbilsToDisplayMax[eax20]) + " to " + GetObjectName(TRSAbilsToDisplayPar[eax20])
endif
endif
endfunction
function StrComAbilOnHitBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 or TRSAbilsToDisplayMin[eax20] == 0 or TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = I2S(TRSAbilsToDisplayMin[eax20]) + "% chance to cast level " + I2S(TRSAbilsToDisplayMax[eax20]) + " " + (GetStoredString(USPData , I2S(((0x3E82 ) )) , ( I2S(( TRSAbilsToDisplayPar[eax20]))))) + " on striking" // INLINED!!
endfunction
function StrComAbilPotHPBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Heals " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Hit Points when used"
endfunction
function StrComAbilPstrBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Permanent add " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " to Strength when used"
endfunction
function StrComAbilPagiBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Permanent add " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " to Agility when used"
endfunction
function StrComAbilPintBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
set esx20 = "Permanent add " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " to Intelligence when used"
endfunction
function StrComAbilCheapBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce all vendor prices by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilTradeBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase trading skill by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPoisonDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] > 0 then
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "+" + I2S(TRSAbilsToDisplayMin[eax20]) + " Poison damage over " + R2SW(I2R(TRSAbilsToDisplayPar[eax20]) / TRSAbilsToDisplayAbilCount[eax20] * 0.01 , 1 , 1) + " seconds"
else
set esx20 = "+" + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Poison damage over " + R2SW(I2R(TRSAbilsToDisplayPar[eax20]) / TRSAbilsToDisplayAbilCount[eax20] * 0.01 , 1 , 1) + " seconds"
endif
else
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = I2S(TRSAbilsToDisplayMin[eax20]) + " Poison damage over " + R2SW(I2R(TRSAbilsToDisplayPar[eax20]) / TRSAbilsToDisplayAbilCount[eax20] * 0.01 , 1 , 1) + " seconds"
else
set esx20 = I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Poison damage over " + R2SW(I2R(TRSAbilsToDisplayPar[eax20]) / TRSAbilsToDisplayAbilCount[eax20] * 0.01 , 1 , 1) + " seconds"
endif
endif
endfunction
function StrComAbilColdDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Cold damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Cold damage"
endif
endfunction
function StrComAbilLightningDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Lightning damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Lightning damage"
endif
endfunction
function StrComAbilFireDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Fire damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Fire damage"
endif
endfunction
function StrComAbilCusBR takes nothing returns nothing
set ebx10 = true
set esx20 = "Some Custom Description"
endfunction
function StrComAbilDmgPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Damage Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilDefensePercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Defense Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilHPPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Life Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilManaPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Mana Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilStrPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Strength Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilIntPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Intelligence Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilAgiPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Agility Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilIasPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Attack Speed Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilLifeRegPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Life Regeneration Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilManaRegPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Mana Regeneration Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilMovePercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Movement Speed Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilLightPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Light Radius Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilSDAPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Increase Spell Damage Absorbing Bonus by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilMagDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Magic damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Magic damage"
endif
endfunction
function StrComAbilHolyDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Holy damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Holy damage"
endif
endfunction
function StrComAbilDarkDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Darkness damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Darkness damage"
endif
endfunction
function StrComAbilPhysDmgBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 and TRSAbilsToDisplayMin[eax20] == 0 and TRSAbilsToDisplayMax[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
endif
if TRSAbilsToDisplayMax[eax20] == TRSAbilsToDisplayMin[eax20] then
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + " Physical damage"
else
set esx20 = "Adds " + I2S(TRSAbilsToDisplayMin[eax20]) + "-" + I2S(TRSAbilsToDisplayMax[eax20]) + " Physical damage"
endif
endfunction
function StrComAbilColdLenBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + R2SW(TRSAbilsToDisplayPar[eax20] * 0.01 , 1 , 1) + " to Cold Damage duration"
else
set esx20 = R2SW(TRSAbilsToDisplayPar[eax20] * 0.01 , 1 , 1) + " to Cold Damage duration"
endif
endif
endfunction
function StrComAbilPoisLenBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + R2SW(TRSAbilsToDisplayPar[eax20] * 0.01 , 1 , 1) + " to Poison Damage duration"
else
set esx20 = R2SW(TRSAbilsToDisplayPar[eax20] * 0.01 , 1 , 1) + " to Poison Damage duration"
endif
endif
endfunction
function StrComAbilFireMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Fire Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Fire Damage"
endif
endif
endfunction
function StrComAbilColdMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Cold Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Cold Damage"
endif
endif
endfunction
function StrComAbilLtngMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Lightning Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Lightning Damage"
endif
endif
endfunction
function StrComAbilPoisMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Poison Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Poison Damage"
endif
endif
endfunction
function StrComAbilMagMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Magic Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Magic Damage"
endif
endif
endfunction
function StrComAbilHolyMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Holy Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Holy Damage"
endif
endif
endfunction
function StrComAbilDarkMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Darkness Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Darkness Damage"
endif
endif
endfunction
function StrComAbilPhysMinBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Physical Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Minimum Physical Damage"
endif
endif
endfunction
function StrComAbilFireMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Fire Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Fire Damage"
endif
endif
endfunction
function StrComAbilColdMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Cold Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Cold Damage"
endif
endif
endfunction
function StrComAbilLtngMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Lightning Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Lightning Damage"
endif
endif
endfunction
function StrComAbilPoisMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Poison Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Poison Damage"
endif
endif
endfunction
function StrComAbilMagMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Magic Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Magic Damage"
endif
endif
endfunction
function StrComAbilHolyMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Holy Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Holy Damage"
endif
endif
endfunction
function StrComAbilDarkMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Darkness Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Darkness Damage"
endif
endif
endfunction
function StrComAbilPhysMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Physical Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " to Maximum Physical Damage"
endif
endif
endfunction
function StrComAbilDmgFirePercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Fire Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Fire Damage"
endif
endif
endfunction
function StrComAbilDmgColdPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Cold Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Cold Damage"
endif
endif
endfunction
function StrComAbilDmgLtngPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Lightning Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Lightning Damage"
endif
endif
endfunction
function StrComAbilDmgPoisPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Poison Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Poison Damage"
endif
endif
endfunction
function StrComAbilDmgMagPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Magic Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Magic Damage"
endif
endif
endfunction
function StrComAbilDmgHolyPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Holy Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Holy Damage"
endif
endif
endfunction
function StrComAbilDmgDarkPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Darkness Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Darkness Damage"
endif
endif
endfunction
function StrComAbilDmgPhysPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Physical Damage"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Physical Damage"
endif
endif
endfunction
function StrComAbilPierceFireBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Fire Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Fire Resistance"
endif
endif
endfunction
function StrComAbilPierceColdBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Cold Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Cold Resistance"
endif
endif
endfunction
function StrComAbilPierceLtngBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Lightning Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Lightning Resistance"
endif
endif
endfunction
function StrComAbilPiercePoisBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Poison Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Poison Resistance"
endif
endif
endfunction
function StrComAbilPierceMagBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Magic Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Magic Resistance"
endif
endif
endfunction
function StrComAbilPierceHolyBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Holy Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Holy Resistance"
endif
endif
endfunction
function StrComAbilPierceDarkBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "-" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Target Darkness Resistance"
else
set esx20 = "+" + I2S(- TRSAbilsToDisplayPar[eax20]) + "% to Target Darkness Resistance"
endif
endif
endfunction
function StrComAbilPierceFirePercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Fire Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPierceColdPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Cold Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPierceLtngPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Lightning Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPiercePoisPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Poison Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPierceMagPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Magic Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPierceHolyPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Holy Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilPierceDarkPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Target Darkness Resistance by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilResFireBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Fire Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Fire Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResColdBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Cold Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Cold Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResLtngBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Lightning Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Lightning Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResPoisBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Poison Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Poison Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResMagBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Magic Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Magic Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResHolyBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Holy Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Holy Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResDarkBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Darkness Resist +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "Darkness Resist " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResFireMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Fire Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Fire Resist"
endif
endif
endfunction
function StrComAbilResColdMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Cold Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Cold Resist"
endif
endif
endfunction
function StrComAbilResLtngMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Lightning Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Lightning Resist"
endif
endif
endfunction
function StrComAbilResPoisMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Poison Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Poison Resist"
endif
endif
endfunction
function StrComAbilResMagMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Magic Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Magic Resist"
endif
endif
endfunction
function StrComAbilResHolyMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Holy Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Holy Resist"
endif
endif
endfunction
function StrComAbilResDarkMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Darkness Resist"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to Maximum Darkness Resist"
endif
endif
endfunction
function StrComAbilResAllBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "All Resistances +" + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
else
set esx20 = "All Resistances " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endif
endfunction
function StrComAbilResAllMaxBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + "% to All Maximum Resistances"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% to All Maximum Resistances"
endif
endif
endfunction
function StrComAbilFireAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Fire Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Fire Absorb"
endif
endif
endfunction
function StrComAbilColdAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Cold Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Cold Absorb"
endif
endif
endfunction
function StrComAbilLtngAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Lightning Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Lightning Absorb"
endif
endif
endfunction
function StrComAbilPoisAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Poison Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Poison Absorb"
endif
endif
endfunction
function StrComAbilMagAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Magic Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Magic Absorb"
endif
endif
endfunction
function StrComAbilHolyAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Holy Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Holy Absorb"
endif
endif
endfunction
function StrComAbilDarkAbsorbBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "+" + I2S(TRSAbilsToDisplayPar[eax20]) + " Darkness Absorb"
else
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + " Darkness Absorb"
endif
endif
endfunction
function StrComAbilFireAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Fire Absorb"
endif
endfunction
function StrComAbilColdAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Cold Absorb"
endif
endfunction
function StrComAbilLtngAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Lightning Absorb"
endif
endfunction
function StrComAbilPoisAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Poison Absorb"
endif
endfunction
function StrComAbilMagAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Magic Absorb"
endif
endfunction
function StrComAbilHolyAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Holy Absorb"
endif
endfunction
function StrComAbilDarkAbsorbPercentBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = I2S(TRSAbilsToDisplayPar[eax20]) + "% Darkness Absorb"
endif
endfunction
function StrComAbilPoisReductionBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Poison duration by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilColdReductionBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Cold duration by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function StrComAbilNoFreezeBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
if TRSAbilsToDisplayPar[eax20] > 0 then
set esx20 = "Cannot be Frozen +" + I2S(TRSAbilsToDisplayPar[eax20])
else
set esx20 = "Cannot be Frozen " + I2S(TRSAbilsToDisplayPar[eax20])
endif
endif
endfunction
function StrComAbilStunReductionBR takes nothing returns nothing
if TRSAbilsToDisplayPar[eax20] == 0 then
set ebx10 = true
else
set ebx10 = false
set esx20 = "Reduce Stun duration by " + I2S(TRSAbilsToDisplayPar[eax20]) + "%"
endif
endfunction
function ParamStringCompilerBR takes integer id,code func returns nothing
set TRSAbilsToDisplayStringCompiler[id]=CreateTrigger()
call TriggerAddCondition(TRSAbilsToDisplayStringCompiler[id] , Condition(func))
endfunction
function InitDisplayModuleParamCompilerBR takes nothing returns nothing
call ParamStringCompilerBR(0x01 , function StrComAbilDmgBR)
call ParamStringCompilerBR(0x02 , function StrComAbilDefBR)
call ParamStringCompilerBR(0x03 , function StrComAbilHPBR)
call ParamStringCompilerBR(0x04 , function StrComAbilManaBR)
call ParamStringCompilerBR(0x05 , function StrComAbilStrBR)
call ParamStringCompilerBR(0x06 , function StrComAbilIntBR)
call ParamStringCompilerBR(0x07 , function StrComAbilAgiBR)
call ParamStringCompilerBR(0x08 , function StrComAbilLichBR)
call ParamStringCompilerBR(0x09 , function StrComAbilIASBR)
call ParamStringCompilerBR(0x0a , function StrComAbilLifeRegBR)
call ParamStringCompilerBR(0x0b , function StrComAbilManaRegBR)
call ParamStringCompilerBR(0x0b , function StrComAbilManaRegBR)
call ParamStringCompilerBR(0x0c , function StrComAbilMoveBR)
call ParamStringCompilerBR(0x0d , function StrComAbilLightBR)
call ParamStringCompilerBR(0x0e , function StrComAbilSDABR)
call ParamStringCompilerBR(0x0f , function StrComAbilOnStruckBR)
call ParamStringCompilerBR(0x10 , function StrComAbilSockBR)
call ParamStringCompilerBR(0x11 , function StrComAbilAddAbilBR)
call ParamStringCompilerBR(0x12 , function StrComAbilCusBR)
call ParamStringCompilerBR(0x14 , function StrComAbilOnHitBR)
call ParamStringCompilerBR(0x15 , function StrComAbilPotHPBR)
call ParamStringCompilerBR(0x16 , function StrComAbilPstrBR)
call ParamStringCompilerBR(0x17 , function StrComAbilPagiBR)
call ParamStringCompilerBR(0x18 , function StrComAbilPintBR)
call ParamStringCompilerBR(0x19 , function StrComAbilCheapBR)
call ParamStringCompilerBR(0x1A , function StrComAbilTradeBR)
call ParamStringCompilerBR(0x1B , function StrComAbilPoisonDmgBR)
call ParamStringCompilerBR(0x1C , function StrComAbilColdDmgBR)
call ParamStringCompilerBR(0x1D , function StrComAbilLightningDmgBR)
call ParamStringCompilerBR(0x1E , function StrComAbilFireDmgBR)
call ParamStringCompilerBR(0x1F , function StrComAbilDmgPercentBR)
call ParamStringCompilerBR(0x20 , function StrComAbilDefensePercentBR)
call ParamStringCompilerBR(0x21 , function StrComAbilHPPercentBR)
call ParamStringCompilerBR(0x22 , function StrComAbilManaPercentBR)
call ParamStringCompilerBR(0x23 , function StrComAbilStrPercentBR)
call ParamStringCompilerBR(0x24 , function StrComAbilIntPercentBR)
call ParamStringCompilerBR(0x25 , function StrComAbilAgiPercentBR)
call ParamStringCompilerBR(0x26 , function StrComAbilIasPercentBR)
call ParamStringCompilerBR(0x27 , function StrComAbilLifeRegPercentBR)
call ParamStringCompilerBR(0x28 , function StrComAbilManaRegPercentBR)
call ParamStringCompilerBR(0x29 , function StrComAbilMovePercentBR)
call ParamStringCompilerBR(0x2a , function StrComAbilLightPercentBR)
call ParamStringCompilerBR(0x2b , function StrComAbilSDAPercentBR)
call ParamStringCompilerBR(0x2c , function StrComAbilMagDmgBR)
call ParamStringCompilerBR(0x2d , function StrComAbilHolyDmgBR)
call ParamStringCompilerBR(0x2e , function StrComAbilDarkDmgBR)
call ParamStringCompilerBR(0x2f , function StrComAbilPhysDmgBR)
call ParamStringCompilerBR(0x30 , function StrComAbilColdLenBR)
call ParamStringCompilerBR(0x31 , function StrComAbilPoisLenBR)
call ParamStringCompilerBR(0x32 , function StrComAbilFireMinBR)
call ParamStringCompilerBR(0x33 , function StrComAbilColdMinBR)
call ParamStringCompilerBR(0x34 , function StrComAbilLtngMinBR)
call ParamStringCompilerBR(0x35 , function StrComAbilPoisMinBR)
call ParamStringCompilerBR(0x36 , function StrComAbilMagMinBR)
call ParamStringCompilerBR(0x37 , function StrComAbilHolyMinBR)
call ParamStringCompilerBR(0x38 , function StrComAbilDarkMinBR)
call ParamStringCompilerBR(0x39 , function StrComAbilPhysMinBR)
call ParamStringCompilerBR(0x3a , function StrComAbilFireMaxBR)
call ParamStringCompilerBR(0x3b , function StrComAbilColdMaxBR)
call ParamStringCompilerBR(0x3c , function StrComAbilLtngMaxBR)
call ParamStringCompilerBR(0x3d , function StrComAbilPoisMaxBR)
call ParamStringCompilerBR(0x3e , function StrComAbilMagMaxBR)
call ParamStringCompilerBR(0x3f , function StrComAbilHolyMaxBR)
call ParamStringCompilerBR(0x40 , function StrComAbilDarkMaxBR)
call ParamStringCompilerBR(0x41 , function StrComAbilPhysMaxBR)
call ParamStringCompilerBR(0x42 , function StrComAbilDmgFirePercentBR)
call ParamStringCompilerBR(0x43 , function StrComAbilDmgColdPercentBR)
call ParamStringCompilerBR(0x44 , function StrComAbilDmgLtngPercentBR)
call ParamStringCompilerBR(0x45 , function StrComAbilDmgPoisPercentBR)
call ParamStringCompilerBR(0x46 , function StrComAbilDmgMagPercentBR)
call ParamStringCompilerBR(0x47 , function StrComAbilDmgHolyPercentBR)
call ParamStringCompilerBR(0x48 , function StrComAbilDmgDarkPercentBR)
call ParamStringCompilerBR(0x49 , function StrComAbilDmgPhysPercentBR)
call ParamStringCompilerBR(0x4a , function StrComAbilPierceFireBR)
call ParamStringCompilerBR(0x4b , function StrComAbilPierceColdBR)
call ParamStringCompilerBR(0x4c , function StrComAbilPierceLtngBR)
call ParamStringCompilerBR(0x4d , function StrComAbilPiercePoisBR)
call ParamStringCompilerBR(0x4e , function StrComAbilPierceMagBR)
call ParamStringCompilerBR(0x4f , function StrComAbilPierceHolyBR)
call ParamStringCompilerBR(0x50 , function StrComAbilPierceDarkBR)
call ParamStringCompilerBR(0x51 , function StrComAbilPierceFirePercentBR)
call ParamStringCompilerBR(0x52 , function StrComAbilPierceColdPercentBR)
call ParamStringCompilerBR(0x53 , function StrComAbilPierceLtngPercentBR)
call ParamStringCompilerBR(0x54 , function StrComAbilPiercePoisPercentBR)
call ParamStringCompilerBR(0x55 , function StrComAbilPierceMagPercentBR)
call ParamStringCompilerBR(0x56 , function StrComAbilPierceHolyPercentBR)
call ParamStringCompilerBR(0x57 , function StrComAbilPierceDarkPercentBR)
call ParamStringCompilerBR(0x58 , function StrComAbilResFireBR)
call ParamStringCompilerBR(0x59 , function StrComAbilResColdBR)
call ParamStringCompilerBR(0x5a , function StrComAbilResLtngBR)
call ParamStringCompilerBR(0x5b , function StrComAbilResPoisBR)
call ParamStringCompilerBR(0x5c , function StrComAbilResMagBR)
call ParamStringCompilerBR(0x5d , function StrComAbilResHolyBR)
call ParamStringCompilerBR(0x5e , function StrComAbilResDarkBR)
call ParamStringCompilerBR(0x5f , function StrComAbilResFireMaxBR)
call ParamStringCompilerBR(0x60 , function StrComAbilResColdMaxBR)
call ParamStringCompilerBR(0x61 , function StrComAbilResLtngMaxBR)
call ParamStringCompilerBR(0x62 , function StrComAbilResPoisMaxBR)
call ParamStringCompilerBR(0x63 , function StrComAbilResMagMaxBR)
call ParamStringCompilerBR(0x64 , function StrComAbilResHolyMaxBR)
call ParamStringCompilerBR(0x65 , function StrComAbilResDarkMaxBR)
call ParamStringCompilerBR(0x66 , function StrComAbilResAllBR)
call ParamStringCompilerBR(0x67 , function StrComAbilResAllMaxBR)
call ParamStringCompilerBR(0x68 , function StrComAbilFireAbsorbBR)
call ParamStringCompilerBR(0x69 , function StrComAbilColdAbsorbBR)
call ParamStringCompilerBR(0x6a , function StrComAbilLtngAbsorbBR)
call ParamStringCompilerBR(0x6b , function StrComAbilPoisAbsorbBR)
call ParamStringCompilerBR(0x6c , function StrComAbilMagAbsorbBR)
call ParamStringCompilerBR(0x6d , function StrComAbilHolyAbsorbBR)
call ParamStringCompilerBR(0x6e , function StrComAbilDarkAbsorbBR)
call ParamStringCompilerBR(0x6f , function StrComAbilFireAbsorbPercentBR)
call ParamStringCompilerBR(0x70 , function StrComAbilColdAbsorbPercentBR)
call ParamStringCompilerBR(0x71 , function StrComAbilLtngAbsorbPercentBR)
call ParamStringCompilerBR(0x72 , function StrComAbilPoisAbsorbPercentBR)
call ParamStringCompilerBR(0x73 , function StrComAbilMagAbsorbPercentBR)
call ParamStringCompilerBR(0x74 , function StrComAbilHolyAbsorbPercentBR)
call ParamStringCompilerBR(0x75 , function StrComAbilDarkAbsorbPercentBR)
call ParamStringCompilerBR(0x76 , function StrComAbilPoisReductionBR)
call ParamStringCompilerBR(0x77 , function StrComAbilColdReductionBR)
call ParamStringCompilerBR(0x78 , function StrComAbilNoFreezeBR)
call ParamStringCompilerBR(0x79 , function StrComAbilStunReductionBR)
endfunction
function InitTrig_TRSDisplayModule takes nothing returns nothing
call ExecuteFunc("InitDisplayModuleParamCompilerBR")
endfunction
function InitPrefixActBR takes string name,string class,integer lvl,string bonus returns nothing
local string s="Prefix" + class
local string sl=I2S(lvl)
local string s2=s + sl
local integer i=GetStoredInteger(TRSItems , s2 , "PrefixCount") + 1
call StoreInteger(TRSItems , s , "PrefixCount" , GetStoredInteger(TRSItems , s , "PrefixCount") + 1)
call StoreInteger(TRSItems , s2 , "PrefixCount" , i)
call StoreString(TRSItems , s2 , "PrefixName" + I2S(i) , name)
call StoreString(TRSItems , s2 , "PrefixBonus" + I2S(i) , bonus)
if not GetStoredBoolean(TRSItems , s , "lvlused" + sl) then
call StoreInteger(TRSItems , s , "PrefixlvlCount" , GetStoredInteger(TRSItems , s , "PrefixlvlCount") + 1)
call StoreInteger(TRSItems , s , "Prefixlvl" + I2S(GetStoredInteger(TRSItems , s , "PrefixlvlCount")) , lvl)
call StoreBoolean(TRSItems , s , "lvlused" + sl , true)
endif
endfunction
function GetPrefixBR takes string id,integer min,integer max returns nothing
local string stype=GetStoredString(TRSItems , id , "type")
local string ssclass=GetStoredString(TRSItems , id , "sclass")
local string sclass=GetStoredString(TRSItems , id , "class")
local string s="Prefix" + sclass
local integer lvl=GetRandomInt(min , max)
local integer cm=GetStoredInteger(TRSItems , s , "PrefixlvlCount")
local string s2=null
local string array ss
local integer array icm
local integer maxs=0
if cm != 0 and cm > min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
endif
set s = "Prefix" + ssclass
set cm = GetStoredInteger(TRSItems , s , "PrefixlvlCount")
if cm != 0 and cm >= min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
endif
set s = "Prefix" + stype
set cm = GetStoredInteger(TRSItems , s , "PrefixlvlCount")
if cm != 0 and cm >= min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
endif
set s = "Prefixany"
set cm = GetStoredInteger(TRSItems , s , "PrefixlvlCount")
if cm != 0 and cm >= min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
else
set maxs = maxs + 1
set ss[maxs]=""
set icm[maxs]=0
endif
set min = GetRandomInt(1 , maxs)
if min > 0 then
set cm = icm[min]
set s = ss[min]
if cm < lvl then
set lvl = cm
endif
set lvl = GetStoredInteger(TRSItems , s , "Prefixlvl" + I2S(lvl))
set s2 = s + I2S(lvl)
set cm = GetStoredInteger(TRSItems , s2 , "PrefixCount")
set cm = GetRandomInt(1 , cm)
set esx25 = GetStoredString(TRSItems , s2 , "PrefixName" + I2S(cm))
set esx26 = GetStoredString(TRSItems , s2 , "PrefixBonus" + I2S(cm))
else
set esx25 = ""
set esx26 = ""
endif
endfunction
function InitSuffixActBR takes string name,string class,integer lvl,string bonus returns nothing
local string s="Suffix" + class
local string sl=I2S(lvl)
local string s2=s + sl
local integer i=GetStoredInteger(TRSItems , s2 , "SuffixCount") + 1
call StoreInteger(TRSItems , s , "SuffixCount" , GetStoredInteger(TRSItems , s , "SuffixCount") + 1)
call StoreInteger(TRSItems , s2 , "SuffixCount" , i)
call StoreString(TRSItems , s2 , "SuffixName" + I2S(i) , name)
call StoreString(TRSItems , s2 , "SuffixBonus" + I2S(i) , bonus)
if not GetStoredBoolean(TRSItems , s , "lvlused" + sl) then
call StoreInteger(TRSItems , s , "SuffixlvlCount" , GetStoredInteger(TRSItems , s , "SuffixlvlCount") + 1)
call StoreInteger(TRSItems , s , "Suffixlvl" + I2S(GetStoredInteger(TRSItems , s , "SuffixlvlCount")) , lvl)
call StoreBoolean(TRSItems , s , "lvlused" + sl , true)
endif
endfunction
function GetSuffixBR takes string id,integer min,integer max returns nothing
local string stype=GetStoredString(TRSItems , id , "type")
local string ssclass=GetStoredString(TRSItems , id , "sclass")
local string sclass=GetStoredString(TRSItems , id , "class")
local string s="Suffix" + sclass
local integer lvl=GetRandomInt(min , max)
local integer cm=GetStoredInteger(TRSItems , s , "SuffixlvlCount")
local string s2=null
local string array ss
local integer array icm
local integer maxs=0
if cm != 0 and cm >= min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
endif
set s = "Suffix" + ssclass
set cm = GetStoredInteger(TRSItems , s , "SuffixlvlCount")
if cm != 0 and cm > min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
endif
set s = "Suffix" + stype
set cm = GetStoredInteger(TRSItems , s , "SuffixlvlCount")
if cm != 0 and cm > min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
endif
set s = "Suffixany"
set cm = GetStoredInteger(TRSItems , s , "SuffixlvlCount")
if cm != 0 and cm > min then
set maxs = maxs + 1
set ss[maxs]=s
set icm[maxs]=cm
else
set maxs = maxs + 1
set ss[maxs]=""
set icm[maxs]=0
endif
set min = GetRandomInt(1 , maxs)
if min > 0 then
set cm = icm[min]
set s = ss[min]
if cm < lvl then
set lvl = cm
endif
set lvl = GetStoredInteger(TRSItems , s , "Suffixlvl" + I2S(lvl))
set s2 = s + I2S(lvl)
set cm = GetStoredInteger(TRSItems , s2 , "SuffixCount")
set cm = GetRandomInt(1 , cm)
set esx25 = GetStoredString(TRSItems , s2 , "SuffixName" + I2S(cm))
set esx26 = GetStoredString(TRSItems , s2 , "SuffixBonus" + I2S(cm))
else
set esx25 = ""
set esx26 = ""
endif
endfunction
function SetAffixBR takes string part,string STR returns nothing
set esx31 = STR
set esx32 = part
call ExecuteFunc("InitAdvBaseExecBR")
endfunction
function InitPrefixExecBR takes nothing returns nothing
local string name=esx00
local string list=esx01
local integer lvl=eax00
local string par=esx02
local integer i=0
local integer max=StringLength(list)
local integer pointer=0
local string token=null
loop
exitwhen i > max
set token = SubString(list , i , i + 1)
if token == "," or i == max then
call InitPrefixActBR(name , SubString(list , pointer , i) , lvl , par)
set pointer = i + 1
endif
set i = i + 1
endloop
endfunction
function InitPrefixBR takes string name,string list,integer lvl,string par returns nothing
set esx00 = name
set esx01 = list
set eax00 = lvl
set esx02 = par
call ExecuteFunc("InitPrefixExecBR")
endfunction
function InitSuffixExecBR takes nothing returns nothing
local string name=esx00
local string list=esx01
local integer lvl=eax00
local string par=esx02
local integer i=0
local integer max=StringLength(list)
local integer pointer=0
local string token=null
loop
exitwhen i > max
set token = SubString(list , i , i + 1)
if token == "," or i == max then
call InitSuffixActBR(name , SubString(list , pointer , i) , lvl , par)
set pointer = i + 1
endif
set i = i + 1
endloop
endfunction
function InitSuffixBR takes string name,string list,integer lvl,string par returns nothing
set esx00 = name
set esx01 = list
set eax00 = lvl
set esx02 = par
call ExecuteFunc("InitSuffixExecBR")
endfunction
function TRSInitPreSufixes takes nothing returns nothing
call SetAffixBR("Prefix0x1" , "^lvl=3;cost=10;^dmg=;5;10;")
call SetAffixBR("Prefix0x2" , "^lvl=5;cost=20;^dmg=;15;20;")
call SetAffixBR("Prefix0x3" , "^lvl=8;cost=35;^dmg=;25;35;")
call SetAffixBR("Prefix0x4" , "^lvl=3;cost=10;^def=;1;4;")
call SetAffixBR("Prefix0x5" , "^lvl=5;cost=20;^def=;4;8;")
call SetAffixBR("Prefix0x6" , "^lvl=8;cost=35;^def=;8;15;")
call SetAffixBR("Prefix0x7" , "^lvl=4;cost=15;^sock=;1;1;")
call SetAffixBR("Prefix0x8" , "^lvl=7;cost=30;^sock=;2;2;")
call SetAffixBR("Prefix0x9" , "^lvl=10;cost=50;^sock=;3;3;")
call SetAffixBR("Prefix0x10" , "^lvl=3;cost=15;^hp=;100;125;")
call SetAffixBR("Prefix0x11" , "^lvl=6;cost=35;^hp=;150;225;")
call SetAffixBR("Prefix0x12" , "^lvl=10;cost=65;^hp=;250;450;")
call SetAffixBR("Prefix0x13" , "^lvl=4;cost=20;^mana=;75;100;")
call SetAffixBR("Prefix0x14" , "^lvl=7;cost=35;^mana=;125;200;")
call SetAffixBR("Prefix0x15" , "^lvl=10;cost=60;^mana=;300;325;")
call SetAffixBR("Suffix0x1" , "^lvl=2;cost=10;^hp=;25;75;")
call SetAffixBR("Suffix0x2" , "^lvl=5;cost=25;^hp=;75;125;")
call SetAffixBR("Suffix0x3" , "^lvl=7;cost=35;^hp=;125;200;")
call SetAffixBR("Suffix0x4" , "^lvl=3;cost=15;^mana=;25;50;")
call SetAffixBR("Suffix0x5" , "^lvl=6;cost=30;^mana=;50;100;")
call SetAffixBR("Suffix0x6" , "^lvl=8;cost=40;^mana=;100;150;")
call SetAffixBR("Suffix0x7" , "^lvl=4;cost=20;^sda=;1;4;")
call SetAffixBR("Suffix0x8" , "^lvl=6;cost=40;^sda=;5;8;")
call SetAffixBR("Suffix0x9" , "^lvl=9;cost=60;^sda=;9;12;")
call SetAffixBR("Suffix0x10" , "^lvl=3;cost=15;^ias=;5;14;")
call SetAffixBR("Suffix0x11" , "^lvl=5;cost=30;^ias=;15;24;")
call SetAffixBR("Suffix0x12" , "^lvl=8;cost=45;^ias=;25;30;")
call SetAffixBR("Suffix0x13" , "^lvl=3;cost=15;^agi=;5;10;")
call SetAffixBR("Suffix0x14" , "^lvl=5;cost=30;^agi=;10;15;")
call SetAffixBR("Suffix0x15" , "^lvl=8;cost=45;^agi=;15;20;")
call SetAffixBR("Suffix0x16" , "^lvl=3;cost=15;^str=;5;10;")
call SetAffixBR("Suffix0x17" , "^lvl=5;cost=30;^str=;10;15;")
call SetAffixBR("Suffix0x18" , "^lvl=8;cost=45;^str=;15;20;")
call SetAffixBR("Suffix0x19" , "^lvl=3;cost=15;^int=;5;10;")
call SetAffixBR("Suffix0x20" , "^lvl=5;cost=30;^int=;10;15;")
call SetAffixBR("Suffix0x21" , "^lvl=8;cost=45;^int=;15;20;")
call SetAffixBR("Suffix0x22" , "^lvl=3;cost=10;^lifereg=;1;2;")
call SetAffixBR("Suffix0x23" , "^lvl=5;cost=20;^lifereg=;3;5;")
call SetAffixBR("Suffix0x24" , "^lvl=8;cost=30;^lifereg=;6;8;")
call SetAffixBR("Suffix0x25" , "^lvl=3;cost=10;^manareg=;25;50;")
call SetAffixBR("Suffix0x26" , "^lvl=5;cost=20;^manareg=;50;100;")
call SetAffixBR("Suffix0x27" , "^lvl=8;cost=35;^manareg=;100;150;")
call SetAffixBR("Suffix0x28" , "^lvl=3;cost=10;^light=;1;2;")
call SetAffixBR("Suffix0x29" , "^lvl=6;cost=20;^light=;2;3;")
call SetAffixBR("Suffix0x30" , "^lvl=9;cost=30;^light=;4;5;")
call SetAffixBR("Suffix0x31" , "^lvl=3;cost=15;^lich=;5;12;")
call SetAffixBR("Suffix0x32" , "^lvl=6;cost=25;^lich=;12;20;")
call SetAffixBR("Suffix0x33" , "^lvl=9;cost=40;^lich=;20;25;")
call SetAffixBR("Suffix0x34" , "^lvl=3;cost=15;^move=;20;30;")
call SetAffixBR("Suffix0x35" , "^lvl=6;cost=30;^move=;40;50;")
call SetAffixBR("Suffix0x36" , "^lvl=9;cost=45;^move=;50;70;")
endfunction
function TRSInitAffixes2 takes nothing returns nothing
call ExecuteFunc("Trig_lolzzzzaa_Actions")
endfunction
function TRSInitAffixes takes nothing returns nothing
call InitPrefixBR("Mechanist's " , "melee,armor,helm,shoulder,shield" , 1 , "Prefix0x7")
call InitPrefixBR("Artificer's " , "melee,armor,helm,shoulder,shield" , 2 , "Prefix0x8")
call InitPrefixBR("Jeweler's " , "melee,armor,helm,shoulder,shield" , 3 , "Prefix0x9")
call InitPrefixBR("Sharp " , "charm,jewel,amulet,ring,melee" , 1 , "Prefix0x1")
call InitPrefixBR("Jagged " , "charm,jewel,amulet,ring,melee" , 2 , "Prefix0x2")
call InitPrefixBR("Cruel " , "melee" , 3 , "Prefix0x3")
call InitPrefixBR("Sturdy " , "armor,pants,helm,bracers,shield,gloves,shoulder,gloves,belt,boots,charm,jewel,amulet,ring" , 1 , "Prefix0x4")
call InitPrefixBR("Glorious " , "armor,pants,helm,bracers,shield,gloves,shoulder,gloves,belt,boots,charm,jewel,amulet,ring" , 2 , "Prefix0x5")
call InitPrefixBR("Holy " , "armor,pants,helm,bracers,belt,boots,shoulder,gloves,shield" , 3 , "Prefix0x6")
call InitPrefixBR("Wolf's " , "armor,pants,helm,bracers,shield,gloves,shoulder,charm,jewel,amulet,ring,potion" , 1 , "Prefix0x10")
call InitPrefixBR("Mammoth's " , "armor,pants,helm,bracers,shield,gloves,shoulder,charm,jewel,amulet,ring" , 2 , "Prefix0x11")
call InitPrefixBR("Colosuss's " , "armor,pants,helm,bracers,shield" , 3 , "Prefix0x12")
call InitPrefixBR("Snake's " , "armor,pants,helm,bracers,shield,gloves,shoulder,charm,jewel,amulet,ring" , 1 , "Prefix0x13")
call InitPrefixBR("Drake's " , "armor,pants,helm,bracers,shield,gloves,shoulder,charm,jewel,amulet,ring" , 2 , "Prefix0x14")
call InitPrefixBR("Wyrm's " , "armor,pants,helm,bracers,shield" , 3 , "Prefix0x15")
call InitSuffixBR(" of Blood" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring,potion" , 1 , "Suffix0x1")
call InitSuffixBR(" of Life" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x2")
call InitSuffixBR(" of Vita" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 3 , "Suffix0x3")
call InitSuffixBR(" of Lizard" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x4")
call InitSuffixBR(" of Snake" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x5")
call InitSuffixBR(" of Serpent" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 3 , "Suffix0x6")
call InitSuffixBR(" of Warding" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x7")
call InitSuffixBR(" of the Sentinel" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x8")
call InitSuffixBR(" of Guarding" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 3 , "Suffix0x9")
call InitSuffixBR(" of Readiness" , "melee,gloves,charm,jewel,amulet,ring" , 1 , "Suffix0x10")
call InitSuffixBR(" of Swiftness" , "melee,gloves,charm,jewel,amulet,ring" , 2 , "Suffix0x11")
call InitSuffixBR(" of Quickness" , "melee,gloves," , 3 , "Suffix0x12")
call InitSuffixBR(" of Agility" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x13")
call InitSuffixBR(" of Accuracy" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x14")
call InitSuffixBR(" of Precision" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt" , 3 , "Suffix0x15")
call InitSuffixBR(" of Strength" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x16")
call InitSuffixBR(" of Might" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x17")
call InitSuffixBR(" of the Giant" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt" , 3 , "Suffix0x18")
call InitSuffixBR(" of Intelligence" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x19")
call InitSuffixBR(" of Brilliance" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x20")
call InitSuffixBR(" of Wizardry" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt" , 3 , "Suffix0x21")
call InitSuffixBR(" of Regeneration" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x22")
call InitSuffixBR(" of Regrowth" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x23")
call InitSuffixBR(" of Revivification" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt" , 3 , "Suffix0x24")
call InitSuffixBR(" of Replenishment" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x25")
call InitSuffixBR(" of Sorcery" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x26")
call InitSuffixBR(" of Enlightenment" , "armor,pants,helm,bracers,shield,gloves,shoulder,belt" , 3 , "Suffix0x27")
call InitSuffixBR(" of Light" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 1 , "Suffix0x28")
call InitSuffixBR(" of Radiance" , "melee,armor,pants,helm,bracers,shield,gloves,shoulder,belt,boots,charm,jewel,amulet,ring" , 2 , "Suffix0x29")
call InitSuffixBR(" of the Sun" , "melee,gloves,armor,pants,helm,bracers,shield,gloves,shoulder,belt" , 3 , "Suffix0x30")
call InitSuffixBR(" of the Leech" , "melee,gloves,helm,bracers,jewel,amulet,ring" , 1 , "Suffix0x31")
call InitSuffixBR(" of the Locust" , "melee,gloves,helm,bracers,jewel,amulet,ring,jewel,amulet,ring" , 2 , "Suffix0x32")
call InitSuffixBR(" of the Lamprey" , "melee,gloves,helm" , 3 , "Suffix0x33")
call InitSuffixBR(" of Pacing" , "boots,armor,pants,helm,bracers,shield,charm" , 1 , "Suffix0x34")
call InitSuffixBR(" of Haste" , "boots,armor,pants,helm,bracers,shield,charm" , 2 , "Suffix0x35")
call InitSuffixBR(" of Speed" , "boots" , 3 , "Suffix0x36")
endfunction
function TRSEnhanceItemBR takes string it,integer min,integer max returns string
local string id=GetStoredString(TRSItems , it , "ID")
call PreGenerateParBR(id , it)
call GetPrefixBR(id , min , max)
call StoreString(TRSItems , it , "Prefix" , esx25)
if esx26 != null then
call PassParamToItemBR(it , esx26 , 1 , true)
call StoreInteger(TRSItems , it , "cost" , GetStoredInteger(TRSItems , it , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , it , "ItemQuality" , 3)
endif
call GetSuffixBR(id , min , max)
call StoreString(TRSItems , it , "Suffix" , esx25)
if esx26 != null then
call PassParamToItemBR(it , esx26 , 1 , true)
call StoreInteger(TRSItems , it , "cost" , GetStoredInteger(TRSItems , it , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , it , "ItemQuality" , 3)
endif
return it
endfunction
function InitTrig_TRSAffixes takes nothing returns nothing
endfunction
function TRSCreateItemBR takes integer id returns string
local string it=I2S(GetCustomItemID())
call CleanItemParBR(it , true)
call PreGenerateParBR(I2S(id) , it)
return it
endfunction
function TRSRemoveItemBR takes string it returns nothing
call FreeCustomItemID(S2I(it))
call CleanItemParBR(it , true)
endfunction
function SetSetItemParamsBR takes string h,string name returns string
local string id=GetStoredString(TRSItems , h , "ID")
call StoreString(TRSItems , h , "ID" , id)
call StoreInteger(TRSItems , h , "ItemQuality" , 6)
call StoreString(TRSItems , h , "SetItemName" , name)
call StoreInteger(TRSItems , h , "cost" , GetStoredInteger(TRSItems , h , "cost") + GetStoredInteger(TRSItems , id + name , "cost"))
call StoreString(TRSItems , h , "nameEX" , GetStoredString(TRSItems , id + name , "name"))
call StoreString(TRSItems , h , "LongString" , GetStoredString(TRSItems , id + name , "LongString"))
call StoreInteger(TRSItems , h , "icon" , GetStoredInteger(TRSItems , id + name , "icon"))
call StoreString(TRSItems , h , "specialname" , name)
call PassParamToItemBR(h , id + name , 1 , true)
return h
endfunction
function CreateSetItemBR takes string name,real x,real y returns item
local integer id=GetStoredInteger(TRSItems , "SetItem" + name , "ItemID")
local item it=CreateItem(id , x , y)
local integer i=(GetHandleId((it))) // INLINED!!
if GetItemUserData(it) == 0 then
call SetItemUserData(it , GetCustomItemID())
endif
call PreGenerateParBR(I2S(id) , I2S(GetItemUserData(it)))
call SetSetItemParamsBR(I2S(GetItemUserData(it)) , name)
set ix = it
set it = null
return ix
endfunction
function TRSCreateSetItemBR takes string name returns string
local integer id=GetStoredInteger(TRSItems , "SetItem" + name , "ItemID")
local string it=TRSCreateItemBR(id)
call SetSetItemParamsBR(it , name)
return it
endfunction
function SetUniqueItemParamsBR takes string h,string name returns string
local string id=GetStoredString(TRSItems , h , "ID")
call StoreString(TRSItems , h , "ID" , id)
call StoreInteger(TRSItems , h , "ItemQuality" , 7)
call StoreInteger(TRSItems , h , "cost" , GetStoredInteger(TRSItems , h , "cost") + GetStoredInteger(TRSItems , id + name , "cost"))
call StoreString(TRSItems , h , "nameEX" , GetStoredString(TRSItems , id + name , "name"))
call StoreString(TRSItems , h , "LongString" , GetStoredString(TRSItems , id + name , "LongString"))
call StoreInteger(TRSItems , h , "icon" , GetStoredInteger(TRSItems , id + name , "icon"))
call StoreString(TRSItems , h , "specialname" , name)
call PassParamToItemBR(h , id + name , 1 , true)
return h
endfunction
function CreateUniqueItemBR takes string name,real x,real y returns item
local integer id=GetStoredInteger(TRSItems , "UniqueItem" + name , "ItemID")
local item it=CreateItem(id , x , y)
local integer i=(GetHandleId((it))) // INLINED!!
if GetItemUserData(it) == 0 then
call SetItemUserData(it , GetCustomItemID())
endif
call PreGenerateParBR(I2S(id) , I2S(GetItemUserData(it)))
call SetUniqueItemParamsBR(I2S(GetItemUserData(it)) , name)
set ix = it
set it = null
return ix
endfunction
function TRSCreateUniqueItemBR takes string name returns string
local integer id=GetStoredInteger(TRSItems , "UniqueItem" + name , "ItemID")
local string it=TRSCreateItemBR(id)
call SetUniqueItemParamsBR(it , name)
return it
endfunction
function InitTrig_TRSAPI takes nothing returns nothing
endfunction
function TRSShowMbTitleBR takes nothing returns string
return "|cfffedaac© BX - TRS II by |r|cfffedaac(|cff5566bbBuranX|r|cfffedaac) |cfffedaacToadcop|r"
endfunction
function ShowItemStatsBR takes unit u,string it,string id returns nothing
local integer pn=GetPlayerId(GetOwningPlayer(u))
set TRSDisUnit = u
set TRSDisItem = it
set TRSDisItemID = id
if it != "" and id != "" and it != null and id != null and it != "TRSCustomDisplay" then
if GetStoredBoolean(TRSItems , id , "Exist") then
set TRSDisMB[pn]=DisplayItemParamsBR(null , I2S((GetHandleId((TRSDisUnit)))) , TRSDisItemID , TRSDisItem) // INLINED!!
call MultiboardSetTitleText(TRSDisMB[pn] , ("|cfffedaac© BX - TRS II by |r|cfffedaac(|cff5566bbBuranX|r|cfffedaac) |cfffedaacToadcop|r")) // INLINED!!
call MultiboardMinimize(TRSDisMB[pn] , false)
if GetLocalPlayer() == Player(pn) then
call MultiboardDisplay(TRSDisMB[pn] , true)
endif
endif
elseif it == "TRSCustomDisplay" then
set TRSDisMB[pn]=XMB[pn * 40 + 3]
call MBSetItemValueBR(TRSDisMB[pn] , 1 , 1 , "")
call MultiboardSetItemsStyle(TRSDisMB[pn] , true , false)
call MultiboardSetItemsWidth(TRSDisMB[pn] , (.315)) // INLINED!!
call MBSetItemValueBR(TRSDisMB[pn] , 1 , 2 , (GetStoredString(USPData , I2S((0x3E86 )) , ( TRSDisItemID)))) // INLINED!!
call MBSetItemColorBR(TRSDisMB[pn] , 1 , 2 , WhiteBR(1) - 35 , WhiteBR(2) - 35 , WhiteBR(3) - 35 , 255)
call MBSetItemValueBR(TRSDisMB[pn] , 1 , 3 , "")
call MultiboardSetTitleText(TRSDisMB[pn] , ("|cfffedaac© BX - TRS II by |r|cfffedaac(|cff5566bbBuranX|r|cfffedaac) |cfffedaacToadcop|r")) // INLINED!!
call MultiboardMinimize(TRSDisMB[pn] , false)
if GetLocalPlayer() == Player(pn) then
call MultiboardDisplay(TRSDisMB[pn] , true)
endif
else
if TRSDisMB[pn] != null then
call MultiboardMinimize(TRSDisMB[pn] , true)
if GetLocalPlayer() == GetOwningPlayer(u) then
call MultiboardDisplay(TRSDisMB[pn] , false)
endif
endif
endif
set TRSDisUnit = null
set TRSDisItem = null
set TRSDisItemID = null
endfunction
function ShowItemStatsActions takes nothing returns nothing
local string it=I2S(GetItemUserData(GetManipulatedItem()))
local string id=GetStoredString(TRSItems , it , "ID")
local unit u=GetManipulatingUnit()
local string inv=TRSGetInvBR(u)
local string ittype=GetStoredString(TRSItems , id , "type")
local boolean used=UseItemBR(u , id , it)
if used == false then
if GetStoredInteger(TRSItems , id , "stack") > 0 then
call SetItemCharges(GetManipulatedItem() , GetItemCharges(GetManipulatedItem()) + 1)
endif
endif
if GetUnitAbilityLevel(u , (1093677141)) > 0 then // INLINED!!
call ShowItemStatsBR(u , it , id)
endif
if GetItemCharges(GetManipulatedItem()) < 1 and ittype == "charged" and GetStoredInteger(TRSItems , id , "stack") > 0 then
call UnequipItemBR(u , id , it , true)
call StoreInteger(TRSInv , inv , "ItemsOfType" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , it , "SourceSlot")) , "")
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , it , "SourceSlot")) , "")
call CleanItemParBR(it , true)
call FreeCustomItemID(S2I(it))
call RemoveItem(GetManipulatedItem())
endif
endfunction
function InitTrig_TRSShowItemStats takes nothing returns nothing
set gg_trg_TRSShowItemStats = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_TRSShowItemStats , EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddAction(gg_trg_TRSShowItemStats , function ShowItemStatsActions)
endfunction
function TRSGridX takes nothing returns real
return - 5316.00
endfunction
function TRSGridY takes nothing returns real
return - 5600.00
endfunction
function TRSXstep takes nothing returns real
return 128.
endfunction
constant function TRSInvSetup_INVSlotModelSize takes nothing returns real
return 7.0
endfunction
constant function TRSInvSetup_IconSize takes nothing returns real
return 0.24
endfunction
constant function TRSInvSetup_IconSizeAspect takes nothing returns real
return 0.27
endfunction
constant function TRSInvSetup_IconEquipmentSizeAspect takes nothing returns real
return 0.381
endfunction
constant function TRSInvSetup_IconSizeEquip takes nothing returns real
return 0.265
endfunction
constant function TRSInvSetup_PageListSize takes nothing returns real
return 0.2
endfunction
constant function TRSInvSetup_INVCancelButtonSize takes nothing returns real
return 0.23
endfunction
constant function TRSInvSetup_INVDropButtonSize takes nothing returns real
return 0.23
endfunction
constant function TRSInvSetup_INVSellItemButtonSize takes nothing returns real
return 0.23
endfunction
constant function TRSInvSetup_INVBuyItemButtonSize takes nothing returns real
return 0.23
endfunction
constant function TRSInvBackgroundId takes nothing returns integer
return 1110454327
endfunction
constant function TRSInvSetup_DefaultIcon takes nothing returns integer
return 1110454351
endfunction
constant function TRSInvSetup_IconBorder takes nothing returns integer
return 1110454352
endfunction
constant function TRSInvSetup_PageListUpUp takes nothing returns integer
return 1110454356
endfunction
constant function TRSInvSetup_PageListUpDis takes nothing returns integer
return 1110454355
endfunction
constant function TRSInvSetup_PageListDownUp takes nothing returns integer
return 1110454354
endfunction
constant function TRSInvSetup_PageListDownDis takes nothing returns integer
return 1110454353
endfunction
constant function TRSInvSetup_INVCancelButton takes nothing returns integer
return 1110454344
endfunction
constant function TRSInvSetup_INVDropButton takes nothing returns integer
return 1110454360
endfunction
constant function TRSInvSetup_INVBorder takes nothing returns integer
return 1110454326
endfunction
constant function TRSInvSetup_INVSellItem takes nothing returns integer
return 1110454603
endfunction
constant function TRSInvSetup_INVBuyItem takes nothing returns integer
return 1110454604
endfunction
constant function TRSInvSetup_TwoHanderMasteryId takes nothing returns integer
return 1093677138
endfunction
constant function TRSInvSetup_TwoWeaponsMasteryId takes nothing returns integer
return 1093677139
endfunction
constant function TRSInvSetup_INVINVSlotIcon takes nothing returns integer
return 1110454320
endfunction
constant function TRSInvSetup_INVAmuletSlotIcon takes nothing returns integer
return 1110454343
endfunction
constant function TRSInvSetup_INVArmorSlotIcon takes nothing returns integer
return 1110454341
endfunction
constant function TRSInvSetup_INVBeltSlotIcon takes nothing returns integer
return 1110454358
endfunction
constant function TRSInvSetup_INVBootsSlotIcon takes nothing returns integer
return 1110454582
endfunction
constant function TRSInvSetup_INVBracersSlotIcon takes nothing returns integer
return 1110454583
endfunction
constant function TRSInvSetup_INVGlovesSlotIcon takes nothing returns integer
return 1110454584
endfunction
constant function TRSInvSetup_INVHelmSlotIcon takes nothing returns integer
return 1110454342
endfunction
constant function TRSInvSetup_INVPantsSlotIcon takes nothing returns integer
return 1110454585
endfunction
constant function TRSInvSetup_INVRingLeftSlotIcon takes nothing returns integer
return 1110454593
endfunction
constant function TRSInvSetup_INVRingRightSlotIcon takes nothing returns integer
return 1110454594
endfunction
constant function TRSInvSetup_INVShieldSlotIcon takes nothing returns integer
return 1110454357
endfunction
constant function TRSInvSetup_INVShoulderLeftSlotIcon takes nothing returns integer
return 1110454595
endfunction
constant function TRSInvSetup_INVShoulderRightSlotIcon takes nothing returns integer
return 1110454596
endfunction
constant function TRSInvSetup_INVWeaponSlotIcon takes nothing returns integer
return 1110454359
endfunction
constant function TRSInvSetup_INVCharged1SlotIcon takes nothing returns integer
return 1110454605
endfunction
constant function TRSInvSetup_INVCharged2SlotIcon takes nothing returns integer
return 1110454606
endfunction
constant function TRSInvSetup_INVIsMerchant takes nothing returns integer
return 1093677140
endfunction
function InitTrig_TRSInvSetups takes nothing returns nothing
endfunction
function FreeInvFreeSlotBR takes string inv,integer slot returns nothing
local integer i=GetStoredInteger(TRSInv , inv , "INVFreeSlotsMax") + 1
if GetStoredBoolean(TRSInv , inv , "INVSlotUsed" + I2S(slot)) == true and GetStoredInteger(TRSInv , inv , "INVFreeSlotId" + I2S(slot)) == 0 then
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(slot) , false)
call StoreInteger(TRSInv , inv , "INVFreeSlotId" + I2S(slot) , i)
call StoreInteger(TRSInv , inv , "INVFreeSlotsMax" , i)
call StoreInteger(TRSInv , inv , "INVFreeSlot" + I2S(i) , slot)
endif
endfunction
function FreeInvFreeSlotRemoveBR takes string inv,integer slot returns nothing
local integer i=GetStoredInteger(TRSInv , inv , "INVFreeSlotsMax")
local integer i2=GetStoredInteger(TRSInv , inv , "INVFreeSlotId" + I2S(slot))
if i2 > 0 then
call StoreInteger(TRSInv , inv , "INVFreeSlotId" + I2S(slot) , 0)
call StoreInteger(TRSInv , inv , "INVFreeSlot" + I2S(i2) , GetStoredInteger(TRSInv , inv , "INVFreeSlot" + I2S(i)))
call StoreInteger(TRSInv , inv , "INVFreeSlotsMax" , i - 1)
endif
endfunction
function GetInvFreeSlotBR takes string inv returns integer
local integer i=GetStoredInteger(TRSInv , inv , "INVFreeSlotsMax")
local integer i2=i
local integer c=1
local integer max=GetStoredInteger(TRSInv , inv , "INVSlotsMax")
if i > 0 then
loop
exitwhen GetStoredBoolean(TRSInv , inv , "INVSlotUsed" + I2S(GetStoredInteger(TRSInv , inv , "INVFreeSlot" + I2S(i2)))) == false
exitwhen i2 < 1
set i2 = i2 - 1
endloop
if i2 > 0 then
call StoreInteger(TRSInv , inv , "INVFreeSlotsMax" , i2 - 1)
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(GetStoredInteger(TRSInv , inv , "INVFreeSlot" + I2S(i2))) , true)
call StoreInteger(TRSInv , inv , "INVFreeSlotId" + I2S(GetStoredInteger(TRSInv , inv , "INVFreeSlot" + I2S(i2))) , 0)
return GetStoredInteger(TRSInv , inv , "INVFreeSlot" + I2S(i2))
else
if GetStoredBoolean(TRSInv , inv , "INVSlotUsed" + I2S(max)) == false then
call StoreInteger(TRSInv , inv , "INVSlotsMax" , max + 1)
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(GetStoredInteger(TRSInv , inv , "INVSlotsMax")) , true)
else
loop
exitwhen GetStoredBoolean(TRSInv , inv , "INVSlotUsed" + I2S(max)) == false
set max = max + 1
endloop
call StoreInteger(TRSInv , inv , "INVSlotsMax" , max)
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(max) , true)
endif
return GetStoredInteger(TRSInv , inv , "INVSlotsMax")
endif
else
if GetStoredBoolean(TRSInv , inv , "INVSlotUsed" + I2S(max)) == false then
call StoreInteger(TRSInv , inv , "INVSlotsMax" , max + 1)
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(GetStoredInteger(TRSInv , inv , "INVSlotsMax")) , true)
else
loop
exitwhen GetStoredBoolean(TRSInv , inv , "INVSlotUsed" + I2S(max)) == false
set max = max + 1
endloop
call StoreInteger(TRSInv , inv , "INVSlotsMax" , max)
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(max) , true)
endif
return GetStoredInteger(TRSInv , inv , "INVSlotsMax")
endif
return 0
endfunction
function ReplaceInvItemBR takes string inv,integer slot,integer slot2 returns nothing
local string it=GetStoredString(TRSInv , inv , "INVItemInSlot" + I2S(slot))
local string it2=""
if HaveStoredString(TRSInv , inv , "INVItemInSlot" + I2S(slot2)) == true then
set it2 = GetStoredString(TRSInv , inv , "INVItemInSlot" + I2S(slot2))
endif
if it != null and it != "" then
if GetStoredString(TRSInv , it , "CurOwner") == inv then
if it2 == null or it2 == "" then
call FreeInvFreeSlotRemoveBR(inv , slot2)
call StoreInteger(TRSInv , it , "INVCurSlot" , slot2)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(slot2) , it)
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(slot2) , true)
call FreeInvFreeSlotBR(inv , slot)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(slot) , "")
else
set it2 = GetStoredString(TRSInv , inv , "INVItemInSlot" + I2S(slot2))
if GetStoredString(TRSInv , it2 , "CurOwner") == inv then
call StoreInteger(TRSInv , it , "INVCurSlot" , slot2)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(slot) , it2)
call StoreInteger(TRSInv , it2 , "INVCurSlot" , slot)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(slot2) , it)
endif
endif
endif
endif
endfunction
function AddItemToCusInvBR takes unit u,string it returns boolean
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string id=GetStoredString(TRSItems , it , "ID")
local integer max=GetStoredInteger(TRSInv , inv , "MaxItems")
local integer maxsize=GetStoredInteger(TRSInv , inv , "MaxSize")
local integer i=max + 1
local integer i2=1
local integer i3=0
local integer i4=GetStoredInteger(TRSItems , it , "quantity")
local integer i5=0
local integer i6=0
local integer idmax=GetStoredInteger(TRSInv , inv , "MaxID" + id)
local integer stack=GetStoredInteger(TRSItems , id , "Stack")
local string ts=null
local boolean equiped=false
set ebx31 = false
if GetStoredString(TRSInv , it , "CurOwner") != inv or GetStoredInteger(TRSItems , it , "SourceSlot") > 0 then
if max <= maxsize or maxsize == 0 then
if stack > 1 then
if idmax > 0 then
loop
exitwhen i2 > idmax
set ts = GetStoredString(TRSInv , inv , "ID" + id + I2S(i2))
set i5 = GetStoredInteger(TRSItems , ts , "quantity")
set i3 = stack - i5
if i3 > 0 then
set i6 = i4
set i4 = i4 - i3
if i4 >= 0 then
call StoreInteger(TRSItems , ts , "quantity" , i5 + i3)
else
call StoreInteger(TRSItems , ts , "quantity" , i5 + i6)
endif
if i4 < 1 then
exitwhen true
endif
endif
set i2 = i2 + 1
endloop
endif
call StoreInteger(TRSItems , it , "quantity" , i4)
if i4 > 0 then
if max < maxsize or maxsize == 0 then
call StoreInteger(TRSInv , inv , "MaxID" + id , idmax + 1)
call StoreString(TRSInv , inv , "ID" + id + I2S(idmax + 1) , it)
call StoreInteger(TRSInv , it , "CurIDOrder" , idmax + 1)
call StoreInteger(TRSInv , inv , "MaxItems" , i)
call StoreString(TRSInv , inv , "Slot" + I2S(i) , it)
call StoreString(TRSInv , it , "CurOwner" , inv)
call StoreInteger(TRSInv , it , "CurSlot" , i)
set i6 = GetInvFreeSlotBR(inv)
call StoreInteger(TRSInv , it , "INVCurSlot" , i6)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(i6) , it)
set ebx31 = true
return true
else
return false
endif
else
return true
endif
else
if max < maxsize or maxsize == 0 then
if GetStoredString(TRSItems , id , "type") == "charm" then
set equiped = EquipItemBR(u , id , it , true)
if equiped == false then
call StoreInteger(TRSInv , inv , "CharmsMax" , GetStoredInteger(TRSInv , inv , "CharmsMax") + 1)
call StoreString(TRSInv , inv , "Charm" + I2S(GetStoredInteger(TRSInv , inv , "CharmsMax")) , it)
call StoreInteger(TRSItems , it , "CharmPosition" , GetStoredInteger(TRSInv , inv , "CharmsMax"))
endif
endif
call StoreInteger(TRSInv , inv , "MaxID" + id , idmax + 1)
call StoreString(TRSInv , inv , "ID" + id + I2S(idmax + 1) , it)
call StoreInteger(TRSInv , it , "CurIDOrder" , idmax + 1)
call StoreInteger(TRSInv , inv , "MaxItems" , i)
call StoreString(TRSInv , inv , "Slot" + I2S(i) , it)
call StoreString(TRSInv , it , "CurOwner" , inv)
call StoreInteger(TRSInv , it , "CurSlot" , i)
set i6 = GetInvFreeSlotBR(inv)
call StoreInteger(TRSInv , it , "INVCurSlot" , i6)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(i6) , it)
set ebx31 = true
return true
else
return false
endif
endif
return true
endif
endif
return false
endfunction
function CheckFreeInvSlotBR takes unit u,string it returns boolean
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string id=GetStoredString(TRSItems , it , "ID")
local integer max=GetStoredInteger(TRSInv , inv , "MaxItems")
local integer maxsize=GetStoredInteger(TRSInv , inv , "MaxSize")
local integer i=max + 1
local integer i2=1
local integer i3=0
local integer i4=GetStoredInteger(TRSItems , it , "quantity")
local integer i5=0
local integer i6=0
local integer idmax=GetStoredInteger(TRSInv , inv , "MaxID" + id)
local integer stack=GetStoredInteger(TRSItems , id , "Stack")
local string ts=null
set ebx31 = false
if GetStoredString(TRSInv , it , "CurOwner") != inv or GetStoredInteger(TRSItems , it , "SourceSlot") > 0 then
if max <= maxsize or maxsize == 0 then
if stack > 1 then
if idmax > 0 then
loop
exitwhen i2 > idmax
set ts = GetStoredString(TRSInv , inv , "ID" + id + I2S(i2))
set i5 = GetStoredInteger(TRSItems , ts , "quantity")
set i3 = stack - i5
if i3 > 0 then
set i6 = i4
set i4 = i4 - i3
if i4 < 1 then
exitwhen true
endif
endif
set i2 = i2 + 1
endloop
endif
if i4 > 0 then
if max < maxsize or maxsize == 0 then
set ebx31 = true
return true
else
return false
endif
else
return true
endif
else
if max < maxsize or maxsize == 0 then
set ebx31 = true
return true
else
return false
endif
endif
return true
endif
endif
return false
endfunction
function RemoveItemFromCusInvBR takes unit u,string it returns boolean
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string id=GetStoredString(TRSItems , it , "ID")
local integer max=GetStoredInteger(TRSInv , inv , "MaxItems")
local integer i=GetStoredInteger(TRSInv , it , "CurSlot")
local integer idmax=GetStoredInteger(TRSInv , inv , "MaxID" + id)
local integer curpos=GetStoredInteger(TRSInv , it , "CurIDOrder")
local string lastit=GetStoredString(TRSInv , inv , "Slot" + I2S(max))
local string lastidit=GetStoredString(TRSInv , inv , "ID" + id + I2S(idmax))
local boolean equiped=false
if GetStoredString(TRSInv , it , "CurOwner") == inv and GetStoredInteger(TRSItems , it , "SourceSlot") < 1 then
if GetStoredString(TRSItems , id , "type") == "charm" then
if GetStoredBoolean(TRSItems , it , "Equiped") == false and GetStoredInteger(TRSItems , it , "CharmPosition") > 0 then
call StoreString(TRSInv , inv , "Charm" + I2S(GetStoredInteger(TRSItems , it , "CharmPosition")) , GetStoredString(TRSInv , inv , "Charm" + I2S(GetStoredInteger(TRSInv , inv , "CharmsMax"))))
call StoreInteger(TRSInv , inv , "CharmsMax" , GetStoredInteger(TRSInv , inv , "CharmsMax") - 1)
call StoreInteger(TRSItems , it , "CharmPosition" , 0)
else
call UnequipItemBR(u , id , it , true)
endif
endif
call StoreString(TRSInv , inv , "ID" + id + I2S(curpos) , lastidit)
call StoreInteger(TRSInv , lastidit , "CurIDOrder" , curpos)
call StoreInteger(TRSInv , it , "CurIDOrder" , 0)
call StoreInteger(TRSInv , inv , "MaxID" + id , idmax - 1)
call StoreString(TRSInv , inv , "Slot" + I2S(i) , lastit)
call StoreInteger(TRSInv , lastit , "CurSlot" , i)
call StoreInteger(TRSInv , inv , "MaxItems" , max - 1)
call StoreString(TRSInv , it , "CurOwner" , null)
call StoreInteger(TRSInv , it , "CurSlot" , 0)
set idmax = GetStoredInteger(TRSInv , it , "INVCurSlot")
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(idmax) , "")
call FreeInvFreeSlotBR(inv , idmax)
call StoreInteger(TRSInv , it , "INVCurSlot" , 0)
return true
endif
return false
endfunction
function MerchantRestoreItemBR takes unit u,string it returns nothing
local string inv=TRSGetInvBR(u)
local boolean add=AddItemToCusInvBR(u , it)
if add == false then
call TRSRemoveItemBR(it)
endif
endfunction
function RedrawInvSlotBR takes unit u,integer slot returns nothing
local integer pn=GetPlayerId(GetOwningPlayer(u))
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string it=""
local integer icon=0
local integer invsize=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local integer i=0
local integer issize=Modulo(slot , invsize)
if issize == 0 then
set i = InvFirstTrk[pn] + invsize - 1
else
set i = InvFirstTrk[pn] + Modulo(slot , invsize) - 1
endif
if TrkIcon[i] != null then
call RemoveDestructable(TrkIcon[i])
set TrkIcon[i]=null
endif
set TrkItem[i]=""
set it = GetStoredString(TRSInv , inv , "INVItemInSlot" + I2S(slot))
if it != "" and it != null then
set TrkItem[i]=it
if GetStoredInteger(TRSItems , it , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , it , "icon")
elseif GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon")
else
set icon = (1110454351) // INLINED!!
endif
set TrkIcon[i]=CreateDestructableZ(icon , TrkX[i] , TrkY[i] , TrkZ[i] + 0.008 , 270 , (0.24) , 1) // INLINED!!
endif
endfunction
function RedrawInvIconsBR takes integer min,integer max,boolean fill,boolean clean returns nothing
local integer i=min
loop
exitwhen i > max
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if clean then
if TrkIcon[i] != null then
call RemoveDestructable(TrkIcon[i])
set TrkIcon[i]=null
endif
set TrkItem[i]=""
endif
if fill then
set TrkBackIcon[i]=CreateDestructableZ(TrkNatIconId[i] , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , TrkNatIconSize[i] , 1)
endif
set i = i + 1
endloop
endfunction
function FillInvBR takes unit u,integer page returns nothing
local integer pn=GetPlayerId(GetOwningPlayer(u))
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer max=0
local integer invsize=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local integer i=InvFirstTrk[pn]
local integer c=1
local string it=""
local string t=""
local integer icon=0
local integer sz=invsize * page
local integer extraslots=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "ExtraSlots")
local integer maxextra=extraslots + invsize
loop
exitwhen c > maxextra
if TrkIcon[i] != null then
call RemoveDestructable(TrkIcon[i])
set TrkIcon[i]=null
endif
set TrkItem[i]=""
set i = i + 1
set c = c + 1
endloop
set c = 1
set i = InvFirstTrk[pn]
loop
exitwhen c > invsize
set it = GetStoredString(TRSInv , inv , "INVItemInSlot" + I2S(c + sz))
if it != "" and it != null then
set TrkItem[i]=it
if GetStoredInteger(TRSItems , it , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , it , "icon")
elseif GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon")
else
set icon = (1110454351) // INLINED!!
endif
set TrkIcon[i]=CreateDestructableZ(icon , TrkX[i] , TrkY[i] , TrkZ[i] + 0.008 , 270 , (0.24) , 1) // INLINED!!
endif
set c = c + 1
set i = i + 1
endloop
set c = 1
set i = InvFirstTrk[pn] + invsize
set max = i + extraslots
loop
exitwhen i > max
set it = GetStoredString(TRSInv , inv , "SlotEx" + I2S(c))
if it != null and it != "" then
set TrkItem[i]=it
if GetStoredInteger(TRSItems , it , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , it , "icon")
elseif GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon")
else
set icon = (1110454351) // INLINED!!
endif
set TrkIcon[i]=CreateDestructableZ(icon , TrkX[i] , TrkY[i] , TrkZ[i] + 0.008 , 270 , (0.265) , 1) // INLINED!!
endif
set c = c + 1
set i = i + 1
endloop
endfunction
function FillMerchInvBR takes unit u,string inv,integer page returns nothing
local integer pn=GetPlayerId(GetOwningPlayer(u))
local integer max=0
local integer invsize=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize")
local integer i=InvFirstMerchTrk[pn]
local integer c=1
local string it=""
local string t=""
local integer icon=0
local integer sz=invsize * page
loop
exitwhen c > invsize
if TrkIcon[i] != null then
call RemoveDestructable(TrkIcon[i])
set TrkIcon[i]=null
endif
set TrkItem[i]=""
set i = i + 1
set c = c + 1
endloop
set c = 1
set i = InvFirstMerchTrk[pn]
loop
exitwhen c > invsize
set it = GetStoredString(TRSInv , inv , "INVItemInSlot" + I2S(c + sz))
if it != "" and it != null then
set TrkItem[i]=it
if GetStoredInteger(TRSItems , it , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , it , "icon")
elseif GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon") > 0 then
set icon = GetStoredInteger(TRSItems , GetStoredString(TRSItems , it , "ID") , "icon")
else
set icon = (1110454351) // INLINED!!
endif
set TrkIcon[i]=CreateDestructableZ(icon , TrkX[i] , TrkY[i] , TrkZ[i] + 0.008 , 270 , (0.24) , 1) // INLINED!!
endif
set c = c + 1
set i = i + 1
endloop
endfunction
function Hit takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer i=0
local integer i2=0
local integer i3=0
local string sid=""
local string sid2=""
local string stype=TrkType[id]
local string ittype=""
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string s=""
local string s1=""
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local boolean equiped=false
call PauseUnit(u , false)
if stype != "inv" and InvCurItem[pn] != "" and InvCurItem[pn] != null then
if TrkItem[id] == "" or TrkItem[id] == null then
set sid2 = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
set ittype = GetStoredString(TRSItems , sid2 , "type")
if TrkReq[id] != null then
set eax = id
set esx00 = InvCurItem[pn]
set esx01 = TrkItem[id]
set equiped = EvalFunc(TrkReq[id])
else
set equiped = ittype == stype and InvCurItem[pn] != TrkItem[id] and GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") < 1
endif
if equiped then
set InvCurSide = TrkSide[id]
if ittype != "charged" then
set equiped = EquipItemBR(u , sid2 , InvCurItem[pn] , true)
endif
if equiped then
set ebx32 = true
if TrkExId[id] >= InvMinChargedSlot[pn] and TrkExId[id] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[id] - InvMinChargedSlot[pn]
call UnitAddItemToSlotById(u , S2I(sid2) , i3)
call SetItemCharges(UnitItemInSlot(u , i3) , GetStoredInteger(TRSItems , InvCurItem[pn] , "quantity"))
call SetItemUserData(UnitItemInSlot(u , i3) , S2I(InvCurItem[pn]))
endif
set ebx32 = false
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call StoreInteger(TRSInv , inv , "ItemsOfType" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype) + 1)
call StoreInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype))
call StoreString(TRSInv , inv , "ItemsOfType" + ittype + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype)) , InvCurItem[pn])
call ShowItemStatsBR(u , InvCurItem[pn] , sid2)
call StoreString(TRSInv , inv , "SlotEx" + I2S(TrkExId[id]) , InvCurItem[pn])
call StoreInteger(TRSItems , InvCurItem[pn] , "SourceSlot" , TrkExId[id])
call StoreString(TRSInv , InvCurItem[pn] , "CurOwner" , inv)
call FillInvBR(u , page)
endif
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
else
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
endif
elseif TrkItem[id] == InvCurItem[pn] then
set sid = GetStoredString(TRSItems , TrkItem[id] , "ID")
set InvCurSide = TrkSide[id]
if GetStoredInteger(TRSItems , TrkItem[id] , "nouse") < 1 and GetStoredInteger(TRSItems , sid , "nouse") < 1 then
set equiped = UseItemBR(u , sid , TrkItem[id])
else
set equiped = false
endif
call ShowItemStatsBR(u , "" , "")
if TrkExId[id] >= InvMinChargedSlot[pn] and TrkExId[id] <= InvMaxChargedSlot[pn] then
call SetItemCharges(UnitItemInSlot(u , TrkExId[id] - InvMinChargedSlot[pn]) , GetStoredInteger(TRSItems , TrkItem[id] , "quantity"))
endif
if equiped and GetStoredInteger(TRSItems , TrkItem[id] , "quantity") < 1 and GetStoredInteger(TRSItems , sid , "stack") > 0 then
set s = GetStoredString(TRSItems , sid , "type")
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + s , GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(TrkExId[id]) , "")
call CleanItemParBR(TrkItem[id] , true)
call FreeCustomItemID(S2I(TrkItem[id]))
if TrkExId[id] >= InvMinChargedSlot[pn] and TrkExId[id] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[id] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
set TrkItem[id]=""
call FillInvBR(u , page)
else
if equiped then
call ShowItemStatsBR(u , TrkItem[id] , sid)
endif
endif
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
else
set sid2 = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
set sid = GetStoredString(TRSItems , TrkItem[id] , "ID")
set ittype = GetStoredString(TRSItems , sid2 , "type")
if TrkReq[id] != null then
set eax = id
set esx00 = InvCurItem[pn]
set esx01 = TrkItem[id]
set equiped = EvalFunc(TrkReq[id])
else
set equiped = ittype == stype and InvCurItem[pn] != TrkItem[id] and GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") < 1
endif
if equiped then
set InvCurSide = TrkSide[id]
if ittype != "charged" then
set equiped = EquipItemBR(u , sid2 , InvCurItem[pn] , true)
endif
if equiped then
set ebx32 = true
if TrkExId[id] >= InvMinChargedSlot[pn] and TrkExId[id] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[id] - InvMinChargedSlot[pn]
call UnitAddItemToSlotById(u , S2I(sid2) , i3)
call SetItemCharges(UnitItemInSlot(u , i3) , GetStoredInteger(TRSItems , InvCurItem[pn] , "quantity"))
call SetItemUserData(UnitItemInSlot(u , i3) , S2I(InvCurItem[pn]))
endif
set ebx32 = false
set s = GetStoredString(TRSItems , sid , "type")
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , TrkItem[id] , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + ittype , GetStoredInteger(TRSInv , TrkItem[id] , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreInteger(TRSInv , inv , "ItemsOfType" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype) + 1)
call StoreInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype))
call StoreString(TRSInv , inv , "ItemsOfType" + ittype + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype)) , InvCurItem[pn])
call UnequipItemBR(u , sid , TrkItem[id] , true)
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call AddItemToCusInvBR(u , TrkItem[id])
call StoreInteger(TRSItems , TrkItem[id] , "SourceSlot" , 0)
if not ebx31 then
call RemoveItemFromCusInvBR(u , TrkItem[id])
call CleanItemParBR(TrkItem[id] , true)
call FreeCustomItemID(S2I(TrkItem[id]))
endif
call ShowItemStatsBR(u , InvCurItem[pn] , sid2)
call StoreString(TRSInv , inv , "SlotEx" + I2S(TrkExId[id]) , InvCurItem[pn])
call StoreInteger(TRSItems , InvCurItem[pn] , "SourceSlot" , TrkExId[id])
call StoreString(TRSInv , InvCurItem[pn] , "CurOwner" , inv)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
call FillInvBR(u , page)
else
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
if GetStoredInteger(TRSItems , TrkItem[id] , "SourceSlot") > 0 and GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") > 0 then
set InvCurItem[pn]=""
else
set InvCurItem[pn]=TrkItem[id]
set InvCurIcon[pn]=CreateDestructableZ((1110454352) , TrkX[id] , TrkY[id] , TrkZ[id] + 0.009 , 270 , (0.265) , 1) // INLINED!!
endif
endif
else
set sid = GetStoredString(TRSItems , TrkItem[id] , "ID")
set sid2 = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
if GetStoredString(TRSItems , sid2 , "type") == "gems" then
set equiped = CheckRequimentsBR(u , sid2 , InvCurItem[pn])
if equiped then
set InvCurSide = TrkSide[id]
set equiped = InsertGemBR(u , sid , TrkItem[id] , InvCurItem[pn])
if equiped then
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call CleanItemParBR(InvCurItem[pn] , true)
call FreeCustomItemID(S2I(InvCurItem[pn]))
call ShowItemStatsBR(u , TrkItem[id] , sid)
call FillInvBR(u , page)
endif
endif
endif
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
endif
endif
else
if TrkItem[id] != "" and TrkItem[id] != null then
if InvCurItem[pn] == TrkItem[id] then
set sid = GetStoredString(TRSItems , TrkItem[id] , "ID")
set InvCurSide = ""
if GetStoredInteger(TRSItems , TrkItem[id] , "nouse") < 1 and GetStoredInteger(TRSItems , sid , "nouse") < 1 then
set equiped = UseItemBR(u , sid , TrkItem[id])
else
set equiped = false
endif
call ShowItemStatsBR(u , "" , "")
if equiped and GetStoredInteger(TRSItems , TrkItem[id] , "quantity") < 1 and GetStoredInteger(TRSItems , sid , "stack") > 0 then
call RemoveItemFromCusInvBR(u , TrkItem[id])
call CleanItemParBR(TrkItem[id] , true)
set TrkItem[id]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
call FillInvBR(u , page)
else
call ShowItemStatsBR(u , TrkItem[id] , sid)
endif
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
elseif InvCurItem[pn] != "" and InvCurItem[pn] != null then
set i = GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot")
if i > 0 then
set sid = GetStoredString(TRSItems , TrkItem[id] , "ID")
set sid2 = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
set ittype = GetStoredString(TRSItems , sid , "type")
set i = InvFirstTrk[pn] + size + i - 1
if TrkReq[i] != null then
set eax = i
set esx00 = TrkItem[id]
set esx01 = InvCurItem[pn]
set equiped = EvalFunc(TrkReq[i])
else
set equiped = GetStoredString(TRSItems , sid , "type") == GetStoredString(TRSItems , sid2 , "type")
endif
if equiped then
set InvCurSide = TrkSide[i]
if ittype != "charged" then
set equiped = EquipItemBR(u , sid , TrkItem[id] , true)
endif
if equiped then
set ebx32 = true
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
call UnitAddItemToSlotById(u , S2I(sid) , i3)
call SetItemCharges(UnitItemInSlot(u , i3) , GetStoredInteger(TRSItems , TrkItem[id] , "quantity"))
call SetItemUserData(UnitItemInSlot(u , i3) , S2I(TrkItem[id]))
endif
set ebx32 = false
set s = GetStoredString(TRSItems , sid2 , "type")
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + s , GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreInteger(TRSInv , inv , "ItemsOfType" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype) + 1)
call StoreInteger(TRSInv , TrkItem[id] , "ItemsOfTypeID" + ittype , GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype))
call StoreString(TRSInv , inv , "ItemsOfType" + ittype + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + ittype)) , TrkItem[id])
call UnequipItemBR(u , sid2 , InvCurItem[pn] , true)
call RemoveItemFromCusInvBR(u , TrkItem[id])
call AddItemToCusInvBR(u , InvCurItem[pn])
call ShowItemStatsBR(u , InvCurItem[pn] , sid2)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot")) , TrkItem[id])
call StoreInteger(TRSItems , TrkItem[id] , "SourceSlot" , GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot"))
call StoreString(TRSInv , TrkItem[id] , "CurOwner" , inv)
call StoreInteger(TRSItems , InvCurItem[pn] , "SourceSlot" , 0)
if not ebx31 then
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call CleanItemParBR(InvCurItem[pn] , true)
call FreeCustomItemID(S2I(InvCurItem[pn]))
endif
call FillInvBR(u , page)
endif
endif
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
else
set sid = GetStoredString(TRSItems , TrkItem[id] , "ID")
set sid2 = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
if GetStoredString(TRSItems , sid2 , "type") == "gems" then
set InvCurSide = ""
set equiped = InsertGemBR(u , sid , TrkItem[id] , InvCurItem[pn])
if equiped then
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call CleanItemParBR(InvCurItem[pn] , true)
call FreeCustomItemID(S2I(InvCurItem[pn]))
call ShowItemStatsBR(u , TrkItem[id] , sid)
call FillInvBR(u , page)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
else
if InvCurItem[pn] != null and InvCurItem[pn] != "" then
set i2 = GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot")
call ReplaceInvItemBR(inv , GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot") , TrkNum[id] + R2I(size * page))
set sid = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
call ShowItemStatsBR(u , InvCurItem[pn] , sid)
if ( i2 - 1 ) / size == page then
call RedrawInvSlotBR(u , i2)
endif
call RedrawInvSlotBR(u , TrkNum[id] + page * size)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
endif
endif
else
if InvCurItem[pn] != null and InvCurItem[pn] != "" then
set i2 = GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot")
call ReplaceInvItemBR(inv , GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot") , TrkNum[id] + R2I(size * page))
set sid = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
call ShowItemStatsBR(u , InvCurItem[pn] , sid)
if ( i2 - 1 ) / size == page then
call RedrawInvSlotBR(u , i2)
endif
set i = TrkNum[id] + page * size
call RedrawInvSlotBR(u , i)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
endif
endif
endif
else
set InvCurItem[pn]=TrkItem[id]
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
if stype != "inv" then
if TrkItem[id] != null and TrkItem[id] != "" then
set InvCurIcon[pn]=CreateDestructableZ((1110454352) , TrkX[id] , TrkY[id] , TrkZ[id] + 0.009 , 270 , (0.265) , 1) // INLINED!!
endif
else
set InvCurIcon[pn]=CreateDestructableZ((1110454352) , TrkX[id] , TrkY[id] , TrkZ[id] + 0.009 , 270 , (0.24) , 1) // INLINED!!
endif
endif
else
if InvCurItem[pn] != "" and InvCurItem[pn] != null then
if GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") > 0 then
if AddItemToCusInvBR(u , InvCurItem[pn]) then
set sid2 = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
set ittype = GetStoredString(TRSItems , sid2 , "type")
set i = TrkNum[id] + R2I(size * page)
if not ebx31 then
set ebx32 = true
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
set ebx32 = false
call UnequipItemBR(u , sid2 , InvCurItem[pn] , true)
set s = ittype
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + ittype , GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot")) , "")
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call CleanItemParBR(InvCurItem[pn] , true)
call FreeCustomItemID(S2I(InvCurItem[pn]))
else
set s = ittype
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s)) , GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s))))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call UnequipItemBR(u , sid2 , InvCurItem[pn] , true)
set ebx32 = true
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
set ebx32 = false
call FreeInvFreeSlotBR(inv , GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot"))
call FreeInvFreeSlotRemoveBR(inv , i)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot")) , "")
call StoreInteger(TRSInv , InvCurItem[pn] , "INVCurSlot" , i)
call StoreString(TRSInv , inv , "INVItemInSlot" + I2S(i) , InvCurItem[pn])
call StoreBoolean(TRSInv , inv , "INVSlotUsed" + I2S(i) , true)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot")) , "")
call StoreInteger(TRSItems , InvCurItem[pn] , "SourceSlot" , 0)
call ShowItemStatsBR(u , InvCurItem[pn] , sid2)
endif
endif
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
call FillInvBR(u , page)
else
set i = TrkNum[id] + size * page
set i2 = GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot")
call ReplaceInvItemBR(inv , i2 , i)
set sid = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
call ShowItemStatsBR(u , InvCurItem[pn] , sid)
if ( i2 - 1 ) / size == page then
call RedrawInvSlotBR(u , i2)
endif
call RedrawInvSlotBR(u , i)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
endif
endif
endif
endif
call PauseUnit(u , true)
set u = null
endfunction
function Track takes nothing returns nothing
local integer id=TrkGetAttachBR((GetHandleId((GetTriggeringTrackable())))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
if TrkItem[id] != null and TrkItem[id] != "" then
call ShowItemStatsBR(u , TrkItem[id] , GetStoredString(TRSItems , nonull(TrkItem[id]) , "ID"))
else
if TrkType[id] != "inv" then
call ShowItemStatsBR(u , "TRSCustomDisplay" , TrkType[id])
elseif u != null then
call ShowItemStatsBR(u , "" , "")
endif
endif
set u = null
endfunction
function TrackMerch takes nothing returns nothing
local integer id=TrkGetAttachBR((GetHandleId((GetTriggeringTrackable())))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
if u != null then
call ShowItemStatsBR(u , "" , "")
endif
set u = null
endfunction
function CheckMerchantsGoodsTypeBR takes unit u,string it returns boolean
local string su=I2S((GetHandleId((u)))) // INLINED!!
local string inv=GetStoredString(TRSInv , su , "BXTRSINV")
local string mtype=GetStoredString(TRSInv , inv , "CanSellType")
local string id=GetStoredString(TRSItems , it , "ID")
local string ittype=GetStoredString(TRSItems , id , "type")
local string itclass=GetStoredString(TRSItems , id , "class")
local string itsclass=GetStoredString(TRSItems , id , "sclass")
if mtype == ittype or mtype == itclass or mtype == itsclass or mtype == "ANY" or mtype == null or mtype == "" then
return true
endif
return false
endfunction
function HitMerch takes nothing returns nothing
local integer id=TrkGetAttachBR((GetHandleId((GetTriggeringTrackable())))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string su=I2S((GetHandleId((u)))) // INLINED!!
local boolean equip=false
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string inv2=null
local string t=null
local string s=null
local string s1=null
local real r=0
local real r1=0
local integer i=0
local integer i3=0
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer pagemerch=GetStoredInteger(TRSInv , inv , "MerchantPage")
if InvCurItem[pn] != null and InvCurItem[pn] != "" and InvMerchant[pn] != null then
set equip = CheckFreeInvSlotBR(InvMerchant[pn] , InvCurItem[pn])
set inv2 = GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
if equip and GetStoredInteger(TRSItems , GetStoredString(TRSItems , InvCurItem[pn] , "ID") , "unsell") < 1 and GetStoredInteger(TRSItems , InvCurItem[pn] , "unsell") < 1 then
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
call UnequipItemBR(u , GetStoredString(TRSItems , InvCurItem[pn] , "ID") , InvCurItem[pn] , true)
if GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") > 0 then
set s = GetStoredString(TRSItems , GetStoredString(TRSItems , InvCurItem[pn] , "ID") , "type")
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + s , GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot")) , "")
call StoreString(TRSInv , InvCurItem[pn] , "CurOwner" , null)
call StoreInteger(TRSItems , InvCurItem[pn] , "SourceSlot" , 0)
endif
set i = R2I(I2R(GetItemCostBR(InvCurItem[pn])) * (0.5)) // INLINED!!
set t = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
if GetStoredString(TRSItems , t , "type") == "charged" then
set r1 = GetStoredInteger(TRSItems , t , "stack")
if r1 > 0 then
set r = ( r1 - ( r1 - I2R(GetStoredInteger(TRSItems , InvCurItem[pn] , "quantity")) ) ) / r1
set r = I2R(i) * r
endif
else
set r = i
endif
set r = AddPercentBonus(r , LimitToBR(GetUnitBonusDataBR(su , "trade" , "Par") , (50.))) // INLINED!!
if CheckMerchantsGoodsTypeBR(InvMerchant[pn] , InvCurItem[pn]) then
call AddItemToCusInvBR(InvMerchant[pn] , InvCurItem[pn])
endif
call SetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD , GetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD) + (R2I(((r)*1.0) + 0.5))) // INLINED!!
call FillInvBR(u , page)
set i = 0
loop
exitwhen i > 11
if InvMerchant[pn] == InvMerchant[i] then
call FillMerchInvBR(InvUser[i] , inv2 , GetStoredInteger(TRSInv , GetStoredString(TRSInv , I2S((GetHandleId((InvUser[i])))) , "BXTRSINV") , "MerchantPage")) // INLINED!!
endif
set i = i + 1
endloop
endif
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
set InvCurItem[pn]=""
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set InvCurMerchItem[pn]=""
elseif InvCurMerchItem[pn] == TrkItem[id] and TrkItem[id] != null and TrkItem[id] != "" then
set i = GetItemCostBR(TrkItem[id])
set t = GetStoredString(TRSItems , TrkItem[id] , "ID")
if GetStoredString(TRSItems , t , "type") == "charged" then
set r1 = GetStoredInteger(TRSItems , t , "stack")
if r1 > 0 then
set r = ( r1 - ( r1 - I2R(GetStoredInteger(TRSItems , TrkItem[id] , "quantity")) ) ) / r1
set r = I2R(i) * r
endif
else
set r = i
endif
set r = AddPercentBonus(r , - LimitToBR(GetUnitBonusDataBR(su , "cheap" , "Par") , (50.))) // INLINED!!
set i = (R2I(((r)*1.0) + 0.5)) // INLINED!!
set equip = CheckFreeInvSlotBR(u , TrkItem[id]) and ( GetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD) >= i )
set inv2 = GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
if equip then
set i3 = GetStoredInteger(TRSInv , TrkItem[id] , "INVCurSlot")
call UnequipItemBR(InvMerchant[pn] , GetStoredString(TRSItems , TrkItem[id] , "ID") , TrkItem[id] , true)
call RemoveItemFromCusInvBR(InvMerchant[pn] , TrkItem[id])
call AddItemToCusInvBR(u , TrkItem[id])
if i3 <= GetStoredInteger(TRSInv , inv2 , "MerchantMaxItems") then
set i3 = GetStoredInteger(TRSItems , TrkItem[id] , "ItemQuality")
if i3 == 6 then
call MerchantRestoreItemBR(InvMerchant[pn] , TRSCreateSetItemBR(GetStoredString(TRSItems , TrkItem[id] , "specialname")))
elseif i3 == 7 then
call MerchantRestoreItemBR(InvMerchant[pn] , TRSCreateUniqueItemBR(GetStoredString(TRSItems , TrkItem[id] , "specialname")))
else
call MerchantRestoreItemBR(InvMerchant[pn] , TRSEnhanceItemBR(TRSCreateItemBR(S2I(t)) , GetStoredInteger(TRSInv , inv2 , "MinMagicLvl") , GetStoredInteger(TRSInv , inv2 , "MaxMagicLvl")))
endif
endif
call SetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD , GetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD) - i)
call FillInvBR(u , page)
set i = 0
loop
exitwhen i > 11
if InvMerchant[pn] == InvMerchant[i] then
if InvCurMerchItem[i] == TrkItem[id] and TrkItem[id] != "" and TrkItem[id] != null then
if InvCurMerchIcon[i] != null then
call RemoveDestructable(InvCurMerchIcon[i])
set InvCurMerchIcon[i]=null
endif
set InvCurMerchItem[i]=""
endif
call FillMerchInvBR(InvUser[i] , inv2 , GetStoredInteger(TRSInv , GetStoredString(TRSInv , I2S((GetHandleId((InvUser[i])))) , "BXTRSINV") , "MerchantPage")) // INLINED!!
endif
set i = i + 1
endloop
endif
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set InvCurMerchItem[pn]=""
elseif TrkItem[id] != null and TrkItem[id] != "" then
call ShowItemStatsBR(u , TrkItem[id] , GetStoredString(TRSItems , nonull(TrkItem[id]) , "ID"))
set InvCurMerchItem[pn]=TrkItem[id]
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set InvCurMerchIcon[pn]=CreateDestructableZ((1110454352) , TrkX[id] , TrkY[id] , TrkZ[id] + 0.009 , 270 , (0.24) , 1) // INLINED!!
else
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set InvCurMerchItem[pn]=""
endif
set u = null
endfunction
function MerchantSellItemBR takes nothing returns nothing
local integer id=TrkGetAttachBR((GetHandleId((GetTriggeringTrackable())))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string su=I2S((GetHandleId((u)))) // INLINED!!
local boolean equip=false
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string inv2=null
local string t=null
local integer i=0
local integer i3=0
local real r=0
local real r1=0
local string s=null
local string s1=null
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer pagemerch=GetStoredInteger(TRSInv , inv , "MerchantPage")
if InvCurItem[pn] != null and InvCurItem[pn] != "" then
set s = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
set equip = CheckFreeInvSlotBR(InvMerchant[pn] , InvCurItem[pn])
set inv2 = GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
if equip and GetStoredInteger(TRSItems , GetStoredString(TRSItems , InvCurItem[pn] , "ID") , "unsell") < 1 and GetStoredInteger(TRSItems , InvCurItem[pn] , "unsell") < 1 then
call UnequipItemBR(u , GetStoredString(TRSItems , InvCurItem[pn] , "ID") , InvCurItem[pn] , true)
call RemoveItemFromCusInvBR(u , InvCurItem[pn])
if GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") > 0 then
set s = GetStoredString(TRSItems , GetStoredString(TRSItems , InvCurItem[pn] , "ID") , "type")
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + s , GetStoredInteger(TRSInv , InvCurItem[pn] , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot")) , "")
call StoreString(TRSInv , InvCurItem[pn] , "CurOwner" , null)
call StoreInteger(TRSItems , InvCurItem[pn] , "SourceSlot" , 0)
endif
set i = R2I(I2R(GetItemCostBR(InvCurItem[pn])) * (0.5)) // INLINED!!
set t = GetStoredString(TRSItems , InvCurItem[pn] , "ID")
if GetStoredString(TRSItems , t , "type") == "charged" then
set r1 = GetStoredInteger(TRSItems , t , "stack")
if r1 > 0 then
set r = ( r1 - ( r1 - I2R(GetStoredInteger(TRSItems , InvCurItem[pn] , "quantity")) ) ) / r1
set r = I2R(i) * r
endif
else
set r = i
endif
set r = AddPercentBonus(r , LimitToBR(GetUnitBonusDataBR(su , "trade" , "Par") , (50.))) // INLINED!!
if CheckMerchantsGoodsTypeBR(InvMerchant[pn] , InvCurItem[pn]) then
call AddItemToCusInvBR(InvMerchant[pn] , InvCurItem[pn])
endif
call SetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD , GetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD) + (R2I(((r)*1.0) + 0.5))) // INLINED!!
call FillInvBR(u , page)
set i = 0
loop
exitwhen i > 11
if InvMerchant[pn] == InvMerchant[i] then
call FillMerchInvBR(InvUser[i] , inv2 , GetStoredInteger(TRSInv , GetStoredString(TRSInv , I2S((GetHandleId((InvUser[i])))) , "BXTRSINV") , "MerchantPage")) // INLINED!!
endif
set i = i + 1
endloop
endif
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
set InvCurItem[pn]=""
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set InvCurMerchItem[pn]=""
endif
set u = null
endfunction
function MerchantBuyItemBR takes nothing returns nothing
local integer id=TrkGetAttachBR((GetHandleId((GetTriggeringTrackable())))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string su=I2S((GetHandleId((u)))) // INLINED!!
local boolean equip=false
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local string inv2=null
local string t=null
local integer i=0
local integer i3=0
local real r=0
local real r1=0
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer pagemerch=GetStoredInteger(TRSInv , inv , "MerchantPage")
if InvCurMerchItem[pn] != null and InvCurMerchItem[pn] != "" then
set i = GetItemCostBR(InvCurMerchItem[pn])
set t = GetStoredString(TRSItems , InvCurMerchItem[pn] , "ID")
if GetStoredString(TRSItems , t , "type") == "charged" then
set r1 = GetStoredInteger(TRSItems , t , "stack")
if r1 > 0 then
set r = ( r1 - ( r1 - I2R(GetStoredInteger(TRSItems , InvCurMerchItem[pn] , "quantity")) ) ) / r1
set r = I2R(i) * r
endif
else
set r = i
endif
set r = AddPercentBonus(r , - LimitToBR(GetUnitBonusDataBR(su , "cheap" , "Par") , (50.))) // INLINED!!
set i = (R2I(((r)*1.0) + 0.5)) // INLINED!!
set equip = CheckFreeInvSlotBR(u , InvCurMerchItem[pn]) and ( GetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD) >= i )
set inv2 = GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
if equip then
set i3 = GetStoredInteger(TRSInv , InvCurMerchItem[pn] , "INVCurSlot")
call UnequipItemBR(InvMerchant[pn] , GetStoredString(TRSItems , InvCurMerchItem[pn] , "ID") , InvCurMerchItem[pn] , true)
call RemoveItemFromCusInvBR(InvMerchant[pn] , InvCurMerchItem[pn])
call AddItemToCusInvBR(u , InvCurMerchItem[pn])
if i3 <= GetStoredInteger(TRSInv , inv2 , "MerchantMaxItems") then
set i3 = GetStoredInteger(TRSItems , InvCurMerchItem[pn] , "ItemQuality")
if i3 == 6 then
call MerchantRestoreItemBR(InvMerchant[pn] , TRSCreateSetItemBR(GetStoredString(TRSItems , InvCurMerchItem[pn] , "specialname")))
elseif i3 == 7 then
call MerchantRestoreItemBR(InvMerchant[pn] , TRSCreateUniqueItemBR(GetStoredString(TRSItems , InvCurMerchItem[pn] , "specialname")))
else
call MerchantRestoreItemBR(InvMerchant[pn] , TRSEnhanceItemBR(TRSCreateItemBR(S2I(t)) , GetStoredInteger(TRSInv , inv2 , "MinMagicLvl") , GetStoredInteger(TRSInv , inv2 , "MaxMagicLvl")))
endif
endif
call SetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD , GetPlayerState(Player(pn) , PLAYER_STATE_RESOURCE_GOLD) - i)
call FillInvBR(u , page)
set i = 0
loop
exitwhen i > 11
if InvMerchant[pn] == InvMerchant[i] then
if InvCurMerchItem[i] == InvCurMerchItem[pn] and InvCurMerchItem[pn] != "" and InvCurMerchItem[pn] != null then
if InvCurMerchIcon[i] != null then
call RemoveDestructable(InvCurMerchIcon[i])
set InvCurMerchIcon[i]=null
endif
set InvCurMerchItem[i]=""
endif
call FillMerchInvBR(InvUser[i] , inv2 , GetStoredInteger(TRSInv , GetStoredString(TRSInv , I2S((GetHandleId((InvUser[i])))) , "BXTRSINV") , "MerchantPage")) // INLINED!!
endif
set i = i + 1
endloop
endif
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set InvCurMerchItem[pn]=""
endif
set u = null
endfunction
function INVPageDown takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local integer i=InvPageUp[pn]
local integer i2=0
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
call StoreInteger(TRSInv , inv , "Page" , page + 1)
set page = page + 1
if InvCurItem[pn] != null and InvCurItem[pn] != "" then
if GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") < 1 then
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
if ( GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot") - 1 ) / size == page then
set i2 = Modulo(GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot") , size)
if i2 == 0 then
set i2 = size
endif
set i2 = i2 + InvFirstTrk[pn] - 1
set InvCurIcon[pn]=CreateDestructableZ((1110454352) , TrkX[i2] , TrkY[i2] , TrkZ[i2] + 0.009 , 270 , (0.24) , 1) // INLINED!!
endif
endif
endif
call FillInvBR(u , page)
endif
if page > 0 then
set TrkBackIcon[i]=CreateDestructableZ((1110454356) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454355) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set i = InvPageDown[pn]
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
set TrkBackIcon[i]=CreateDestructableZ((1110454354) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454353) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set u = null
endfunction
function INVPageDownMerch takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
local string inv2=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv2 , "MerchantPage")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize")
local integer i=GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "pageupmerch")
local integer i2=0
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
call StoreInteger(TRSInv , inv2 , "MerchantPage" , page + 1)
set page = page + 1
if InvCurMerchItem[pn] != null and InvCurMerchItem[pn] != "" then
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
if ( GetStoredInteger(TRSInv , InvCurMerchItem[pn] , "INVCurSlot") - 1 ) / size == page then
set i2 = Modulo(GetStoredInteger(TRSInv , InvCurMerchItem[pn] , "INVCurSlot") , size)
if i2 == 0 then
set i2 = size
endif
set i2 = i2 + InvFirstMerchTrk[pn] - 1
set InvCurMerchIcon[pn]=CreateDestructableZ((1110454352) , TrkX[i2] , TrkY[i2] , TrkZ[i2] + 0.009 , 270 , (0.24) , 1) // INLINED!!
endif
endif
call FillMerchInvBR(u , inv , page)
endif
if page > 0 then
set TrkBackIcon[i]=CreateDestructableZ((1110454356) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454355) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set i = GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "pagedownmerch")
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
set TrkBackIcon[i]=CreateDestructableZ((1110454354) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454353) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set u = null
endfunction
function INVPageUp takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local integer i=InvPageUp[pn]
local integer i2=0
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if page > 0 then
call StoreInteger(TRSInv , inv , "Page" , page - 1)
set page = page - 1
if InvCurItem[pn] != null and InvCurItem[pn] != "" then
if GetStoredInteger(TRSItems , InvCurItem[pn] , "SourceSlot") < 1 then
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
if ( GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot") - 1 ) / size == page then
set i2 = Modulo(GetStoredInteger(TRSInv , InvCurItem[pn] , "INVCurSlot") , size)
if i2 == 0 then
set i2 = size
endif
set i2 = i2 + InvFirstTrk[pn] - 1
set InvCurIcon[pn]=CreateDestructableZ((1110454352) , TrkX[i2] , TrkY[i2] , TrkZ[i2] + 0.009 , 270 , (0.24) , 1) // INLINED!!
endif
endif
endif
call FillInvBR(u , page)
endif
if page > 0 then
set TrkBackIcon[i]=CreateDestructableZ((1110454356) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454355) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set i = InvPageDown[pn]
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
set TrkBackIcon[i]=CreateDestructableZ((1110454354) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454353) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set u = null
endfunction
function TRSTrue takes nothing returns boolean
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
if InvUser[pn] != null then
return true
endif
return false
endfunction
function INVPageUpMerch takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
local string inv2=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv2 , "MerchantPage")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize")
local integer i=GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "pageupmerch")
local integer i2=0
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if page > 0 then
call StoreInteger(TRSInv , inv2 , "MerchantPage" , page - 1)
set page = page - 1
if InvCurMerchItem[pn] != null and InvCurMerchItem[pn] != "" then
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
if ( GetStoredInteger(TRSInv , InvCurMerchItem[pn] , "INVCurSlot") - 1 ) / size == page then
set i2 = Modulo(GetStoredInteger(TRSInv , InvCurMerchItem[pn] , "INVCurSlot") , size)
if i2 == 0 then
set i2 = size
endif
set i2 = i2 + InvFirstMerchTrk[pn] - 1
set InvCurMerchIcon[pn]=CreateDestructableZ((1110454352) , TrkX[i2] , TrkY[i2] , TrkZ[i2] + 0.009 , 270 , (0.24) , 1) // INLINED!!
endif
endif
call FillMerchInvBR(u , inv , page)
endif
if page > 0 then
set TrkBackIcon[i]=CreateDestructableZ((1110454356) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454355) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set i = GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "pagedownmerch")
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
set TrkBackIcon[i]=CreateDestructableZ((1110454354) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454353) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set u = null
endfunction
function CreateGridBR takes integer gid,string side,real x,real y,integer cols,integer rows,integer exid,string invtype,string model,integer Did,real xoff,real yoff,real size,real xex,real yex,code OnTrack,code OnHit,boolexpr OnTrackCon,boolexpr OnHitCon,boolexpr Exreq returns integer
local integer i=1
local integer i2=1
local integer i3=0
local trackable t=null
local integer tmp=1
local trigger trig=null
local destructable d=null
local real tx=0
local real ty=y + yoff
local string st=null
local real xrat=(7.0) * size + xex // INLINED!!
local real yrat=(7.0) * size + yex // INLINED!!
local integer slot=InvMax
local location l=Location(x , y)
local real z=GetLocationZ(l)
local integer id=TrkMax
call RemoveLocation(l)
set l = null
set InvMax = InvMax + 1
set TrkMax = TrkMax + ( cols * rows )
call StoreInteger(TRSInv , "TRSINV" + I2S(gid) , invtype , id + 1)
if invtype == "inv" then
set InvFirstTrk[gid]=id + 1
call CreateDestructableZ((1110454327) , x , y , z + 0.001 , 180 , 1.01 , 1) // INLINED!!
endif
if invtype == "merchant" then
set InvFirstMerchTrk[gid]=id + 1
endif
loop
exitwhen i > rows
set tx = x + xoff
set i2 = 1
loop
exitwhen i2 > cols
set i3 = id + tmp
set tx = tx + xrat
set t = CreateTrackable(model , tx , ty , 0)
if Did > 0 then
set d = CreateDestructableZ(Did , tx , ty , z + 0.005 , 270 , size , 1)
endif
if OnHit != null then
set trig = CreateTrigger()
call TriggerAddAction(trig , OnHit)
call TriggerAddCondition(trig , OnHitCon)
call TriggerRegisterTrackableHitEvent(trig , t)
endif
if OnTrack != null then
set trig = CreateTrigger()
call TriggerAddAction(trig , OnTrack)
call TriggerAddCondition(trig , OnTrackCon)
call TriggerRegisterTrackableTrackEvent(trig , t)
endif
call TrkAttachBR((GetHandleId((t))) , i3) // INLINED!!
set Trk[i3]=t
set TrkX[i3]=tx
set TrkY[i3]=ty
set TrkZ[i3]=z
set TrkBackIcon[i3]=d
set TrkNum[i3]=tmp
set TrkIndex[i3]=id
set TrkInvId[i3]=gid
set TrkExId[i3]=exid
set TrkSide[i3]=side
set TrkItem[i3]=""
set TrkIcon[i3]=null
set TrkReq[i3]=Exreq
set TrkType[i3]=invtype
set TrkNatIconId[i3]=Did
set TrkNatIconSize[i3]=size
set i2 = i2 + 1
set d = null
set tmp = tmp + 1
endloop
set ty = ty - yrat
set i = i + 1
endloop
if invtype == "pagedown" then
set InvPageDown[gid]=i3
elseif invtype == "pageup" then
set InvPageUp[gid]=i3
endif
return slot
endfunction
function TRSInvCamControl takes nothing returns nothing
local integer i=1
if InvCamMax > 0 then
loop
exitwhen i > InvCamMax
if GetLocalPlayer() == Player(InvCamCon[i]) then
call CameraSetupApply(InvCamSetups[InvCamCon[i]] , true , false)
if TRSInvClearMessages then
call ClearTextMessages()
endif
endif
set i = i + 1
endloop
endif
endfunction
function InvCreateCamSetupBR takes integer pn returns nothing
local real duration=0.00
set InvCamSetups[pn]=CreateCameraSetup()
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_TARGET_DISTANCE , 135.00 , duration)
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_FARZ , 500.00 , duration)
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_ZOFFSET , 0.00 , duration)
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_ANGLE_OF_ATTACK , 270.00 , duration)
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_FIELD_OF_VIEW , 20.00 , duration)
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_ROLL , 0.00 , duration)
call CameraSetupSetField(InvCamSetups[pn] , CAMERA_FIELD_ROTATION , 90.00 , duration)
call CameraSetupSetDestPosition(InvCamSetups[pn] , InvPlayerX[pn] , InvPlayerY[pn] , duration)
endfunction
function AddPlayerToInvCameraControlBR takes integer pn returns nothing
if InvCamUsed[pn] == false then
if InvCamTimer == null then
set InvCamTimer = CreateTimer()
call TimerStart(InvCamTimer , 0.02 , true , function TRSInvCamControl)
endif
set InvCamMax = InvCamMax + 1
set InvCamPP[pn]=InvCamMax
set InvCamCon[InvCamMax]=pn
if InvCamSetups[pn] == null then
call InvCreateCamSetupBR(pn)
endif
call FogModifierStart(TRSVisibility[pn])
if GetLocalPlayer() == Player(pn) then
call SetCameraBounds(InvPlayerX[pn] , InvPlayerY[pn] , InvPlayerX[pn] , InvPlayerY[pn] , InvPlayerX[pn] , InvPlayerY[pn] , InvPlayerX[pn] , InvPlayerY[pn])
call CameraSetSmoothingFactor(1)
endif
endif
endfunction
function RemovePlayerFromInvCameraControlBR takes integer pn returns nothing
if InvCamUsed[pn] == true then
set InvCamCon[InvCamPP[pn]]=InvCamCon[InvCamMax]
set InvCamPP[InvCamCon[InvCamMax]]=InvCamPP[InvCamPP[pn]]
set InvCamMax = InvCamMax - 1
if GetLocalPlayer() == Player(pn) then
call SetCameraBounds(MapBoundMinX , MapBoundMinY , MapBoundMaxX , MapBoundMaxY , MapBoundMinX , MapBoundMaxY , MapBoundMaxX , MapBoundMinY)
call ResetToGameCamera(0.000)
call CameraSetSmoothingFactor(0)
call SetCameraPosition(GetUnitX(InvUser[pn]) , GetUnitY(InvUser[pn]))
endif
endif
endfunction
function EnterInvBR takes unit u returns boolean
local integer pn=GetPlayerId(GetOwningPlayer(u))
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local integer i=0
if InvCamUsed[pn] == false and u != null then
set InvUser[pn]=u
set InvUserId[pn]=inv
set InvCurItem[pn]=""
set InvCurMerchItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
if InvCurMerchIcon[pn] != null then
call RemoveDestructable(InvCurMerchIcon[pn])
set InvCurMerchIcon[pn]=null
endif
set i = InvPageUp[pn]
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if page > 0 then
set TrkBackIcon[i]=CreateDestructableZ((1110454356) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454355) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
set i = InvPageDown[pn]
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , inv , "INVSlotsMax") > size + ( page * size ) then
set TrkBackIcon[i]=CreateDestructableZ((1110454354) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454353) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
call FillInvBR(u , page)
if InvMerchant[pn] != null then
call StoreInteger(TRSInv , inv , "MerchantPage" , 0)
call RedrawInvIconsBR(InvFirstMerchTrk[pn] , InvFirstMerchTrk[pn] + GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize") - 1 , true , false)
set i = GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "sellitem")
call RedrawInvIconsBR(i , i , true , false)
call RedrawInvIconsBR(i + 1 , i + 1 , true , false)
set i = GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "pagedownmerch")
call RedrawInvIconsBR(i , i , true , false)
set size = GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize")
if TrkBackIcon[i] != null then
call RemoveDestructable(TrkBackIcon[i])
set TrkBackIcon[i]=null
endif
if GetStoredInteger(TRSInv , GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") , "INVSlotsMax") > GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize") then // INLINED!!
set TrkBackIcon[i]=CreateDestructableZ((1110454354) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
else
set TrkBackIcon[i]=CreateDestructableZ((1110454353) , TrkX[i] , TrkY[i] , TrkZ[i] + 0.005 , 270 , (0.2) , 1) // INLINED!!
endif
call RedrawInvIconsBR(i + 1 , i + 1 , true , false)
set inv = GetStoredString(TRSInv , I2S((GetHandleId((InvMerchant[pn])))) , "BXTRSINV") // INLINED!!
call FillMerchInvBR(u , inv , 0)
else
set i = GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "sellitem")
call RedrawInvIconsBR(i , i , false , false)
call RedrawInvIconsBR(i + 1 , i + 1 , false , false)
set i = GetStoredInteger(TRSInv , "TRSINV" + I2S(pn) , "pagedownmerch")
call RedrawInvIconsBR(i , i , false , false)
call RedrawInvIconsBR(i + 1 , i + 1 , false , false)
call RedrawInvIconsBR(InvFirstMerchTrk[pn] , InvFirstMerchTrk[pn] + GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "MerchantSize") - 1 , false , true)
endif
call AddPlayerToInvCameraControlBR(pn)
set InvCamUsed[pn]=true
return true
endif
return false
endfunction
function LeaveInvBR takes unit u returns boolean
local integer pn=GetPlayerId(GetOwningPlayer(u))
if InvCamUsed[pn] == true and u == InvUser[pn] then
call RemovePlayerFromInvCameraControlBR(pn)
call ShowItemStatsBR(u , "" , "")
set InvCurItem[pn]=""
set InvCurMerchItem[pn]=""
set InvUserId[pn]=""
set InvCamUsed[pn]=false
set InvUser[pn]=null
set InvMerchant[pn]=null
return true
endif
return false
endfunction
function INVButtonExit takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
if LeaveInvBR(u) then
call PauseUnit(u , false)
endif
set u = null
endfunction
function INVDropItem takes nothing returns nothing
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local string it=InvCurItem[pn]
local string s=null
local string s1=null
local item itm=null
local integer i3=0
local string sid=""
if it != null and it != "" then
set sid = GetStoredString(TRSItems , it , "ID")
if GetStoredInteger(TRSItems , sid , "undrop") < 1 and GetStoredInteger(TRSItems , it , "undrop") < 1 then
if GetStoredInteger(TRSItems , it , "SourceSlot") > 0 then
call UnequipItemBR(u , sid , it , true)
set s = GetStoredString(TRSItems , sid , "type")
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , it , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + s , GetStoredInteger(TRSInv , it , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , it , "SourceSlot")) , "")
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , it , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
call StoreInteger(TRSItems , it , "SourceSlot" , 0)
call StoreString(TRSInv , it , "CurOwner" , null)
else
call RemoveItemFromCusInvBR(u , it)
endif
call FillInvBR(u , page)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
set itm = CreateItem(S2I(sid) , GetUnitX(u) , GetUnitY(u))
call SetItemUserData(itm , S2I(it))
set itm = null
else
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
set InvCurItem[pn]=""
endif
endif
set u = null
endfunction
function INVDropItemExBR takes unit u,string it returns nothing
local integer pn=GetPlayerId(GetOwningPlayer(u))
local string inv=GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
local integer page=GetStoredInteger(TRSInv , inv , "Page")
local integer size=GetStoredInteger(TRSInv , "PlayerInv" + I2S(pn) , "Size")
local string s=null
local string s1=null
local item itm=null
local integer i3=0
local string sid=""
if it != null and it != "" then
set sid = GetStoredString(TRSItems , it , "ID")
if GetStoredInteger(TRSItems , sid , "undrop") < 1 and GetStoredInteger(TRSItems , it , "undrop") < 1 then
if GetStoredInteger(TRSItems , it , "SourceSlot") > 0 then
call UnequipItemBR(u , sid , it , true)
set s = GetStoredString(TRSItems , sid , "type")
set s1 = GetStoredString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , inv , "ItemsOfType" + s)))
call StoreString(TRSInv , inv , "ItemsOfType" + s + "Item" + I2S(GetStoredInteger(TRSInv , it , "ItemsOfTypeID" + s)) , s1)
call StoreInteger(TRSInv , s1 , "ItemsOfTypeID" + s , GetStoredInteger(TRSInv , it , "ItemsOfTypeID" + s))
call StoreInteger(TRSInv , inv , "ItemsOfType" + s , GetStoredInteger(TRSInv , inv , "ItemsOfType" + s) - 1)
call StoreString(TRSInv , inv , "SlotEx" + I2S(GetStoredInteger(TRSItems , it , "SourceSlot")) , "")
set i3 = InvFirstTrk[pn] + size + GetStoredInteger(TRSItems , it , "SourceSlot") - 1
if TrkExId[i3] >= InvMinChargedSlot[pn] and TrkExId[i3] <= InvMaxChargedSlot[pn] then
set i3 = TrkExId[i3] - InvMinChargedSlot[pn]
call RemoveItem(UnitItemInSlot(u , i3))
endif
call StoreInteger(TRSItems , it , "SourceSlot" , 0)
call StoreString(TRSInv , it , "CurOwner" , null)
else
call RemoveItemFromCusInvBR(u , it)
endif
call FillInvBR(u , page)
set InvCurItem[pn]=""
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
set itm = CreateItem(S2I(sid) , GetUnitX(u) , GetUnitY(u))
call SetItemUserData(itm , S2I(it))
set itm = null
else
if InvCurIcon[pn] != null then
call RemoveDestructable(InvCurIcon[pn])
set InvCurIcon[pn]=null
endif
set InvCurItem[pn]=""
endif
endif
set u = null
endfunction
function INVCustomReqWeaponSlot takes nothing returns boolean
local integer i=1
local integer id=eax
local string it=esx00
local string it2=esx01
local string sid=""
local string sid2=""
local string stype=TrkType[id]
local integer pn=TrkInvId[id]
local unit u=InvUser[pn]
local string inv=null
local boolean equiped=false
local integer c=0
local string ittype=""
local string it2type=""
local integer twohand=0
local integer twohand2=0
local string s=""
if u != null then
set inv = GetStoredString(TRSInv , I2S((GetHandleId((u)))) , "BXTRSINV") // INLINED!!
set u = null
if nonull(it) != "" then
set sid = GetStoredString(TRSItems , it , "ID")
set ittype = GetStoredString(TRSItems , sid , "type")
set twohand = GetStoredInteger(TRSItems , sid , "2handed")
endif
if nonull(it2) != "" then
set sid2 = GetStoredString(TRSItems , it2 , "ID")
set it2type = GetStoredString(TRSItems , sid2 , "type")
set twohand2 = GetStoredInteger(TRSItems , sid2 , "2handed")
endif
if ittype == "weapon" or ittype == "shield" or it2type == "weapon" or it2type == "shield" then
if it2 == null or it2 == "" then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeweapon") > 0 then
if ittype == "weapon" then
if GetUnitAbilityLevel(InvUser[pn] , (1093677139)) < 1 then // INLINED!!
return false
endif
endif
set twohand2 = GetStoredInteger(TRSItems , GetStoredString(TRSItems , GetStoredString(TRSInv , inv , "ItemsOfTypeweaponItem1") , "ID") , "2handed")
endif
if ittype == "weapon" then
if twohand > 0 then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeshield") > 0 or GetStoredInteger(TRSInv , inv , "ItemsOfTypeweapon") > 0 or GetUnitAbilityLevel(InvUser[pn] , (1093677138)) < 1 then // INLINED!!
return false
else
return true
endif
endif
if twohand2 > 0 then
return false
endif
return true
elseif ittype == "shield" then
if twohand2 < 1 then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeshield") < 1 then
return true
endif
else
return false
endif
endif
else
if ittype == "weapon" then
if it2type == "weapon" then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeweapon") > 1 then
if twohand > 0 then
return false
else
if GetUnitAbilityLevel(InvUser[pn] , (1093677139)) > 0 then // INLINED!!
return true
else
return false
endif
endif
else
if twohand > 0 then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeshield") > 0 then
return false
else
if GetUnitAbilityLevel(InvUser[pn] , (1093677138)) > 0 then // INLINED!!
return true
else
return false
endif
endif
else
return true
endif
endif
elseif it2type == "shield" then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeweapon") > 0 and twohand > 0 then
return false
else
if twohand > 0 then
if GetUnitAbilityLevel(InvUser[pn] , (1093677138)) > 0 and GetStoredInteger(TRSInv , inv , "ItemsOfTypeweapon") < 1 then // INLINED!!
return true
else
return false
endif
else
if GetUnitAbilityLevel(InvUser[pn] , (1093677139)) > 0 then // INLINED!!
return true
else
return false
endif
endif
endif
endif
elseif ittype == "shield" then
if it2type == "weapon" then
if GetStoredInteger(TRSInv , inv , "ItemsOfTypeshield") < 1 then
return true
else
return false
endif
elseif it2type == "shield" then
return true
endif
endif
endif
endif
endif
return false
endfunction
function TRSInvIsByMerchant takes nothing returns boolean
local trackable tr=GetTriggeringTrackable()
local integer id=TrkGetAttachBR((GetHandleId((tr)))) // INLINED!!
local integer pn=TrkInvId[id]
return InvMerchant[pn] != null
endfunction
function CreateGridExec takes nothing returns nothing
local real x=(- 5316.00) // INLINED!!
local real y=(- 5600.00) // INLINED!!
local integer i=eax
local real xstep=(128.) // INLINED!!
set InvPlayerX[i]=x + ( i * xstep )
set InvPlayerY[i]=y
call CreateGridBR(i , null , x + ( i * xstep ) , y , 6 , 10 , 0 , "inv" , "TRS\\TRSINVtrk.mdx" , (1110454320) , - 15.5 , 9.0 , (0.27) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 1 , "helm" , "TRS\\TRSINVtrkEx.mdx" , (1110454342) , - 18.56 , 8.55 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 2 , "shoulder" , "TRS\\TRSINVtrkEx.mdx" , (1110454595) , - 18.56 , 5.883 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 3 , "weapon" , "TRS\\TRSINVtrkEx.mdx" , (1110454359) , - 18.56 , 3.216 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , Condition(function INVCustomReqWeaponSlot)) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 4 , "armor" , "TRS\\TRSINVtrkEx.mdx" , (1110454341) , - 18.56 , 0.549 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 5 , "belt" , "TRS\\TRSINVtrkEx.mdx" , (1110454358) , - 18.56 , - 2.118 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 6 , "pants" , "TRS\\TRSINVtrkEx.mdx" , (1110454585) , - 18.56 , - 4.785 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "right" , x + ( i * xstep ) , y , 1 , 1 , 7 , "ring" , "TRS\\TRSINVtrkEx.mdx" , (1110454593) , - 18.56 , - 7.452 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 8 , "amulet" , "TRS\\TRSINVtrkEx.mdx" , (1110454343) , - 4.55 , 8.55 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 9 , "shoulder" , "TRS\\TRSINVtrkEx.mdx" , (1110454596) , - 4.55 , 5.883 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 10 , "shield" , "TRS\\TRSINVtrkEx.mdx" , (1110454357) , - 4.55 , 3.216 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , Condition(function INVCustomReqWeaponSlot)) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 11 , "gloves" , "TRS\\TRSINVtrkEx.mdx" , (1110454584) , - 4.55 , 0.549 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 12 , "bracers" , "TRS\\TRSINVtrkEx.mdx" , (1110454583) , - 4.55 , - 2.118 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 13 , "boots" , "TRS\\TRSINVtrkEx.mdx" , (1110454582) , - 4.55 , - 4.785 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "left" , x + ( i * xstep ) , y , 1 , 1 , 14 , "ring" , "TRS\\TRSINVtrkEx.mdx" , (1110454594) , - 4.55 , - 7.452 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
set InvMinChargedSlot[i]=15
set InvMaxChargedSlot[i]=18
call CreateGridBR(i , "UseSlot1" , x + ( i * xstep ) , y , 1 , 1 , 15 , "charged" , "TRS\\TRSINVtrkEx.mdx" , (1110454605) , 1 , - 6.35 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "UseSlot2" , x + ( i * xstep ) , y , 1 , 1 , 16 , "charged" , "TRS\\TRSINVtrkEx.mdx" , (1110454606) , 3.667 , - 6.35 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "UseSlot3" , x + ( i * xstep ) , y , 1 , 1 , 17 , "charged" , "TRS\\TRSINVtrkEx.mdx" , (1110454605) , 1 , - 9 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , "UseSlot4" , x + ( i * xstep ) , y , 1 , 1 , 18 , "charged" , "TRS\\TRSINVtrkEx.mdx" , (1110454606) , 3.667 , - 9 , (0.381) , 0 , 0 , function Track , function Hit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 8 , 5 , 0 , "merchant" , "TRS\\TRSINVtrk.mdx" , (1110454320) , 2 , 5.3 , (0.27) , 0 , 0 , function TrackMerch , function HitMerch , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "background" , "TRS\\TRSINVtrkBack.mdx" , 0 , 0 , 0 , 0 , 0 , 0 , function Track , function Track , Condition(function TRSTrue) , Condition(function TRSTrue) , null)
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "pagedown" , "TRS\\TRSINVtrk0x1.mdx" , (1110454353) , - 5.5 , - 9.8 , (0.2) , 0 , 0 , function Track , function INVPageDown , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "pageup" , "TRS\\TRSINVtrk0x1.mdx" , (1110454355) , - 5.5 , 10.6 , (0.2) , 0 , 0 , function Track , function INVPageUp , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "pagedownmerch" , "TRS\\TRSINVtrk0x1.mdx" , (1110454353) , 15.73 , - 3.95 , (0.2) , 0 , 0 , function Track , function INVPageDownMerch , Condition(function TRSInvIsByMerchant) , Condition(function TRSInvIsByMerchant) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "pageupmerch" , "TRS\\TRSINVtrk0x1.mdx" , (1110454355) , 15.73 , 6.95 , (0.2) , 0 , 0 , function Track , function INVPageUpMerch , Condition(function TRSInvIsByMerchant) , Condition(function TRSInvIsByMerchant) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "sellitem" , "TRS\\TRSINVtrk.mdx" , (1110454603) , 0.25 , 5.25 , (0.23) , 0 , 0 , function Track , function MerchantSellItemBR , Condition(function TRSInvIsByMerchant) , Condition(function TRSInvIsByMerchant) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "buyitem" , "TRS\\TRSINVtrk.mdx" , (1110454604) , 0.25 , 3.5 , (0.23) , 0 , 0 , function Track , function MerchantBuyItemBR , Condition(function TRSInvIsByMerchant) , Condition(function TRSInvIsByMerchant) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "exit" , "TRS\\TRSINVtrk.mdx" , (1110454344) , - 3.5 , - 10.0 , (0.23) , 0 , 0 , function Track , function INVButtonExit , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call CreateGridBR(i , null , x + ( i * xstep ) , y , 1 , 1 , 0 , "drop" , "TRS\\TRSINVtrk.mdx" , (1110454360) , - 1 , - 10.0 , (0.23) , 0 , 0 , function Track , function INVDropItem , Condition(function TRSTrue) , Condition(function TRSTrue) , null) // INLINED!!
call StoreInteger(TRSInv , "PlayerInv" + I2S(i) , "Size" , 60)
call StoreInteger(TRSInv , "PlayerInv" + I2S(i) , "MerchantSize" , 40)
call StoreInteger(TRSInv , "PlayerInv" + I2S(i) , "ExtraSlots" , 18)
endfunction
function CreateGridAction takes nothing returns nothing
local integer i=0
local rect r
loop
exitwhen i > 11
set eax = i
call ExecuteFunc("CreateGridExec")
set i = i + 1
endloop
set i = 0
set r = Rect((- 5316.00) - 128 , (- 5600.00) - 128 , (- 5316.00) + ( 12 * (128.) ) + 128 , (- 5600.00) + 128) // INLINED!!
loop
exitwhen i > 12
set TRSVisibility[i]=CreateFogModifierRect(Player(i) , FOG_OF_WAR_VISIBLE , r , false , false)
call FogModifierStart(TRSVisibility[i])
set i = i + 1
endloop
endfunction
function InitTrig_TRSInv takes nothing returns nothing
endfunction
function MerchantAddItemBR takes unit u,string it returns nothing
local string inv=TRSGetInvBR(u)
local boolean add=AddItemToCusInvBR(u , it)
if add == false then
call TRSRemoveItemBR(it)
else
call StoreInteger(TRSInv , inv , "MerchantMaxItems" , GetStoredInteger(TRSInv , inv , "MerchantMaxItems") + 1)
endif
endfunction
function MerchantsCondition takes nothing returns boolean
if GetOwningPlayer(GetTriggerUnit()) == GetTriggerPlayer() then
set InvCurSelectedHero[GetPlayerId(GetTriggerPlayer())]=GetTriggerUnit()
endif
return GetUnitAbilityLevel(GetTriggerUnit() , (1093677140)) > 0 // INLINED!!
endfunction
function TRSMerchant_BuyRange takes nothing returns integer
return 500
endfunction
function MerchantsActions takes nothing returns nothing
local integer pn=GetPlayerId(GetTriggerPlayer())
local boolean exten=GetUnitAbilityLevel(InvCurSelectedHero[pn] , (1093677141)) > 0 // INLINED!!
if not exten then
call TRSGetInvBR(GetTriggerUnit())
if InvCurSelectedHero[pn] != null then
if DistanceBetweenCord(GetUnitX(InvCurSelectedHero[pn]) - GetUnitX(GetTriggerUnit()) , GetUnitY(InvCurSelectedHero[pn]) - GetUnitY(GetTriggerUnit())) < (500) then // INLINED!!
call TRSGetInvBR(InvCurSelectedHero[pn])
set InvMerchant[pn]=GetTriggerUnit()
set exten = EnterInvBR(InvCurSelectedHero[pn])
if exten then
call PauseUnit(InvCurSelectedHero[pn] , true)
endif
endif
endif
endif
endfunction
function InitTrig_TRSMerchant takes nothing returns nothing
local integer i=0
set gg_trg_TRSMerchant = CreateTrigger()
loop
exitwhen i > 11
call TriggerRegisterPlayerSelectionEventBJ(gg_trg_TRSMerchant , Player(i) , true)
set i = i + 1
endloop
call TriggerAddAction(gg_trg_TRSMerchant , function MerchantsActions)
call TriggerAddCondition(gg_trg_TRSMerchant , Condition(function MerchantsCondition))
endfunction
function Trig_EnterInv_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 1093677143
endfunction
function Trig_EnterInv_Actions takes nothing returns nothing
local boolean exten=GetUnitAbilityLevel(GetTriggerUnit() , (1093677141)) > 0 // INLINED!!
call IssueImmediateOrder(GetTriggerUnit() , "stop")
if exten == false then
call TRSGetInvBR(GetTriggerUnit())
set exten = EnterInvBR(GetTriggerUnit())
if exten then
call PauseUnit(GetTriggerUnit() , true)
endif
endif
endfunction
function InitTrig_TRSEnterInv takes nothing returns nothing
set gg_trg_TRSEnterInv = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_TRSEnterInv , EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_TRSEnterInv , Condition(function Trig_EnterInv_Conditions))
call TriggerAddAction(gg_trg_TRSEnterInv , function Trig_EnterInv_Actions)
endfunction
function TRSLeaveInvAct takes nothing returns nothing
local boolean b=false
local player p=GetTriggerPlayer()
local integer pn=GetPlayerId(p)
local unit u
if IsMultiboardMinimized(TRSDisMB[pn]) then
set b = true
else
call MultiboardMinimize(TRSDisMB[pn] , true)
if GetLocalPlayer() == p then
call MultiboardDisplay(TRSDisMB[pn] , false)
endif
endif
if b then
set u = InvUser[GetPlayerId(p)]
set b = LeaveInvBR(u)
if b then
call PauseUnit(u , false)
endif
endif
set u = null
endfunction
function InitTrig_TRSLeaveInv takes nothing returns nothing
local integer i=0
set gg_trg_TRSLeaveInv = CreateTrigger()
loop
exitwhen i > 11
call TriggerRegisterPlayerEventEndCinematic(gg_trg_TRSLeaveInv , Player(i))
set i = i + 1
endloop
call TriggerAddAction(gg_trg_TRSLeaveInv , function TRSLeaveInvAct)
endfunction
function EquipItemCondition takes nothing returns boolean
return not ebx32
endfunction
function EquipItemAct takes nothing returns nothing
local boolean equiped=false
local string h=null
local boolean ex=GetUnitAbilityLevel(GetManipulatingUnit() , (1093677141)) > 0 // INLINED!!
call TRSGetInvBR(GetManipulatingUnit())
if GetItemUserData(GetManipulatedItem()) == 0 then
call SetItemUserData(GetManipulatedItem() , GetCustomItemID())
endif
call PreGenerateParBR(I2S(GetItemTypeId(GetManipulatedItem())) , I2S(GetItemUserData(GetManipulatedItem())))
set h = I2S(GetItemUserData(GetManipulatedItem()))
if GetStoredInteger(TRSItems , h , "ItemQuality") < 3 then
call TRSEnhanceItemBR(I2S(GetItemUserData(GetManipulatedItem())) , 1 , 3)
endif
if GetStoredString(TRSItems , h , "type") == "charm" and ex then
call EquipItemBR(GetManipulatingUnit() , I2S(GetItemTypeId(GetManipulatedItem())) , h , true)
endif
if not ex then
set equiped = AddItemToCusInvBR(GetManipulatingUnit() , h)
if equiped == false then
call UnitRemoveItem(GetManipulatingUnit() , GetManipulatedItem())
else
call RemoveItem(GetManipulatedItem())
endif
endif
endfunction
function InitTrig_EquipItem takes nothing returns nothing
set gg_trg_EquipItem = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_EquipItem , EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(gg_trg_EquipItem , function EquipItemAct)
call TriggerAddCondition(gg_trg_EquipItem , Condition(function EquipItemCondition))
endfunction
function UnequipItemAct takes nothing returns nothing
if GetUnitAbilityLevel(GetTriggerUnit() , (1093677141)) > 0 then // INLINED!!
call UnequipItemBR(GetTriggerUnit() , I2S(GetItemTypeId(GetManipulatedItem())) , I2S(GetItemUserData(GetManipulatedItem())) , true)
endif
endfunction
function InitTrig_UnequipItem takes nothing returns nothing
set gg_trg_UnequipItem = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_UnequipItem , EVENT_PLAYER_UNIT_DROP_ITEM)
call TriggerAddAction(gg_trg_UnequipItem , function UnequipItemAct)
endfunction
function Trig_lolll_Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
if s == "-save" then
call SaveGameCache(TRS)
elseif s == "-load" then
call ReloadGameCachesFromDisk()
endif
endfunction
function InitTrig_lolll takes nothing returns nothing
set gg_trg_lolll = CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_lolll , Player(0) , "" , true)
call TriggerAddAction(gg_trg_lolll , function Trig_lolll_Actions)
endfunction
function Trig_CreateSpecialItems_Actions takes nothing returns nothing
local integer i=0
local item it=null
local unit u=gg_unit_Hpal_0235
call CreateSetItemBR("DioDWard" , 0 , - 128)
call CreateSetItemBR("CelebrateCharge" , 0 , - 128)
call CreateSetItemBR("AlexeyWisdom" , 0 , - 128)
call CreateSetItemBR("TcMight" , 0 , - 128)
call CreateSetItemBR("DioDWard" , 0 , - 128)
call CreateSetItemBR("CelebrateCharge" , 0 , - 128)
call CreateSetItemBR("AlexeyWisdom" , 0 , - 128)
call CreateSetItemBR("TcMight" , 0 , - 128)
call CreateSetItemBR("Rammstein" , 0 , - 128)
call CreateSetItemBR("Tiesto" , 0 , - 128)
call CreateSetItemBR("Tomcraft" , 0 , - 128)
call CreateSetItemBR("PaulOakenfold" , 0 , - 128)
call CreateSetItemBR("FerryCorsten" , 0 , - 128)
set i = GetStoredInteger(TRSItems , I2S(1227894832) , "UniqueCount")
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
set i = GetStoredInteger(TRSItems , I2S(1227894833) , "UniqueCount")
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
call CreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i))) , 0 , 200)
endfunction
function InitTrig_CreateSpecialItems takes nothing returns nothing
set gg_trg_CreateSpecialItems = CreateTrigger()
call TriggerAddAction(gg_trg_CreateSpecialItems , function Trig_CreateSpecialItems_Actions)
endfunction
function Trig_CreateItems_for_Merchant_Actions2 takes nothing returns nothing
local unit u=gg_unit_Othr_0230
local integer i=0
local string it=null
local integer min=1
local integer max=3
set i = GetStoredInteger(TRSItems , I2S(1227894832) , "UniqueCount")
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
set i = GetStoredInteger(TRSItems , I2S(1227894833) , "UniqueCount")
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
set i = GetStoredInteger(TRSItems , I2S(1227894832) , "UniqueCount")
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894832) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
set i = GetStoredInteger(TRSItems , I2S(1227894833) , "UniqueCount")
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894833) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894854) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894841) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894860) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894857) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894838) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894836) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894833) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894856) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894858) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894855) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894855) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894859) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894859) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894838) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894832) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894832) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894857) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894832) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894837) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894837) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894853) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894841) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894853) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894853) , min , max))
set i = GetStoredInteger(TRSItems , I2S(1227894855) , "UniqueCount")
call MerchantAddItemBR(u , TRSCreateUniqueItemBR(GetStoredString(TRSItems , I2S(1227894855) , "UniqueItem" + I2S(GetRandomInt(1 , i)))))
endfunction
function Trig_CreateItems_for_Merchant_Actions takes nothing returns nothing
local unit u=gg_unit_Othr_0230
local integer i=0
local string it=null
local integer min=1
local integer max=3
call TriggerSleepAction(0.5)
call StoreString(TRSInv , TRSGetInvBR(u) , "CanSellType" , "ANY")
call StoreInteger(TRSInv , TRSGetInvBR(u) , "MinMagicLvl" , min)
call StoreInteger(TRSInv , TRSGetInvBR(u) , "MaxMagicLvl" , max)
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894854) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894841) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894860) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894857) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894838) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894836) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894833) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894856) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894858) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894855) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894855) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894859) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894859) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894838) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894832) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894832) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894857) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894832) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894839) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894837) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894837) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894853) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894841) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894853) , min , max))
call MerchantAddItemBR(u , TRSEnhanceItemBR(TRSCreateItemBR(1227894853) , min , max))
set u = gg_unit_hfoo_0232
call TRSGetInvBR(u)
call MerchantAddItemBR(u , TRSCreateSetItemBR("Tomcraft"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("Rammstein"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("FerryCorsten"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("Rammstein"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("Tiesto"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("Rammstein"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("Tiesto"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("PaulOakenfold"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("Tomcraft"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("PaulOakenfold"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("FerryCorsten"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("TcMight"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("DioDWard"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("TcMight"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("TcMight"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("AlexeyWisdom"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("DioDWard"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("DioDWard"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("AlexeyWisdom"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("AlexeyWisdom"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("CelebrateCharge"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("CelebrateCharge"))
call MerchantAddItemBR(u , TRSCreateSetItemBR("CelebrateCharge"))
call ExecuteFunc("Trig_CreateItems_for_Merchant_Actions2")
endfunction
function InitTrig_MerchantItems takes nothing returns nothing
call ExecuteFunc("Trig_CreateItems_for_Merchant_Actions")
endfunction
function Trig_Inits_Actions takes nothing returns nothing
local integer i=0
loop
exitwhen i > 11
call SetPlayerAbilityAvailable(Player(i) , 1093677105 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677106 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677108 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677109 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677110 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677111 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677112 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677113 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677121 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677122 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677123 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677124 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677125 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677126 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677127 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677128 , false)
call SetPlayerAbilityAvailable(Player(i) , 1093677144 , false)
set i = i + 1
endloop
call echoAdv("Runeword ''Corpse Explosion'' insert OrtRalOrt in melee weapon ")
call echoAdv("Runeword ''Flame Guard'' insert TalRalOrtTal in armor ")
call echoAdv("|cffff0000 Mountain King have limited inventory ! maxslot == 20 !")
endfunction
function InitTrig_ExtraInits takes nothing returns nothing
set gg_trg_ExtraInits = CreateTrigger()
call TriggerAddAction(gg_trg_ExtraInits , function Trig_Inits_Actions)
endfunction
function Trig_LimitInvSize_Actions takes nothing returns nothing
call StoreInteger(TRSInv , TRSGetInvBR(gg_unit_Hmkg_0362) , "MaxSize" , 20)
endfunction
function InitTrig_LimitInvSize takes nothing returns nothing
set gg_trg_LimitInvSize = CreateTrigger()
call TriggerAddAction(gg_trg_LimitInvSize , function Trig_LimitInvSize_Actions)
endfunction
function Trig_save_Actions takes nothing returns nothing
call SaveGameCache(TPC)
endfunction
function InitTrig_save takes nothing returns nothing
set gg_trg_save = CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_save , Player(0) , "save" , true)
call TriggerAddAction(gg_trg_save , function Trig_save_Actions)
endfunction
function Trig_load_Actions takes nothing returns nothing
call ReloadGameCachesFromDisk()
endfunction
function InitTrig_load takes nothing returns nothing
set gg_trg_load = CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_load , Player(0) , "load" , true)
call TriggerAddAction(gg_trg_load , function Trig_load_Actions)
endfunction
function MathGetNumLengthBR takes integer i returns integer
if i < 10 then
return 1
elseif i < 100 then
return 2
elseif i < 1000 then
return 3
elseif i < 10000 then
return 4
elseif i < 100000 then
return 5
elseif i < 1000000 then
return 6
elseif i < 10000000 then
return 7
elseif i < 100000000 then
return 8
elseif i < 1000000000 then
return 9
elseif i < 10000000000 then
return 10
endif
return 0
endfunction
function MathGetSubTokenBR takes integer val,integer pos returns integer
local integer i2=0
local integer i3=0
local integer i4=0
local integer l=MathGetNumLengthBR(val)
if pos <= l and pos > 0 then
set i2 = R2I(Pow(10 , l - pos))
set i3 = val / i2
set i4 = ( i3 / 10 ) * 10
set i4 = i3 - i4
return i4
else
return 0
endif
return i4
endfunction
function MathGetSubNumBR takes integer val,integer min,integer max returns integer
local integer i2=0
local integer i3=0
local integer i4=0
local integer l=MathGetNumLengthBR(val)
if max > l then
set max = l
endif
if min > max then
set min = max
endif
if min > 0 then
set i2 = R2I(Pow(10 , l - max))
set val = val / i2
set i4 = R2I(Pow(10 , max - min + 1))
set i4 = val - ( ( val / i4 ) * i4 )
return i4
else
return 0
endif
return i4
endfunction
function SumNumAdvBR takes integer val returns integer
local integer l=MathGetNumLengthBR(val)
local integer i=1
local integer i2=0
local integer i3=0
loop
exitwhen i > l
set i2 = MathGetSubTokenBR(val , i)
set i3 = i3 + i2
if i3 > 9 then
set i3 = MathGetSubTokenBR(i3 , 1) + MathGetSubTokenBR(i3 , 2)
endif
set i = i + 1
endloop
return i3
endfunction
function Trig_adv_Actions takes nothing returns nothing
local string s=GetEventPlayerChatString()
call echo(I2S(SumNumAdvBR(S2I(s))))
endfunction
function InitTrig_Mathadv takes nothing returns nothing
set gg_trg_Mathadv = CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_Mathadv , Player(0) , "" , true)
call TriggerAddAction(gg_trg_Mathadv , function Trig_adv_Actions)
endfunction
function Spellblizzard takes nothing returns nothing
local unit u=CreateUnit(GetOwningPlayer(GetAttacker()) , 1752196449 , GetUnitX(GetAttacker()) , GetUnitY(GetAttacker()) , 0)
local unit tar=GetTriggerUnit()
call UnitAddAbility(u , 1095262842)
call SetUnitAbilityLevel(u , 1095262842 , eax)
call IssuePointOrder(u , "blizzard" , GetUnitX(tar) , GetUnitY(tar))
call TriggerSleepAction(10)
call KillUnit(u)
set tar = null
set u = null
endfunction
function Spellacid takes nothing returns nothing
local unit u=CreateUnit(GetOwningPlayer(GetAttacker()) , 1752196449 , GetUnitX(GetAttacker()) , GetUnitY(GetAttacker()) , 0)
local unit tar=GetTriggerUnit()
call UnitAddAbility(u , 1095655778)
call SetUnitAbilityLevel(u , 1095655778 , eax)
call IssueTargetOrder(u , "acidbomb" , tar)
call TriggerSleepAction(1)
call KillUnit(u)
call KillUnit(u)
set u = null
endfunction
function Spellinferno takes nothing returns nothing
local unit u=CreateUnit(GetOwningPlayer(GetAttacker()) , 1752196449 , GetUnitX(GetAttacker()) , GetUnitY(GetAttacker()) , 0)
local unit tar=GetTriggerUnit()
call UnitAddAbility(u , 1095263859)
call SetUnitAbilityLevel(u , 1095263859 , eax)
call IssuePointOrder(u , "flamestrike" , GetUnitX(tar) , GetUnitY(tar))
call TriggerSleepAction(2)
call KillUnit(u)
call KillUnit(u)
set u = null
endfunction
function Trig_asdasf3_Actions takes nothing returns nothing
local unit a=GetAttacker()
local string s=I2S((GetHandleId((a)))) // INLINED!!
local integer i=1
local string param=null
local integer count=GetStoredInteger(TRSItems , s , "Prop20StackMax")
local integer ch=0
if GetUnitTypeId(a) == 1215324524 then
endif
set eux = a
loop
exitwhen i > count
set param = "Prop20" + "s" + I2S(GetStoredInteger(TRSItems , s , "Prop20Stack" + I2S(i)))
if GetUnitTypeId(a) == 1215324524 then
endif
set ch = GetStoredInteger(TRSItems , s , param + "Min")
if GetRandomReal(1 , 100) <= ch then
set eax = GetStoredInteger(TRSItems , s , param + "Max")
if (GetStoredString(USPData , I2S((0x3E81 )) , ( I2S((GetStoredInteger(TRSItems , s , "Prop20Stack" + I2S(i))))))) != null then // INLINED!!
call ExecuteFunc("Spell" + (GetStoredString(USPData , I2S((0x3E81 )) , ( I2S((GetStoredInteger(TRSItems , s , "Prop20Stack" + I2S(i)))))))) // INLINED!!
endif
endif
set i = i + 1
endloop
endfunction
function InitTrig_OnHitActs takes nothing returns nothing
set gg_trg_OnHitActs = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_OnHitActs , EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddAction(gg_trg_OnHitActs , function Trig_asdasf3_Actions)
endfunction
function Trig_Removegems_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 1093677135 or GetSpellAbilityId() == 1093677136 or GetSpellAbilityId() == 1093677137
endfunction
function RecreateItemBR takes nothing returns nothing
local integer id=S2I(GetStoredString(TRSItems , esx24 , "ID"))
local item it=CreateItem(id , GetUnitX(TRSUnit) , GetUnitY(TRSUnit))
local string sit=null
if GetItemUserData(it) == 0 then
call SetItemUserData(it , GetCustomItemID())
endif
set sit = I2S(GetItemUserData(it))
call StoreString(TRSItems , sit , "ID" , I2S(id))
call CopyItemBR(sit , esx24 , 1 , true , true)
set it = null
endfunction
function CloneItemBR takes item IT,unit u returns nothing
local integer id=S2I(GetStoredString(TRSItems , I2S(GetItemUserData(IT)) , "ID"))
local item it=CreateItem(id , GetUnitX(u) , GetUnitY(u))
local string sit=null
if GetItemUserData(it) == 0 then
call SetItemUserData(it , GetCustomItemID())
endif
set sit = I2S(GetItemUserData(it))
call StoreString(TRSItems , sit , "ID" , I2S(id))
call CopyItemBR(sit , I2S(GetItemUserData(IT)) , 1 , true , true)
set it = null
endfunction
function Trig_Removegems_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local item it=GetSpellTargetItem()
local string id=I2S(GetItemTypeId(it))
local boolean mag=false
local integer max=0
local string sit=null
if GetItemUserData(it) == 0 then
call SetItemUserData(it , GetCustomItemID())
endif
set sit = I2S(GetItemUserData(it))
set max = GetStoredInteger(TRSItems , sit , "MaxGems")
call PreGenerateParBR(id , sit)
if GetSpellAbilityId() == 1093677135 then
if max > 0 then
call RemoveInsertedGemBR(u , id , sit , true , function RecreateItemBR)
endif
elseif GetSpellAbilityId() == 1093677136 then
call CloneItemBR(it , u)
elseif GetSpellAbilityId() == 1093677137 then
if GetStoredInteger(TRSItems , sit , "ItemQuality") < 3 and not GetStoredBoolean(TRSItems , sit , "IsRuneword") then
if GetStoredBoolean(TRSItems , sit , "Equiped") then
call UnequipItemBR(u , id , sit , true)
call GetPrefixBR(id , 0 , 3)
call StoreString(TRSItems , sit , "Prefix" , esx25)
if esx26 != null then
call PassParamToItemBR(sit , esx26 , 1 , true)
call StoreInteger(TRSItems , sit , "cost" , GetStoredInteger(TRSItems , sit , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
set mag = true
endif
call GetSuffixBR(id , 0 , 3)
call StoreString(TRSItems , sit , "Suffix" , esx25)
if esx26 != null then
call PassParamToItemBR(sit , esx26 , 1 , true)
call StoreInteger(TRSItems , sit , "cost" , GetStoredInteger(TRSItems , sit , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
set mag = true
endif
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
call EquipItemBR(u , id , sit , true)
else
call GetPrefixBR(id , 0 , 3)
call StoreString(TRSItems , sit , "Prefix" , esx25)
if esx26 != null then
call PassParamToItemBR(sit , esx26 , 1 , true)
call StoreInteger(TRSItems , sit , "cost" , GetStoredInteger(TRSItems , sit , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
set mag = true
endif
call GetSuffixBR(id , 0 , 3)
call StoreString(TRSItems , sit , "Suffix" , esx25)
if esx26 != null then
call PassParamToItemBR(sit , esx26 , 1 , true)
call StoreInteger(TRSItems , sit , "cost" , GetStoredInteger(TRSItems , sit , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
set mag = true
endif
endif
if mag == false then
if GetChance(50) then
call GetPrefixBR(id , 1 , 3)
call StoreString(TRSItems , sit , "Prefix" , esx25)
if esx26 != null then
call PassParamToItemBR(sit , esx26 , 1 , true)
call StoreInteger(TRSItems , sit , "cost" , GetStoredInteger(TRSItems , sit , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
endif
else
call GetSuffixBR(id , 1 , 3)
call StoreString(TRSItems , sit , "Suffix" , esx25)
if esx26 != null then
call PassParamToItemBR(sit , esx26 , 1 , true)
call StoreInteger(TRSItems , sit , "cost" , GetStoredInteger(TRSItems , sit , "cost") + GetStoredInteger(TRSItems , esx26 , "cost"))
call StoreInteger(TRSItems , sit , "ItemQuality" , 3)
endif
endif
endif
endif
endif
set u = null
set it = null
endfunction
function InitTrig_ItemManipulations takes nothing returns nothing
set gg_trg_ItemManipulations = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ItemManipulations , EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_ItemManipulations , Condition(function Trig_Removegems_Conditions))
call TriggerAddAction(gg_trg_ItemManipulations , function Trig_Removegems_Actions)
endfunction
function Trig_asdasdasdasd_Actions takes nothing returns nothing
call echo(I2S(MathGetSubNumBR(123456789 , 3 , 7)))
endfunction
function InitTrig_asdasdasdasd takes nothing returns nothing
set gg_trg_asdasdasdasd = CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_asdasdasdasd , Player(0) , "lol" , true)
call TriggerAddAction(gg_trg_asdasdasdasd , function Trig_asdasdasdasd_Actions)
endfunction
function Trig_Ally_Actions takes nothing returns nothing
local integer i=0
local integer i2=0
loop
exitwhen i2 > 11
set i = 0
loop
exitwhen i > 11
call SetPlayerAllianceStateBJ(Player(i2) , Player(i) , bj_ALLIANCE_ALLIED_ADVUNITS)
set i = i + 1
endloop
set i2 = i2 + 1
endloop
endfunction
function InitTrig_Ally takes nothing returns nothing
set gg_trg_Ally = CreateTrigger()
call TriggerAddAction(gg_trg_Ally , function Trig_Ally_Actions)
endfunction
function InvControlCondition takes nothing returns boolean
local integer i=GetIssuedOrderId()
return i > 852001 and i < 852008
endfunction
function GetItemPosInInvBR takes unit u,item it returns integer
local integer i=0
loop
exitwhen i > 5
if UnitItemInSlot(u , i) == it then
return i
endif
set i = i + 1
endloop
return - 1
endfunction
function InvControlActions takes nothing returns nothing
local unit u=GetTriggerUnit()
local item it=GetOrderTargetItem()
local string su=I2S((GetHandleId((u)))) // INLINED!!
local integer slot=GetIssuedOrderId() - 852002
local integer slot2=GetItemPosInInvBR(u , it)
local boolean insert=false
local item it2=UnitItemInSlot(u , slot)
local string sit=null
local string sit2=null
local string sid=I2S(GetItemTypeId(it))
local string sid2=I2S(GetItemTypeId(it2))
local integer array i
if GetItemUserData(it) == 0 then
call SetItemUserData(it , GetCustomItemID())
endif
set sit = I2S(GetItemUserData(it))
if GetItemUserData(it2) == 0 then
call SetItemUserData(it2 , GetCustomItemID())
endif
set sit2 = I2S(GetItemUserData(it2))
if it2 != null and it != it2 and GetStoredString(TRSItems , sid , "type") == "gems" then
set insert = InsertGemBR(u , sid2 , sit2 , sit)
if insert then
call CleanItemParBR(sit , true)
call RemoveItem(it)
endif
elseif it2 != null and it != it2 and GetStoredInteger(TRSItems , sit2 , "quantity") < GetStoredInteger(TRSItems , sid2 , "stack") and sid == sid2 then
set i[1]=GetStoredInteger(TRSItems , sid2 , "stack") - GetStoredInteger(TRSItems , sit2 , "quantity")
set i[2]=GetStoredInteger(TRSItems , sit , "quantity")
set i[3]=i[2] - i[1]
if i[3] > 0 then
set i[2]=i[2] - i[3]
endif
call StoreInteger(TRSItems , sit2 , "quantity" , GetStoredInteger(TRSItems , sit2 , "quantity") + i[2])
if i[3] > 0 then
call StoreInteger(TRSItems , sit , "quantity" , i[3])
else
call CleanItemParBR(sit , true)
call RemoveItem(it)
endif
elseif it == it2 and GetStoredBoolean(TRSItems , sid , "Exist") then
if GetStoredInteger(TRSItems , sid , "notequip") == 0 then
if GetStoredBoolean(TRSItems , sit , "Equiped") then
call UnequipItemBR(u , sid , sit , true)
else
call EquipItemBR(u , sid , sit , true)
endif
elseif GetStoredString(TRSItems , sid , "type") == "potion" and GetStoredInteger(TRSItems , sit , "quantity") > 0 then
set insert = EquipItemBR(u , sid , sit , true)
if insert then
call StoreBoolean(TRSItems , sit , "Equiped" , false)
call StoreInteger(TRSItems , sit , "quantity" , GetStoredInteger(TRSItems , sit , "quantity") - 1)
if GetStoredInteger(TRSItems , sit , "quantity") < 1 then
call CleanItemParBR(sit , true)
call RemoveItem(it)
endif
endif
endif
endif
set it = null
set it2 = null
set u = null
endfunction
function InitTrig_InvControl takes nothing returns nothing
set gg_trg_InvControl = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_InvControl , EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(gg_trg_InvControl , Condition(function InvControlCondition))
call TriggerAddAction(gg_trg_InvControl , function InvControlActions)
endfunction
function Trig_ListInv_Conditions takes nothing returns boolean
local integer i=GetSpellAbilityId()
return i >= 1093677129 and i <= 1093677132
endfunction
function InvDummyId takes nothing returns integer
return 1227894850
endfunction
function Trig_ListInv_Actions takes nothing returns nothing
local integer i=GetSpellAbilityId() - 1093677128
local integer c=0
local item it=null
local unit u=GetTriggerUnit()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local string t=null
local string su=I2S((GetHandleId((u)))) // INLINED!!
local integer sui=(GetHandleId((u))) // INLINED!!
local integer lvl=GetUnitAbilityLevel(u , 1093677134)
local item array its
local integer maxits=0
if lvl == 0 then
call UnitAddAbility(u , 1093677134)
set lvl = 1
endif
if lvl != i then
call DisableTrigger(gg_trg_EquipItem)
call DisableTrigger(gg_trg_UnequipItem)
call DisableTrigger(gg_trg_InvControl)
set t = "InvPage" + I2S(lvl) + "Item"
loop
exitwhen c > 4
set it = UnitItemInSlot(u , c)
call SaveItemHandle(TRS_hash , sui , StringHash(t + I2S(c)) , it)
call UnitRemoveItem(u , it)
call SetItemVisible(it , false)
set c = c + 1
endloop
set c = 0
set t = "InvPage" + I2S(i) + "Item"
loop
exitwhen c > 4
set it = LoadItemHandle(TRS_hash , sui , StringHash(t + I2S(c)))
if it == null then
set maxits = maxits + 1
set its[maxits]=CreateItem((1227894850) , x , y) // INLINED!!
call UnitAddItem(u , its[maxits])
else
call SetItemVisible(it , true)
call UnitAddItem(u , it)
endif
set c = c + 1
endloop
set c = 1
loop
exitwhen c > maxits
call RemoveItem(its[c])
set its[c]=null
set c = c + 1
endloop
call EnableTrigger(gg_trg_EquipItem)
call EnableTrigger(gg_trg_UnequipItem)
call EnableTrigger(gg_trg_InvControl)
call SetUnitAbilityLevel(u , 1093677134 , i)
endif
set u = null
set it = null
endfunction
function InitTrig_ListInv takes nothing returns nothing
set gg_trg_ListInv = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_ListInv , EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(gg_trg_ListInv , Condition(function Trig_ListInv_Conditions))
call TriggerAddAction(gg_trg_ListInv , function Trig_ListInv_Actions)
endfunction
function InitCustomTriggers takes nothing returns nothing
//Function not found: call InitTrig_TRSGeneric()
call ExecuteFunc("TRS2Init") // INLINED!!
call InitTrig_TRSSetups()
call InitTrig_TRSItems()
call ExecuteFunc("InitDisplayModuleParamCompilerBR") // INLINED!!
call InitTrig_TRSAffixes()
call InitTrig_TRSAPI()
call InitTrig_TRSShowItemStats()
call InitTrig_TRSInvSetups()
call InitTrig_TRSInv()
call InitTrig_TRSMerchant()
call InitTrig_TRSEnterInv()
call InitTrig_TRSLeaveInv()
call InitTrig_EquipItem()
call InitTrig_UnequipItem()
call InitTrig_lolll()
call InitTrig_CreateSpecialItems()
call ExecuteFunc("Trig_CreateItems_for_Merchant_Actions") // INLINED!!
call InitTrig_ExtraInits()
call InitTrig_LimitInvSize()
call InitTrig_save()
call InitTrig_load()
call InitTrig_Mathadv()
call InitTrig_OnHitActs()
call InitTrig_ItemManipulations()
call InitTrig_asdasdasdasd()
call InitTrig_Ally()
call InitTrig_InvControl()
call InitTrig_ListInv()
endfunction
function RunInitializationTriggers takes nothing returns nothing
call ConditionalTriggerExecute(gg_trg_TRSCore)
call ConditionalTriggerExecute(gg_trg_TRSDisplayModule)
call ConditionalTriggerExecute(gg_trg_TRSAffixes)
call ConditionalTriggerExecute(gg_trg_CreateSpecialItems)
call ConditionalTriggerExecute(gg_trg_ExtraInits)
call ConditionalTriggerExecute(gg_trg_LimitInvSize)
call ConditionalTriggerExecute(gg_trg_Ally)
endfunction
function InitCustomPlayerSlots takes nothing returns nothing
call SetPlayerStartLocation(Player(0) , 0)
call ForcePlayerStartLocation(Player(0) , 0)
call SetPlayerColor(Player(0) , ConvertPlayerColor(0))
call SetPlayerRacePreference(Player(0) , RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(0) , true)
call SetPlayerController(Player(0) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(1) , 1)
call ForcePlayerStartLocation(Player(1) , 1)
call SetPlayerColor(Player(1) , ConvertPlayerColor(1))
call SetPlayerRacePreference(Player(1) , RACE_PREF_ORC)
call SetPlayerRaceSelectable(Player(1) , true)
call SetPlayerController(Player(1) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(2) , 2)
call ForcePlayerStartLocation(Player(2) , 2)
call SetPlayerColor(Player(2) , ConvertPlayerColor(2))
call SetPlayerRacePreference(Player(2) , RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(2) , true)
call SetPlayerController(Player(2) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(3) , 3)
call ForcePlayerStartLocation(Player(3) , 3)
call SetPlayerColor(Player(3) , ConvertPlayerColor(3))
call SetPlayerRacePreference(Player(3) , RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(3) , true)
call SetPlayerController(Player(3) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(4) , 4)
call ForcePlayerStartLocation(Player(4) , 4)
call SetPlayerColor(Player(4) , ConvertPlayerColor(4))
call SetPlayerRacePreference(Player(4) , RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(4) , true)
call SetPlayerController(Player(4) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(5) , 5)
call ForcePlayerStartLocation(Player(5) , 5)
call SetPlayerColor(Player(5) , ConvertPlayerColor(5))
call SetPlayerRacePreference(Player(5) , RACE_PREF_ORC)
call SetPlayerRaceSelectable(Player(5) , true)
call SetPlayerController(Player(5) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(6) , 6)
call ForcePlayerStartLocation(Player(6) , 6)
call SetPlayerColor(Player(6) , ConvertPlayerColor(6))
call SetPlayerRacePreference(Player(6) , RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(6) , true)
call SetPlayerController(Player(6) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(7) , 7)
call ForcePlayerStartLocation(Player(7) , 7)
call SetPlayerColor(Player(7) , ConvertPlayerColor(7))
call SetPlayerRacePreference(Player(7) , RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(7) , true)
call SetPlayerController(Player(7) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(8) , 8)
call ForcePlayerStartLocation(Player(8) , 8)
call SetPlayerColor(Player(8) , ConvertPlayerColor(8))
call SetPlayerRacePreference(Player(8) , RACE_PREF_HUMAN)
call SetPlayerRaceSelectable(Player(8) , true)
call SetPlayerController(Player(8) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(9) , 9)
call ForcePlayerStartLocation(Player(9) , 9)
call SetPlayerColor(Player(9) , ConvertPlayerColor(9))
call SetPlayerRacePreference(Player(9) , RACE_PREF_ORC)
call SetPlayerRaceSelectable(Player(9) , true)
call SetPlayerController(Player(9) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(10) , 10)
call ForcePlayerStartLocation(Player(10) , 10)
call SetPlayerColor(Player(10) , ConvertPlayerColor(10))
call SetPlayerRacePreference(Player(10) , RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(10) , true)
call SetPlayerController(Player(10) , MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(11) , 11)
call ForcePlayerStartLocation(Player(11) , 11)
call SetPlayerColor(Player(11) , ConvertPlayerColor(11))
call SetPlayerRacePreference(Player(11) , RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(11) , true)
call SetPlayerController(Player(11) , MAP_CONTROL_USER)
endfunction
function InitCustomTeams takes nothing returns nothing
call SetPlayerTeam(Player(0) , 0)
call SetPlayerState(Player(0) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(1) , 0)
call SetPlayerState(Player(1) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(2) , 0)
call SetPlayerState(Player(2) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(3) , 0)
call SetPlayerState(Player(3) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(4) , 0)
call SetPlayerState(Player(4) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(5) , 0)
call SetPlayerState(Player(5) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerAllianceStateAllyBJ(Player(0) , Player(1) , true)
call SetPlayerAllianceStateAllyBJ(Player(0) , Player(2) , true)
call SetPlayerAllianceStateAllyBJ(Player(0) , Player(3) , true)
call SetPlayerAllianceStateAllyBJ(Player(0) , Player(4) , true)
call SetPlayerAllianceStateAllyBJ(Player(0) , Player(5) , true)
call SetPlayerAllianceStateAllyBJ(Player(1) , Player(0) , true)
call SetPlayerAllianceStateAllyBJ(Player(1) , Player(2) , true)
call SetPlayerAllianceStateAllyBJ(Player(1) , Player(3) , true)
call SetPlayerAllianceStateAllyBJ(Player(1) , Player(4) , true)
call SetPlayerAllianceStateAllyBJ(Player(1) , Player(5) , true)
call SetPlayerAllianceStateAllyBJ(Player(2) , Player(0) , true)
call SetPlayerAllianceStateAllyBJ(Player(2) , Player(1) , true)
call SetPlayerAllianceStateAllyBJ(Player(2) , Player(3) , true)
call SetPlayerAllianceStateAllyBJ(Player(2) , Player(4) , true)
call SetPlayerAllianceStateAllyBJ(Player(2) , Player(5) , true)
call SetPlayerAllianceStateAllyBJ(Player(3) , Player(0) , true)
call SetPlayerAllianceStateAllyBJ(Player(3) , Player(1) , true)
call SetPlayerAllianceStateAllyBJ(Player(3) , Player(2) , true)
call SetPlayerAllianceStateAllyBJ(Player(3) , Player(4) , true)
call SetPlayerAllianceStateAllyBJ(Player(3) , Player(5) , true)
call SetPlayerAllianceStateAllyBJ(Player(4) , Player(0) , true)
call SetPlayerAllianceStateAllyBJ(Player(4) , Player(1) , true)
call SetPlayerAllianceStateAllyBJ(Player(4) , Player(2) , true)
call SetPlayerAllianceStateAllyBJ(Player(4) , Player(3) , true)
call SetPlayerAllianceStateAllyBJ(Player(4) , Player(5) , true)
call SetPlayerAllianceStateAllyBJ(Player(5) , Player(0) , true)
call SetPlayerAllianceStateAllyBJ(Player(5) , Player(1) , true)
call SetPlayerAllianceStateAllyBJ(Player(5) , Player(2) , true)
call SetPlayerAllianceStateAllyBJ(Player(5) , Player(3) , true)
call SetPlayerAllianceStateAllyBJ(Player(5) , Player(4) , true)
call SetPlayerAllianceStateVisionBJ(Player(0) , Player(1) , true)
call SetPlayerAllianceStateVisionBJ(Player(0) , Player(2) , true)
call SetPlayerAllianceStateVisionBJ(Player(0) , Player(3) , true)
call SetPlayerAllianceStateVisionBJ(Player(0) , Player(4) , true)
call SetPlayerAllianceStateVisionBJ(Player(0) , Player(5) , true)
call SetPlayerAllianceStateVisionBJ(Player(1) , Player(0) , true)
call SetPlayerAllianceStateVisionBJ(Player(1) , Player(2) , true)
call SetPlayerAllianceStateVisionBJ(Player(1) , Player(3) , true)
call SetPlayerAllianceStateVisionBJ(Player(1) , Player(4) , true)
call SetPlayerAllianceStateVisionBJ(Player(1) , Player(5) , true)
call SetPlayerAllianceStateVisionBJ(Player(2) , Player(0) , true)
call SetPlayerAllianceStateVisionBJ(Player(2) , Player(1) , true)
call SetPlayerAllianceStateVisionBJ(Player(2) , Player(3) , true)
call SetPlayerAllianceStateVisionBJ(Player(2) , Player(4) , true)
call SetPlayerAllianceStateVisionBJ(Player(2) , Player(5) , true)
call SetPlayerAllianceStateVisionBJ(Player(3) , Player(0) , true)
call SetPlayerAllianceStateVisionBJ(Player(3) , Player(1) , true)
call SetPlayerAllianceStateVisionBJ(Player(3) , Player(2) , true)
call SetPlayerAllianceStateVisionBJ(Player(3) , Player(4) , true)
call SetPlayerAllianceStateVisionBJ(Player(3) , Player(5) , true)
call SetPlayerAllianceStateVisionBJ(Player(4) , Player(0) , true)
call SetPlayerAllianceStateVisionBJ(Player(4) , Player(1) , true)
call SetPlayerAllianceStateVisionBJ(Player(4) , Player(2) , true)
call SetPlayerAllianceStateVisionBJ(Player(4) , Player(3) , true)
call SetPlayerAllianceStateVisionBJ(Player(4) , Player(5) , true)
call SetPlayerAllianceStateVisionBJ(Player(5) , Player(0) , true)
call SetPlayerAllianceStateVisionBJ(Player(5) , Player(1) , true)
call SetPlayerAllianceStateVisionBJ(Player(5) , Player(2) , true)
call SetPlayerAllianceStateVisionBJ(Player(5) , Player(3) , true)
call SetPlayerAllianceStateVisionBJ(Player(5) , Player(4) , true)
call SetPlayerTeam(Player(6) , 1)
call SetPlayerState(Player(6) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(7) , 1)
call SetPlayerState(Player(7) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(8) , 1)
call SetPlayerState(Player(8) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(9) , 1)
call SetPlayerState(Player(9) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(10) , 1)
call SetPlayerState(Player(10) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerTeam(Player(11) , 1)
call SetPlayerState(Player(11) , PLAYER_STATE_ALLIED_VICTORY , 1)
call SetPlayerAllianceStateAllyBJ(Player(6) , Player(7) , true)
call SetPlayerAllianceStateAllyBJ(Player(6) , Player(8) , true)
call SetPlayerAllianceStateAllyBJ(Player(6) , Player(9) , true)
call SetPlayerAllianceStateAllyBJ(Player(6) , Player(10) , true)
call SetPlayerAllianceStateAllyBJ(Player(6) , Player(11) , true)
call SetPlayerAllianceStateAllyBJ(Player(7) , Player(6) , true)
call SetPlayerAllianceStateAllyBJ(Player(7) , Player(8) , true)
call SetPlayerAllianceStateAllyBJ(Player(7) , Player(9) , true)
call SetPlayerAllianceStateAllyBJ(Player(7) , Player(10) , true)
call SetPlayerAllianceStateAllyBJ(Player(7) , Player(11) , true)
call SetPlayerAllianceStateAllyBJ(Player(8) , Player(6) , true)
call SetPlayerAllianceStateAllyBJ(Player(8) , Player(7) , true)
call SetPlayerAllianceStateAllyBJ(Player(8) , Player(9) , true)
call SetPlayerAllianceStateAllyBJ(Player(8) , Player(10) , true)
call SetPlayerAllianceStateAllyBJ(Player(8) , Player(11) , true)
call SetPlayerAllianceStateAllyBJ(Player(9) , Player(6) , true)
call SetPlayerAllianceStateAllyBJ(Player(9) , Player(7) , true)
call SetPlayerAllianceStateAllyBJ(Player(9) , Player(8) , true)
call SetPlayerAllianceStateAllyBJ(Player(9) , Player(10) , true)
call SetPlayerAllianceStateAllyBJ(Player(9) , Player(11) , true)
call SetPlayerAllianceStateAllyBJ(Player(10) , Player(6) , true)
call SetPlayerAllianceStateAllyBJ(Player(10) , Player(7) , true)
call SetPlayerAllianceStateAllyBJ(Player(10) , Player(8) , true)
call SetPlayerAllianceStateAllyBJ(Player(10) , Player(9) , true)
call SetPlayerAllianceStateAllyBJ(Player(10) , Player(11) , true)
call SetPlayerAllianceStateAllyBJ(Player(11) , Player(6) , true)
call SetPlayerAllianceStateAllyBJ(Player(11) , Player(7) , true)
call SetPlayerAllianceStateAllyBJ(Player(11) , Player(8) , true)
call SetPlayerAllianceStateAllyBJ(Player(11) , Player(9) , true)
call SetPlayerAllianceStateAllyBJ(Player(11) , Player(10) , true)
call SetPlayerAllianceStateVisionBJ(Player(6) , Player(7) , true)
call SetPlayerAllianceStateVisionBJ(Player(6) , Player(8) , true)
call SetPlayerAllianceStateVisionBJ(Player(6) , Player(9) , true)
call SetPlayerAllianceStateVisionBJ(Player(6) , Player(10) , true)
call SetPlayerAllianceStateVisionBJ(Player(6) , Player(11) , true)
call SetPlayerAllianceStateVisionBJ(Player(7) , Player(6) , true)
call SetPlayerAllianceStateVisionBJ(Player(7) , Player(8) , true)
call SetPlayerAllianceStateVisionBJ(Player(7) , Player(9) , true)
call SetPlayerAllianceStateVisionBJ(Player(7) , Player(10) , true)
call SetPlayerAllianceStateVisionBJ(Player(7) , Player(11) , true)
call SetPlayerAllianceStateVisionBJ(Player(8) , Player(6) , true)
call SetPlayerAllianceStateVisionBJ(Player(8) , Player(7) , true)
call SetPlayerAllianceStateVisionBJ(Player(8) , Player(9) , true)
call SetPlayerAllianceStateVisionBJ(Player(8) , Player(10) , true)
call SetPlayerAllianceStateVisionBJ(Player(8) , Player(11) , true)
call SetPlayerAllianceStateVisionBJ(Player(9) , Player(6) , true)
call SetPlayerAllianceStateVisionBJ(Player(9) , Player(7) , true)
call SetPlayerAllianceStateVisionBJ(Player(9) , Player(8) , true)
call SetPlayerAllianceStateVisionBJ(Player(9) , Player(10) , true)
call SetPlayerAllianceStateVisionBJ(Player(9) , Player(11) , true)
call SetPlayerAllianceStateVisionBJ(Player(10) , Player(6) , true)
call SetPlayerAllianceStateVisionBJ(Player(10) , Player(7) , true)
call SetPlayerAllianceStateVisionBJ(Player(10) , Player(8) , true)
call SetPlayerAllianceStateVisionBJ(Player(10) , Player(9) , true)
call SetPlayerAllianceStateVisionBJ(Player(10) , Player(11) , true)
call SetPlayerAllianceStateVisionBJ(Player(11) , Player(6) , true)
call SetPlayerAllianceStateVisionBJ(Player(11) , Player(7) , true)
call SetPlayerAllianceStateVisionBJ(Player(11) , Player(8) , true)
call SetPlayerAllianceStateVisionBJ(Player(11) , Player(9) , true)
call SetPlayerAllianceStateVisionBJ(Player(11) , Player(10) , true)
endfunction
function InitAllyPriorities takes nothing returns nothing
call SetStartLocPrioCount(0 , 11)
call SetStartLocPrio(0 , 0 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 1 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 2 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 3 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 4 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 5 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(0 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(1 , 11)
call SetStartLocPrio(1 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 1 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 2 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 3 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 4 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 5 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(1 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(2 , 11)
call SetStartLocPrio(2 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 2 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 3 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 4 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 5 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(3 , 11)
call SetStartLocPrio(3 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 3 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 4 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 5 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(4 , 11)
call SetStartLocPrio(4 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 4 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 5 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(5 , 11)
call SetStartLocPrio(5 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 5 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(6 , 11)
call SetStartLocPrio(6 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 5 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 6 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(7 , 11)
call SetStartLocPrio(7 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 5 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 6 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 7 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(8 , 11)
call SetStartLocPrio(8 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 5 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 6 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 7 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 8 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(9 , 11)
call SetStartLocPrio(9 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 5 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 6 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 7 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 8 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 9 , 10 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(10 , 11)
call SetStartLocPrio(10 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 5 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 6 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 7 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 8 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 9 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(10 , 10 , 11 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(11 , 11)
call SetStartLocPrio(11 , 0 , 0 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 1 , 1 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 2 , 2 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 3 , 3 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 4 , 4 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 5 , 5 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 6 , 6 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 7 , 7 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 8 , 8 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 9 , 9 , MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(11 , 10 , 10 , MAP_LOC_PRIO_HIGH)
endfunction
function main takes nothing returns nothing
call SetCameraBounds(- 5376.0 + GetCameraMargin(CAMERA_MARGIN_LEFT) , - 5632.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM) , 5376.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT) , 5120.0 - GetCameraMargin(CAMERA_MARGIN_TOP) , - 5376.0 + GetCameraMargin(CAMERA_MARGIN_LEFT) , 5120.0 - GetCameraMargin(CAMERA_MARGIN_TOP) , 5376.0 - GetCameraMargin(CAMERA_MARGIN_RIGHT) , - 5632.0 + GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl" , "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
call SetTerrainFogEx(0 , 0.0 , 15000.0 , 0.500 , 0.000 , 0.502 , 0.000)
call NewSoundEnvironment("lake")
call SetAmbientDaySound("SunkenRuinsDay")
call SetAmbientNightSound("SunkenRuinsNight")
call SetMapMusic("Music" , true , 0)
call CreateAllItems()
call CreateAllUnits()
call InitBlizzard()


call InitGlobals()
call InitCustomTriggers()
call RunInitializationTriggers()
endfunction
function config takes nothing returns nothing
call SetMapName("TRIGSTR_001")
call SetMapDescription("TRIGSTR_003")
call SetPlayers(12)
call SetTeams(12)
call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER)
call DefineStartLocation(0 , 128.0 , 128.0)
call DefineStartLocation(1 , 128.0 , 128.0)
call DefineStartLocation(2 , 128.0 , 128.0)
call DefineStartLocation(3 , 128.0 , 128.0)
call DefineStartLocation(4 , 128.0 , 128.0)
call DefineStartLocation(5 , 128.0 , 128.0)
call DefineStartLocation(6 , 128.0 , 128.0)
call DefineStartLocation(7 , 128.0 , 128.0)
call DefineStartLocation(8 , 128.0 , 128.0)
call DefineStartLocation(9 , 128.0 , 128.0)
call DefineStartLocation(10 , 128.0 , 128.0)
call DefineStartLocation(11 , 128.0 , 128.0)
call InitCustomPlayerSlots()
call InitCustomTeams()
call InitAllyPriorities()
endfunction


//Struct method generated initializers/callers:

