globals
hashtable o
timer array a
integer n=0
boolean array V
group E=null
integer O
hashtable A=InitHashtable()
integer N
real array C
real R
real X
real Y
unit U
boolean B
player P
location L=null
integer I
integer J
integer K
integer D
integer F
integer G
multiboarditem H=null
unit array m
integer M=0
integer q
integer Q
integer S
integer T
integer W
integer Z
integer vv
integer ev
integer xv
integer ov
integer rv
integer iv
unit av=null
boolexpr nv
boolexpr Vv
boolexpr Ev
boolexpr Xv
boolexpr Ov
boolexpr Rv
boolexpr Iv
boolexpr Av
boolexpr Nv
boolexpr bv
integer Bv
integer cv
integer Cv
integer dv
integer Dv
integer fv
integer Fv
integer gv
integer Gv
integer hv
integer Hv
integer jv
integer Jv
integer kv
integer Kv
integer lv
integer Lv
integer mv
integer Mv
integer pv
integer Pv
integer qv
integer Qv
integer sv
integer Sv
integer tv
integer Tv
integer array uv
group Uv
location wv
integer Wv=50
integer yv='d'
integer Yv='d'
integer zv=75
integer Zv=75
integer ve=-80
integer ee=40
real xe=5
integer oe=45
integer re=33
integer ie=15
integer ae=300
integer ne=40
integer Ve=60
integer array Ee
integer array Xe
integer array Oe
integer array Re
integer Ie
integer Ae
integer Ne
integer be
integer Be
integer ce
integer Ce
integer de
integer array De
boolean fe=false
boolean Fe=false
integer ge=0
boolexpr Ge=null
rect he=null
integer array He
integer array je
integer array Je
integer array ke
integer array Ke
boolean array le
boolean array Le
group me=null
force Me=null
real array pe
integer array Pe
integer array qe
integer array Qe
boolean array se
boolean array Se
timer array te
integer array Te
integer array ue
integer array Ue
rect array We
integer array ye
integer array Ye
integer array ze
integer array Ze
integer array vx
integer array ex
integer array xx
integer array ox
integer array rx
group array ix
group array ax
group array nx
integer array Vx
rect array Ex
rect array Xx
rect array Ox
integer array Rx
real array Ix
integer array Ax
integer array Nx
integer array bx
timer Bx=null
boolean cx=false
boolean Cx=false
real Dx=0
string fx=""
integer array Fx
gamecache gx=null
string Gx=""
boolean hx=false
group Hx=null
integer jx=0
integer array Jx
weathereffect kx=null
integer array Kx
integer array lx
boolean Lx=false
item array mx
rect array Mx
boolean px=false
location Px=null
rect array qx
group Qx=null
location sx=null
boolean Sx=false
group tx=null
integer array Tx
rect array ux
boolean Ux=false
integer array wx
integer Wx=0
real array yx
location array Yx
timer array zx
group array Zx
integer array vo
integer array eo
integer array xo
integer oo=0
real array ro
integer io=0
integer array ao
integer array no
group Vo=null
integer Eo=0
real Xo=0
real Oo=0
force array Ro
real array Io
integer array Ao
string array No
boolean bo=false
timer Bo=null
integer array co
real Co=0
real do=0
group array Do
boolean fo=false
string array Fo
boolean go=false
string array Go
integer array ho
dialog Ho=null
real array jo
integer Jo=0
timer ko=null
integer array Ko
integer array lo
group Lo=null
real array mo
integer Mo=0
dialog array po
unit Po=null
boolean array qo
integer array Qo
integer array so
integer array So
boolean to=false
real To=0
integer uo=0
boolean Uo=false
force array wo
boolean array Wo
unit yo=null
integer array Yo
integer array zo
integer array Zo
gamecache vr=null
force er=null
location array xr
real rr=0
boolean ir=false
multiboard ar=null
boolean array nr
integer array Vr
boolean Er=false
boolean array Xr
unit array Rr
integer array Ir
boolean Ar=false
integer array Nr
unit array br
integer array Br
integer array cr
integer array Cr
force array dr
integer array Dr
real fr=0
real Fr=0
timer gr=null
boolean Gr=false
boolean hr=false
integer array Hr
timer jr=null
fogmodifier array Jr
integer kr=0
boolean Kr=false
timer lr=null
string array Lr
player mr=null
integer Mr=0
real pr=0
boolean array Pr
integer qr=0
timer Qr=null
integer array sr
group array Sr
integer array tr
timerdialog Tr=null
dialog ur=null
boolean array Ur
string array wr
integer array Wr
integer array yr
integer Yr=0
boolean array zr
integer array Zr
boolean vi=false
real array ei
integer xi=0
boolean oi=false
integer array ri
integer ii=0
boolean ai=false
boolean ni=false
integer array Vi
rect array Ei
force Xi=null
boolean Oi=false
boolean Ri=false
boolean Ii=false
integer array Ai
integer array Ni
integer array bi
boolean Bi=false
boolean array ci
boolean Ci=false
boolean array di
integer array Di
boolean fi=false
integer array Fi
integer array gi
integer array Gi
real hi=0
boolean Hi=false
boolean ji=false
string array Ji
integer array ki
group Ki=null
boolean li=false
timer Li=null
boolean mi=false
integer Mi=0
string pi=""
integer Pi=0
integer qi=0
real array Qi
timer si=null
integer array Si
integer array ti
real array Ti
integer array ui
string array Ui
integer wi=0
button array Wi
real yi=0
boolean Yi=false
integer array zi
integer array Zi
group va=null
real ea=0
integer array xa
real oa=0
integer array ra
integer array ia
location aa=null
real array na
unit array Va
boolean Ea=false
integer array Xa
timer Oa=null
integer array Ra
integer Ia=0
integer Aa=0
timer Na=null
real ba=0
force Ba=null
integer array ca
integer Ca=0
group da=null
string array Da
integer fa=0
boolean Fa=false
rect ga=null
rect Ga=null
rect ha=null
rect Ha=null
rect ja=null
rect Ja=null
rect ka=null
rect Ka=null
rect la=null
rect La=null
rect ma=null
rect Ma=null
rect pa=null
rect Pa=null
rect qa=null
rect Qa=null
rect sa=null
rect Sa=null
rect ta=null
rect Ta=null
rect ua=null
rect Ua=null
rect wa=null
rect Wa=null
rect ya=null
rect Ya=null
rect za=null
rect Za=null
rect vn=null
rect en=null
rect xn=null
rect on=null
sound rn=null
sound in=null
sound an=null
sound nn=null
trigger Vn=null
trigger En=null
trigger Xn=null
trigger On=null
trigger Rn=null
trigger In=null
trigger An=null
trigger Nn=null
trigger bn=null
trigger Bn=null
trigger cn=null
trigger Cn=null
trigger dn=null
trigger Dn=null
trigger fn=null
trigger Fn=null
trigger gn=null
trigger Gn=null
trigger hn=null
trigger Hn=null
trigger jn=null
trigger Jn=null
trigger kn=null
trigger Kn=null
trigger ln=null
trigger Ln=null
trigger mn=null
trigger Mn=null
trigger pn=null
trigger Pn=null
trigger qn=null
trigger Qn=null
trigger sn=null
trigger Sn=null
trigger tn=null
trigger Tn=null
trigger un=null
trigger Un=null
trigger wn=null
trigger Wn=null
trigger yn=null
trigger Yn=null
trigger zn=null
trigger Zn=null
trigger vV=null
trigger eV=null
trigger xV=null
trigger oV=null
trigger rV=null
trigger iV=null
trigger aV=null
trigger nV=null
trigger VV=null
trigger EV=null
trigger XV=null
trigger OV=null
trigger RV=null
trigger IV=null
trigger AV=null
trigger NV=null
trigger bV=null
trigger BV=null
trigger cV=null
trigger CV=null
trigger dV=null
trigger DV=null
trigger fV=null
trigger FV=null
trigger gV=null
trigger GV=null
trigger hV=null
trigger HV=null
trigger jV=null
trigger JV=null
trigger kV=null
trigger KV=null
trigger lV=null
trigger LV=null
trigger mV=null
trigger MV=null
trigger pV=null
trigger PV=null
trigger qV=null
trigger QV=null
trigger sV=null
trigger SV=null
trigger tV=null
trigger TV=null
trigger uV=null
trigger UV=null
trigger wV=null
trigger WV=null
trigger yV=null
trigger YV=null
trigger zV=null
trigger ZV=null
trigger vE=null
trigger eE=null
trigger xE=null
trigger oE=null
trigger rE=null
trigger iE=null
trigger aE=null
trigger nE=null
trigger VE=null
trigger EE=null
trigger XE=null
trigger OE=null
trigger RE=null
trigger IE=null
trigger AE=null
trigger NE=null
trigger bE=null
trigger BE=null
trigger cE=null
trigger CE=null
trigger dE=null
trigger DE=null
unit fE=null
unit FE=null
boolean gE=false
integer GE=-1
hashtable hE=InitHashtable()
group HE=CreateGroup()
hashtable jE=InitHashtable()
hashtable JE=InitHashtable()
hashtable kE=InitHashtable()
integer KE=0
real lE=325.
integer LE=2
integer mE=2
hashtable ME=InitHashtable()
integer pE=0
integer PE=0
integer array qE
integer array QE
integer array sE
integer tE=0
integer TE=0
integer array uE
integer array UE
integer array wE
integer array WE
hashtable yE
integer YE
integer zE
integer ZE=0
integer vX=0
integer array eX
integer array xX
integer array oX
integer iX=0
integer aX=0
integer array nX
integer array VX
integer array EX
integer array XX
hashtable OX
integer RX
integer IX
integer AX=0
integer NX=0
integer array bX
integer array BX
integer array cX
integer dX=0
integer DX=0
integer array fX
integer array FX
integer array gX
integer array GX
integer hX
integer HX
integer jX=0
integer JX=0
integer array kX
integer array KX
integer array lX
unit array LX
integer mX=0
integer MX=0
integer array pX
integer array PX
integer array qX
integer array QX
integer sX
integer SX
integer tX=0
integer TX=0
integer array uX
unit array UX
integer array wX
integer array WX
integer array yX
boolean array YX
hashtable zX=InitHashtable()
integer ZX=0
integer vO=0
integer array eO
integer array xO
integer array oO
integer array rO
integer array iO
integer array aO
integer nO=0
integer VO=0
integer array EO
unit array XO
player array OO
unit array RO
integer array IO
integer AO=0
integer array NO
timer array bO
integer BO=0
integer cO=0
integer array CO
real array dO
real array DO
real array fO
real array FO
integer array gO
integer array GO
integer array hO
unit HO
integer jO
integer JO
group kO
unit KO
boolexpr lO
integer array LO
trigger array mO
trigger MO
trigger pO
trigger PO
trigger qO
trigger QO
trigger array sO
unit SO
unit tO
integer TO
integer uO
timer UO=null
real WO=.0
real yO=.0
group YO=null
force zO=null
boolexpr ZO=null
endglobals
function eR takes real xR returns nothing
local real oR
local real st=TimerGetElapsed(UO)
if st<=0 then
set UO=CreateTimer()
call TimerStart(UO,0xF4240,false,null)
endif
if(xR>0)then
loop
set oR=xR-TimerGetElapsed(UO)+st
exitwhen oR<=0
if(oR>bj_POLLED_WAIT_SKIP_THRESHOLD)then
call TriggerSleepAction(.1*oR)
else
call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL)
endif
endloop
endif
endfunction
function rR takes location iR,real aR,real nR returns location
return Location(GetLocationX(iR)+aR*Cos(nR*bj_DEGTORAD),GetLocationY(iR)+aR*Sin(nR*bj_DEGTORAD))
endfunction
function VR takes nothing returns boolean
local destructable d=GetFilterDestructable()
local real dx=GetDestructableX(d)-WO
local real dy=GetDestructableY(d)-yO
return(dx*dx+dy*dy<=bj_enumDestructableRadius)
endfunction
function ER takes rect r returns group
set YO=CreateGroup()
call GroupEnumUnitsInRect(YO,r,ZO)
return YO
endfunction
function XR takes real OR,location RR,boolexpr IR returns group
set YO=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(YO,RR,OR,IR)
return YO
endfunction
function AR takes real OR,location RR returns group
set YO=CreateGroup()
call GroupEnumUnitsInRangeOfLoc(YO,RR,OR,ZO)
return YO
endfunction
function NR takes player bR returns group
set YO=CreateGroup()
call GroupEnumUnitsOfPlayer(YO,bR,ZO)
return YO
endfunction
function BR takes player bR returns force
set zO=CreateForce()
call ForceAddPlayer(zO,bR)
return zO
endfunction
function cR takes player bR returns force
set zO=CreateForce()
call ForceEnumAllies(zO,bR,ZO)
return zO
endfunction
function CR takes itemtype dR,integer DR returns nothing
local group g
set bj_stockPickedItemType=dR
set bj_stockPickedItemLevel=DR
set g=CreateGroup()
call GroupEnumUnitsOfType(g,"marketplace",ZO)
call ForGroup(g,function UpdateEachStockBuildingEnum)
call DestroyGroup(g)
set g=null
endfunction
function fR takes nothing returns nothing
local integer pickedItemId
local itemtype FR
local integer gR=0
local integer GR=0
local integer DR
set DR=1
loop
if(bj_stockAllowedPermanent[DR])then
set GR=GR+1
if(GetRandomInt(1,GR)==1)then
set FR=ITEM_TYPE_PERMANENT
set gR=DR
endif
endif
if(bj_stockAllowedCharged[DR])then
set GR=GR+1
if(GetRandomInt(1,GR)==1)then
set FR=ITEM_TYPE_CHARGED
set gR=DR
endif
endif
if(bj_stockAllowedArtifact[DR])then
set GR=GR+1
if(GetRandomInt(1,GR)==1)then
set FR=ITEM_TYPE_ARTIFACT
set gR=DR
endif
endif
set DR=DR+1
exitwhen DR>10
endloop
if(GR==0)then
set FR=null
return
endif
call CR(FR,gR)
set FR=null
endfunction
function hR takes nothing returns nothing
call fR()
call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INTERVAL,true,function fR)
endfunction
function HR takes nothing returns boolean
return true
endfunction
function jR takes nothing returns integer
local integer JR=pE
if(JR!=0)then
set pE=qE[JR]
else
set PE=PE+1
set JR=PE
endif
if(JR>8190)then
return 0
endif
set QE[JR]=0
set sE[JR]=0
set qE[JR]=-1
return JR
endfunction
function kR takes integer JR returns nothing
if JR==null then
return
elseif(qE[JR]!=-1)then
return
endif
set qE[JR]=pE
set pE=JR
endfunction
function KR takes nothing returns integer
local integer JR=BO
if(JR!=0)then
set BO=CO[JR]
else
set cO=cO+1
set JR=cO
endif
if(JR>8190)then
return 0
endif
set fO[JR]=0
set CO[JR]=-1
return JR
endfunction
function s__IntSet__allocate takes nothing returns integer
local integer JR=tE
if(JR!=0)then
set tE=uE[JR]
else
set TE=TE+1
set JR=TE
endif
if(JR>8190)then
return 0
endif
set UE[JR]=0
set wE[JR]=0
set WE[JR]=0
set uE[JR]=-1
return JR
endfunction
function lR takes unit LR,unit mR returns integer
set SO=LR
set tO=mR
call TriggerEvaluate(QO)
return uO
endfunction
function MR takes nothing returns integer
local integer JR=nO
if(JR!=0)then
set nO=EO[JR]
else
set VO=VO+1
set JR=VO
endif
if(JR>8190)then
return 0
endif
set LO[JR]=12
set EO[JR]=-1
return JR
endfunction
function s__Team__allocate takes nothing returns integer
local integer JR=ZX
if(JR!=0)then
set ZX=eO[JR]
else
set vO=vO+1
set JR=vO
endif
if(JR>8190)then
return 0
endif
set eO[JR]=-1
return JR
endfunction
function pR takes nothing returns integer
local integer JR=tX
if(JR!=0)then
set tX=uX[JR]
else
set TX=TX+1
set JR=TX
endif
if(JR>15)then
return 0
endif
set wX[JR]=(JR-1)*500
set WX[JR]=1
set yX[JR]=0
set YX[JR]=false
set uX[JR]=-1
return JR
endfunction
function PR takes nothing returns integer
local integer JR=mX
if(JR!=0)then
set mX=pX[JR]
else
set MX=MX+1
set JR=MX
endif
if(JR>8190)then
return 0
endif
set PX[JR]=0
set qX[JR]=0
set QX[JR]=0
set pX[JR]=-1
return JR
endfunction
function qR takes nothing returns integer
local integer JR=jX
if(JR!=0)then
set jX=kX[JR]
else
set JX=JX+1
set JR=JX
endif
if(JR>8190)then
return 0
endif
set KX[JR]=0
set lX[JR]=0
set kX[JR]=-1
return JR
endfunction
function QR takes integer JR returns nothing
if JR==null then
return
elseif(kX[JR]!=-1)then
return
endif
set kX[JR]=jX
set jX=JR
endfunction
function s__List__allocate takes nothing returns integer
local integer JR=dX
if(JR!=0)then
set dX=fX[JR]
else
set DX=DX+1
set JR=DX
endif
if(JR>8190)then
return 0
endif
set FX[JR]=0
set gX[JR]=0
set GX[JR]=0
set fX[JR]=-1
return JR
endfunction
function sR takes nothing returns integer
local integer JR=AX
if(JR!=0)then
set AX=bX[JR]
else
set NX=NX+1
set JR=NX
endif
if(JR>8190)then
return 0
endif
set BX[JR]=0
set cX[JR]=0
set bX[JR]=-1
return JR
endfunction
function SR takes integer JR returns nothing
if JR==null then
return
elseif(bX[JR]!=-1)then
return
endif
set bX[JR]=AX
set AX=JR
endfunction
function s__UnitSet__allocate takes nothing returns integer
local integer JR=iX
if(JR!=0)then
set iX=nX[JR]
else
set aX=aX+1
set JR=aX
endif
if(JR>8190)then
return 0
endif
set VX[JR]=0
set EX[JR]=0
set XX[JR]=0
set nX[JR]=-1
return JR
endfunction
function tR takes nothing returns integer
local integer JR=ZE
if(JR!=0)then
set ZE=eX[JR]
else
set vX=vX+1
set JR=vX
endif
if(JR>8190)then
return 0
endif
set xX[JR]=0
set oX[JR]=0
set eX[JR]=-1
return JR
endfunction
function TR takes integer JR returns nothing
if JR==null then
return
elseif(eX[JR]!=-1)then
return
endif
set eX[JR]=ZE
set ZE=JR
endfunction
function uR takes unit LR,unit mR returns integer
local integer JR=lR(LR,mR)
local integer UR
if(JR==0)then
return 0
endif
set LO[JR]=13
set UR=JR
return JR
endfunction
function wR takes nothing returns timer
if(n==0)then
set a[0]=CreateTimer()
else
set n=n-1
endif
call SaveInteger(o,0,GetHandleId((a[n])),(0))
return a[n]
endfunction
function WR takes timer t returns nothing
if(t==null)then
return
endif
if(n==8191)then
call DestroyTimer(t)
else
call PauseTimer(t)
if((LoadInteger(o,0,GetHandleId((t))))==679645218)then
return
endif
call SaveInteger(o,0,GetHandleId((t)),(679645218))
set a[n]=t
set n=n+1
endif
endfunction
function yR takes nothing returns nothing
set o=InitHashtable()
endfunction
function YR takes integer zR returns nothing
if(SubString(Lr[zR],StringLength(Lr[zR])-8,StringLength(Lr[zR]))==" - AFK|r")then
set se[zR]=false
call SetPlayerName(Player(zR-1),SubString(GetPlayerName(Player(zR-1)),0,StringLength(GetPlayerName(Player(zR-1)))-6))
set Lr[zR]=SubString(Lr[zR],0,StringLength(Lr[zR])-8)+"|r"
call SetPlayerController(Player(zR-1),MAP_CONTROL_USER)
call ForceRemovePlayer(Me,Player(zR-1))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[zR]+"|cffCA0000 is no longer AFK!|r"))
endif
endfunction
function ZR takes integer vI returns nothing
set di[vI]=true
set se[vI]=true
call ForceAddPlayer(Me,Player(-1+(vI)))
call ForceAddPlayer(wo[Fi[vI]],Player(-1+(vI)))
call ForceAddPlayer(Ba,Player(-1+(vI)))
set Zi[Fi[vI]]=(Zi[Fi[vI]]+1)
call SetPlayerName(Player(-1+(vI)),("Bot "+I2S(vI)))
set Lr[vI]=(Fo[vI]+(GetPlayerName(Player(-1+(vI)))+"|r"))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[vI]+" entered the game!"))
endfunction
function eI takes integer xI returns nothing
local integer i
local integer oI=1+xI*6
local integer rI
set i=oI
set rI=(oI+5)
loop
exitwhen i>rI
if(di[i]==false)then
call ZR(i)
return
endif
set i=i+1
endloop
call DisplayTextToPlayer(Player(0),0,0,"No free playerslot found, could not add a bot!")
endfunction
function iI takes integer aI,integer xI returns nothing
local integer nI
set nI=1
loop
exitwhen nI>aI
call eI(xI)
set nI=nI+1
endloop
endfunction
function VI takes nothing returns nothing
local integer EI
if(Zi[0]<Zi[1])then
set EI=Zi[1]-Zi[0]
call iI(EI,0)
else
if(Zi[0]>Zi[1])then
set EI=Zi[0]-Zi[1]
call iI(EI,1)
else
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Teams are balanced, no bot is added!")
endif
endif
endfunction
function XI takes integer OI returns nothing
call iI(OI-Zi[0],0)
call iI(OI-Zi[1],1)
endfunction
function RI takes integer II returns boolean
local boolean AI=true
if(Ri)then
if(II=='h01P')then
set AI=true
else
set AI=false
endif
endif
if(Ea)then
if(II=='h01P' or II=='h006' or II=='o000' or II=='h01O' or II=='h03Q' or II=='h014' or II=='n01J' or II=='h05L')then
set AI=true
else
set AI=false
endif
endif
if(Kr)then
if(II=='h01P' or II=='h006' or II=='o000')then
set AI=false
else
set AI=true
endif
endif
return AI
endfunction
function NI takes integer II returns boolean
if(Er)then
if(IsUnitIdType(lx[GetUnitPointValueByType(II)],UNIT_TYPE_FLYING))then
return false
else
return true
endif
else
return true
endif
endfunction
function bI takes nothing returns nothing
set E=CreateGroup()
endfunction
function BI takes string s returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,s)
endfunction
function CI takes nothing returns nothing
local string s="notNull"
if GetEnumUnit()==null then
set s="Null"
endif
set O=O+1
call BI(I2S(O)+":"+GetUnitName(GetEnumUnit())+"("+I2S(GetHandleId(GetEnumUnit()))+")"+s)
endfunction
function dI takes nothing returns integer
local integer i=1
local integer e=0
loop
if Pr[i]then
set e=e+1
endif
exitwhen(i==12)
set i=i+1
endloop
return e
endfunction
function GetNumDrawersNeeded takes nothing returns integer
return qr-dI()
endfunction
function DI takes nothing returns nothing
if(qr-dI())<=0 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffFFAC00All players have voted for a draw, round will restart!|r")
call TriggerExecute(ln)
endif
endfunction
function fI takes integer FI returns real
if(FI<10)then
return(mo[FI]*.25)+1
else
return((((I2R(FI-9))*.25)+5.11)*.25)+1
endif
endfunction
function gI takes integer GI returns integer
return R2I(yx[GI]*pe[GI]*10)
endfunction
function hI takes integer GI returns integer
return R2I(I2R(gI(GI))*(fI(Kx[(GI)])))
endfunction
function HI takes integer GI returns integer
local real i=hI(GI)
local real j=0
local real k=0
if Cx then
return R2I(30.*(fI(Kx[(GI)])))
endif
loop
exitwhen(i<pr)or(k>=8)
set i=i-pr
set j=j+pr*(1-k/ 10)
set k=k+1
endloop
set j=j+i*(1-k/ 10)
return R2I(j*jo[Fi[GI]])
endfunction
function jI takes integer GI returns integer
set Wr[GI]=HI(GI)
return Wr[GI]
endfunction
function JI takes nothing returns nothing
call TriggerSleepAction(.2)
set ii=1
call EnableTrigger(IE)
call DisableTrigger(Jn)
endfunction
function lI takes nothing returns nothing
set yE=InitHashtable()
endfunction
function MI takes nothing returns nothing
set OX=InitHashtable()
endfunction
function sI takes unit KI returns integer
local integer e=qR()
set LX[e]=KI
return e
endfunction
function SI takes integer JR,integer e returns integer
if QX[JR]==0 then
set PX[JR]=e
set qX[JR]=e
else
set KX[qX[JR]]=e
set lX[e]=qX[JR]
set qX[JR]=e
endif
set QX[JR]=QX[JR]+1
return e
endfunction
function tI takes integer JR returns nothing
set SX=PX[JR]
loop
exitwhen SX==0
set sX=SX
set SX=KX[sX]
call QR(sX)
endloop
endfunction
function TI takes integer JR returns nothing
if JR==null then
return
elseif(pX[JR]!=-1)then
return
endif
call tI(JR)
set pX[JR]=mX
set mX=JR
endfunction
function uI takes group UI,integer wI returns nothing
local group g=CreateGroup()
local unit u
call GroupAddGroup(UI,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
call RemoveUnitFromStock(u,ti[wI])
endloop
call DestroyGroup(g)
set g=null
endfunction
function WI takes integer wI,integer yI returns nothing
if yI==-1 then
set ci[25+wI]=true
call uI(Do[1],wI)
set ci[wI]=true
call uI(Do[0],wI)
else
set ci[yI*25+wI]=true
call uI(Do[yI],wI)
endif
endfunction
function YI takes nothing returns nothing
local integer i=0
loop
exitwhen i>Yr
set ci[25+i]=false
set ci[i]=false
set i=i+1
endloop
endfunction
function zI takes player p,integer ZI returns nothing
local integer i=0
local integer yI=Fi[(1+GetPlayerId(p))]
local location l=GetPlayerStartLocationLoc(p)
call CreateUnitAtLocSaveLast(p,ZI,l,bj_UNIT_FACING)
call RemoveLocation(l)
set l=null
loop
exitwhen i>Yr
if not ci[yI*25+i]then
call AddUnitToStockBJ(ti[i],bj_lastCreatedUnit,1,1)
endif
set i=i+1
endloop
call SetUnitPathing(bj_lastCreatedUnit,false)
call GroupAddUnit(Do[yI],bj_lastCreatedUnit)
call SelectUnitForPlayerSingle(bj_lastCreatedUnit,p)
endfunction
function vA takes player p returns integer
local integer yI=Fi[(1+GetPlayerId(p))]
local integer array eA
local integer i=0
local integer j=0
loop
exitwhen i>Yr
if not ci[yI*25+i]then
set eA[j]=i
set j=j+1
endif
set i=i+1
endloop
if j==0 then
return-1
endif
return eA[GetRandomInt(0,j-1)]
endfunction
function xA takes unit oA returns nothing
local integer OI=(1+GetPlayerId(GetOwningPlayer(oA)))
set br[OI]=oA
if Gr then
call WI(GetUnitPointValue(oA),Fi[OI])
if oi then
call WI(GetUnitPointValue(oA),1-Fi[OI])
endif
endif
set ui[OI]=GetUnitPointValue(oA)
call GroupAddUnit(Hx,oA)
if hx==false then
call ShowUnit(oA,false)
else
call SelectUnitForPlayerSingle(oA,GetOwningPlayer(oA))
endif
call TriggerRegisterUnitEvent(EE,oA,EVENT_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterUnitEvent(EE,oA,EVENT_UNIT_ISSUED_POINT_ORDER)
if fo then
call UnitRemoveAbility(oA,'A005')
call UnitRemoveAbility(oA,'A06E')
endif
if mi then
call UnitAddItemById(oA,'I00D')
endif
endfunction
function rA takes player p returns integer
local integer i=vA(p)
local integer yI=Fi[(1+GetPlayerId(p))]
if Ca==3 then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,40,Lr[(1+GetPlayerId(p))]+" has randomed |cffFFFF00"+Go[i]+"|r")
endif
call CreateUnitAtLocSaveLast(p,ti[i],GetPlayerStartLocationLoc(p),bj_UNIT_FACING)
call xA(bj_lastCreatedUnit)
return i
endfunction
function iA takes integer JR,unit aA returns nothing
local integer p=WX[JR]
set UX[wX[JR]+p]=aA
call SaveInteger(zX,JR,GetHandleId(aA),p)
set WX[JR]=p+1
endfunction
function nA takes integer JR returns unit
if WX[JR]<2 then
return null
endif
return UX[wX[JR]+GetRandomInt(1,WX[JR]-1)]
endfunction
function VA takes integer JR,unit EA returns nothing
local integer XA=GetHandleId(EA)
local integer i=LoadInteger(zX,JR,XA)
local integer p=WX[JR]-1
if(i<1 or i>p)then
return
endif
call RemoveSavedInteger(zX,JR,XA)
if YX[JR]then
if(i==yX[JR])then
set yX[JR]=i-1
else
call BJDebugMsg("Warning: Concurrent modification while iterating over RandomList:"+I2S(yX[JR])+":"+I2S(i))
endif
endif
if(i<p)then
set UX[wX[JR]+i]=UX[wX[JR]+p]
call SaveInteger(zX,JR,GetHandleId(UX[wX[JR]+i]),i)
set WX[JR]=p
return
endif
if(i==p)then
set WX[JR]=p
endif
endfunction
function OA takes integer JR returns nothing
set yX[JR]=0
set YX[JR]=true
endfunction
function RA takes integer JR returns unit
set yX[JR]=yX[JR]+1
if(yX[JR]>=WX[JR])then
set YX[JR]=false
return null
endif
return UX[wX[JR]+yX[JR]]
endfunction
function IA takes integer JR returns nothing
set WX[JR]=1
set yX[JR]=0
set YX[JR]=false
call FlushChildHashtable(zX,JR)
endfunction
function AA takes nothing returns nothing
local integer i=0
loop
exitwhen i>1
set xO[(i)]=pR()
set oO[(i)]=pR()
set rO[(i)]=pR()
set iO[(i)]=pR()
set i=i+1
endloop
set aO[(0)]=1
set aO[(1)]=0
endfunction
function NA takes nothing returns boolean
local integer bA=LoadInteger(A,0,GetSpellAbilityId())
if bA!=0 then
call TriggerExecute(sO[(bA)])
endif
return false
endfunction
function BA takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerAddCondition(t,Condition(function NA))
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
endfunction
function cA takes player p,integer CA,real dA returns nothing
set N=Mr*12*1+GetPlayerId(p)*1+CA
set C[N]=C[N]+dA
endfunction
function DA takes integer turnNr returns nothing
local integer i=0
set N=Mr*12*1
loop
exitwhen i>=1*12
set C[N+i]=0
set i=i+1
endloop
endfunction
function fA takes integer FA returns integer
set FA=Ko[FA]+Hr[FA]+Zo[FA]+250-Qo[FA]-Ir[FA]-GetPlayerState(Player(FA-1),PLAYER_STATE_RESOURCE_GOLD)
return FA*(-1)
endfunction
function gA takes integer zR returns nothing
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"-------- Current statistics: --------")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"Income: "+pi+I2S(jI(zR))+"|r ("+pi+I2S(Hr[zR])+"|r gold in total)")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"Coins collected: "+pi+I2S(yr[zR])+"|r ("+pi+I2S(Zo[zR])+"|r gold in total)")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"Units killed: "+pi+I2S(Cr[zR])+"|r ("+pi+I2S(fA(zR))+"|r gold in total)")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"Units trained: "+pi+I2S(Ao[zR])+"|r ("+pi+I2S(tr[zR])+"|r creepspawning buildings in total)")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"Specials built: "+pi+I2S(So[zR])+"|r")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"Rescue Strike damage: "+pi+I2S(Si[zR])+"|r ("+pi+I2S(so[zR])+"|r units killed)")
call DisplayTimedTextToPlayer(Player(zR-1),0,0,15,"-------------------------------------")
endfunction
function GA takes nothing returns nothing
local integer i=0
set Ia=0
loop
exitwhen(i>13)
set Ao[i]=0
set Cr[i]=0
set eo[i]=0
set yr[i]=0
set Zo[i]=0
set So[i]=0
set tr[i]=0
set Hr[i]=0
set Ir[i]=0
set Qo[i]=0
set Ko[i]=0
set i=i+1
endloop
endfunction
function hA takes group g returns unit
local unit u=FirstOfGroup(g)
local group HA
if u==null then
set bj_isUnitGroupEmptyResult=true
call ForGroup(g,function IsUnitGroupEmptyBJEnum)
if not bj_isUnitGroupEmptyResult then
set HA=CreateGroup()
call GroupAddGroup(g,HA)
call GroupClear(g)
call GroupAddGroup(HA,g)
call DestroyGroup(HA)
set HA=null
set u=FirstOfGroup(g)
endif
endif
return u
endfunction
function jA takes player p,string JA returns nothing
local integer OI=GetPlayerId(p)+1
call SetPlayerName(p,JA)
set Lr[OI]=Fo[OI]+JA+"|r"
endfunction
function kA takes unit u,rect r returns boolean
return GetUnitX(u)>=GetRectMinX(r)and GetUnitX(u)<=GetRectMaxX(r)and GetUnitY(u)>=GetRectMinY(r)and GetUnitY(u)<=GetRectMaxY(r)
endfunction
function KA takes string c returns boolean
return( not((c!="1")and(c!="2")and(c!="3")and(c!="4")and(c!="5")and(c!="6")))
endfunction
function lA takes string s returns boolean
local integer LA=1
local string c
if(StringLength(s)>0)then
loop
exitwhen LA>StringLength(s)
set c=SubString(s,LA-1,LA)
if((c!="0")and(c!="1")and(c!="2")and(c!="3")and(c!="4")and(c!="5")and(c!="6")and(c!="7")and(c!="8")and(c!="9"))then
return false
endif
set LA=LA+1
endloop
return true
endif
return false
endfunction
function mA takes nothing returns string
local integer i=R2I(TimerGetElapsed(Qr))
local integer j=ModuloInteger(i,60)
local string s
if(j<10)then
set s="0"+I2S(j)
else
set s=I2S(j)
endif
return"|cffFFFF00"+I2S(i/ 60)+"|cffFF8000:|cffFFFF00"+s+"|r"
endfunction
function MA takes unit u returns nothing
call IssuePointOrderByIdLoc(u,851983,Yx[Fi[(1+GetPlayerId(GetOwningPlayer(u)))]])
endfunction
function pA takes unit u returns nothing
if GetUnitAbilityLevel(u,'A07M')==1 then
set Po=u
call TriggerExecute(sn)
else
call IssuePointOrderByIdLoc(u,851983,Yx[Fi[(1+GetPlayerId(GetOwningPlayer(u)))]])
endif
endfunction
function PA takes nothing returns force
local force f=CreateForce()
call ForceEnumPlayers(f,bv)
return f
endfunction
function qA takes unit u,integer QA,integer sA returns nothing
call UnitAddAbility(u,QA)
call SetUnitAbilityLevel(u,QA,sA)
call UnitRemoveAbility(u,QA)
endfunction
function SA takes nothing returns unit
local group g=CreateGroup()
local unit u
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,nv)
set u=GroupPickRandomUnit(g)
call DestroyGroup(g)
set g=null
return u
endfunction
function tA takes integer yI returns player
local integer i=yI*6
loop
exitwhen i>5+yI*6
if IsPlayerInForce(Player(i),Ba)and not se[i+1]then
return Player(i)
endif
set i=i+1
endloop
return null
endfunction
function TA takes unit uA returns unit
if IsUnitType(uA,UNIT_TYPE_TAUREN)==false then
return uA
endif
return XO[(GetUnitUserData(uA))]
endfunction
function GetRealKillingUnit takes nothing returns unit
return TA(GetKillingUnit())
endfunction
function UA takes unit LR,unit mR returns integer
local integer u=MR()
set XO[u]=mR
set RO[u]=LR
set OO[u]=GetOwningPlayer(mR)
return u
endfunction
function wA takes nothing returns integer
local unit u=CreateUnit(Player(13),'e008',0,0,.0)
local integer d=uR(u,u)
set RO[d]=u
set bO[d]=CreateTimer()
call SaveInteger(o,0,GetHandleId((bO[d])),(d))
call SetUnitUserData(u,d)
call ShowUnit(u,false)
call UnitAddAbility(u,'Amrf')
call UnitAddAbility(u,'Aloc')
call UnitRemoveAbility(u,'Amrf')
return d
endfunction
function WA takes nothing returns nothing
local integer d=(LoadInteger(o,0,GetHandleId((GetExpiredTimer()))))
call UnitRemoveAbility(RO[d],NO[d])
set IO[AO]=d
set AO=AO+1
endfunction
function yA takes unit YA,integer c returns integer
local integer d
local unit zA
if(AO<1)then
set d=wA()
else
set AO=AO-1
set d=IO[AO]
endif
set zA=RO[d]
call UnitAddAbility(zA,GO[c])
set NO[d]=GO[c]
set XO[d]=YA
set OO[d]=GetOwningPlayer(YA)
call SetUnitOwner(zA,OO[d],true)
call TimerStart(bO[d],FO[c],false,function WA)
call SetUnitX(zA,dO[c])
call SetUnitY(zA,DO[c])
return d
endfunction
function ZA takes integer QA,string vN,real eN returns integer
local integer c=KR()
set GO[c]=QA
set gO[c]=OrderId(vN)
set hO[c]='e008'
set FO[c]=eN
return c
endfunction
function xN takes integer JR,unit YA returns nothing
set dO[JR]=GetUnitX(YA)
set DO[JR]=GetUnitY(YA)
call IssueImmediateOrderById(RO[yA(YA,JR)],gO[JR])
endfunction
function oN takes integer JR,unit YA,unit rN returns nothing
set dO[JR]=GetUnitX(rN)
set DO[JR]=GetUnitY(rN)
call IssueImmediateOrderById(RO[yA(YA,JR)],gO[JR])
endfunction
function iN takes integer JR,unit YA,real x,real y returns nothing
set dO[JR]=x
set DO[JR]=y
call IssueImmediateOrderById(RO[yA(YA,JR)],gO[JR])
endfunction
function aN takes integer JR,unit YA,unit rN returns nothing
local player p=GetOwningPlayer(YA)
set dO[JR]=GetUnitX(YA)
set DO[JR]=GetUnitY(YA)
call UnitShareVision(rN,p,true)
call IssueTargetOrderById(RO[yA(YA,JR)],gO[JR],rN)
call UnitShareVision(rN,p,false)
endfunction
function nN takes integer JR,unit YA,unit rN returns nothing
local player p=GetOwningPlayer(YA)
set dO[JR]=GetUnitX(rN)
set DO[JR]=GetUnitY(rN)
call UnitShareVision(rN,p,true)
call IssueTargetOrderById(RO[yA(YA,JR)],gO[JR],rN)
call UnitShareVision(rN,p,false)
endfunction
function VN takes integer JR,unit YA,unit rN returns nothing
set dO[JR]=GetUnitX(rN)
set DO[JR]=GetUnitY(rN)
call IssuePointOrderById(RO[yA(YA,JR)],gO[JR],dO[JR],DO[JR])
endfunction
function EN takes integer JR,unit YA,real XN,real ON returns nothing
set dO[JR]=GetUnitX(YA)
set DO[JR]=GetUnitY(YA)
call IssuePointOrderById(RO[yA(YA,JR)],gO[JR],XN,ON)
endfunction
function RN takes integer JR,unit YA returns nothing
set dO[JR]=GetUnitX(YA)
set DO[JR]=GetUnitY(YA)
call yA(YA,JR)
endfunction
function IN takes integer JR,unit YA,real AN,real NN returns nothing
set dO[JR]=AN
set DO[JR]=NN
call yA(YA,JR)
endfunction
function bN takes nothing returns boolean
set KO=GetFilterUnit()
if true then
call IssueTargetOrderById(RO[yA(HO,jO)],JO,KO)
endif
return false
endfunction
function BN takes nothing returns nothing
set lO=Condition(function bN)
set kO=CreateGroup()
endfunction
function cN takes integer CN,unit mR,unit dN,real DN returns nothing
local location w=GetUnitLoc(dN)
set bj_lastCreatedUnit=CreateUnitAtLoc(GetOwningPlayer(mR),CN,w,bj_UNIT_FACING)
call ShowUnitHide(bj_lastCreatedUnit)
call UnitApplyTimedLifeBJ(DN,'BFig',bj_lastCreatedUnit)
call RemoveLocation(w)
set w=null
endfunction
function fN takes nothing returns nothing
set m[0]=null
set m[0]=null
set M=852024
endfunction
function FN takes nothing returns nothing
if m[Fi[1+GetPlayerId(GetEnumPlayer())]]!=null and(GetUnitCurrentOrder(br[1+GetPlayerId(GetEnumPlayer())])==0 or GetUnitCurrentOrder(br[1+GetPlayerId(GetEnumPlayer())])==M)then
call IssueTargetOrderById(br[1+GetPlayerId(GetEnumPlayer())],852024,m[Fi[1+GetPlayerId(GetEnumPlayer())]])
endif
endfunction
function gN takes integer yI returns nothing
local unit u
loop
set u=hA(nx[yI])
exitwhen u==null
if(IsUnitType(u,UNIT_TYPE_DEAD))then
call GroupRemoveUnit(nx[yI],u)
else
set R=GetUnitState(u,UNIT_STATE_LIFE)/ GetUnitState(u,UNIT_STATE_MAX_LIFE)
if R>=.97 then
call GroupRemoveUnit(nx[yI],u)
else
set m[yI]=u
if ge>=3 then
call BI("Repair target for Team "+I2S(yI)+": attacked building "+GetUnitName(u))
endif
return
endif
endif
endloop
loop
set u=hA(ax[yI])
exitwhen u==null
if(IsUnitType(u,UNIT_TYPE_DEAD))then
call GroupRemoveUnit(ax[yI],u)
else
set R=GetUnitState(u,UNIT_STATE_LIFE)/ GetUnitState(u,UNIT_STATE_MAX_LIFE)
if R>=.4 then
call GroupRemoveUnit(ax[yI],u)
else
set m[yI]=u
if ge>=3 then
call BI("Repair target for Team "+I2S(yI)+": heavily damaged building "+GetUnitName(u))
endif
return
endif
endif
endloop
if GetUnitStatePercent(Rr[yI],UNIT_STATE_LIFE,UNIT_STATE_MAX_LIFE)<99. then
set m[yI]=Rr[yI]
return
endif
loop
set u=hA(ix[yI])
exitwhen u==null
if(IsUnitType(u,UNIT_TYPE_DEAD))then
call GroupRemoveUnit(ix[yI],u)
else
set R=GetUnitState(u,UNIT_STATE_LIFE)/ GetUnitState(u,UNIT_STATE_MAX_LIFE)
if R>=.97 then
call GroupRemoveUnit(ix[yI],u)
else
set m[yI]=u
if ge>=3 then
call BI("Repair target for Team "+I2S(yI)+": damaged building "+GetUnitName(u))
endif
return
endif
endif
endloop
if ge>=3 then
call BI("Repair target for Team "+I2S(yI)+": nothing")
endif
set m[yI]=null
endfunction
function GN takes nothing returns nothing
set q=ZA('A05B',"howlofterror",1.)
call SaveInteger(A,0,('A05C'),((1)))
endfunction
function hN takes nothing returns nothing
set Q=ZA('A0AF',"impale",2.)
call SaveInteger(A,0,('A0AE'),((2)))
endfunction
function HN takes nothing returns nothing
set S=ZA('A086',"deathanddecay",6.)
endfunction
function jN takes nothing returns nothing
call SaveInteger(A,0,('A09N'),((3)))
endfunction
function JN takes unit rN,integer kN,real KN,real lN,real LN returns nothing
local unit e
local integer mN
if GetUnitAbilityLevel(rN,'A07E')==0 then
call UnitAddAbility(rN,'A07E')
endif
set mN=GetUnitUserData(rN)
if mN==0 then
set mN=PR()
call SetUnitUserData(rN,mN)
endif
set e=CreateUnit(GetOwningPlayer(rN),kN,GetUnitX(rN)+lN,GetUnitY(rN)+LN,KN)
call SetUnitPathing(e,false)
call SetUnitX(e,GetUnitX(rN)+lN)
call SetUnitY(e,GetUnitY(rN)+LN)
call SI((mN),sI((e)))
endfunction
function MN takes unit pN returns nothing
local integer i
local integer mN
local integer PN
if GetUnitAbilityLevel(pN,'A07E')==0 then
return
endif
set mN=GetUnitUserData(pN)
if mN==0 then
return
endif
set PN=(PX[(mN)])
loop
exitwhen PN==0
call RemoveUnit((LX[(PN)]))
set PN=KX[PN]
endloop
call TI(mN)
call SetUnitUserData(pN,0)
endfunction
function qN takes unit u returns nothing
if GetUnitTypeId(u)=='h07M' then
call JN(u,'h08N',226.,37.75,-41.5)
elseif GetUnitTypeId(u)=='h04U' then
call JN((u),('h04J'),((191.)*1.),0,0)
elseif GetUnitTypeId(u)=='h07O' then
call JN(u,'h08K',.0,15.,.0)
call JN((u),('h08R'),((.0)*1.),0,0)
elseif GetUnitTypeId(u)=='h05I' then
call JN((u),('h08G'),((.0)*1.),0,0)
elseif GetUnitTypeId(u)=='h04K' then
call JN((u),('h08I'),((.0)*1.),0,0)
elseif GetUnitTypeId(u)=='h088' then
call JN((u),('h08K'),((.0)*1.),0,0)
elseif GetUnitTypeId(u)=='h07I' then
call JN((u),('h08A'),((.0)*1.),0,0)
elseif GetUnitTypeId(u)=='h073' then
call JN(u,'h08O',312.,40.,19.)
call JN(u,'h08N',34.,-37.75,-25.25)
call JN((u),('h08T'),((.0)*1.),0,0)
elseif GetUnitTypeId(u)=='h08P' then
call JN(u,'h08D',116.,-3.,-10.5)
call JN(u,'h08N',323.,20.,5.75)
elseif GetUnitTypeId(u)=='h07H' then
call JN(u,'h08L',32.,12.,-11.5)
elseif GetUnitTypeId(u)=='h08X' then
call JN(u,'h08Z',250.,46.,33.5)
call JN(u,'h090',270.,-17.,18.)
call SetUnitVertexColor(u,255,255,255,0)
elseif GetUnitTypeId(u)=='h069' then
call JN(u,'h09R',300.,3.5,65.25)
call JN(u,'h09R',70.,-16.5,-51.)
call JN(u,'h09N',238.,36.,53.)
call JN(u,'h09O',314.,-38.,-39.5)
elseif GetUnitTypeId(u)=='h09T' then
call JN((u),('h09V'),((270)*1.),0,0)
call JN(u,'h09U',90.,20.,.0)
call JN(u,'h09U',.0,.0,-20.)
call JN(u,'h09U',270.,-20.,.0)
call JN(u,'h09U',180.,.0,20.)
elseif GetUnitTypeId(u)=='h05L' then
call JN((u),('h09K'),((45.)*1.),0,0)
elseif GetUnitTypeId(u)=='h03S' then
call SetUnitVertexColor(u,0,166,255,'s')
endif
endfunction
function QN takes unit u returns nothing
if GetUnitTypeId(u)=='h07L' then
call JN(u,'h08O',318,43.5,-41.75)
call JN(u,'h08N',226,-38.25,40.25)
elseif GetUnitTypeId(u)=='h07N' then
call JN((u),('h08M'),((0)*1.),0,0)
call JN((u),('h08Q'),((0)*1.),0,0)
elseif GetUnitTypeId(u)=='h07D' then
call JN((u),('h08K'),((0)*1.),0,0)
call JN((u),('h08S'),((0)*1.),0,0)
elseif GetUnitTypeId(u)=='h08Y' then
call JN(u,'h08Z',250.,46.,33.5)
call JN(u,'h091',270.,-17.,18.)
call JN(u,'h08Z',350.,-22.,-40.)
call SetUnitVertexColor(u,255,255,255,0)
elseif GetUnitTypeId(u)=='h03G' then
call JN(u,'h094',74.,38.5,28.)
call JN(u,'h093',160.,-42.,-18.75)
call JN(u,'h093',250.,3.75,-55.5)
elseif GetUnitTypeId(u)=='h097' then
call JN(u,'h096',180.,-45.75,21.75)
call JN(u,'h096',110.,9.,-62.5)
elseif GetUnitTypeId(u)=='h09B' then
call JN(u,'h09C',33.,36.25,36.5)
call JN(u,'h09C',13.,21.,-47.5)
call JN(u,'h09C',319.,-46.25,11.75)
elseif GetUnitTypeId(u)=='h09H' then
call JN(u,'h09C',33.,36.25,36.5)
call JN(u,'h09C',13.,21.,-47.5)
call JN(u,'h09C',319.,-46.25,11.75)
call JN(u,'h09E',348.,-6.5,9.)
elseif GetUnitTypeId(u)=='h09I' then
call JN(u,'h09D',225.,35.,-29.75)
call JN(u,'h09D',45.,20.,22.5)
call JN(u,'h09D',225.,-31.,26.25)
call JN(u,'h09G',23.,-25.25,-36.)
elseif GetUnitTypeId(u)=='h09J' then
call JN(u,'h09F',2.,36.25,41.)
call JN(u,'h09F',2.,33.25,-33.5)
call JN(u,'h09F',2.,-46.25,10.75)
call JN(u,'h09A',45.,-5.25,17.)
elseif GetUnitTypeId(u)=='h09L' then
call JN((u),('h09K'),((238.)*1.),0,0)
elseif GetUnitTypeId(u)=='h09P' then
call JN(u,'h09O',279.,-45.5,24.75)
call JN(u,'h09N',300.,31.,-32.25)
elseif GetUnitTypeId(u)=='h09Y' then
call JN((u),('h09Z'),((270.)*1.),0,0)
elseif GetUnitTypeId(u)=='h0A1' then
call SetUnitVertexColor(u,255,255,255,0)
call JN(u,'h0A0',170.,31.25,-43.)
call JN(u,'h0A0',80.,-38.,-40.25)
call JN(u,'h0A0',350.,-30.25,30.)
call JN(u,'h08Z',220.,43.,27.5)
endif
endfunction
function sN takes nothing returns nothing
call SaveInteger(A,0,('A039'),((4)))
endfunction
function SN takes nothing returns nothing
set T=ZA('A03R',"roar",1.)
call SaveInteger(A,0,('A03S'),((5)))
endfunction
function tN takes nothing returns nothing
call SaveInteger(A,0,('A09A'),((6)))
endfunction
function TN takes nothing returns nothing
set W=ZA('A00N',"charm",1.)
call SaveInteger(A,0,('A00O'),((7)))
endfunction
function uN takes nothing returns nothing
call SaveInteger(A,0,('A033'),((8)))
endfunction
function UN takes nothing returns nothing
set Z=ZA('A08W',"bloodlust",1.)
endfunction
function wN takes nothing returns nothing
set vv=ZA('A06D',"",29.)
endfunction
function WN takes nothing returns nothing
set ev=ZA('A08U',"thunderbolt",3.)
call SaveInteger(A,0,('A08V'),((9)))
endfunction
function yN takes nothing returns nothing
set xv=ZA('A07A',"entanglingroots",6.)
call SaveInteger(A,0,('A07P'),((10)))
endfunction
function YN takes nothing returns nothing
set ov=ZA('A09T',"chainlightning",4.)
endfunction
function zN takes nothing returns nothing
set rv=ZA('A01X',"thunderbolt",1.)
call SaveInteger(A,0,('A01W'),((11)))
endfunction
function ZN takes nothing returns nothing
set iv=ZA('A04S',"",20.)
call SaveInteger(A,0,('A04R'),((12)))
endfunction
function vb takes nothing returns nothing
call SaveInteger(A,0,('A004'),((13)))
endfunction
function eb takes nothing returns boolean
return((IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)and(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_SAPPER))
endfunction
function xb takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)and(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_SAPPER))and((Fi[GetPlayerId(GetOwningPlayer((GetFilterUnit())))+1])==(Fi[GetPlayerId(GetOwningPlayer((av)))+1]))
endfunction
function ob takes nothing returns boolean
return((Fi[GetPlayerId(GetOwningPlayer((GetFilterUnit())))+1])!=(Fi[GetPlayerId(GetOwningPlayer((av)))+1]))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)==false)and(IsUnitType(GetFilterUnit(),UNIT_TYPE_SAPPER)or IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))
endfunction
function rb takes nothing returns boolean
return((Fi[GetPlayerId(GetOwningPlayer((GetFilterUnit())))+1])!=(Fi[GetPlayerId(GetOwningPlayer((av)))+1]))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)==false)and IsUnitType(GetFilterUnit(),UNIT_TYPE_SAPPER)
endfunction
function ib takes nothing returns boolean
return((Fi[GetPlayerId(GetOwningPlayer((GetFilterUnit())))+1])!=(Fi[GetPlayerId(GetOwningPlayer((av)))+1]))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)==false)and(IsUnitType(GetFilterUnit(),UNIT_TYPE_SAPPER))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING))
endfunction
function ab takes nothing returns boolean
return((Fi[GetPlayerId(GetOwningPlayer((GetFilterUnit())))+1])!=(Fi[GetPlayerId(GetOwningPlayer((av)))+1]))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)==false)and(IsUnitType(GetFilterUnit(),UNIT_TYPE_SAPPER))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING))and(IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)==false)
endfunction
function nb takes nothing returns boolean
return(IsPlayerInForce(GetFilterPlayer(),Ba)and not se[GetPlayerId(GetFilterPlayer())+1])
endfunction
function Vb takes nothing returns boolean
return( not(IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING)))and( not(GetPlayerId(GetOwningPlayer(GetFilterUnit()))>11))and( not(GetUnitPointValue(GetFilterUnit())==129))and( not(IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD)))and( not(GetUnitTypeId(GetFilterUnit())=='n026'))
endfunction
function Eb takes nothing returns boolean
return GetUnitTypeId(GetEventDamageSource())=='h04X'
endfunction
function Xb takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)!=null)
endfunction
function Ob takes nothing returns nothing
set nv=Condition(function eb)
set Vv=Condition(function xb)
set Ev=Condition(function ob)
set Xv=Condition(function ib)
set Rv=Condition(function rb)
set Av=Condition(function Eb)
set Nv=Condition(function Vb)
set bv=Condition(function nb)
set Iv=Condition(function Xb)
set Ov=Condition(function ab)
endfunction
function Rb takes string Ib,unit uA,integer Ab,integer Nb,integer bb,real Bb,real cb,real Cb returns texttag
local real lN=-I2R(StringLength(Ib))*6
set bj_lastCreatedTextTag=CreateTextTag()
call SetTextTagText(bj_lastCreatedTextTag,Ib,.024)
call SetTextTagPos(bj_lastCreatedTextTag,lN+GetUnitX(uA),GetUnitY(uA)-16,0)
call SetTextTagColor(bj_lastCreatedTextTag,Ab,Nb,bb,255)
call SetTextTagPermanent(bj_lastCreatedTextTag,false)
call SetTextTagLifespan(bj_lastCreatedTextTag,cb)
call SetTextTagFadepoint(bj_lastCreatedTextTag,Bb)
call SetTextTagVelocity(bj_lastCreatedTextTag,0,Cb)
return bj_lastCreatedTextTag
endfunction
function db takes player p,string Ib,unit uA,integer Ab,integer Nb,integer bb,real Bb,real cb,real Cb returns texttag
call Rb(Ib,uA,Ab,Nb,bb,Bb,cb,Cb)
if GetLocalPlayer()!=p then
call SetTextTagVisibility(bj_lastCreatedTextTag,false)
endif
return bj_lastCreatedTextTag
endfunction
function Db takes unit u,integer fb returns nothing
if Pi>0 and(C[Mr*12*1+GetPlayerId((GetOwningPlayer(u)))*1+(0)])+fb>Pi then
set fb=Pi-R2I((C[Mr*12*1+GetPlayerId((GetOwningPlayer(u)))*1+(0)]))
endif
call cA(GetOwningPlayer(u),0,fb)
call AdjustPlayerStateBJ(fb,GetOwningPlayer(u),PLAYER_STATE_RESOURCE_LUMBER)
call db(GetOwningPlayer(u),I2S(fb),u,0,170,0,1.,3.,.06)
endfunction
function Fb takes nothing returns nothing
call SaveInteger(A,0,('A04U'),((14)))
endfunction
function gb takes nothing returns nothing
call SaveInteger(A,0,('A04J'),((15)))
endfunction
function Gb takes nothing returns nothing
set Bv=ZA('A016',"bloodlust",1.)
call SaveInteger(A,0,('A01K'),((16)))
endfunction
function hb takes nothing returns nothing
call SaveInteger(A,0,('A04L'),((17)))
endfunction
function Hb takes nothing returns nothing
set cv=ZA('A09E',"thunderclap",3.)
call SaveInteger(A,0,('A09D'),((18)))
endfunction
function jb takes nothing returns nothing
set Cv=ZA('A018',"hex",1.)
call SaveInteger(A,0,('A017'),((19)))
endfunction
function Jb takes nothing returns nothing
set dv=ZA('A043',"frostnova",1.)
call SaveInteger(A,0,('A044'),((20)))
endfunction
function kb takes multiboard Kb,integer x,integer y,string lb returns nothing
set H=MultiboardGetItem(Kb,y,x)
call MultiboardSetItemValue(H,lb)
call MultiboardReleaseItem(H)
endfunction
function UpdateRoundTime takes nothing returns nothing
call kb(ar,5,3,mA())
endfunction
function Lb takes nothing returns nothing
set Dv=ZA('A018',"hex",1.)
set fv=ZA('A06S',"thunderbolt",2.)
call SaveInteger(A,0,('A06R'),((21)))
endfunction
function mb takes nothing returns nothing
set Fv=ZA('A05D',"stomp",1.)
call SaveInteger(A,0,('A05E'),((22)))
endfunction
function Mb takes nothing returns nothing
call SaveInteger(A,0,('A095'),((23)))
endfunction
function pb takes nothing returns nothing
local integer Pb=0
local integer qb=0
if io!=0 then
if(GetPlayerId(GetOwningPlayer(Va[0]))==0)then
set Pb=1
elseif(GetPlayerId(GetOwningPlayer(Va[0]))==6)then
set qb=1
endif
endif
if io!=1 then
if(GetPlayerId(GetOwningPlayer(Va[1]))==0)then
set Pb=Pb+1
elseif(GetPlayerId(GetOwningPlayer(Va[1]))==6)then
set qb=qb+1
endif
endif
if io!=-1 then
set Pb=Pb+1
set qb=qb+1
endif
if(Pb==2)then
set jo[0]=1.+hi
call DisplayTimedTextToForce(Ba,8,Ji[0]+"|cffFFFF00 are dominating, they gain +"+I2S(R2I(hi*'d'))+"% income!|r")
set qo[0]=true
else
if qo[0]then
call DisplayTimedTextToForce(Ba,8,Ji[0]+"|cffFFFF00 are no longer dominating!|r")
endif
set qo[0]=false
set jo[0]=1.
endif
if(qb==2)then
set jo[1]=1.+hi
call DisplayTimedTextToForce(Ba,8,Ji[1]+"|cffFFFF00 are dominating, they gain +"+I2S(R2I(hi*'d'))+"% income!|r")
set qo[1]=true
else
if qo[1]then
call DisplayTimedTextToForce(Ba,8,Ji[1]+"|cffFFFF00 are no longer dominating!|r")
endif
set qo[1]=false
set jo[1]=1.
endif
endfunction
function Qb takes integer i,unit sb returns nothing
local group g
local integer Pb=0
local integer qb=0
local unit u
if io==i then
return
endif
set g=CreateGroup()
call GroupEnumUnitsInRect(g,Ei[i],Nv)
call GroupAddUnit(g,sb)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
if(GetPlayerId(GetOwningPlayer(u))<=5)then
set Pb=Pb+1
else
set qb=qb+1
endif
endloop
call DestroyGroup(g)
set g=null
if(Pb>0 and qb==0)and GetPlayerId(GetOwningPlayer(Va[i]))!=0 then
call SetUnitOwner(Va[i],Player(0),true)
call pb()
elseif(Pb==0 and qb>0)and GetPlayerId(GetOwningPlayer(Va[i]))!=6 then
call SetUnitOwner(Va[i],Player(6),true)
call pb()
endif
endfunction
function Sb takes nothing returns nothing
local integer tb=CountPlayersInForceBJ(er)
if tb==0 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"All players have agreed, number of rounds is increased by "+I2S(oo))
call DisableTrigger(vE)
call PauseTimer(Li)
call DestroyForce(er)
set Wx=Wx+oo
set go=true
call TriggerExecute(In)
endif
endfunction
function Tb takes nothing returns nothing
local player p
local integer ub=wi*2
local integer yI=qi
local integer i
local unit Ub
loop
exitwhen ub==0
set p=tA(yI)
if(p!=null)then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(p))]+" has 15 seconds to ban a race!")
call zI(p,'h09W')
set Ub=bj_lastCreatedUnit
else
set i=vA(Player(0))
call WI(i,-1)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Ji[yI]+" has banned |cffFFFF00"+Go[i]+"|r")
endif
set i=0
loop
if i>=15 then
set i=vA(Player(0))
call WI(i,-1)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(p))]+" has random banned |cffFFFF00"+Go[i]+"|r")
call RemoveUnit(Ub)
exitwhen true
endif
call TriggerSleepAction(1.)
exitwhen CountUnitsInGroup(Do[yI])==0
set i=i+1
endloop
call TriggerSleepAction(3.)
set yI=ModuloInteger(yI+1,2)
set ub=ub-1
endloop
endfunction
function wb takes nothing returns nothing
if not se[(1+GetPlayerId(GetEnumPlayer()))]then
call zI(GetEnumPlayer(),'h033')
else
call rA(GetEnumPlayer())
endif
endfunction
function Wb takes nothing returns nothing
local integer i=rA(GetOwningPlayer(GetEnumUnit()))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(GetOwningPlayer(GetEnumUnit())))]+" has randomed |cffFFFF00"+Go[i]+"|r")
call RemoveUnit(GetEnumUnit())
endfunction
function yb takes force f,integer yI returns nothing
local integer i=0
if CountPlayersInForceBJ(f)==0 then
return
endif
loop
exitwhen i>11
if IsPlayerInForce(Player(i),f)then
call DisplayTextToPlayer(Player(i),0,0,"|cffFFFF00You have 15 seconds to pick your race!|r")
endif
set i=i+1
endloop
call ForForce(f,function wb)
set i=0
loop
if i>=15 then
call ForGroup(Do[yI],function Wb)
exitwhen true
endif
call TriggerSleepAction(1.)
exitwhen CountUnitsInGroup(Do[yI])==0
set i=i+1
endloop
call TriggerSleepAction(3.)
call ForceClear(f)
endfunction
function Yb takes integer zb returns integer
local integer Zb=(zb/ 6)*6+5
if zb==-1 then
return-1
endif
loop
exitwhen zb>Zb
if IsPlayerInForce(Player(zb),Ba)then
return zb
endif
set zb=zb+1
endloop
return-1
endfunction
function vB takes nothing returns nothing
local integer yI=qi
local integer array zb
local force eB=CreateForce()
set zb[0]=0
set zb[1]=6
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"")
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"

|cffFFFF00----------- Get ready for the draft! -----------|r")
call TriggerSleepAction(5.)
set zb[yI]=Yb(zb[yI])
call ForceAddPlayer(eB,Player(zb[yI]))
set zb[yI]=zb[yI]+1
call yb(eB,yI)
loop
set yI=ModuloInteger(yI+1,2)
set zb[yI]=Yb(zb[yI])
if(zb[yI]!=-1)then
call ForceAddPlayer(eB,Player(zb[yI]))
set zb[yI]=zb[yI]+1
set zb[yI]=Yb(zb[yI])
if(zb[yI]!=-1)then
call ForceAddPlayer(eB,Player(zb[yI]))
set zb[yI]=zb[yI]+1
endif
endif
call yb(eB,yI)
exitwhen zb[0]==-1 and zb[1]==-1
endloop
endfunction
function xB takes nothing returns nothing
set gv=ZA('A02T',"purge",2.)
call SaveInteger(A,0,('A02U'),((24)))
endfunction
function oB takes nothing returns nothing
call SaveInteger(A,0,('A072'),((25)))
endfunction
function rB takes nothing returns nothing
call SaveInteger(A,0,('A08E'),((26)))
endfunction
function iB takes nothing returns nothing
call SaveInteger(A,0,('A03K'),((27)))
endfunction
function aB takes nothing returns nothing
call SaveInteger(A,0,('A03I'),((28)))
endfunction
function nB takes nothing returns nothing
set Gv=ZA('A00B',"thunderclap",1.)
call SaveInteger(A,0,('A00M'),((29)))
endfunction
function VB takes nothing returns nothing
set hv=ZA('A06C',"",29.)
endfunction
function EB takes nothing returns nothing
call SaveInteger(A,0,('A09O'),((30)))
endfunction
function XB takes string OB,unit RB returns nothing
local location l=GetUnitLoc(RB)
local effect e=AddSpecialEffectLoc(OB,l)
call RemoveLocation(l)
call DestroyEffect(e)
set e=null
set l=null
endfunction
function IB takes string OB,unit RB,string dN returns nothing
local effect e=AddSpecialEffectTarget(OB,RB,dN)
call DestroyEffect(e)
set e=null
endfunction
function AB takes nothing returns nothing
set Hv=ZA('A07Q',"entanglingroots",11.)
call SaveInteger(A,0,('A07R'),((31)))
endfunction
function NB takes nothing returns nothing
set jv=ZA('A02G',"",1.)
set gO[(jv)]=(852269)
endfunction
function bB takes nothing returns nothing
set Jv=ZA('A030',"acidbomb",30.)
call SaveInteger(A,0,('A02Z'),((32)))
endfunction
function BB takes nothing returns nothing
call SaveInteger(A,0,('A01E'),((33)))
endfunction
function cB takes nothing returns nothing
set kv=ZA('A0AK',"thunderbolt",10.)
call SaveInteger(A,0,('A06P'),((34)))
endfunction
function CB takes nothing returns nothing
set Kv=ZA('A08A',"",1.)
set gO[(Kv)]=(852269)
endfunction
function dB takes nothing returns nothing
call SaveInteger(A,0,('A08B'),((35)))
endfunction
function DB takes nothing returns nothing
set lv=ZA('A0A8',"healingwave",2.)
call SaveInteger(A,0,('A0A7'),((36)))
endfunction
function fB takes unit u returns nothing
local integer sA=GetUnitAbilityLevel(u,'A09C')+1
if(sA>=6)then
return
endif
call SetUnitAbilityLevel(u,'A09C',sA)
call SetUnitAbilityLevel(u,'A09B',sA)
call IB("Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl",u,"origin")
if sA==2 then
call AddSpecialEffectTarget("Abilities\\Spells\\Orc\\Bloodlust\\BloodlustTarget.mdl",u,"weapon,right")
elseif sA==3 then
call AddSpecialEffectTarget("Abilities\\Spells\\Orc\\TrollBerserk\\HeadhunterWEAPONSLeft.mdl",u,"head")
elseif sA==4 then
call AddSpecialEffectTarget("Abilities\\Spells\\Orc\\Bloodlust\\BloodlustTarget.mdl",u,"head")
elseif sA==5 then
call AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl",u,"weapon,right")
endif
endfunction
function FB takes unit u returns nothing
local integer sA=GetUnitAbilityLevel(u,'A09L')
if sA==2 then
call SetUnitAbilityLevel(u,'A09L',1)
call SetUnitState(u,UNIT_STATE_LIFE,GetUnitState(u,UNIT_STATE_LIFE)+200)
call SetUnitState(u,UNIT_STATE_MANA,GetUnitState(u,UNIT_STATE_MANA)+'d')
call qA(u,'A09M',3)
elseif sA==1 then
call UnitRemoveAbility(u,'A09L')
endif
call IB("Abilities\\Spells\\Items\\AIvi\\AIviTarget.mdl",u,"origin")
endfunction
function gB takes unit GB,unit hB returns boolean
if GetUnitTypeId(GB)=='n01T' then
call fB(GB)
if GetRandomInt(0,99)<60 then
return false
endif
endif
if GetUnitAbilityLevel(GB,'A09L')>0 then
call FB(GB)
return false
endif
if GetUnitAbilityLevel(GB,'A070')!=0 then
return false
endif
return true
endfunction
function HB takes unit GB,unit hB returns boolean
if not gB(GB,hB)then
call IB("Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl",GB,"origin")
return false
endif
return true
endfunction
function jB takes nothing returns nothing
set Lv=ZA('A07T',"starfall",11.)
set mv=ZA('A08T',"starfall",11.)
call SaveInteger(A,0,('A07U'),((37)))
endfunction
function JB takes nothing returns nothing
set Mv=ZA('A031',"stomp",1.)
call SaveInteger(A,0,('A032'),((38)))
endfunction
function kB takes nothing returns nothing
set pv=ZA('A06H',"ensnare",2.)
call SaveInteger(A,0,('A06I'),((39)))
endfunction
function KB takes unit u returns nothing
local integer yI
if u==null then
return
endif
set yI=(Fi[GetPlayerId(GetOwningPlayer((u)))+1])
call iA(xO[yI],u)
if IsUnitType(u,UNIT_TYPE_FLYING)then
call iA(rO[yI],u)
call UnitAddAbility(u,'A07F')
else
call iA(iO[yI],u)
endif
endfunction
function lB takes unit u,integer yI returns nothing
if u==null then
return
endif
call VA(xO[yI],u)
if GetUnitAbilityLevel(u,'A07F')==1 then
call VA(rO[yI],u)
else
call VA(iO[yI],u)
endif
endfunction
function LB takes unit u returns nothing
call lB(u,(Fi[GetPlayerId(GetOwningPlayer((u)))+1]))
endfunction
function mB takes nothing returns nothing
set Pv=ZA('A01I',"flamestrike",6.)
set qv=ZA('A05H',"flamestrike",6.)
call SaveInteger(A,0,('A01J'),((40)))
endfunction
function MB takes nothing returns nothing
set Qv=ZA('A00I',"fanofknives",1.)
call SaveInteger(A,0,('A00K'),((41)))
endfunction
function pB takes nothing returns nothing
call SaveInteger(A,0,('A057'),((42)))
endfunction
function PB takes nothing returns nothing
set sv=ZA('A00Y',"healingwave",2.)
call SaveInteger(A,0,('A00X'),((43)))
endfunction
function qB takes nothing returns nothing
set Sv=ZA('A082',"thunderbolt",2.)
set tv=ZA('A083',"thunderbolt",2.)
set Tv=ZA('A04H',"entanglingroots",16.)
endfunction
function QB takes nothing returns nothing
call SaveInteger(A,0,('A04I'),((44)))
endfunction
function sB takes integer SB returns nothing
local string tB=""
if(ModuloInteger((SB),2))==1 then
set tB="bottom"
else
set tB="top"
endif
call DisplayTextToForce(cR(Player(SB-1)),Lr[SB]+": I will build on "+tB+" Lane!")
call PingMinimapLocForForce(cR(Player(SB-1)),GetRectCenter(Ox[(ModuloInteger((SB),2))]),3)
endfunction
function TB takes unit uB returns nothing
local integer UB=GetUnitPointValue(uB)
local integer wB=xo[UB]
local integer WB=vo[UB]
local integer yB=Fx[UB]
local integer flyingClass=0
local integer yI=(Fi[GetPlayerId(GetOwningPlayer((uB)))+1])
local integer YB=yI*2
if gi[UB]>=2 then
return
endif
if not RectContainsCoords(We[yI*2],GetUnitX(uB),GetUnitY(uB))then
set YB=YB+1
endif
if IsUnitIdType(lx[UB],UNIT_TYPE_FLYING) then
set ye[wB*4+YB]=ye[wB*4+YB]+yB
set ze[YB]=ze[YB]+yB
else
set Ye[wB*4+YB]=Ye[wB*4+YB]+yB
set Ze[YB]=Ze[YB]+yB
endif
if ho[UB]==1 or ho[UB]==3 then
set vx[WB*4+YB]=vx[WB*4+YB]+yB
set xx[YB]=xx[YB]+yB
endif
if ho[UB]==2 or ho[UB]==3 then
set ex[WB*4+YB]=ex[WB*4+YB]+yB
set ox[YB]=ox[YB]+yB
endif
if ho[UB]==3 then
set rx[YB]=rx[YB]+yB
endif
endfunction
function zB takes integer yI returns nothing
if TimerGetRemaining(te[yI])<=.0 then
call TimerStart(te[yI],20,false,null)
set Se[yI]=true
endif
endfunction
function ZB takes nothing returns nothing
if(GetUnitTypeId(GetEnumUnit())=='h033')then
call rA(GetOwningPlayer(GetEnumUnit()))
call RemoveUnit(GetEnumUnit())
endif
endfunction
function vc takes integer zR returns nothing
call eR(15)
call ForGroupBJ(NR(Player(zR)),function ZB)
endfunction
function ec takes nothing returns nothing
if fe then
return
endif
set fe=true
call EnableTrigger(AE)
endfunction
function xc takes boolean oc returns nothing
if oc then
if ForcePickRandomPlayer(Me)!=null then
call EnableTrigger(nE)
if not to then
call EnableTrigger(VE)
endif
endif
set Fe=true
else
call DisableTrigger(nE)
call DisableTrigger(VE)
set Fe=false
endif
endfunction
function rc takes integer SB returns nothing
local integer i
set se[SB]=true
call ForceAddPlayer(Me,Player(SB-1))
call ec()
if Fe then
call xc(true)
endif
set Pe[SB]=0
call sB(SB)
set i=0
loop
exitwhen i>2
set Rx[SB*3+i]=0
set i=i+1
endloop
set Vx[SB]=0
set ke[SB]=-1
set Ke[SB]=-1
set KE=0
set He[SB]=0
set je[SB]=0
set le[SB]=true
set Je[SB]=0
set Le[SB]=false
endfunction
function ic takes nothing returns nothing
call rc((1+GetPlayerId(GetEnumPlayer())))
endfunction
function ac takes nothing returns nothing
local integer i
if ForcePickRandomPlayer(Me)==null then
return
endif
call ec()
set Se[0]=false
set Se[1]=false
call ForForce(Me,function ic)
set i=0
loop
exitwhen i>3
set ze[i]=0
set Ze[i]=0
set xx[i]=0
set ox[i]=0
set rx[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen i>40
set ye[i]=0
set Ye[i]=0
set vx[i]=0
set ex[i]=0
set i=i+1
endloop
set cx=true
set Bx=CreateTimer()
call TimerStart(Bx,25,false,null)
call TimerStart(te[0],1,false,null)
call TimerStart(te[1],1,false,null)
endfunction
function nc takes nothing returns nothing
if GetOwningPlayer(GetEnumUnit())!=Player(15)and GetUnitTypeId(GetEnumUnit())!='h00L' then
call MN(GetEnumUnit())
call RemoveUnit(GetEnumUnit())
endif
endfunction
function Vc takes integer Ec,unit RB,unit Xc,player mR returns nothing
local location dN=GetUnitLoc(RB)
local integer i=Fi[(1+GetPlayerId(mR))]
set bj_lastCreatedUnit=CreateUnitAtLoc(mR,Ec,dN,GetUnitFacing(RB))
call RemoveLocation(dN)
set dN=null
call pA(bj_lastCreatedUnit)
set Br[i]=(Br[i]+1)
call KB(bj_lastCreatedUnit)
endfunction
function Oc takes unit uB,unit u returns nothing
if(uB==null)then
return
endif
if(GetUnitAbilityLevel(uB,'B01K')>0)then
call qA(u,'A09M',3)
call UnitAddAbility(u,'A09Q')
call UnitAddAbility(u,'A09R')
endif
endfunction
function Rc takes unit u returns boolean
return(GetUnitTypeId(u)=='n003')or(GetUnitTypeId(u)=='n00I')or(GetUnitTypeId(u)=='n00J')or(GetUnitTypeId(u)=='n00K')
endfunction
function Ic takes unit uB,unit u returns nothing
local integer i
if(Rc(u))then
call Vc(GetUnitTypeId(u),u,uB,GetOwningPlayer(u))
call Oc(uB,bj_lastCreatedUnit)
elseif(GetUnitPointValue(u)=='e')then
call LB(u)
set i=GetRandomInt(0,99)
if(i<5)then
call ReplaceUnitBJ(u,'n00M',1)
elseif(i<14)then
call ReplaceUnitBJ(u,'n00R',1)
else
set i=GetRandomInt(0,3)
if(i==0)then
call ReplaceUnitBJ(u,'n00Q',1)
elseif(i==1)then
call ReplaceUnitBJ(u,'n00N',1)
elseif(i==2)then
call ReplaceUnitBJ(u,'n00O',1)
else
call ReplaceUnitBJ(u,'n00P',1)
endif
endif
set u=bj_lastReplacedUnit
call KB(u)
call pA(u)
call Oc(uB,u)
set i=GetRandomInt(0,99)
if(i<20)then
call UnitAddAbility(u,'A009')
elseif(i<55)then
call UnitAddAbility(u,'A01F')
endif
set i=GetRandomInt(0,99)
if(i<18)then
call UnitAddAbility(u,'A02B')
elseif(i<30)then
call UnitAddAbility(u,'A01B')
elseif(i<33)then
call UnitAddAbility(u,'A00Z')
elseif(i<43)then
call UnitAddAbility(u,'A07L')
endif
set i=GetRandomInt(0,99)
if(i<10)then
call UnitAddAbility(u,'A00U')
elseif(i<32)then
call UnitAddAbility(u,'A00T')
elseif(i<35)then
call UnitAddAbility(u,'A05J')
endif
set i=GetRandomInt(0,99)
if(i<25)then
call UnitAddAbility(u,'A01A')
endif
set i=GetRandomInt(0,99)
if(i<15)then
call UnitAddAbility(u,'A00V')
elseif(i<40)then
call UnitAddAbility(u,'A00D')
endif
set i=GetRandomInt(0,99)
if(i<8)then
call UnitAddAbility(u,'A01U')
elseif(i<16)then
call UnitAddAbility(u,'A010')
elseif(i<24)then
call UnitAddAbility(u,'A01P')
elseif(i<34)then
call UnitAddAbility(u,'A006')
elseif(i<44)then
call UnitAddAbility(u,'A01R')
elseif(i<47)then
call UnitAddAbility(u,'A012')
endif
elseif GetUnitTypeId(u)=='n01U' then
call UnitApplyTimedLife(u,'BTLF','x')
set L=GetUnitRallyPoint(uB)
if(L!=null)then
call StoreReal(vr,"repairgobboX",(I2S(GetHandleId((u)))),GetLocationX(L))
call StoreReal(vr,"repairgobboY",(I2S(GetHandleId((u)))),GetLocationY(L))
call RemoveLocation(L)
set L=null
endif
call LB(u)
elseif GetUnitTypeId(u)=='h06U' then
call SetUnitState(u,UNIT_STATE_MANA,GetRandomReal(0,50))
endif
endfunction
function Ac takes integer Ec,unit RB,unit Xc,player mR returns nothing
local location dN=GetUnitLoc(RB)
local integer i=Fi[(1+GetPlayerId(mR))]
set bj_lastCreatedUnit=CreateUnitAtLoc(mR,Ec,dN,GetUnitFacing(RB))
call RemoveLocation(dN)
set dN=null
call pA(bj_lastCreatedUnit)
set Br[i]=(Br[i]+1)
call KB(bj_lastCreatedUnit)
if(GetUnitAbilityLevelSwapped('A07J',bj_lastCreatedUnit)==1)then
set Po=bj_lastCreatedUnit
call Ic(Xc,bj_lastCreatedUnit)
endif
endfunction
function Nc takes player p,integer sA returns nothing
local unit bc=CreateUnitAtLoc(p,'tec0'+sA,wv,.0)
call ShowUnit(bc,false)
call GroupAddUnit(Uv,bc)
endfunction
function Bc takes nothing returns nothing
local integer i=0
local integer j
local player p
local unit u
set wv=GetRectCenter(Za)
set Uv=CreateGroup()
loop
exitwhen i>11
set j=1
set p=Player(i)
loop
exitwhen j>3
set u=CreateUnitAtLoc(p,'tec0'+j,wv,.0)
call ShowUnit(u,false)
call GroupAddUnit(Uv,u)
set j=j+1
endloop
set i=i+1
endloop
endfunction
function cc takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function Cc takes nothing returns nothing
call ForGroup(Uv,function cc)
call GroupClear(Uv)
endfunction
function dc takes nothing returns nothing
set De[0]=3
set De[1]=1
set De[2]=0
set De[3]=0
set De[4]=0
set De[5]=0
set De[6]=0
set Ee[0]=0
set Ee[1]=1
set Ee[2]=2
set Ee[3]=99
set Ee[4]=4
set Re[0]=2
set Re[1]=0
set Re[2]=1
set Re[3]=99
set Re[4]=99
set Xe[0]=1
set Xe[1]=2
set Xe[2]=0
set Xe[3]=99
set Xe[4]=99
set Xe[7]=99
set Oe[0]=0
set Oe[1]=1
set Oe[2]=2
set Oe[3]=99
set Oe[4]=4
set Oe[7]=99
set Ix[0]=7.
set Ax[0]=0
set Nx[0]=285
set bx[0]=285
set Ix[1]=15.
set Ax[1]=0
set Nx[1]=285
set bx[1]=450
set Ix[2]=27.
set Ax[2]=165
set Nx[2]=350
set bx[2]=650
set Ix[3]=65.
set Ax[3]=165
set Nx[3]=550
set bx[3]=5000
set Ix[4]=100000.
set Ax[4]=200
set Nx[4]=5000
set bx[4]=5000
endfunction
function Dc takes integer SB,integer II,integer fc returns integer
local integer Fc=GetUnitPointValueByType(II)
local integer gc=5000
set I=GetRandomInt(0,Wv)
set gc=gc+I
if ge>=3 then
call BI("+"+I2S(I)+" random bonus")
endif
set gc=gc+fc/ ie
if ge>=3 then
call BI("+"+I2S(fc/ ie)+" for its price")
endif
return gc
endfunction
function Gc takes integer SB,integer II,integer fc returns integer
local integer Fc=GetUnitPointValueByType(II)
local integer gc=5000
set I=GetRandomInt(0,Wv)
set gc=gc+I
if ge>=3 then
call BI("+"+I2S(I)+" random bonus")
endif
set gc=gc+fc/ ie
if ge>=3 then
call BI("+"+I2S(fc/ ie)+" for its price")
endif
if ho[Fc]==1 then
set I=vx[vo[Fc]*4+Ie]/ oe
if I>0 then
set gc=gc-I
if ge>=3 then
call BI("-"+I2S(I)+" for repeated attack type")
endif
endif
elseif ho[Fc]==2 then
set I=ex[vo[Fc]*4+Ie]/ oe
if I>0 then
set gc=gc-I
if ge>=3 then
call BI("-"+I2S(I)+" for repeated attack type")
endif
endif
elseif ho[Fc]==3 then
set I=(ex[vo[Fc]*4+Ie]+vx[vo[Fc]*4+Ie])/ 2/ oe
if I>0 then
set gc=gc-I
if ge>=3 then
call BI("-"+I2S(I)+" for repeated attack type")
endif
endif
endif
if de>0 then
set I=0
if ho[Fc]==1 or ho[Fc]==3 then
set I=ye[Ae+4*Oe[vo[Fc]]]
endif
if ho[Fc]==2 or ho[Fc]==3 then
set I=I+Ye[Ae+4*Oe[vo[Fc]]]
endif
set I=I*'d'/ de
set K=I*yv/ 'd'
set gc=gc+K
if ge>=3 and I>0 then
call BI("+"+I2S(K)+" for countering the armor of "+I2S(I)+"% of all enemies")
endif
set I=0
if ho[Fc]==1 or ho[Fc]==3 then
set I=ye[Ae+4*Xe[vo[Fc]]]
endif
if ho[Fc]==2 or ho[Fc]==3 then
set I=I+Ye[Ae+4*Xe[vo[Fc]]]
endif
set I=I*'d'/ de
set K=I*zv/ 'd'
set gc=gc-K
if ge>=3 and I>0 then
call BI("-"+I2S(K)+" for beeing bad against the armor of "+I2S(I)+"% of all enemies")
endif
endif
if Ce>0 then
if IsUnitIdType(lx[Fc],UNIT_TYPE_FLYING) then
set I=ye[xo[Fc]*4+Ie]/ oe
if I>0 then
set gc=gc-I
if ge>=3 then
call BI("-"+I2S(I)+" for repeated armor type")
endif
endif
set I=vx[Ae+4*Re[xo[Fc]]]
else
set I=Ye[xo[Fc]*4+Ie]/ oe
if I>0 then
set gc=gc-I
if ge>=3 then
call BI("-"+I2S(I)+" for repeated armor type")
endif
endif
set I=ex[Ae+4*Re[xo[Fc]]]
endif
set I=I*'d'/ Ce
set K=I*Yv/ 'd'
set gc=gc+K
if ge>=3 and I>0 then
call BI("+"+I2S(K)+" for countering the attack of "+I2S(I)+"% of all enemies")
endif
if IsUnitIdType(lx[Fc],UNIT_TYPE_FLYING) then
set I=vx[Ae+4*Ee[xo[Fc]]]
else
set I=ex[Ae+4*Ee[xo[Fc]]]
endif
set I=I*'d'/ Ce
set K=I*Zv/ 'd'
set gc=gc-K
if ge>=3 and I>0 then
call BI("-"+I2S(K)+" for having a bad armor against the attack of "+I2S(I)+"% of all enemies")
endif
endif
if de>0 then
if ho[Fc]==1 and ze[Ae]*'d'/ de<=ne then
set gc=gc-ae
if ge>=3 then
call BI("-"+I2S(ae)+" for beeing able to attack less than "+I2S(ne)+"% of all enemies")
endif
elseif ho[Fc]==2 and Ze[Ae]*'d'/ de<=ne then
set gc=gc-ae
if ge>=3 then
call BI("-"+I2S(ae)+" for beeing able to attack less than "+I2S(ne)+"% of all enemies")
endif
endif
endif
if vo[Fc]==3 then
set I=ve+R2I(I2R(Ne)*xe)
if I>ee then
set I=ee
endif
set gc=gc+I
if ge>=3 then
if I>=0 then
call BI("+"+I2S(I)+" for beeing a Siege Creep Building")
else
call BI(I2S(I)+" for beeing a Siege Creep Building")
endif
endif
endif
return gc
endfunction
function hc takes integer SB,integer II returns nothing
local integer Fc=0
local integer fc
local integer gc=1
set Fc=GetUnitPointValueByType(II)
set fc=Fx[Fc]+ca[Fc]
if ge>=3 then
call BI("|cffFFFF80-- Begin of "+Lr[SB]+"|cffFFFF80's calculation for "+GetObjectName(II)+" (Tier "+I2S(Pe[SB])+") --|r")
endif
if Fx[Fc]>Nx[Pe[SB]]or ca[Fc]>Nx[Pe[SB]]or fc>bx[Pe[SB]]or(fc<Ax[Pe[SB]]and gi[Fc]<2)then
if ge>=3 then
call BI("Building out of price range ("+I2S(fc)+")")
endif
set gc=0
endif
if Se[Fi[SB]] and qe[Fc]==1 and gi[Fc]==3 and be>=Tx[Fc]then
set Je[SB]=II
set Se[Fi[SB]]=false
if ge>=3 then
call BI("<<< Forced to build a tower >>>")
endif
elseif Hi==false and(Vx[SB]+1)*re<=Ne and be>=Tx[GetUnitPointValueByType('h008')]then
set Je[SB]='h008'
if ge>=3 then
call BI("<<< Forced to build a treasure box >>>")
endif
elseif((V[GetUnitPointValueByType((II))]) and Be>0 and be>=Tx[Fc]and I2R(Ne)>(I2R(Fx[Fc])/ 10))then
set Je[SB]=II
if ge>=3 then
call BI("<<< Forced to build a legendary structure >>>")
endif
elseif(gc!=0)then
if((ro[Fc]==To and qe[Fc]==1)or(V[GetUnitPointValueByType((II))]) or II=='h008')then
set gc=0
else
if gi[Fc]<2 then
set gc=Gc(SB,II,fc)
if gc>=ke[SB]then
set He[SB]=II
set ke[SB]=gc
endif
elseif le[SB]and gi[Fc]==2 then
set gc=Dc(SB,II,fc)
if gc>=Ke[SB]then
set je[SB]=II
set Ke[SB]=gc
endif
endif
endif
endif
if ge>=3 and gc>0 then
call BI("Final multiplier: "+I2S(gc))
endif
endfunction
function Hc takes integer SB returns nothing
local integer i=0
if ge>=3 then
call BI("|cffFFBF00*** Begin of "+Lr[SB]+"|cffFFBF00's tactics calculation ***|r")
endif
set Ke[SB]=0
set ke[SB]=0
loop
exitwhen i>=Te[ui[SB]]
call hc(SB,ue[ui[SB]*30+i])
set i=i+1
endloop
set le[SB]=false
endfunction
function jc takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())==Qe[GetUnitPointValueByType(G)])
endfunction
function Jc takes nothing returns nothing
local integer i=0
loop
exitwhen i>11
if GetPlayerController(Player(i))==MAP_CONTROL_COMPUTER then
call ZR(i+1)
if GetAIDifficulty(Player(i))==AI_DIFFICULTY_INSANE then
set pe[i+1]=1.33
endif
endif
set i=i+1
endloop
endfunction
function kc takes nothing returns nothing
local integer i
set Ge=Condition(function jc)
set i=0
loop
exitwhen i>12
set pe[i]=1
set i=i+1
endloop
set me=CreateGroup()
set te[0]=CreateTimer()
set te[1]=CreateTimer()
set Me=CreateForce()
set ix[0]=CreateGroup()
set ix[1]=CreateGroup()
set ax[0]=CreateGroup()
set ax[1]=CreateGroup()
set nx[0]=CreateGroup()
set nx[1]=CreateGroup()
set We[0]=La
set Ox[0]=wa
set Ox[0+4]=qa
set Ox[0+8]=qa
set Ox[0+12]=La
set Ex[0]=ua
set Ex[0+4]=ua
set Ex[0+8]=Sa
set Ex[0+12]=Sa
set Xx[0]=Ya
set Xx[0+4]=Ya
set Xx[0+8]=qa
set Xx[0+12]=La
set We[1]=vn
set Ox[1]=Pa
set Ox[1+4]=qa
set Ox[1+8]=qa
set Ox[1+12]=vn
set Ex[1]=Ua
set Ex[1+4]=Ua
set Ex[1+8]=Sa
set Ex[1+12]=Sa
set Xx[1]=za
set Xx[1+4]=za
set Xx[1+8]=pa
set Xx[1+12]=vn
set We[2]=ma
set Ox[2]=ga
set Ox[2+4]=Qa
set Ox[2+8]=Qa
set Ox[2+12]=ma
set Ex[2]=ta
set Ex[2+4]=ta
set Ex[2+8]=en
set Ex[2+12]=en
set Xx[2]=Wa
set Xx[2+4]=Wa
set Xx[2+8]=Qa
set Xx[2+12]=ma
set We[3]=Ma
set Ox[3]=la
set Ox[3+4]=sa
set Ox[3+8]=sa
set Ox[3+12]=Ma
set Ex[3]=Ta
set Ex[3+4]=Ta
set Ex[3+8]=en
set Ex[3+12]=en
set Xx[3]=ya
set Xx[3+4]=ya
set Xx[3+8]=sa
set Xx[3+12]=Ma
call Jc()
endfunction
function Kc takes integer SB,integer lc,boolean Lc returns nothing
if Je[SB]>0 and lc==Je[SB]then
set Je[SB]=0
endif
if(lc=='h008')then
set Vx[SB]=Vx[SB]+1
endif
if not(V[GetUnitPointValueByType((lc))])and gi[GetUnitPointValueByType(lc)]==2 then
set le[SB]=true
endif
if GetRandomInt(0,99)<Ve then
set Le[SB]=true
else
set Le[SB]=false
endif
if not Lc and ge>=1 then
call BI(Lr[SB]+" was unable to build "+GetObjectName(lc)+"!")
endif
endfunction
function mc takes integer SB,integer Mc returns nothing
local location l
local group g
local integer i=0
local integer UB
set UB=GetUnitPointValueByType(Mc)
if ge>=1 then
call BI(Lr[SB]+" wants to build "+pi+GetObjectName(Mc)+"("+I2S(Mc)+")")
endif
if(Fx[UB]<=ce)then
if(Tx[UB]>be)then
if ge>=1 then
call BI(Lr[SB]+" has insufficient lumber! THIS MAY NOT HAPPEN, Send replay to gex!")
endif
call Kc(SB,Mc,false)
endif
else
if ge>=1 then
call BI(Lr[SB]+" has insufficient funds!")
endif
return
endif
if qe[UB]==3 then
set G=Mc
set g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,Player(SB-1),Ge)
if(CountUnitsInGroup(g)>0)then
set U=GroupPickRandomUnit(g)
set P=GetOwningPlayer(U)
call SetUnitOwner(U,Player(15),false)
call SetUnitOwner(U,P,true)
call IssueImmediateOrderById(U,Mc)
call Kc(SB,Mc,true)
else
if ge>=1 then
call BI(Lr[SB]+" cannot upgrade, because the predecessor is missing!")
endif
call mc(SB,Qe[UB])
endif
call DestroyGroup(g)
set g=null
else
if(qe[UB]==1)then
set he=Ex[Rx[SB*3+1]*4+Ie]
elseif(qe[UB]==2)then
set he=Xx[Rx[SB*3+2]*4+Ie]
else
set he=Ox[Rx[SB*3+0]*4+Ie]
endif
call SetUnitPosition(br[SB],GetPlayerStartLocationX(Player(SB-1)),GetPlayerStartLocationY(Player(SB-1)))
set i=0
loop
exitwhen i>14
set i=i+1
set l=GetRandomLocInRect(he)
if not IssueBuildOrderById(br[SB],Mc,GetLocationX(l),GetLocationY(l))then
if(i==15)then
if Rx[SB*3+qe[UB]]==3 then
if qe[UB]==1 then
call Kc(SB,Mc,false)
endif
else
set Rx[SB*3+qe[UB]]=Rx[SB*3+qe[UB]]+1
endif
if ge>=1 then
call BI(Lr[SB]+" cannot build, no building space found!")
endif
endif
else
call Kc(SB,Mc,true)
set i=15
endif
call RemoveLocation(l)
set l=null
endloop
endif
endfunction
function pc takes nothing returns nothing
local integer SB=GetPlayerId(GetEnumPlayer())+1
set Ie=(SB/ 7)*2+(ModuloInteger((SB),2))
set Ae=(1-(SB/ 7))*2+(ModuloInteger((SB),2))
set Ne=Wr[SB]
set be=GetPlayerState(Player(SB-1),PLAYER_STATE_RESOURCE_LUMBER)
set ce=GetPlayerState(Player(SB-1),PLAYER_STATE_RESOURCE_GOLD)
set Be=GetPlayerState(Player(SB-1),PLAYER_STATE_RESOURCE_FOOD_CAP)-GetPlayerState(Player(SB-1),PLAYER_STATE_RESOURCE_FOOD_USED)
set Ce=xx[Ae]+ox[Ae]-rx[Ae]
set de=ze[Ae]+Ze[Ae]
if Ne>Ix[Pe[SB]]then
set Pe[SB]=Pe[SB]+1
endif
if(not cx)or Ze[Ae]+ze[Ae]>0 then
if Je[SB]<=0 then
call Hc(SB)
endif
if Je[SB]>0 then
call mc(SB,Je[SB])
elseif je[SB]!=0 and be>=Tx[GetUnitPointValueByType(je[SB])]and Le[SB]then
set Je[SB]=je[SB]
call mc(SB,Je[SB])
else
if ce>=Fx[GetUnitPointValueByType(He[SB])]then
set Je[SB]=He[SB]
endif
call mc(SB,He[SB])
endif
endif
endfunction
function Pc takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function qc takes nothing returns nothing
call xc(false)
set hx=false
set Bi=false
if Tr!=null then
call TimerDialogDisplay(Tr,false)
call DestroyTimerDialog(Tr)
set Tr=null
call PauseTimer(jr)
endif
if jx>0 then
set gE=false
call FogEnable(false)
call PauseTimer(gr)
elseif jx==-1 then
set gE=false
call FogEnable(false)
endif
call DisableTrigger(Ln)
call DisableTrigger(xE)
call DisableTrigger(hn)
call DisableTrigger(Hn)
call DisableTrigger(gn)
call DisableTrigger(Gn)
call DisableTrigger(BV)
call DisableTrigger(fV)
call PauseTimer(lr)
call PauseTimer(Qr)
call PauseTimer(ko)
call PauseTimer(Na)
call TriggerSleepAction(3.)
call CinematicFadeBJ(1,2,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,6.)
call ForGroupBJ(Lo,function Pc)
endfunction
function Qc takes nothing returns boolean
return(GetPlayerSlotState(GetEnumPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction
function sc takes nothing returns nothing
if(Qc())then
set qr=(qr+1)
set di[(1+GetPlayerId(GetEnumPlayer()))]=true
call ForceAddPlayer(Ba,GetEnumPlayer())
call ForceAddPlayer(wo[Fi[(1+GetPlayerId(GetEnumPlayer()))]],GetEnumPlayer())
set Zi[Fi[(1+GetPlayerId(GetEnumPlayer()))]]=(Zi[Fi[(1+GetPlayerId(GetEnumPlayer()))]]+1)
set Mi=GetRandomInt(0,7)
set ui[(1+GetPlayerId(GetEnumPlayer()))]=GetRandomInt(0,Yr)
endif
endfunction
function Sc takes nothing returns boolean
return(GetPlayerController(Player(-1+(bj_forLoopAIndex)))==MAP_CONTROL_COMPUTER)
endfunction
function tc takes nothing returns nothing
call InitGameCacheBJ("cf.w3v")
set gx=bj_lastCreatedGameCache
call InitGameCacheBJ("cf2.w3v")
set vr=bj_lastCreatedGameCache
call CinematicFadeBJ(1,.0,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",.0,0,0,6.)
set Px=GetRectCenter(bj_mapInitialPlayableArea)
set sx=GetRectCenter(bj_mapInitialPlayableArea)
set aa=GetRectCenter(bj_mapInitialPlayableArea)
set Oo=GetRectMinX(bj_mapInitialPlayableArea)
set fr=GetRectMaxX(bj_mapInitialPlayableArea)
set Xo=GetRectMinY(bj_mapInitialPlayableArea)
set Fr=GetRectMaxY(bj_mapInitialPlayableArea)
set pi="|cffFFFF00"
set Di[0]='Vstp'
set Di[1]='Adrt'
set Di[2]='Adrg'
set Di[3]='Agrs'
set Di[4]='Agrd'
set Di[5]='Alvd'
set Di[6]='Zdtr'
set Di[7]='Avin'
set Vi[0]='ATtr'
set Vi[1]='ATtc'
set Ni[0]='B002'
set Ni[1]='B003'
set Ni[2]='B004'
set Ni[3]='B005'
set Ni[4]='B006'
set No[0]="|cffff0303"
set No[1]="|cff20c000"
set Ji[0]="|cffff0303Western Forces|r"
set Ji[1]="|cff20c000Eastern Forces|r"
set Fo[1]="|cffff0303"
set Fo[2]="|cff0042ff"
set Fo[3]="|cff1ce69b"
set Fo[4]="|cff540081"
set Fo[5]="|cfffffc01"
set Fo[6]="|cfffe8a0e"
set Fo[7]="|cff20c000"
set Fo[8]="|cffe55bb0"
set Fo[9]="|cff959697"
set Fo[10]="|cff7ebff1"
set Fo[11]="|cff106246"
set Fo[12]="|cff4e2a04"
set mo[0]=.0
set mo[1]=1.
set mo[2]=1.85
set mo[3]=2.57
set mo[4]=3.18
set mo[5]=3.7
set mo[6]=4.14
set mo[7]=4.52
set mo[8]=4.84
set mo[9]=5.11
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set Lr[bj_forLoopAIndex]=(Fo[bj_forLoopAIndex]+(GetPlayerName(Player(-1+(bj_forLoopAIndex)))+"|r"))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call TriggerExecute(Xn)
set sr[0]='u002'
set sr[1]='n00D'
set sr[2]='u00A'
set sr[3]='n00C'
set sr[4]='u00B'
set sr[5]='n01L'
set sr[6]='u003'
set sr[7]='n01M'
set Yr=9
set ti[0]='h00C'
set Go[0]="Human"
set ti[1]='h00E'
set Go[1]="Naga"
set ti[2]='h00O'
set Go[2]="Chaos"
set ti[3]='h00P'
set Go[3]="Elven Union"
set ti[4]='h018'
set Go[4]="Undead"
set ti[5]='h019'
set Go[5]="Orc"
set ti[6]='h017'
set Go[6]="Northern"
set ti[7]='u006'
set Go[7]="Corrupted"
set ti[8]='h089'
set Go[8]="Night Elf"
set ti[9]='h06P'
set Go[9]="Mechanical"
set xr[0]=GetUnitLoc(fE)
set xr[1]=GetUnitLoc(FE)
set Ui[1]="first"
set Ui[2]="second"
set Ui[3]="third"
set Ui[4]="fourth"
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerFlagBJ(PLAYER_STATE_GIVES_BOUNTY,true,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call FogEnableOff()
call FogMaskEnableOff()
call SetTimeOfDay(12)
call SetMapFlag(MAP_LOCK_RESOURCE_TRADING,true)
set Yx[0]=GetRectCenter(Ha)
set Yx[1]=GetRectCenter(ja)
set ux[0]=ja
set ux[1]=Ha
set Mx[0]=Ga
set Mx[1]=ha
set qx[0]=ha
set qx[1]=Ga
set qr=0
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set Fi[bj_forLoopAIndex]=0
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=7
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set Fi[bj_forLoopAIndex]=1
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call ForForce(bj_FORCE_ALL_PLAYERS,function sc)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Sc())then
set Uo=true
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call DestroyTimer(si)
set si=CreateTimer()
call StartTimerBJ(si,false,99999)
call CreateQuestBJ(0,"Game Modes","TRIGSTR_5255","ReplaceableTextures\\CommandButtons\\BTNPickUpItem.blp")
call CreateQuestBJ(0,"Modifications","TRIGSTR_5257","ReplaceableTextures\\CommandButtons\\BTNSpy.blp")
call CreateQuestBJ(0,"Other Commands","TRIGSTR_5259","ReplaceableTextures\\CommandButtons\\BTNAuraOfDarkness.blp")
call CreateQuestBJ(2,"First Match?","TRIGSTR_5261","ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp")
call CreateQuestBJ(2,"Basic Hints","TRIGSTR_5263","ReplaceableTextures\\CommandButtons\\BTNSelectHeroOff.blp")
call CreateQuestBJ(2,"About","TRIGSTR_5265","ReplaceableTextures\\CommandButtons\\BTNTomeOfRetraining.blp")
endfunction
function Tc takes nothing returns nothing
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=11
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call DisplayTimedTextToPlayer(Player(bj_forLoopAIndex),0,0,30.,(("Welcome to |cffFFFF80Castle Fight|r! |cffFF0000"+GetPlayerName(Player(0))+"|r has now 20 seconds to choose game modes. If you are new to this map, you can find some useful hints in the |cff80FF00Manual|r (|cffFFBA17F9|r).")))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call DisplayTimedTextToPlayer(Player(0),0,0,30.,"Welcome to |cffFFFF80Castle Fight|r! You have 20 seconds to enter gamemodes. If you don't enter a valid command, you will be able to choose gamemodes via dialogues. If you don't know how to enter gamemodes read the |cff80FF00Manual|r (|cffFFBA17F9|r).")
if Uo then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,90.,"|cffFF0000WARNING: You are playing with computer slots. These will show buggy behavior. If you want to play with bots, leave their slots closed and use the ingame commands -fill -east -west and -balance to add bots. Read the manual to find out how these commands work.")
endif
endfunction
function uc takes integer Uc,string wc returns nothing
local integer nI
if Ri or(wc!="siege" and Ea)then
set nI=1
loop
exitwhen nI>12
call SetPlayerUnitAvailableBJ(Uc,false,Player(-1+(nI)))
set nI=nI+1
endloop
endif
endfunction
function Wc takes integer Uc,integer yc,integer Yc,integer zc,integer Zc,integer vC,integer eC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
set Fx[xC]=yc
set ro[xC]=Dx
set lx[xC]=Yc
set qe[xC]=0
set xo[xC]=zc
set vo[xC]=Zc
set ki[xC]=vC
set ca[xC]=0
set Tx[xC]=0
set gi[xC]=0
set ho[xC]=eC
if(NI(Uc))then
set ue[vC*30+Te[vC]]=Uc
set Ue[xC]=Te[vC]
set Te[vC]=Te[vC]+1
endif
endfunction
function oC takes integer Uc,integer yc,integer Yc,integer zc,integer Zc,integer vC,integer eC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
set Fx[xC]=yc
set ro[xC]=ea
set lx[xC]=Yc
set qe[xC]=0
set ca[xC]=0
set xo[xC]=zc
set vo[xC]=Zc
set ki[xC]=vC
set Tx[xC]=0
set gi[xC]=1
set ho[xC]=eC
if(RI(Uc))then
set ue[vC*30+Te[vC]]=Uc
set Ue[xC]=Te[vC]
set Te[vC]=Te[vC]+1
endif
call uc(Uc,"siege")
endfunction
function rC takes integer Uc,integer yc,real iC,integer aC,integer vC,integer nC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
set Fx[xC]=yc
set ro[xC]=iC
set lx[xC]='h023'
set qe[xC]=aC
set ki[xC]=vC
set Tx[xC]=nC
set vo[xC]=6
set ca[xC]=0
set gi[xC]=2
if(RI(Uc))then
set ue[vC*30+Te[vC]]=Uc
set Ue[xC]=Te[vC]
set Te[vC]=Te[vC]+1
endif
call uc(Uc,"special")
endfunction
function VC takes integer Uc,integer yc,integer vC,integer nC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
set Fx[xC]=yc
set ro[xC]=To
set lx[xC]='h023'
set qe[xC]=1
set ki[xC]=vC
set ca[xC]=0
set Tx[xC]=nC
set vo[xC]=6
set gi[xC]=3
if(RI(Uc))then
set ue[vC*30+Te[vC]]=Uc
set Ue[xC]=Te[vC]
set Te[vC]=Te[vC]+1
endif
call uc(Uc,"special")
endfunction
function EC takes integer Uc,integer yc,integer Yc,integer XC,integer OC,integer zc,integer Zc,integer vC,integer eC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
call Wc(Uc,yc,Yc,zc,Zc,vC,eC)
set qe[xC]=3
set ca[xC]=XC
set Qe[xC]=OC
endfunction
function RC takes integer Uc,integer yc,integer Yc,integer XC,integer OC,integer zc,integer Zc,integer vC,integer eC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
call oC(Uc,yc,Yc,zc,Zc,vC,eC)
set qe[xC]=3
set ca[xC]=XC
set Qe[xC]=OC
endfunction
function IC takes integer Uc,integer yc,real iC,integer XC,integer OC,integer vC,integer nC returns nothing
local integer xC
set xC=GetUnitPointValueByType(Uc)
call rC(Uc,yc,iC,3,vC,nC)
set ca[xC]=XC
set Qe[xC]=OC
call uc(Uc,"special")
endfunction
function AC takes nothing returns nothing
local integer vC=0
local integer i
local integer NC=0
local integer bC=1
local integer BC=2
local integer cC=3
local integer CC=4
local integer Attack_AntiAir=5
local integer dC=0
local integer DC=1
local integer fC=2
local integer FC=3
local integer gC=4
local integer GC=2
local integer hC=1
set Dx=.2
set ea=.18
set To=.08
set oa=.12
set rr=.09
set i=0
loop
exitwhen i>Yr
set Te[i]=0
set i=i+1
endloop
call rC('h008',330,rr,2,vC,400)
set vC=0
call Wc('h037',280,'h03B',dC,CC,vC,2)
call EC('h038',245,'h03C',280,'h037',dC,CC,vC,2)
call Wc('h015',250,'h016',DC,NC,vC,3)
call Wc('h00K',300,'n005',FC,CC,vC,3)
call oC('h004',210,'hmtm',fC,cC,vC,2)
call Wc('h003',140,'hrif',DC,BC,vC,3)
call EC('h0A1',160,'h05C',140,'h003',DC,BC,vC,1)
call EC('h05D',180,'h0A2',140,'h003',DC,BC,vC,2)
call Wc('h000','d','hfoo',dC,bC,vC,2)
call EC('h039',175,'h03A','d','h000',dC,bC,vC,2)
call VC('h006',150,vC,300)
call rC('h05G',700,oa,GC,vC,1800)
call rC('h010',225,oa,hC,vC,750)
call rC('h001',200,rr,GC,vC,360)
set vC=1
call Wc('h01Z',350,'n00S',FC,CC,vC,3)
call Wc('h00J',175,'n004',DC,bC,vC,3)
call EC('h05F',725,'n01P',175,'h00J',DC,CC,vC,3)
call oC('h01B',280,'n007',dC,cC,vC,3)
call Wc('h00H','x','n003',FC,bC,vC,2)
call EC('h020',130,'n00I','x','h00H',FC,bC,vC,2)
call EC('h021',150,'n00J',250,'h020',FC,bC,vC,2)
call EC('h022',200,'n00K',400,'h021',FC,bC,vC,2)
call Wc('h01Y',230,'n00H',fC,NC,vC,3)
call Wc('h00F',250,'n002',dC,BC,vC,2)
call EC('h032',200,'n00X',250,'h00F',dC,BC,vC,2)
call rC('h00N',750,rr,GC,vC,1500)
call rC('h00M',310,oa,GC,vC,625)
call rC('h00I',360,oa,GC,vC,600)
call rC('h00G',250,oa,hC,vC,480)
set vC=2
call Wc('h025',280,'n00L',FC,CC,vC,2)
call Wc('h01I','x','n00A',fC,bC,vC,3)
call EC('h026',230,'z000','x','h01I',fC,bC,vC,3)
call Wc('h01C',230,'n008',fC,NC,vC,3)
call Wc('h01D',160,'n009',DC,bC,vC,2)
call EC('h03G',190,'n00Z',160,'h01D',DC,bC,vC,2)
call Wc('h009',350,'n001',dC,CC,vC,3)
call Wc('h007',500,'n000',dC,CC,vC,3)
call rC('h05I',200,rr,GC,vC,330)
call rC('h01M',350,rr,GC,vC,1000)
call IC('h01W',175,rr,350,'h01M',vC,350)
call IC('h01X',175,rr,525,'h01W',vC,350)
call rC('h01F',340,rr,GC,vC,660)
call rC('h01E',850,oa,GC,vC,1800)
set vC=3
call Wc('h09X',360,'h07B',FC,NC,vC,3)
call EC('h00X',440,'h00W',360,'h09X',FC,CC,vC,3)
call Wc('h00V',275,'h00U',DC,NC,vC,3)
call Wc('h00T',220,'n006',dC,bC,vC,2)
call EC('h03F',230,'n00Y',220,'h00T',dC,bC,vC,2)
call Wc('h08X',180,'n022',FC,BC,vC,3)
call EC('h08Y',200,'n023',180,'h08X',FC,BC,vC,3)
call oC('h070',350,'e005',DC,cC,vC,2)
call Wc('h06Y',310,'n01Y',dC,BC,vC,3)
call VC('h014',250,vC,300)
call rC('h059',650,oa,GC,vC,1800)
call rC('h00Z',240,oa,GC,vC,420)
call rC('h005',235,oa,GC,vC,450)
set vC=4
call Wc('h01K',210,'u005',FC,NC,vC,3)
call EC('h04B',170,'u009',210,'h01K',FC,NC,vC,3)
call EC('h055',370,'u00D',380,'h04B',FC,NC,vC,3)
call oC('h01T',370,'n00E',DC,cC,vC,2)
call Wc('h01N',230,'h01U',dC,BC,vC,2)
call EC('h054',245,'h05H',230,'h01N',dC,BC,vC,2)
call Wc('h01L',290,'u001',gC,NC,vC,3)
call Wc('h01S',500,'u000',fC,bC,vC,3)
call Wc('h01R','x','n00B',DC,CC,vC,2)
call EC('h04Z','d','n01K','x','h01R',DC,CC,vC,2)
call EC('h03M',205,'u007',220,'h04Z',DC,CC,vC,2)
call VC('h01O',200,vC,300)
call rC('h01Q',650,rr,GC,vC,1500)
call rC('h01P',160,oa,GC,vC,0)
call IC('h056',140,oa,160,'h01P',vC,0)
call rC('h00A',360,rr,GC,vC,575)
set vC=5
call Wc('h02P',220,'o009',FC,BC,vC,3)
call Wc('h02K',260,'o007',fC,BC,vC,2)
call EC('h092',60,'o00B',260,'h02K',fC,BC,vC,3)
call EC('h035',140,'o008',260,'h02K',fC,BC,vC,3)
call EC('h036',140,'o006',260,'h02K',fC,BC,vC,3)
call Wc('h029','n','o002',dC,bC,vC,2)
call EC('h02U','d','o004','n','h029',dC,bC,vC,2)
call EC('h031',240,'o005',210,'h02U',dC,bC,vC,2)
call Wc('h02B',170,'o003',FC,NC,vC,3)
call oC('h02I',380,'o001',DC,cC,vC,2)
call Wc('h02H',200,'n00V',DC,bC,vC,3)
call EC('h05E',80,'n01O',200,'h02H',DC,bC,vC,3)
call VC('o000',175,vC,300)
call rC('h02R',250,oa,GC,vC,540)
call rC('h02O',475,oa,GC,vC,1350)
call rC('h02N',350,rr,GC,vC,750)
set vC=6
call Wc('h049','s','n017',FC,bC,vC,2)
call EC('h04F','}','n018','s','h049',FC,bC,vC,2)
call EC('h03W',280,'n016',240,'h04F',FC,bC,vC,2)
call Wc('h03T',275,'n012',DC,BC,vC,2)
call EC('h043',225,'n013',275,'h03T',DC,BC,vC,2)
call Wc('h03S',400,'n014',FC,CC,vC,3)
call Wc('h03K',175,'n015',fC,NC,vC,3)
call EC('h03J',150,'o00A',175,'h03K',fC,NC,vC,3)
call Wc('h03U',160,'n011',dC,BC,vC,3)
call Wc('h03I',280,'n010',dC,CC,vC,3)
call VC('h03Q',230,vC,300)
call rC('h047',190,oa,GC,vC,350)
call rC('h048',210,rr,GC,vC,475)
call IC('h03L',290,rr,210,'h048',vC,575)
call rC('h03O',600,rr,GC,vC,1350)
set vC=7
call Wc('h04V','}','n01I',dC,bC,vC,2)
call EC('h04W','}','n01H','}','h04V',dC,bC,vC,2)
call EC('h09Y',500,'n027',250,'h04W',dC,bC,vC,2)
call Wc('h04U',520,'h04I',DC,CC,vC,3)
call Wc('h04S',240,'n01G',DC,BC,vC,2)
call oC('h04Q',300,'n01F',dC,cC,vC,2)
call RC('h04P',150,'n01E',300,'h04Q',dC,cC,vC,2)
call Wc('h04O',235,'n01D',DC,NC,vC,3)
call EC('h04M',165,'n01B',235,'h04O',DC,NC,vC,3)
call Wc('h04L',190,'n019',fC,NC,vC,3)
call EC('h04N',190,'n01A',190,'h04L',fC,NC,vC,3)
call VC('n01J',200,vC,300)
call rC('h04T',500,oa,GC,vC,1350)
call rC('h04R',260,rr,GC,vC,420)
call rC('h04K',275,rr,GC,vC,420)
set vC=8
call Wc('h088',190,'e007',FC,CC,vC,3)
call EC('h07D',260,'e00J',190,'h088',FC,CC,vC,3)
call Wc('h07M',200,'n01Z',DC,BC,vC,2)
call EC('h07L',175,'n020',200,'h07M',DC,BC,vC,2)
call Wc('h07O',230,'e00B',fC,NC,vC,2)
call EC('h07N',240,'e00A',230,'h07O',fC,NC,vC,2)
call oC('h011',285,'e002',dC,cC,vC,2)
call Wc('h00S',150,'e001',fC,BC,vC,3)
call EC('h03D',200,'e003',150,'h00S',fC,BC,vC,3)
call EC('h03E',400,'e004',350,'h03D',fC,BC,vC,3)
call Wc('h00B',260,'e000',fC,NC,vC,3)
call VC('h073',210,vC,300)
call rC('h07H',220,oa,GC,vC,300)
call rC('h08P',225,oa,GC,vC,600)
call rC('h07I',650,rr,GC,vC,1350)
set vC=9
call Wc('h05T',220,'z002',fC,CC,vC,2)
call EC('h09P',140,'z003',220,'h05T',fC,CC,vC,2)
call Wc('h05U',375,'n01T',DC,BC,vC,2)
call Wc('h05M',200,'n01V',FC,CC,vC,2)
call Wc('h05J',160,'h06Q',fC,BC,vC,1)
call EC('h09L',180,'h06R',160,'h05J',fC,BC,vC,1)
call Wc('h05V',270,'n01X',DC,CC,vC,2)
call EC('h097',500,'n024',270,'h05V',gC,CC,vC,2)
call Wc('h05X',180,'h06T',dC,bC,vC,2)
call EC('h09J',150,'h06U',180,'h05X',dC,bC,vC,2)
call EC('h09I',200,'h099',180,'h05X',dC,CC,vC,2)
call EC('h09B',250,'h06S',180,'h05X',dC,bC,vC,2)
call EC('h09H','d','h098',430,'h09B',dC,bC,vC,2)
call VC('h05L',240,vC,300)
call rC('h09T',340,oa,GC,vC,1050)
call rC('h069',250,oa,GC,vC,480)
call rC('h06J',190,oa,GC,vC,270)
call IC('h05R',140,oa,190,'h06J',vC,130)
set ei[14]=180
set ei[26]=800
set ei[70]=600
set ei[75]=750
set ei[88]=850
set ei['t']=900
set ei['y']=675
set ei[134]=500
set ei[138]=800
set ei[141]=700
set ei[150]=950
set V[('h05G')]=true
set V[('h05F')]=true
set V[('h00N')]=true
set V[('h01M')]=true
set V[('h01W')]=true
set V[('h01X')]=true
set V[('h01E')]=true
set V[('h00X')]=true
set V[('h059')]=true
set V[('h055')]=true
set V[('h01Q')]=true
set V[('h02O')]=true
set V[('h03O')]=true
set V[('h09Y')]=true
set V[('h04T')]=true
set V[('h03E')]=true
set V[('h07I')]=true
set V[('h097')]=true
set lx[GetUnitPointValueByType('h069')]='n01U'
set gi[GetUnitPointValueByType('h056')]=0
set xo[GetUnitPointValueByType('h056')]=2
set vo[GetUnitPointValueByType('h056')]=7
set ho[GetUnitPointValueByType('h056')]=2
set gi[GetUnitPointValueByType('h01P')]=0
set xo[GetUnitPointValueByType('h01P')]=2
set vo[GetUnitPointValueByType('h01P')]=7
set ho[GetUnitPointValueByType('h01P')]=2
endfunction
function HC takes nothing returns nothing
set Vo=ER(Za)
set co[1]=2
set co[7]=3
set Xa[0]=2
set Xa[1]=3
call CreateMultiboardBJ(6,4,"Stats")
set ar=bj_lastCreatedMultiboard
call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,0,0,true,false)
call MultiboardSetItemStyleBJ(bj_lastCreatedMultiboard,0,0,true,false)
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,0,0,"0")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,0,4,"")
call MultiboardSetItemColorBJ(bj_lastCreatedMultiboard,6,0,'d',90.,.0,0)
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,1,1,"")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,2,1,"Resc.")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,3,1,"Coins")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,4,1,"Destr.")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,5,1,"Income")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,6,1,"|cffFFFF80Wins|r")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,1,2,"|cffFF0000West|r")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,1,3,"|cff00FF00East|r")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,1,4,"|cffFFFF00Round Time:|r")
call MultiboardSetItemValueBJ(bj_lastCreatedMultiboard,6,4,"|cffFFFF000|cffFF8000:|cffFFFF0000|r")
call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,0,4,2.)
call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,1,4,7.)
call MultiboardSetItemWidthBJ(bj_lastCreatedMultiboard,6,4,3)
call MultiboardDisplay(bj_lastCreatedMultiboard,true)
call AddWeatherEffectSaveLast(bj_mapInitialPlayableArea,'SNhs')
set kx=bj_lastCreatedWeatherEffect
call TriggerSleepAction(1.)
call EnableWeatherEffect(kx,false)
endfunction
function jC takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function JC takes nothing returns nothing
call RemoveItem(GetEnumItem())
endfunction
function kC takes nothing returns nothing
if IsDestructableDeadBJ(GetEnumDestructable())then
call DestructableRestoreLife(GetEnumDestructable(),GetDestructableMaxLife(GetEnumDestructable()),true)
endif
endfunction
function KC takes nothing returns nothing
set zi[Fi[(1+GetPlayerId(GetEnumPlayer()))]]=(zi[Fi[(1+GetPlayerId(GetEnumPlayer()))]]+1)
endfunction
function lC takes nothing returns nothing
if not se[(1+GetPlayerId(GetEnumPlayer()))]then
call zI(GetEnumPlayer(),'h033')
else
call rA(GetEnumPlayer())
endif
endfunction
function LC takes nothing returns nothing
call rA(GetEnumPlayer())
endfunction
function mC takes nothing returns nothing
call xA(CreateUnit(GetEnumPlayer(),ti[ui[(1+GetPlayerId(GetEnumPlayer()))]],GetPlayerStartLocationX(GetEnumPlayer()),GetPlayerStartLocationY(GetEnumPlayer()),270))
endfunction
function MC takes nothing returns nothing
call ShowUnit(GetEnumUnit(),true)
call SelectUnitForPlayerSingle(GetEnumUnit(),GetOwningPlayer(GetEnumUnit()))
endfunction
function pC takes nothing returns nothing
local force PC=CreateForce()
local unit qC
call TimerDialogDisplay(Tr,false)
call DestroyTimerDialog(Tr)
set Tr=null
loop
set qC=FirstOfGroup(Do[0])
exitwhen qC==null
call ForceAddPlayer(PC,GetOwningPlayer(qC))
call GroupRemoveUnit(Do[0],qC)
call RemoveUnit(qC)
endloop
loop
set qC=FirstOfGroup(Do[1])
exitwhen qC==null
call ForceAddPlayer(PC,GetOwningPlayer(qC))
call GroupRemoveUnit(Do[1],qC)
call RemoveUnit(qC)
endloop
call ForForce(PC,function LC)
call DestroyForce(PC)
set PC=null
endfunction
function QC takes nothing returns nothing
local group g
local integer i
local player p1
local player p2
call DisableTrigger(nE)
call GA()
call DisableTrigger(OV)
call DisableTrigger(XV)
set cr[0]=0
set cr[1]=0
call ForGroupBJ(tx,function jC)
call GroupClear(Lo)
call GroupClear(da)
set i=0
loop
exitwhen i>1
set lo[i]=0
set i=i+1
endloop
call FlushGameCache(vr)
set vr=InitGameCache("cf2.w3v")
set g=ER(GetWorldBounds())
call ForGroup(g,function nc)
call DestroyGroup(g)
set g=ER(GetWorldBounds())
call ForGroup(g,function nc)
call DestroyGroup(g)
set g=null
call ForGroup(Ki,function jC)
set i=0
loop
exitwhen i>1
call IA(xO[(i)])
call IA(rO[(i)])
call IA(iO[(i)])
call IA(oO[(i)])
set i=i+1
endloop
call EnumItemsInRectBJ(GetWorldBounds(),function JC)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,9.5,("Get ready for round |cffFFCC00"+(I2S(Mr)+"|r!")))
call TriggerSleepAction(5.)
set Bi=true
call CinematicFadeBJ(0,4.,"ReplaceableTextures\\CameraMasks\\Black_mask.blp",0,0,0,6.)
call EnumDestructablesInRectAll(bj_mapInitialPlayableArea,function kC)
call DA(Mr)
if ii==1 then
call VI()
elseif ii==2 then
call XI(xi)
set ii=0
elseif ii==3 then
call iI(zo[0],0)
call iI(zo[1],1)
set zo[0]=0
set zo[1]=0
set ii=0
endif
set ba=.0
set Aa=0
call ForceClear(Xi)
call GroupClear(va)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
set i=1
loop
exitwhen i>12
set Pr[i]=false
set yx[i]=.5
set Kx[i]=0
set Kx[i]=0
set Jx[i]=-2
set so[i]=0
set Si[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen i>1
set ri[i]=-1
set wx[i]=0
set Gi[i]=0
set zi[i]=0
call MultiboardSetItemValueBJ(ar,3,Xa[i],"0")
call MultiboardSetItemValueBJ(ar,4,Xa[i],"0")
set i=i+1
endloop
if not fo then
call ForForce(Ba,function KC)
endif
call MultiboardSetItemValueBJ(ar,2,Xa[0],I2S(zi[0]))
call MultiboardSetItemValueBJ(ar,2,Xa[1],I2S(zi[1]))
if mi then
call Cc()
endif
set i=1
loop
exitwhen i>12
if Cx then
call SetPlayerStateBJ(Player(-1+(i)),PLAYER_STATE_RESOURCE_GOLD,'d')
else
call SetPlayerStateBJ(Player(-1+(i)),PLAYER_STATE_RESOURCE_GOLD,250)
endif
call SetPlayerStateBJ(Player(-1+(i)),PLAYER_STATE_RESOURCE_LUMBER,'}')
if px then
call SetPlayerStateBJ(Player(-1+(i)),PLAYER_STATE_RESOURCE_FOOD_CAP,0)
else
call SetPlayerStateBJ(Player(-1+(i)),PLAYER_STATE_RESOURCE_FOOD_CAP,1)
endif
set i=i+1
endloop
call YI()
set qi=GetRandomInt(0,1)
if Mr>1 and Yi==false then
call ForForce(Ba,function mC)
else
if li then
call Tb()
endif
if Ca==0 then
call ForForce(Ba,function LC)
elseif Ca==2 then
call ForceClear(Ro[0])
call ForceClear(Ro[1])
set i=1
loop
exitwhen i>12
if IsPlayerInForce(Player(i-1),Ba)then
call ForceAddPlayer(Ro[(i-1)/ 6],Player(i-1))
endif
set i=i+1
endloop
loop
set i=vA(Player(0))
set p1=ForcePickRandomPlayer(Ro[0])
set p2=ForcePickRandomPlayer(Ro[1])
if p1!=null then
call ForceRemovePlayer(Ro[0],p1)
call xA(CreateUnit(p1,ti[i],GetPlayerStartLocationX(p1),GetPlayerStartLocationY(p1),bj_UNIT_FACING))
endif
if p2!=null then
call ForceRemovePlayer(Ro[1],p2)
call xA(CreateUnit(p2,ti[i],GetPlayerStartLocationX(p2),GetPlayerStartLocationY(p2),bj_UNIT_FACING))
endif
exitwhen p1==null and p2==null
endloop
elseif Ca==1 then
call ForForce(Ba,function lC)
call TimerStart(jr,34,false,function pC)
set Tr=CreateTimerDialog(jr)
call TimerDialogSetTitle(Tr,"Pick Time:")
call TimerDialogDisplay(Tr,true)
elseif Ca==3 then
call vB()
endif
endif
set i=0
loop
exitwhen i>1
set g=ER(ux[i])
call ForGroup(g,function jC)
call DestroyGroup(g)
set g=null
set bj_lastCreatedUnit=CreateUnitAtLoc(Player(i*6),'hcas',xr[i],270)
set Rr[i]=bj_lastCreatedUnit
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
if fi then
call UnitAddAbility(bj_lastCreatedUnit,'Asid')
call AddItemToStock(bj_lastCreatedUnit,'I00B',10,10)
endif
if ji then
call UnitRemoveAbility(bj_lastCreatedUnit,'Aall')
call UnitRemoveAbility(bj_lastCreatedUnit,'Apit')
endif
set i=i+1
endloop
call EnableTrigger(mn)
call TriggerSleepAction(4.)
set hx=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("Round |cffFFCC00"+(I2S(Mr)+"|r started! gl & hf!")))
if jx>0 then
set gE=true
call FogEnable(true)
call TimerStart(gr,I2R(jx),false,null)
elseif jx==-1 then
set gE=true
call FogEnable(true)
endif
if Ar then
call EnableTrigger(hn)
call EnableTrigger(Hn)
call EnableTrigger(gn)
call EnableTrigger(Gn)
set jo[0]=1.
set jo[1]=1.
set qo[0]=false
set qo[1]=false
if io!=0 then
set Va[0]=CreateUnit(Player(15),'n026',GetRectCenterX(xn),GetRectCenterY(xn),bj_UNIT_FACING)
endif
if io!=1 then
set Va[1]=CreateUnit(Player(15),'n026',GetRectCenterX(on),GetRectCenterY(on),bj_UNIT_FACING)
endif
endif
call ForGroupBJ(Hx,function MC)
if uo>0 then
call EnableTrigger(BV)
endif
call EnableTrigger(fV)
call EnableTrigger(xE)
call EnableTrigger(ln)
call EnableTrigger(Ln)
call StartTimerBJ(ko,true,Mo)
call StartTimerBJ(Na,true,Mo*4)
call StartTimerBJ(Qr,false,99999.)
call StartTimerBJ(lr,true,1.)
call TriggerSleepAction(3.)
call ac()
call xc(true)
call TriggerSleepAction(3.)
call SetUnitInvulnerable(Rr[0],false)
call SetUnitInvulnerable(Rr[1],false)
endfunction
function sC takes nothing returns nothing
if Wx==1 then
if Ca==0 then
set fx=(Lr[1]+" has chosen single round/random race. You will get a random race! The first round determines the winner!")
set Gx="Single Round Random"
elseif Ca==2 then
set fx=(Lr[1]+" has chosen single round/mirror mode. Both teams will get the same random races! The first round determines the winner!")
set Gx="Single Round Random"
elseif Ca==1 then
set fx=(Lr[1]+" has chosen single round/pick race. You may pick your race! The first round determines the winner!")
set Gx="Single Round Pick"
elseif Ca==3 then
set fx=(Lr[1]+" has chosen single round/draft race. Races will be drafted! The first round determines the winner!")
set Gx="Single Round Draft"
endif
else
if Ca==0 then
if Yi then
set fx=(Lr[1]+(" has chosen |cffFFFF00random|r race |cffFFFF00each round|r. You will get a new random race each round! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Random each round, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
else
set fx=(Lr[1]+(" has chosen |cffFFFF00random|r race. You will get a random race at the beginning that you keep for the |cffFFFF00whole game|r! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Random once, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
endif
elseif Ca==2 then
if Yi then
set fx=(Lr[1]+(" has chosen  |cffFFFF00mirror mode each round|r. Both teams will get the same random races each round! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Mirror each round, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
else
set fx=(Lr[1]+(" has chosen |cffFFFF00mirror mode|r. Both teams will get the same random races at the beginning that they will keep for the |cffFFFF00whole game|r! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Mirror once, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
endif
elseif Ca==1 then
if Yi then
set fx=(Lr[1]+(" has chosen |cffFFFF00pick|r race |cffFFFF00each round|r. You may pick a new race each round! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Pick each round, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
else
set fx=(Lr[1]+(" has chosen |cffFFFF00pick|r race. You may pick a race at the beginning that you keep for the |cffFFFF00whole game|r! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Pick once, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
endif
elseif Ca==3 then
if Yi then
set fx=(Lr[1]+(" has chosen |cffFFFF00draft|r race |cffFFFF00each round|r. You will draft a new race each round! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Draft each round, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
else
set fx=(Lr[1]+(" has chosen |cffFFFF00draft|r race. You will draft a race at the beginning that you keep for the |cffFFFF00whole game|r! Number of wins for overall victory: |cffFFFF00"+(I2S(Wx)+"|r")))
set Gx=("Draft once, |cffFFCC00"+(I2S(Wx)+"|cffFFFF80 wins"))
endif
endif
set fx=(fx+"
|cffFF0000(Please don't leave after the first round!)|r")
endif
set Gx=("|cffFFFF80"+(Gx+"|r"))
set Ux=true
call MultiboardSetTitleText(ar,Gx)
if not go then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,fx)
endif
endfunction
function SC takes string c returns boolean
if(c=="r")or(c=="g")then
return true
else
return false
endif
endfunction
function tC takes string c returns boolean
if(c=="r")then
return true
else
return false
endif
endfunction
function TC takes string s returns boolean
local string s1
local string s2
if(s=="")or(s==" ")then
set Wx=1
set Yi=true
return true
endif
set s1=SubStringBJ(s,1,1)
set s2=SubStringBJ(s,2,2)
if(SC(s1))and(KA(s2))then
set Wx=S2I(s2)
set Yi=tC(s1)
else
return false
endif
return true
endfunction
function DisplayBotNum takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Number of bots to be added: "+Ji[0]+": "+pi+I2S(zo[0])+"|r, "+Ji[1]+": "+pi+I2S(zo[1])+"|r")
endfunction
function uC takes nothing returns nothing
if ii!=1 then
set ii=1
call EnableTrigger(IE)
call DisableTrigger(Jn)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has enabled auto team balance! Teams will get balanced before each round by adding bots."))
else
call DisplayTextToPlayer(Player(0),0,0,"|cffFF0000Auto Team Balance is already on!|r")
endif
endfunction
function UC takes nothing returns nothing
if ii!=0 then
set ii=0
call EnableTrigger(Jn)
call DisableTrigger(IE)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has disabled auto team balance!"))
endif
endfunction
function wC takes string fb returns nothing
if not lA(fb)then
return
endif
set Pi=S2I(fb)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Lumber Limit|r has been set to |cffFFFF00"+fb+"|r.")
endfunction
function WC takes string fb returns nothing
local integer OI
if not lA(fb)then
return
endif
set OI=S2I(fb)
if OI<2 then
set OI=2
elseif OI>'x' then
set OI='x'
endif
set Mo=OI
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Income Timer|r has been set to |cffFFFF00"+I2S(OI)+"|r.")
endfunction
function yC takes string YC returns nothing
local integer zC
local string ZC
local real i=192
if bo then
return
endif
set bo=true
if YC=="u" or YC=="t" then
set zC=-1
elseif YC=="d" or YC=="b" then
set zC=1
elseif YC=="" then
set zC=(GetRandomInt(0,1)*2)-1
else
return
endif
if zC==1 then
set io=0
set ZC="bottom"
else
set io=1
set ZC="top"
endif
loop
exitwhen i>Fr
call CreateDestructable('YTfc',1472,i*zC,270,1,0)
call CreateDestructable('YTfc',-1472,i*zC,270,1,0)
set i=i+128
endloop
set i=-1520
loop
exitwhen i>1520
call SetTerrainPathable(i,272*zC,PATHING_TYPE_WALKABILITY,false)
call SetTerrainPathable(i,272*zC,PATHING_TYPE_FLYABILITY,false)
set i=i+32
endloop
call CreateDestructable(Ni[2],1472,640*zC,270,1.1,0)
call CreateDestructable(Ni[2],-1472,640*zC,270,1.1,0)
call CreateDestructable(Ni[2],1472,960*zC,270,1.1,0)
call CreateDestructable(Ni[2],-1472,960*zC,270,1.1,0)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Single Lane|r has been chosen. Units are only able to walk/fly over the |cffFFFF00"+ZC+" lane|r.")
endfunction
function vd takes string ed returns nothing
local integer xd
local integer i=1
if ed=="" then
set xd=-1
else
if not lA(ed)then
return
endif
set xd=S2I(ed)
if(xd<1)then
return
endif
endif
set jx=xd
if Jr[1]==null then
loop
exitwhen i>6
set Jr[i]=CreateFogModifierRectBJ(true,Player(i-1),FOG_OF_WAR_VISIBLE,ha)
set Jr[i+6]=CreateFogModifierRectBJ(true,Player(i-1+6),FOG_OF_WAR_VISIBLE,Ga)
call CreateFogModifierRectBJ(true,Player(i-1+6),FOG_OF_WAR_VISIBLE,Za)
call CreateFogModifierRectBJ(true,Player(i-1),FOG_OF_WAR_VISIBLE,Za)
set i=i+1
endloop
endif
if(xd==-1)then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Permanent |cffC6FF00Fog of War|r has been chosen")
else
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Fog of War|r time has been set to |cffFFFF00"+I2S(xd)+"|r seconds.")
endif
endfunction
function od takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Time is up and not all players have agreed. Extra rounds declined!")
call DisableTrigger(vE)
call DestroyForce(er)
endfunction
function rd takes string ad returns nothing
local integer nd
if not lA(ad)then
return
endif
set nd=S2I(ad)
if IsTriggerEnabled(vE)then
call DisplayTextToPlayer(Player(0),0,0,"You cannot start another vote yet")
return
endif
if nd<1 or nd>3 then
call DisplayTextToPlayer(Player(0),0,0,"Invalid number of rounds, must be between 1 and 3")
return
endif
set er=PA()
set oo=nd
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"|cffC6FF00"+I2S(nd)+" Extra Rounds|r vote has been started. You have 30 seconds to agree to it by typing |cffFFFF00-agree|r. If all players agree, the number of wins for overall victory will be increased by "+I2S(nd))
call ForceRemovePlayer(er,Player(0))
call EnableTrigger(vE)
call TimerStart(Li,30,false,function od)
call Sb()
endfunction
function Vd takes string Ed returns nothing
local integer OI
if li then
return
endif
if Ed=="" then
set Ed="1"
endif
if not lA(Ed)then
return
endif
set OI=S2I(Ed)
if OI<1 or OI>2 then
call DisplayTextToPlayer(Player(0),0,0,"|cffFF0000Number of bans must be between 1 and 2|r")
return
endif
set li=true
set wi=OI
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Ban Race|r has been chosen. Number of bans per team: |cffFFFF00"+I2S(OI)+"|r")
endfunction
function Xd takes player Od,player Rd returns nothing
local integer i=(1+GetPlayerId(Rd))
set di[i]=true
call ForceAddPlayer(Ba,Rd)
call ForceAddPlayer(wo[Fi[i]],Rd)
set Zi[Fi[i]]=(Zi[Fi[i]]+1)
set ui[i]=GetRandomInt(0,Yr)
call SetPlayerAllianceStateBJ(Rd,Od,5)
call SetPlayerAllianceStateBJ(Od,Rd,5)
call jA(Rd,GetPlayerName(Od))
set zr[i-1]=true
call ForceAddPlayer(dr[GetPlayerId(Od)],Rd)
endfunction
function Id takes player Od,integer Ad returns nothing
local integer yI=GetPlayerId(Od)/ 6
local integer i=yI*6
loop
exitwhen i>yI*6+5
if not IsPlayerInForce(Player(i),wo[yI])then
call Xd(Od,Player(i))
set Ad=Ad-1
endif
exitwhen Ad==0
set i=i+1
endloop
endfunction
function Nd takes string Ed returns nothing
local integer array j
local integer i=0
local integer bd
if not lA(Ed)then
return
endif
set bd=S2I(Ed)-1
if bd<1 or bd>5 then
call DisplayTextToPlayer(Player(0),0,0,"|cffFF0000Wrong number of players per player! Must be between 2 and 5!|r")
return
endif
if Uo then
call DisplayTextToPlayer(Player(0),0,0,"|cffFF0000Multi Race mode is not possible while playing with AI Slots, use -fillX, -eastX or -westX instead!|r")
return
endif
set j[0]=CountPlayersInForceBJ(wo[0])
set j[1]=CountPlayersInForceBJ(wo[1])
if j[0]*bd>5 or j[1]*bd>5 then
call DisplayTextToPlayer(Player(0),0,0,"|cffFF0000Too many players for Multi Race mode!|r")
return
endif
set Oi=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Multiple Players|r has been chosen. Number of additional players per human player: |cffFFFF00"+I2S(bd)+"|r")
loop
exitwhen i>11
if IsPlayerInForce(Player(i),wo[i/ 6])and not zr[i]then
call Id(Player(i),bd)
endif
set i=i+1
endloop
endfunction
function Bd takes string cd returns nothing
local string s=SubString(cd,1,3)
if(cd=="boons")then
call EnableTrigger(bV)
call DisplayTextToPlayer(Player(0),0,0,"You have turned the boon reminder ON! Players will receive a message every minute, reminding them if there is another round after the current.")
elseif(cd=="noboons")then
call DisableTrigger(bV)
call DisplayTextToPlayer(Player(0),0,0,"You have turned the boon reminder OFF!")
elseif(cd=="balance")and(not Ci)then
call uC()
elseif(cd=="nobalance")and(not Ci)then
call UC()
elseif SubString(cd,0,4)=="fill" then
set s=SubString(cd,4,5)
if(s=="")then
set ii=2
set xi=5
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has enabled team fill! Teams will get filled with bots at the next round's beginning."))
elseif KA(s)then
set xi=S2I(s)
if xi>5 then
set xi=5
endif
set ii=2
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has enabled fill teams up to "+s+" players! Teams will get filled with bots at the next round's beginning."))
endif
elseif SubString(cd,0,4)=="west" then
set s=SubString(cd,4,5)
if(s=="")then
set ii=3
set zo[0]=zo[0]+1
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has added one bot to the "+Ji[0]+". It will join at the next round's beginning."))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Number of bots to be added: "+Ji[0]+": "+pi+I2S(zo[0])+"|r, "+Ji[1]+": "+pi+I2S(zo[1])+"|r")
elseif KA(s)or s=="0" then
set zo[0]=S2I(s)
set ii=3
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has set the number of bots to be added to the "+Ji[0]+" to "+pi+s+"|r. Bots will join at the next round's beginning."))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Number of bots to be added: "+Ji[0]+": "+pi+I2S(zo[0])+"|r, "+Ji[1]+": "+pi+I2S(zo[1])+"|r")
endif
elseif SubString(cd,0,4)=="east" then
set s=SubString(cd,4,5)
if(s=="")then
set ii=3
set zo[1]=zo[1]+1
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has added one bot to the "+Ji[1]+". It will join at the next round's beginning."))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Number of bots to be added: "+Ji[0]+": "+pi+I2S(zo[0])+"|r, "+Ji[1]+": "+pi+I2S(zo[1])+"|r")
elseif KA(s)or s=="0" then
set zo[1]=S2I(s)
set ii=3
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[1]+" has set the number of bots to be added to the "+Ji[1]+" to "+pi+s+"|r. Bots will join at the next round's beginning."))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"Number of bots to be added: "+Ji[0]+": "+pi+I2S(zo[0])+"|r, "+Ji[1]+": "+pi+I2S(zo[1])+"|r")
endif
elseif SubString(cd,0,2)=="xr" then
call rd(SubString(cd,2,3))
elseif ir then
return
elseif SubString(cd,0,2)=="mp" then
call Nd(SubString(cd,2,3))
elseif(cd=="dom")then
call TriggerExecute(pV)
elseif(cd=="dr")then
call TriggerExecute(UV)
elseif(cd=="pause")then
call DisableTrigger(Bn)
call DisplayTimedTextToPlayer(Player(0),0,0,20,"|cffFF0000The game will not start after 20 seconds. Type -skip to start the game!|r")
elseif SubString(cd,0,1)=="m" then
if TC(s)then
set Ca=2
call TriggerExecute(In)
endif
elseif SubString(cd,0,1)=="p" then
if TC(s)then
set Ca=1
call TriggerExecute(In)
endif
elseif SubString(cd,0,1)=="r" then
if TC(s)then
set Ca=0
call TriggerExecute(In)
endif
elseif SubString(cd,0,1)=="d" then
if TC(s)then
set Ca=3
set oi=true
call TriggerExecute(In)
endif
elseif(cd=="sm")then
call TriggerExecute(ZV)
elseif(cd=="uo")then
call TriggerExecute(JV)
elseif(cd=="ns")then
call TriggerExecute(kV)
elseif(cd=="na")then
call TriggerExecute(KV)
elseif(cd=="ntb")then
call TriggerExecute(LV)
elseif(cd=="nb")then
call TriggerExecute(mV)
elseif(cd=="nt")then
call TriggerExecute(MV)
elseif(cd=="ht")then
call TriggerExecute(PV)
elseif(cd=="ni")then
call TriggerExecute(qV)
elseif(cd=="nai")then
call TriggerExecute(zV)
elseif(cd=="cc")then
call TriggerExecute(YV)
elseif(cd=="te")then
call TriggerExecute(sV)
elseif(cd=="ca")then
call TriggerExecute(lV)
elseif(cd=="co")then
call TriggerExecute(uV)
elseif(cd=="lm")then
call TriggerExecute(WV)
elseif(cd=="nafk")then
call TriggerExecute(yV)
elseif(cd=="nl")then
call TriggerExecute(QV)
elseif(cd=="nrs")then
call TriggerExecute(tV)
elseif(cd=="ur")then
call TriggerExecute(wV)
elseif(cd=="fi")then
call TriggerExecute(SV)
elseif(cd=="nuke")then
call TriggerExecute(TV)
elseif SubString(cd,0,2)=="ll" then
call wC(SubString(cd,2,8))
elseif SubString(cd,0,2)=="it" then
call WC(SubString(cd,2,5))
elseif SubString(cd,0,3)=="fow" then
call vd(SubString(cd,3,7))
elseif SubString(cd,0,2)=="sl" then
call yC(SubString(cd,2,3))
elseif SubString(cd,0,3)=="ban" then
call Vd(SubString(cd,3,4))
elseif(cd=="envlava")and(not Lx)then
call TriggerExecute(dE)
set Lx=true
elseif(cd=="envice")and(not Lx)then
call TriggerExecute(cE)
set Lx=true
elseif(cd=="skip")then
set ai=true
endif
endfunction
function Cd takes string dd,string Dd returns integer
local integer i=0
if(StringLength(dd)>=StringLength(Dd))then
loop
exitwhen i>(StringLength(dd)-StringLength(Dd))
if(SubString(dd,i,i+StringLength(Dd))==Dd)then
return i
endif
set i=i+1
endloop
endif
return-1
endfunction
function fd takes string Fd returns nothing
local string gd=Fd
local string Gd
local integer i
local integer j
loop
set i=Cd(gd,"-")
exitwhen i==-1
set gd=SubString(gd,i+1,StringLength(gd))
set i=Cd(gd,"-")
set j=Cd(gd," ")
if(i==-1)then
set i=1000
endif
if(j==-1)then
set j=1000
endif
if(i!=1000)or(j!=1000)then
set Gd=SubString(gd,0,IMinBJ(i,j))
set gd=SubString(gd,IMinBJ(i,j),StringLength(gd))
else
set Gd=gd
endif
if(Gd!="")then
call Bd(Gd)
endif
endloop
if ai and not ir then
call TriggerExecute(Bn)
endif
endfunction
function hd takes nothing returns nothing
call fd(GetEventPlayerChatString())
endfunction
function Hd takes nothing returns boolean
return GetUnitTypeId(GetSellingUnit())=='h033'
endfunction
function jd takes nothing returns nothing
local player p=GetOwningPlayer(GetSellingUnit())
local unit u
local integer i
call GroupRemoveUnit(Do[Fi[(1+GetPlayerId(GetOwningPlayer(GetSellingUnit())))]],GetSellingUnit())
call RemoveUnit(GetSellingUnit())
if not Bi then
call RemoveUnit(GetSoldUnit())
return
endif
if GetLocalPlayer()==p then
call TimerDialogDisplay(Tr,false)
endif
if GetUnitTypeId(GetSoldUnit())=='h03H' then
call RemoveUnit(GetSoldUnit())
set i=rA(p)
if Ca==3 then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,40,Lr[(1+GetPlayerId(p))]+" has randomed |cffFFFF00"+Go[i]+"|r")
endif
else
call SetUnitOwner(GetSoldUnit(),p,true)
call xA(GetSoldUnit())
if Ca==3 then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,40,Lr[(1+GetPlayerId(p))]+" has picked |cffFFFF00"+Go[GetUnitPointValue(GetSoldUnit())]+"|r")
endif
endif
endfunction
function Jd takes nothing returns boolean
return GetUnitTypeId(GetSellingUnit())=='h09W'
endfunction
function kd takes nothing returns nothing
local player p=GetOwningPlayer(GetSellingUnit())
local unit u
local integer i
call GroupRemoveUnit(Do[Fi[(1+GetPlayerId(GetOwningPlayer(GetSellingUnit())))]],GetSellingUnit())
call RemoveUnit(GetSellingUnit())
if not Bi then
call RemoveUnit(GetSoldUnit())
return
endif
if GetUnitTypeId(GetSoldUnit())=='h03H' then
set i=vA(p)
call WI(i,-1)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(p))]+" has random banned |cffFFFF00"+Go[i]+"|r")
else
call WI(GetUnitPointValue(GetSoldUnit()),-1)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(p))]+" has banned |cffFFFF00"+Go[GetUnitPointValue(GetSoldUnit())]+"|r")
endif
call RemoveUnit(GetSoldUnit())
endfunction
function Kd takes nothing returns boolean
return(Ux)
endfunction
function ld takes nothing returns nothing
set ir=true
call DisableTrigger(GetTriggeringTrigger())
if(Kd())then
set Mr=1
call TriggerExecute(Rn)
else
call DialogSetMessage(po[0],"Choose number of victories to win the game!")
call DialogAddButtonBJ(po[0],"1")
set Wi[4]=bj_lastCreatedButton
call DialogAddButtonBJ(po[0],"2")
set Wi[5]=bj_lastCreatedButton
call DialogAddButtonBJ(po[0],"3")
set Wi[6]=bj_lastCreatedButton
call DialogAddButtonBJ(po[0],"4")
set Wi[7]=bj_lastCreatedButton
call DialogDisplayBJ(true,po[0],Player(0))
endif
endfunction
function Ld takes nothing returns boolean
return(GetClickedButton()==Wi[7])
endfunction
function md takes nothing returns boolean
return(GetClickedButton()==Wi[6])
endfunction
function Md takes nothing returns boolean
return(GetClickedButton()==Wi[5])
endfunction
function pd takes nothing returns boolean
return(GetClickedButton()==Wi[4])
endfunction
function Pd takes nothing returns nothing
if(pd())then
set Wx=1
call TriggerExecute(Dn)
else
if(Md())then
set Wx=2
call TriggerExecute(Cn)
else
if(md())then
set Wx=3
call TriggerExecute(Cn)
else
if(Ld())then
set Wx=4
call TriggerExecute(Cn)
endif
endif
endif
endif
endfunction
function qd takes nothing returns nothing
call DialogSetMessage(po[1],"New races after each round?")
call DialogAddButtonBJ(po[1],"YES")
set Wi[8]=bj_lastCreatedButton
call DialogAddButtonBJ(po[1],"NO")
set Wi[9]=bj_lastCreatedButton
call DialogDisplayBJ(true,po[1],Player(0))
endfunction
function Qd takes nothing returns boolean
return(GetClickedButton()==Wi[9])
endfunction
function sd takes nothing returns boolean
return(GetClickedButton()==Wi[8])
endfunction
function Sd takes nothing returns nothing
if(sd())then
set Yi=true
else
if(Qd())then
set Yi=false
endif
endif
call TriggerExecute(Dn)
endfunction
function td takes nothing returns nothing
call DialogSetMessage(po[2],"Choose the method of race distribution!")
call DialogAddButtonBJ(po[2],"Pick your race!")
set Wi[10]=bj_lastCreatedButton
call DialogAddButtonBJ(po[2],"Random race!")
set Wi[11]=bj_lastCreatedButton
call DialogDisplayBJ(true,po[2],Player(0))
endfunction
function Td takes nothing returns boolean
return(GetClickedButton()==Wi[11])
endfunction
function ud takes nothing returns boolean
return(GetClickedButton()==Wi[10])
endfunction
function Ud takes nothing returns nothing
if(ud())then
set Ca=1
else
if(Td())then
set Ca=0
endif
endif
call TriggerExecute(In)
call TriggerSleepAction(3.)
set Mr=1
call TriggerExecute(Rn)
endfunction
function wd takes nothing returns nothing
set gE=false
call FogEnable(false)
endfunction
function Wd takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_FLYING)==false)and((1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))<=12)and(GetUnitPointValue(GetEnteringUnit())!=129)
endfunction
function yd takes nothing returns nothing
call Qb(0,GetEnteringUnit())
endfunction
function Yd takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_FLYING)==false)and((1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))<=12)and(GetUnitPointValue(GetEnteringUnit())!=129)
endfunction
function zd takes nothing returns nothing
call Qb(0,GetLeavingUnit())
endfunction
function Zd takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_FLYING)==false)and((1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))<=12)and(GetUnitPointValue(GetEnteringUnit())!=129)
endfunction
function vD takes nothing returns nothing
call Qb(1,GetEnteringUnit())
endfunction
function eD takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_FLYING)==false)and((1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))<=12)and(GetUnitPointValue(GetEnteringUnit())!=129)
endfunction
function xD takes nothing returns nothing
call Qb(1,GetLeavingUnit())
endfunction
function oD takes nothing returns nothing
call kb(ar,5,3,mA())
endfunction
function rD takes nothing returns nothing
if GetUnitTypeId(GetEnumUnit())!='hcas' then
set mr=ForcePickRandomPlayer(wo[Fi[(1+GetPlayerId(GetTriggerPlayer()))]])
set Nr[(1+GetPlayerId(mr))]=(Nr[(1+GetPlayerId(mr))]+1)
call SetUnitOwner(GetEnumUnit(),mr,true)
if IsUnitType(GetEnumUnit(),UNIT_TYPE_STRUCTURE)then
call GroupAddUnit(va,GetEnumUnit())
call IssueImmediateOrderById(GetEnumUnit(),lx[GetUnitPointValue(GetEnumUnit())])
call IssueImmediateOrderById(GetEnumUnit(),lx[GetUnitPointValue(GetEnumUnit())])
endif
endif
endfunction
function iD takes nothing returns nothing
call AdjustPlayerStateBJ(Mi,GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
call DisplayTextToPlayer(GetEnumPlayer(),0,0,(("You received |cffFFFF00"+I2S(Mi))+(("|r gold and |cffFFFF00"+I2S(Nr[(1+GetPlayerId(GetEnumPlayer()))]))+("|r units from "+Lr[(1+GetPlayerId(GetTriggerPlayer()))]))))
endfunction
function aD takes nothing returns nothing
local integer i=1
local integer id=(1+GetPlayerId(GetTriggerPlayer()))
local integer yI=Fi[id]
set qr=qr-1
set Pr[id]=false
set di[id]=false
call ForceRemovePlayer(wo[yI],GetTriggerPlayer())
call ForceRemovePlayer(Ba,GetTriggerPlayer())
set Zi[yI]=(Zi[yI]-1)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[id]+"|cffCA0000 has left the game!|r"))
if(id!=6 and id!=12)then
loop
exitwhen i>12
set Nr[bj_forLoopAIndex]=0
set i=i+1
endloop
set Mi=(GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)/ Zi[yI])
call ForGroup(NR(GetTriggerPlayer()),function rD)
call ForForce(wo[yI],function iD)
call DI()
endif
endfunction
function nD takes nothing returns boolean
return GetItemTypeId(GetManipulatedItem())=='I000'
endfunction
function VD takes nothing returns nothing
if GetOwningPlayer(GetTriggerUnit())!=GetEnumPlayer()then
call DisplayTextToPlayer(GetEnumPlayer(),0,0,(Lr[D]+" collected the coin!"))
endif
endfunction
function ED takes nothing returns nothing
local integer lb
local effect e
call RemoveItem(GetManipulatedItem())
set D=(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
set lb=R2I((I2R(Kx[D])+4.)*.25*(8.+ba))
set yr[D]=yr[D]+1
set Zo[D]=Zo[D]+lb
call DisplayTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0,0,"|cffFFFF80You found |cffFFFF00"+I2S(lb)+"|cffFFFF80 gold!|r")
if ri[Fi[D]]==D then
set Jx[D]=Jx[D]+1
else
set Jx[D]=1
endif
set nr[Fi[D]]=true
set ri[Fi[D]]=D
if Jx[D]==3 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[D]+(("|cffFFFF80 just collected |cffFFFF003|cffFFFF80 coins in a row for the "+Ji[Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]])+"|cffFFFF00! Very nice!")))
elseif Jx[D]==5 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[D]+(("|cffFFFF80 just collected|cffFFFF00 5|cffFFFF80 coins in a row for the "+Ji[Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]])+"|cffFFFF00! Impressive!")))
elseif Jx[D]==10 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[D]+(("|cffFFFF80 just collected|cffFFFF00 10|cffFFFF80 coins in a row for the "+Ji[Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]])+"|cffFFFF00! Sick!")))
else
call ForForce(wo[Fi[D]],function VD)
endif
call AdjustPlayerStateBJ(lb,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD)
set e=AddSpecialEffectTarget("Abilities\\Spells\\Other\\Transmute\\PileofGold.mdl",GetTriggerUnit(),"origin")
call DestroyEffect(e)
set e=null
call PlaySoundOnUnitBJ(rn,'d',GetTriggerUnit())
set wx[Fi[D]]=wx[Fi[D]]+1
call kb(ar,2,Xa[Fi[D]]-1,I2S(wx[Fi[D]]))
endfunction
function XD takes nothing returns boolean
return(IsUnitType(GetEnteringUnit(),UNIT_TYPE_PEON)!=null)
endfunction
function OD takes nothing returns nothing
call PingMinimapForPlayer(GetOwningPlayer(GetEnteringUnit()),GetUnitX(GetEnteringUnit()),GetUnitY(GetEnteringUnit()),1)
call SetUnitPosition(GetEnteringUnit(),GetPlayerStartLocationX(GetOwningPlayer(GetEnteringUnit())),GetPlayerStartLocationY(GetOwningPlayer(GetEnteringUnit())))
call DisplayTextToPlayer(GetOwningPlayer(GetEnteringUnit()),0,0,"|cffFF0000Your worker may not leave your castle!|r")
endfunction
function RD takes nothing returns nothing
call ExecuteFunc("qc")
call TriggerExecute(aE)
call TriggerSleepAction(10.)
call TriggerExecute(Rn)
endfunction
function ID takes nothing returns boolean
return GetUnitTypeId(GetDyingUnit())=='hcas'
endfunction
function AD takes nothing returns nothing
call ExecuteFunc("qc")
set Ia=1+GetPlayerId(GetOwningPlayer(GetKillingUnit()))
set I=1-Fi[1+GetPlayerId(GetOwningPlayer(GetDyingUnit()))]
set ia[I]=ia[I]+1
call kb(ar,5,Xa[I]-1,I2S(ia[I]))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Ji[I]+" have won the round!"))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,((("The Score is |cffFF0000West|r: |cffFFCC00"+I2S(ia[0]))+(" |cff00FF00East|r:|cffFFCC00 "+I2S(ia[1])))+("|r. Number of wins for overall victory: |cffFFCC00"+(I2S(Wx)+"|r"))))
if ia[I]>=Wx then
set ni=true
set GE=I
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(("|cffFFFF00Congratulations! "+Ji[I])+"|cffFFFF00 have won the match! Game ends in one minute.|r"))
call DestroyTimer(si)
call TriggerExecute(aE)
call TriggerSleepAction(15.)
call ForGroup(ER(bj_mapInitialPlayableArea),function nc)
call TriggerSleepAction(45.)
set I=0
loop
exitwhen I>11
if Fi[I+1]==GE then
call CustomVictoryBJ(Player(I),true,true)
else
call CustomDefeatBJ(Player(I),"You were defeated!")
endif
set I=I+1
endloop
else
call TriggerExecute(aE)
call TriggerSleepAction(15.)
set Mr=Mr+1
call TriggerExecute(Rn)
endif
endfunction
function ND takes nothing returns boolean
return not IsPlayerInForce(GetTriggerPlayer(),Xi)
endfunction
function Trig_First_Building_Func007C takes nothing returns boolean
return(Aa>=4)
endfunction
function bD takes nothing returns nothing
local integer lb
set Aa=Aa+1
set lb=(5-Aa)*5
set Ko[(1+GetPlayerId(GetTriggerPlayer()))]=(Ko[(1+GetPlayerId(GetTriggerPlayer()))]+lb)
call AdjustPlayerStateBJ(lb,GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,(("|cffFFFF80You receive |cffFFCC00"+I2S(lb))+("|cffFFFF80 gold for being the "+(Ui[Aa]+" player that finishes a structure!"))))
if Aa>=4 then
call DisableTrigger(GetTriggeringTrigger())
else
call ForceAddPlayer(Xi,GetTriggerPlayer())
endif
endfunction
function BD takes nothing returns boolean
return(GetIssuedOrderId()==851971)
endfunction
function cD takes nothing returns nothing
local location l=GetRandomLocInRect(Mx[Fi[(1+GetPlayerId(GetOwningPlayer(GetOrderedUnit())))]])
call IssuePointOrderByIdLoc(GetOrderedUnit(),851984,l)
call RemoveLocation(l)
set l=null
endfunction
function CD takes unit u returns nothing
local integer i=(Fi[GetPlayerId(GetOwningPlayer((u)))+1])*4096+GetUnitUserData(u)
set Yo[i]=Yo[i]+1
endfunction
function dD takes nothing returns nothing
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_SAPPER)then
call CD(GetOrderedUnit())
call pA(GetOrderedUnit())
if GetUnitAbilityLevel(GetOrderedUnit(),'A08X')==1 then
call aN(Z,GetOrderedUnit(),GetOrderedUnit())
endif
elseif GetUnitTypeId(GetOrderedUnit())=='h001' then
call cD()
elseif GetUnitTypeId(GetOrderedUnit())=='h00N' then
set yo=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetOrderedUnit()))))+1]))])]))
call IssueTargetOrderById(GetOrderedUnit(),851983,yo)
endif
endfunction
function DD takes nothing returns boolean
return(GetSpellAbilityId()=='A005')
endfunction
function fD takes nothing returns nothing
local integer i=(1+GetPlayerId(GetOwningPlayer(GetEventDamageSource())))
set Si[i]=Si[i]+R2I(GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE))
set so[i]=so[i]+1
endfunction
function FD takes nothing returns nothing
local location l=GetSpellTargetLoc()
local integer yI=Fi[(1+GetPlayerId(GetTriggerPlayer()))]
local integer gD=(1+GetPlayerId(GetTriggerPlayer()))
local unit u=CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'h04X',l,0)
local unit GD=GetTriggerUnit()
local trigger hD=CreateTrigger()
local group HD=CreateGroup()
call SetUnitVertexColorBJ(u,.0,.0,.0,100.)
call DestroyEffect(AddSpecialEffectTarget("Units\\NightElf\\Wisp\\WispExplode.mdl",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Units\\NightElf\\Wisp\\WispExplode.mdl",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Units\\NightElf\\Wisp\\WispExplode.mdl",u,"origin"))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",GetTriggerUnit(),"origin"))
call UnitRemoveAbility(GetTriggerUnit(),'A005')
call UnitRemoveAbility(GetTriggerUnit(),'A06E')
set zi[yI]=zi[yI]-1
if zi[yI]==0 then
call kb(ar,1,Xa[yI]-1,"|cffFF00000|r")
else
call kb(ar,1,Xa[yI]-1,I2S(zi[yI]))
endif
call TriggerSleepAction(.35)
call TriggerAddCondition(hD,Av)
call TriggerAddAction(hD,function fD)
set av=GD
call GroupEnumUnitsInRangeOfLoc(HD,l,1200,Ev)
loop
set GD=FirstOfGroup(HD)
exitwhen GD==null
call GroupRemoveUnit(HD,GD)
call TriggerRegisterUnitEvent(hD,GD,EVENT_UNIT_DAMAGED)
if GetUnitAbilityLevel(GD,'B012')>0 then
call UnitRemoveAbility(GD,'B012')
endif
endloop
call IssueImmediateOrderById(u,852526)
call TriggerSleepAction(1.5)
if so[gD]==0 then
call DisplayTextToForce(Ba,Lr[gD]+" wasted his Rescue Strike, killing no unit! Epic Fail!")
elseif so[gD]==1 then
call DisplayTextToForce(Ba,Lr[gD]+" wasted his Rescue Strike, killing only one unit!")
elseif so[gD]<5 then
call DisplayTextToForce(Ba,Lr[gD]+" wasted his Rescue Strike, dealing only |cffFFFF00"+I2S(Si[gD])+"|r damage and killing only |cffFFFF00"+I2S(so[gD])+"|r units!")
else
call DisplayTextToForce(Ba,Lr[gD]+" dealt |cffFFFF00"+I2S(Si[gD])+"|r damage with his Rescue Strike, killing |cffFFFF00"+I2S(so[gD])+"|r units!")
endif
call DestroyTrigger(hD)
set hD=null
call RemoveLocation(l)
set l=null
call DestroyGroup(HD)
set HD=null
call RemoveUnit(u)
endfunction
function jD takes nothing returns boolean
return Fi[(1+GetPlayerId(GetOwningPlayer(GetAttacker())))]==Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]
endfunction
function JD takes nothing returns nothing
if GetUnitLifePercent(GetTriggerUnit())>=20. then
call IssueImmediateOrderById(GetAttacker(),851972)
endif
endfunction
function kD takes unit u returns boolean
return(GetUnitTypeId(u)=='n00V')or(GetUnitTypeId(u)=='n01O')
endfunction
function KD takes unit u returns boolean
return((GetUnitTypeId(u)=='h01U')or(GetUnitTypeId(u)=='h05H'))and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_UNDEAD)==false)and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_MECHANICAL)==false)and(GetUnitAbilityLevelSwapped('A07G',GetTriggerUnit())==0)
endfunction
function lD takes nothing returns nothing
local unit u=Po
local unit LD=GetTriggerUnit()
if(GetUnitPointValue(u)==129)then
call pA(u)
elseif(kD(u))then
call IssueImmediateOrderById(u,852100)
call pA(u)
elseif(KD(u))then
if(GetUnitTypeId(u)=='h01U')then
call Ac('h01V',LD,u,GetOwningPlayer(u))
else
call Ac('h01U',LD,u,GetOwningPlayer(u))
endif
call XB("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",bj_lastCreatedUnit)
call RemoveUnit(LD)
elseif(GetUnitPointValue(u)==128)then
if(GetUnitTypeId(u)=='e00B')then
call SetUnitLifePercentBJ(u,(GetUnitLifePercent(u)+14.))
else
call SetUnitLifePercentBJ(u,(GetUnitLifePercent(u)+20.))
endif
endif
endfunction
function mD takes nothing returns nothing
local unit u=Po
local unit LD=GetTriggerUnit()
if(GetUnitTypeId(LD)=='e00A' and not IsUnitType(u,UNIT_TYPE_STRUCTURE))then
call UnitDamageTargetBJ(LD,u,350,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL)
endif
endfunction
function MD takes unit pD returns unit
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((pD))))+1]))])]))
local unit u2=null
local unit u3=null
local integer i=0
if(u==null)then
return null
endif
loop
exitwhen i>4
set i=i+1
if GetUnitAbilityLevel(u,'B012')==0 then
if not(IsUnitType(u,UNIT_TYPE_MELEE_ATTACKER))then
set u2=u
if(GetUnitState(u,UNIT_STATE_MANA)>=40.)then
return u
endif
else
if(GetUnitState(u,UNIT_STATE_MANA)>=40.)then
set u3=u
endif
if false then
return null
endif
endif
endif
set u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((pD))))+1]))])]))
endloop
if(u2!=null)then
return u2
endif
if(u3!=null)then
return u3
endif
if GetUnitAbilityLevel(u,'B012')>0 then
return null
endif
return u
endfunction
function PD takes unit qD,unit rN returns nothing
call IssueTargetOrderById(qD,851983,rN)
call SaveUnitHandle(hE,0,GetHandleId(qD),rN)
endfunction
function QD takes nothing returns nothing
local unit u=Po
local unit rN
local integer s
if(GetUnitPointValue(u)==129)then
set s=GetHandleId(u)
if GetUnitAbilityLevel(u,'B012')>0 then
if HaveSavedHandle(hE,0,s)then
set rN=LoadUnitHandle(hE,0,s)
if rN==null or GetUnitX(rN)==.0 or IsUnitType(rN,UNIT_TYPE_DEAD) then
call RemoveSavedHandle(hE,0,s)
call TriggerExecute(sn)
return
endif
if not IssueTargetOrderById(u,851983,rN)then
call RemoveSavedHandle(hE,0,s)
call TriggerExecute(sn)
return
endif
else
set rN=MD(u)
if rN==null then
call IssuePointOrderById(u,851986,GetUnitX(u),GetUnitY(u))
return
endif
call PD(u,rN)
return
endif
else
if HaveSavedHandle(hE,0,s)then
set rN=LoadUnitHandle(hE,0,s)
if rN==null or GetUnitX(rN)==.0 or IsUnitType(rN,UNIT_TYPE_DEAD) then
call RemoveSavedHandle(hE,0,s)
call TriggerExecute(sn)
return
endif
call IssueTargetOrderById(u,851983,rN)
elseif(GetUnitState(u,UNIT_STATE_MANA)>=50.)then
call IssueImmediateOrderById(u,852129)
call TriggerSleepAction(.1)
set rN=MD(u)
if rN==null then
return
endif
call PD(u,rN)
call TriggerSleepAction(2)
call IssueTargetOrderById(u,851983,rN)
return
else
call MA(u)
return
endif
endif
elseif GetUnitTypeId(u)=='n01U' then
if HaveStoredReal(vr,"repairgobboX",(I2S(GetHandleId((u)))))then
set X=GetStoredReal(vr,"repairgobboX",(I2S(GetHandleId((u)))))
set Y=GetStoredReal(vr,"repairgobboY",(I2S(GetHandleId((u)))))
if RAbsBJ(X-GetUnitX(u))<300 and RAbsBJ(Y-GetUnitY(u))<300 then
call IssuePointOrderById(u,851986,GetUnitX(u),GetUnitY(u))
call FlushStoredReal(vr,"repairgobboX",(I2S(GetHandleId((u)))))
call FlushStoredReal(vr,"repairgobboY",(I2S(GetHandleId((u)))))
else
call IssuePointOrderById(u,851986,X,Y)
endif
else
call IssuePointOrderById(u,851986,GetUnitX(u),GetUnitY(u))
endif
endif
endfunction
function sD takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),'A03Q')==1
endfunction
function SD takes unit tD,unit GB returns nothing
local integer i=GetRandomInt(0,99)
local real TD
local location l
local effect e
if GetUnitAbilityLevel(tD,'B019')==1 then
return
endif
if(i<15)and(GetUnitAbilityLevel(GB,'A070')==0)and IsUnitType(GB,UNIT_TYPE_MECHANICAL)==false then
call TriggerSleepAction(1)
if GB==null or IsUnitType(GB,UNIT_TYPE_DEAD)then
return
endif
set TD=GetUnitState(GB,UNIT_STATE_LIFE)/ 2
call UnitDamageTarget(tD,GB,10000,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
call SetUnitState(tD,UNIT_STATE_LIFE,GetUnitState(tD,UNIT_STATE_LIFE)+TD)
set e=AddSpecialEffectTarget("Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl",GB,"chest")
call TriggerSleepAction(1.2)
call DestroyEffect(e)
set e=null
elseif(i<25)then
call TriggerSleepAction(1)
call VN(S,tD,GB)
endif
endfunction
function uD takes nothing returns nothing
local unit UD=GetAttacker()
local unit GB=GetTriggerUnit()
if GetUnitTypeId(UD)=='u00D' then
call SD(UD,GB)
elseif GetUnitTypeId(UD)=='n01V' then
call IssuePointOrderById(UD,852040,GetUnitX(UD),GetUnitY(UD))
endif
endfunction
function wD takes nothing returns nothing
call SetUnitVertexColorBJ(bj_lastCreatedUnit,'d','d','d',100.)
endfunction
function WD takes nothing returns nothing
if GetUnitAbilityLevelSwapped('A07H',GetTrainedUnit())==0 and GetRandomInt(0,99)<24 then
call Ac(GetUnitTypeId(GetTrainedUnit()),GetTrainedUnit(),GetTriggerUnit(),GetOwningPlayer(GetEnumUnit()))
call Oc(GetTriggerUnit(),bj_lastCreatedUnit)
endif
endfunction
function yD takes nothing returns nothing
local unit u=GetTrainedUnit()
local unit uB=GetTriggerUnit()
local integer i=(1+GetPlayerId(GetOwningPlayer(uB)))
set Ao[i]=(Ao[i]+1)
set i=(Fi[GetPlayerId(GetOwningPlayer((u)))+1])
set Br[i]=(Br[i]+1)
call KB(u)
call pA(u)
call Oc(uB,u)
if GetUnitAbilityLevel(u,'A07J')==1 then
call Ic(uB,u)
endif
call ForGroupBJ(Zx[i],function WD)
call TriggerSleepAction(.1)
call IssueImmediateOrderById(uB,lx[GetUnitPointValue(uB)])
call pA(u)
endfunction
function YD takes nothing returns boolean
return( not(IsUnitType(GetDyingUnit(),UNIT_TYPE_STRUCTURE)))and( not(IsUnitType(GetDyingUnit(),UNIT_TYPE_TAUREN)))and( not(IsUnitType(GetDyingUnit(),UNIT_TYPE_SAPPER)==false))
endfunction
function zD takes nothing returns nothing
local unit u
local integer i
call LB(GetTriggerUnit())
if GetDyingUnit()==null then
return
endif
if GetKillingUnit()!=null then
set u=(TA(GetKillingUnit()))
set i=(1+GetPlayerId(GetOwningPlayer(u)))
set Cr[i]=Cr[i]+1
set Ra[Fi[i]]=Ra[Fi[i]]+1
if GetUnitAbilityLevel(u,'A07K')>0 then
set Po=u
call TriggerExecute(qn)
endif
if GetUnitAbilityLevelSwapped('A07O',GetDyingUnit())>0 then
set Po=u
call TriggerExecute(Qn)
endif
endif
set i=IMinBJ(lo[Fi[(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))]],2)
if i<=0 then
return
endif
set u=GetDyingUnit()
call TriggerSleepAction(2)
if u==null then
return
endif
loop
exitwhen i<=0
if(GetRandomInt(0,99)<20)and(GetUnitAbilityLevel(u,'A07G')==0)then
if GetUnitPointValue(u)=='h' or GetUnitPointValue(u)=='i' then
call Vc(GetUnitTypeId(u),u,null,GetOwningPlayer(u))
else
call Ac(GetUnitTypeId(u),u,null,GetOwningPlayer(u))
endif
call XB("Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl",u)
call RemoveUnit(u)
exitwhen true
endif
set i=i-1
endloop
endfunction
function ZD takes nothing returns nothing
local unit u=GetEnumUnit()
if GetUnitAbilityLevel(u,'Bfrz')>0 and GetRandomInt(0,99)<50 then
call UnitRemoveAbility(u,'Bfrz')
endif
if GetUnitAbilityLevel(u,'B00M')>0 and GetRandomInt(0,99)<50 then
call UnitRemoveAbility(u,'B00M')
endif
endfunction
function vf takes nothing returns nothing
local unit ef=LoadUnitHandle(jE,0,(LoadInteger(o,0,GetHandleId((GetExpiredTimer())))))
if ef==null or GetUnitPointValue(ef)!=GetUnitPointValueByType('h09T')or GetUnitState(ef,UNIT_STATE_LIFE)<.405 then
call RemoveSavedHandle(jE,0,(LoadInteger(o,0,GetHandleId((GetExpiredTimer())))))
call WR(GetExpiredTimer())
set ef=null
return
endif
call GroupEnumUnitsInRange(HE,GetUnitX(ef),GetUnitY(ef),252.,Iv)
call ForGroup(HE,function ZD)
call GroupClear(HE)
set ef=null
endfunction
function xf takes unit of returns nothing
local timer t=wR()
call UnitAddAbility(GetConstructedStructure(),'A09S')
call UnitAddAbility(GetConstructedStructure(),'A09P')
call UnitAddAbility(GetConstructedStructure(),'A09V')
call TimerStart(t,4.,true,function vf)
call SaveInteger(o,0,GetHandleId((t)),(GetHandleId(of)))
call SaveUnitHandle(jE,0,GetHandleId(of),of)
endfunction
function rf takes nothing returns nothing
local unit u=GetConstructedStructure()
local integer yI=(Fi[GetPlayerId(GetOwningPlayer((u)))+1])
set D=(1+GetPlayerId(GetOwningPlayer(u)))
set I=GetUnitPointValue(u)
if I==1000 then
return
endif
call ResetUnitAnimation(br[D])
call GroupRemoveUnit(E,u)
call TB(u)
set J=(Fi[GetPlayerId(GetOwningPlayer((u)))+1])+2*gi[I]
set uv[J]=uv[J]+1
set Ir[D]=Ir[D]+Fx[I]
set bi[Fi[D]]=bi[Fi[D]]+1
if gi[I]==2 then
set So[D]=So[D]+1
elseif gi[I]==0 then
set tr[D]=tr[D]+1
if(GetUnitAbilityLevel((u),'A06V')>0)then
else
call Db(u,Fx[I])
endif
elseif gi[I]==1 then
set tr[D]=tr[D]+1
call Db(u,Fx[I]*3/ 4)
endif
set yx[D]=yx[D]+ro[I]*I2R(Fx[I])/ 100.
call iA(oO[yI],u)
call IssueImmediateOrderById(u,lx[I])
call IssueImmediateOrderById(u,lx[I])
if GetUnitTypeId(u)=='h001' then
call GroupAddUnit(Lo,u)
set X=GetRandomReal(GetRectMinX(Mx[Fi[D]]),GetRectMaxX(Mx[Fi[D]]))
set Y=GetRandomReal(GetRectMinY(Mx[Fi[D]]),GetRectMaxY(Mx[Fi[D]]))
call IssuePointOrderById(u,851984,X,Y)
elseif GetUnitTypeId(u)=='h00N' then
call GroupAddUnit(da,u)
call IssueTargetOrderById(u,851983,(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((u))))+1]))])])))
elseif GetUnitTypeId(u)=='h008' then
set Kx[D]=Kx[D]+1
elseif GetUnitTypeId(u)=='h059' then
set lo[Fi[D]]=lo[Fi[D]]+1
elseif GetUnitTypeId(u)=='h05G' then
call GroupAddUnit(Zx[Fi[D]],u)
elseif GetUnitTypeId(u)=='h01O' then
call UnitAddAbility(u,'A01V')
elseif GetUnitTypeId(u)=='h00G' then
call UnitAddAbility(u,'A008')
call UnitAddAbility(u,'A007')
elseif GetUnitTypeId(u)=='h05L' then
call EnableTrigger(XV)
elseif GetUnitTypeId(u)=='h09T' then
call xf(u)
endif
endfunction
function af takes nothing returns nothing
call GroupAddUnit(E,GetConstructingStructure())
endfunction
function nf takes nothing returns nothing
set Mi=(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
set yi=(ro[GetUnitPointValue(GetTriggerUnit())]*I2R((Fx[GetUnitPointValue(GetTriggerUnit())]+ca[GetUnitPointValue(GetTriggerUnit())])))
set yx[Mi]=(yx[Mi]+(yi/ 100.))
endfunction
function Vf takes nothing returns nothing
local unit u
set D=(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))
set I=GetUnitPointValue(GetTriggerUnit())
if I>1000 then
call Nc(GetOwningPlayer(GetTriggerUnit()),I-1000)
return
endif
set Ir[D]=Ir[D]+Fx[I]
call IssueImmediateOrderById(GetTriggerUnit(),lx[I])
call IssueImmediateOrderById(GetTriggerUnit(),lx[I])
call TB(GetTriggerUnit())
set yx[D]=yx[D]+ro[I]*I2R(Fx[I])/ 100.
if gi[I]==0 then
if(GetUnitAbilityLevel((GetTriggerUnit()),'A06V')>0)then
else
call Db(GetTriggerUnit(),Fx[I])
endif
elseif gi[I]==1 then
call Db(GetTriggerUnit(),Fx[I]*3/ 4)
endif
if gi[I]==2 or'h056'==GetUnitTypeId(GetTriggerUnit())then
set u=GetTriggerUnit()
call IssueImmediateOrderById(u,852602)
call TriggerSleepAction(1.)
call IssueTargetOrderById(u,852601,GroupPickRandomUnit(Vo))
call TriggerSleepAction(45.)
call IssueTargetOrderById(u,852601,GroupPickRandomUnit(Vo))
endif
endfunction
function Ef takes nothing returns boolean
return(IsUnitType(GetDyingUnit(),UNIT_TYPE_STRUCTURE))and(GetUnitTypeId(GetDyingUnit())!='hcas')
endfunction
function Xf takes nothing returns nothing
local integer UB=GetUnitPointValue(GetDyingUnit())
local integer yI=(Fi[GetPlayerId(GetOwningPlayer((GetDyingUnit())))+1])
call GroupRemoveUnit(E,GetDyingUnit())
call MN(GetTriggerUnit())
set yI=(Fi[GetPlayerId(GetOwningPlayer((GetDyingUnit())))+1])
call VA(oO[yI],GetDyingUnit())
call GroupRemoveUnit(ix[yI],GetDyingUnit())
call GroupRemoveUnit(ax[yI],GetDyingUnit())
call GroupRemoveUnit(nx[yI],GetDyingUnit())
set J=yI+2*gi[UB]
set uv[J]=uv[J]-1
if(TA(GetKillingUnit()))!=null then
set J=(Fi[GetPlayerId(GetOwningPlayer(((TA(GetKillingUnit())))))+1])
set Gi[J]=Gi[J]+1
call kb(ar,3,Xa[J]-1,I2S(Gi[J]))
endif
set J=(1+GetPlayerId(GetOwningPlayer(GetDyingUnit())))
if not IsUnitInGroup(GetDyingUnit(),va)then
set R=ro[UB]*I2R(Fx[UB]+ca[UB])
set yx[J]=yx[J]-R/ 100.
if GetUnitTypeId(GetDyingUnit())=='h008' then
set Kx[J]=Kx[J]-1
endif
else
call GroupRemoveUnit(va,GetDyingUnit())
endif
if GetUnitTypeId(GetDyingUnit())=='h001' then
call GroupRemoveUnit(Lo,GetDyingUnit())
elseif GetUnitTypeId(GetDyingUnit())=='h00N' then
call GroupRemoveUnit(da,GetDyingUnit())
elseif GetUnitTypeId(GetDyingUnit())=='h059' then
set lo[yI]=lo[yI]-1
elseif GetUnitTypeId(GetDyingUnit())=='h05G' then
call GroupRemoveUnit(Zx[yI],GetDyingUnit())
endif
endfunction
function Of takes nothing returns boolean
return GetUnitAbilityLevel(GetConstructingStructure(),'A07E')==1
endfunction
function Rf takes nothing returns nothing
call qN(GetConstructingStructure())
endfunction
function If takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'A07E')==1
endfunction
function Af takes nothing returns nothing
call MN(GetTriggerUnit())
call QN(GetTriggerUnit())
endfunction
function Nf takes nothing returns nothing
call MN(GetTriggerUnit())
call qN(GetTriggerUnit())
endfunction
function bf takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false)and(IsUnitType(GetTriggerUnit(),UNIT_TYPE_SAPPER))
endfunction
function Bf takes nothing returns nothing
call lB(GetTriggerUnit(),ModuloInteger(Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+1,2))
call KB(GetTriggerUnit())
if GetUnitTypeId(GetTriggerUnit())=='h03A' then
call TriggerSleepAction(.1)
call IssueImmediateOrderById(GetTriggerUnit(),852055)
call TriggerSleepAction(.1)
endif
call pA(GetTriggerUnit())
endfunction
function cf takes nothing returns boolean
return(GetUnitTypeId(GetSummoningUnit())=='h03C')
endfunction
function Cf takes nothing returns nothing
local unit u=GetSummonedUnit()
call KB(u)
if GetUnitTypeId(u)=='h03C' then
call SetUnitState(u,UNIT_STATE_MANA,30)
endif
call TriggerSleepAction(.7)
if GetUnitTypeId(u)=='h03A' then
call IssueImmediateOrderById(u,852055)
call TriggerSleepAction(.1)
endif
call pA(u)
endfunction
function df takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='n00W')
endfunction
function Df takes nothing returns nothing
call pA(GetSummonedUnit())
call KB(GetSummonedUnit())
endfunction
function ff takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='u004')
endfunction
function Ff takes nothing returns nothing
call ReplaceUnitBJ(GetSummonedUnit(),sr[GetRandomInt(0,2)],2)
call pA(bj_lastReplacedUnit)
call KB(bj_lastReplacedUnit)
set Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastReplacedUnit)))+1])]=Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastReplacedUnit)))+1])]+1
endfunction
function gf takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='u008')
endfunction
function Gf takes nothing returns nothing
call ReplaceUnitBJ(GetSummonedUnit(),sr[GetRandomInt(0,6)],2)
call pA(bj_lastReplacedUnit)
call KB(bj_lastReplacedUnit)
set Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastReplacedUnit)))+1])]=Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastReplacedUnit)))+1])]+1
endfunction
function hf takes nothing returns boolean
return(GetUnitTypeId(GetSummonedUnit())=='u00E')
endfunction
function Hf takes nothing returns nothing
local integer i=GetRandomInt(0,7)
if i==0 then
set i=7
else
set i=GetRandomInt(3,6)
endif
call ReplaceUnitBJ(GetSummonedUnit(),sr[i],2)
call pA(bj_lastReplacedUnit)
call KB(bj_lastReplacedUnit)
call UnitAddAbility(bj_lastReplacedUnit,'A088')
call UnitAddAbility(bj_lastReplacedUnit,'A089')
set Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastReplacedUnit)))+1])]=Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastReplacedUnit)))+1])]+1
endfunction
function jf takes nothing returns boolean
return(GetSpellAbilityId()=='A01Q')
endfunction
function Jf takes nothing returns nothing
local location l
local effect e
local unit u=SA()
if(u==null)then
return
endif
set l=GetUnitLoc(u)
if(GetRandomInt(0,99)<10)then
call CreateUnitAtLocSaveLast(GetOwningPlayer(GetSpellAbilityUnit()),sr[3],l,bj_UNIT_FACING)
else
call CreateUnitAtLocSaveLast(GetOwningPlayer(GetSpellAbilityUnit()),sr[GetRandomInt(0,2)],l,bj_UNIT_FACING)
endif
call pA(bj_lastCreatedUnit)
call KB(bj_lastCreatedUnit)
call RemoveLocation(l)
set l=GetUnitLoc(bj_lastCreatedUnit)
set e=AddSpecialEffectLoc("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",l)
set Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastCreatedUnit)))+1])]=Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastCreatedUnit)))+1])]+1
call RemoveUnit(u)
call RemoveLocation(l)
call DestroyEffect(e)
set e=null
set l=null
endfunction
function kf takes nothing returns boolean
return(GetSpellAbilityId()=='A05U')
endfunction
function Kf takes nothing returns nothing
local location l
local effect e
local unit u=SA()
if(u==null)then
return
endif
set l=GetUnitLoc(u)
if(GetRandomInt(0,99)<10)then
call CreateUnitAtLocSaveLast(GetOwningPlayer(GetSpellAbilityUnit()),sr[7],l,bj_UNIT_FACING)
else
call CreateUnitAtLocSaveLast(GetOwningPlayer(GetSpellAbilityUnit()),sr[GetRandomInt(1,6)],l,bj_UNIT_FACING)
endif
call pA(bj_lastCreatedUnit)
call KB(bj_lastCreatedUnit)
call RemoveLocation(l)
set l=GetUnitLoc(bj_lastCreatedUnit)
set e=AddSpecialEffectLoc("Abilities\\Spells\\Items\\AIam\\AIamTarget.mdl",l)
set Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastCreatedUnit)))+1])]=Br[(Fi[GetPlayerId(GetOwningPlayer((bj_lastCreatedUnit)))+1])]+1
call RemoveUnit(u)
call RemoveLocation(l)
call DestroyEffect(e)
set e=null
set l=null
endfunction
function lf takes nothing returns boolean
return(GetUnitTypeId(GetEnteringUnit())=='n01P')or(GetUnitTypeId(GetEnteringUnit())=='n01Q')
endfunction
function Lf takes nothing returns boolean
return(lf())
endfunction
function mf takes nothing returns boolean
return(GetUnitTypeId(GetEnteringUnit())=='n01R')or(GetUnitTypeId(GetEnteringUnit())=='n01Q')
endfunction
function Mf takes nothing returns boolean
return(mf())
endfunction
function pf takes nothing returns nothing
if(Lf())then
call SetUnitAbilityLevelSwapped('A00C',GetEnteringUnit(),2)
endif
if(Mf())then
call KB(GetEnteringUnit())
call pA(GetEnteringUnit())
endif
endfunction
function Pf takes nothing returns boolean
return GetUnitTypeId(GetAttacker())=='h05L'
endfunction
function qf takes nothing returns nothing
if GetRandomInt(0,99)<20 then
call aN(ov,GetAttacker(),GetTriggerUnit())
endif
endfunction
function SPELL_BlueShieldGenerator takes nothing returns nothing
local unit u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return
endif
if GetUnitAbilityLevel(u,'A09L')>0 then
set u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return
endif
endif
if GetUnitAbilityLevel(u,'A09L')==0 then
call UnitAddAbility(u,'A09L')
endif
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"death")
call TriggerSleepAction(.3)
call SetUnitAnimation(u,"stand")
endfunction
function SPELL_RedShieldGenerator takes nothing returns nothing
local unit u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return
endif
if GetUnitAbilityLevel(u,'A09L')>0 then
set u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return
endif
endif
if GetUnitAbilityLevel(u,'A09L')<=1 then
call UnitAddAbility(u,'A09L')
call SetUnitAbilityLevel(u,'A09L',2)
endif
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"death")
call TriggerSleepAction(.3)
call SetUnitAnimation(u,"stand")
endfunction
function SPELL_CheckRange takes nothing returns nothing
local real Qf=ei[GetUnitPointValue(GetSpellAbilityUnit())]
local integer i=0
local integer OI=20+R2I((Qf-500)/ 50)
local real x
local real y
local real sf
local effect array e
loop
exitwhen i>=OI
set sf=2*bj_PI*i/ OI
set y=Sin(sf)*Qf+GetUnitY(GetTriggerUnit())
set x=Cos(sf)*Qf+GetUnitX(GetTriggerUnit())
if(Fi[GetPlayerId(GetOwningPlayer((GetTriggerUnit())))+1])==Fi[(1+GetPlayerId(GetLocalPlayer()))]then
set e[i]=AddSpecialEffect("Abilities\\Spells\\NightElf\\Barkskin\\BarkSkinTarget.mdl",x,y)
else
set e[i]=AddSpecialEffect(".mdl",x,y)
endif
set i=i+1
endloop
call TriggerSleepAction(6)
set i=0
loop
exitwhen i>=OI
call DestroyEffect(e[i])
set e[i]=null
set i=i+1
endloop
endfunction
function SPELL_ObeliskOfTheClaw takes nothing returns nothing
local unit rN=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetTriggerUnit()))))+1]))]))
call XB("Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl",GetTriggerUnit())
if(rN==null)then
return
endif
if GetUnitAbilityLevel(rN,'A08C')==1 then
set rN=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetTriggerUnit()))))+1]))]))
if(rN==null)then
return
endif
endif
call IB("Abilities\\Spells\\Human\\ControlMagic\\ControlMagicTarget.mdl",rN,"overhead")
call UnitAddAbility(rN,'A08C')
call UnitAddAbility(rN,'A08D')
call UnitAddAbility(rN,'A08F')
endfunction
function SPELL_SilverGlade takes nothing returns nothing
local integer yI=(Fi[GetPlayerId(GetOwningPlayer((GetTriggerUnit())))+1])
call XB("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",GetTriggerUnit())
call EnableTrigger(OV)
set cr[yI]=cr[yI]+1
endfunction
function Sf takes nothing returns boolean
return( not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)))and( not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_SAPPER)==false))and( not(GetUnitAbilityLevel(GetTriggerUnit(),'A08H')==1))
endfunction
function tf takes nothing returns nothing
local integer yI=(Fi[GetPlayerId(GetOwningPlayer((GetTriggerUnit())))+1])
if(cr[yI]>0)then
call xN(Kv,GetTriggerUnit())
set cr[yI]=cr[yI]-1
call XB("Abilities\\Spells\\Items\\AIda\\AIdaCaster.mdl",bj_lastCreatedUnit)
if(cr[0]<=0 and cr[1]<=0)then
call DisableTrigger(GetTriggeringTrigger())
endif
endif
endfunction
function SPELL_StarfallObelisk takes nothing returns nothing
local unit rN=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
local effect e
local fogmodifier f
local boolean b=gE
if rN==null then
return
endif
set e=AddSpecialEffect("Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
if b then
set f=CreateFogModifierRadius(GetOwningPlayer(GetSpellAbilityUnit()),FOG_OF_WAR_VISIBLE,GetUnitX(rN),GetUnitY(rN),1100.,true,false)
call FogModifierStart(f)
endif
if Kr then
call oN(mv,GetSpellAbilityUnit(),rN)
else
call oN(Lv,GetSpellAbilityUnit(),rN)
endif
call TriggerSleepAction(8)
if b then
call DestroyFogModifier(f)
set f=null
endif
call DestroyEffect(e)
set e=null
endfunction
function Tf takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer s=GetHandleId(t)
local unit u=LoadUnitHandle(JE,s,1)
local integer i=LoadInteger(JE,s,0)
local real nR=GetUnitFacing(u)
local location l=GetUnitLoc(u)
if not hx then
call FlushChildHashtable(JE,s)
call DestroyTimer(t)
call RemoveUnit(u)
elseif i<1 then
call FlushChildHashtable(JE,s)
call DestroyTimer(t)
set yo=u
call TriggerExecute(RV)
else
set i=i-1
call SetUnitFlyHeight(u,I2R(i)*6.,.0)
call MoveLocation(l,GetLocationX(l)+10*Cos(nR*bj_DEGTORAD),GetLocationY(l)+10*Sin(nR*bj_DEGTORAD))
call SetUnitPositionLoc(u,l)
call SaveInteger(JE,s,0,i)
endif
call RemoveLocation(l)
set l=null
set t=null
endfunction
function SPELL_Nuke takes nothing returns nothing
local location uf=GetUnitLoc(GetTriggerUnit())
local location rN=GetRandomLocInRect(Mx[Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]])
local real nR=AngleBetweenPoints(uf,rN)
local location l=rR(rN,-2500,nR)
local unit Uf
local timer t=CreateTimer()
local integer s=GetHandleId(t)
local effect e
local unit u
call PlaySoundBJ(in)
call PlaySoundBJ(nn)
set u=CreateUnitAtLoc(GetTriggerPlayer(),'h06X',uf,270)
call SetUnitTimeScalePercent(u,20)
set e=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl",uf)
call DestroyEffect(e)
set e=null
call TriggerSleepAction(5)
set Uf=CreateUnitAtLoc(GetTriggerPlayer(),'h06V',l,nR)
call SaveInteger(JE,s,0,250)
call SaveUnitHandle(JE,s,1,Uf)
call SetUnitFlyHeight(Uf,1500.,.0)
call TimerStart(t,.04,true,function Tf)
call RemoveLocation(l)
set l=null
call RemoveLocation(uf)
set uf=null
set t=null
call RemoveLocation(rN)
set rN=null
call RemoveUnit(u)
endfunction
function wf takes nothing returns nothing
local unit Uf=yo
local location l=GetUnitLoc(Uf)
local player p=GetOwningPlayer(Uf)
local unit u
local unit u2
local real xd=GetTimeOfDay()
call RemoveUnit(Uf)
set u=CreateUnitAtLoc(p,'h06W',l,270)
call SetUnitAnimation(u,"Death")
call SetUnitTimeScalePercent(u,12)
set u2=CreateUnitAtLoc(p,'h06W',l,270)
call SetUnitAnimation(u2,"Death")
call SetUnitTimeScalePercent(u2,12)
call AbortCinematicFadeBJ()
call CinematicFadeCommonBJ('d','d','d',.25,"ReplaceableTextures\\CameraMasks\\White_mask.blp",'d',0)
call ContinueCinematicFadeAfterBJ(.75,'d','d','d',0,"ReplaceableTextures\\CameraMasks\\White_mask.blp")
call FinishCinematicFadeAfterBJ(1.5)
call SetTimeOfDay(12.)
call UnitDamagePointLoc(u,.0,400,l,600,ATTACK_TYPE_HERO,DAMAGE_TYPE_FIRE)
call UnitDamagePointLoc(u,.0,800,l,600,ATTACK_TYPE_HERO,DAMAGE_TYPE_FIRE)
call UnitDamagePointLoc(u,.0,1200,l,600,ATTACK_TYPE_HERO,DAMAGE_TYPE_FIRE)
call PlaySoundAtPointBJ(an,'d',l,0)
call TriggerSleepAction(1)
call TriggerSleepAction(1)
call SetTimeOfDay(xd)
call TriggerSleepAction(11)
call RemoveUnit(u)
call RemoveUnit(u2)
call RemoveLocation(l)
set l=null
set p=null
endfunction
function Wf takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='h04M')or(GetUnitTypeId(GetEnteringUnit())=='n01B')
endfunction
function yf takes nothing returns boolean
return(Wf())
endfunction
function Yf takes nothing returns nothing
call SetUnitVertexColorBJ(GetTriggerUnit(),32.,.0,53.,40.)
endfunction
function SPELL_ForgottenOne takes nothing returns nothing
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
local integer i=0
if u==null then
return
endif
loop
exitwhen i>5
set do=GetUnitX(u)+64.*Cos(60.*I2R(i)*bj_DEGTORAD)
set Co=GetUnitY(u)+64.*Sin(60.*I2R(i)*bj_DEGTORAD)
if Kr then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()),'n021',do,Co,AngleBetweenPoints(sx,Px))
else
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()),'n01C',do,Co,AngleBetweenPoints(sx,Px))
endif
call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF',9.)
set i=i+1
endloop
endfunction
function SPELL_WellOfPain takes nothing returns nothing
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if(u==null)then
return
endif
call IB("Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl",u,"origin")
if HB(u,GetSpellAbilityUnit())then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,200.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_SONIC)
endif
endfunction
function SPELL_EyeOfCorruption takes nothing returns nothing
call RN(iv,GetSpellAbilityUnit())
endfunction
function SPELL_DeathPit takes nothing returns nothing
local unit u
local effect e=null
local location l=null
set u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if u==null then
return
endif
if HB(u,GetSpellAbilityUnit())then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,50000.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
endif
call XB("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl",u)
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"work")
call TriggerSleepAction(1.)
call ResetUnitAnimation(u)
endfunction
function SPELL_MagicTowerRuin takes nothing returns nothing
local integer i=GetRandomInt(0,8)
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
call XB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",GetSpellAbilityUnit())
if u==null then
return
endif
call IB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",u,"origin")
if not HB(u,GetSpellAbilityUnit())then
return
endif
if i==0 then
call XB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",u)
call ExplodeUnitBJ(u)
set i=(1+GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())))
set Cr[i]=Cr[i]+1
set Ra[Fi[i]]=Ra[Fi[i]]+1
elseif i==1 then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,50000.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
elseif i==2 then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,500.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
elseif i==3 then
call IB("Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl",u,"origin")
call UnitAddAbility(u,'A06T')
call UnitAddAbility(u,'A06U')
call SetUnitLifePercentBJ(u,'d')
elseif i==4 then
call aN(Dv,GetSpellAbilityUnit(),u)
call TriggerSleepAction(1.)
call pA(u)
if GetUnitTypeId(u)=='h03A' then
call TriggerSleepAction(44.5)
call IssueImmediateOrderById(u,852055)
call TriggerSleepAction(.5)
call pA(u)
return
endif
elseif i==5 then
call nN(fv,GetSpellAbilityUnit(),u)
elseif i==6 then
call XB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",u)
call LB(u)
call ShowUnit(u,false)
call Ac('n01S',u,GetSpellAbilityUnit(),GetTriggerPlayer())
call RemoveUnit(u)
return
endif
endfunction
function zf takes nothing returns nothing
if((Fi[GetPlayerId(GetOwningPlayer((GetEnumUnit())))+1])==(Fi[GetPlayerId(GetOwningPlayer((av)))+1]))and IsUnitType(GetEnumUnit(),UNIT_TYPE_SAPPER)then
call aN(Bv,av,GetEnumUnit())
endif
endfunction
function SPELL_Gjallarhorn takes nothing returns nothing
local location l=GetUnitLoc(GetSpellAbilityUnit())
local group g=AR(500.,l)
call XB("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",GetSpellAbilityUnit())
set av=GetSpellAbilityUnit()
call ForGroupBJ(g,function zf)
call DestroyGroup(g)
call RemoveLocation(l)
set g=null
set l=null
endfunction
function SPELL_OracleOfSirens takes nothing returns nothing
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if u==null or not HB(u,GetSpellAbilityUnit())then
return
endif
call nN(W,GetSpellAbilityUnit(),u)
endfunction
function SPELL_FrozenMushroom takes nothing returns nothing
local unit u=(nA(rO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if(u==null)or not HB(u,GetSpellAbilityUnit())then
return
endif
call aN(kv,GetSpellAbilityUnit(),u)
endfunction
function SPELL_CeremonialTotem takes nothing returns nothing
local unit u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return
endif
call UnitAddAbility(u,'A03B')
call UnitAddAbility(u,'A03A')
call UnitAddAbility(u,'A03D')
call UnitAddAbility(u,'A08L')
set Mi=GetRandomInt(1,3)
if(Mi==1)then
call UnitAddAbility(u,'A05I')
call UnitAddAbility(u,'A06W')
else
if(Mi==2)then
call UnitAddAbility(u,'A08M')
call UnitAddAbility(u,'A06Y')
else
call UnitAddAbility(u,'A08R')
call UnitAddAbility(u,'A06X')
endif
endif
call IB("Abilities\\Spells\\Undead\\ReplenishHealth\\ReplenishHealthCasterOverhead.mdl",u,"overhead")
call XB("Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl",GetSpellAbilityUnit())
endfunction
function SPELL_SerpentRock takes nothing returns nothing
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
call aN(Jv,GetSpellAbilityUnit(),u)
set u=GetSpellAbilityUnit()
call TriggerSleepAction(.5)
call SetUnitAnimation(u,"attack")
call TriggerSleepAction(1.)
call ResetUnitAnimation(u)
endfunction
function SPELL_WorldFreezer takes nothing returns nothing
local unit u
local unit u2
local real Zf
local integer i=0
local player p=GetOwningPlayer(GetSpellAbilityUnit())
local real x=GetUnitX(GetSpellAbilityUnit())
local real y=GetUnitY(GetSpellAbilityUnit())
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"death")
call TriggerSleepAction(1.5)
call TimerStart(Bo,.04,true,null)
set Zf=I2R(Fi[(1+GetPlayerId(p))])*180
loop
exitwhen i>2
set u2=CreateUnit(p,'h08U',x,y,ModuloReal(Zf+GetRandomReal(-55,55)+360,360))
if(Kr)then
call UnitRemoveAbility(u2,'A080')
call UnitAddAbility(u2,'A084')
endif
call GroupAddUnit(tx,u2)
set i=i+1
endloop
call EnableWeatherEffect(kx,true)
call TriggerSleepAction(3.7)
call ResetUnitAnimation(u)
call TriggerSleepAction(2.6)
call EnableWeatherEffect(kx,false)
endfunction
function vF takes nothing returns nothing
local group g=CreateGroup()
local group eF
local unit u
local unit u2
local real x
local real y
local integer i
call GroupAddGroup(tx,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
set x=GetUnitX(u)+Cos(GetUnitFacing(u)*bj_DEGTORAD)*10
if(x>=fr)or(x<=Oo)then
call GroupRemoveUnit(tx,u)
call RemoveUnit(u)
else
set y=GetUnitY(u)+Sin(GetUnitFacing(u)*bj_DEGTORAD)*10
if(y>=Fr)or(y<=Xo)then
set y=GetUnitY(u)+Sin((360-GetUnitFacing(u))*bj_DEGTORAD)*30
call SetUnitFacing(u,360-GetUnitFacing(u))
endif
call SetUnitX(u,x)
call SetUnitY(u,y)
set i=GetUnitUserData(u)+1
if(i>50)then
call SetUnitUserData(u,0)
set av=u
set eF=CreateGroup()
call GroupEnumUnitsInRange(eF,x,y,700,Rv)
set u2=GroupPickRandomUnit(eF)
if(u2!=null)then
if IsUnitType(u2,UNIT_TYPE_FLYING)then
call aN(Sv,u,u2)
else
call aN(tv,u,u2)
call aN(Tv,u,u2)
endif
endif
call DestroyGroup(eF)
set eF=null
else
call SetUnitUserData(u,i)
endif
endif
endloop
call DestroyGroup(g)
set g=null
if IsUnitGroupEmptyBJ(tx)then
call PauseTimer(Bo)
endif
endfunction
function Trig_Ausrotten_Conditions takes nothing returns boolean
return GetSpellAbilityId()=='A01W'
endfunction
function SPELL_Erasor takes nothing returns nothing
local integer i
local unit u
local integer rl
call IB("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",GetSpellAbilityUnit(),"origin")
set fa=GetUnitTypeId((nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])])))
set i=GetUnitPointValueByType(fa)
set rl=xO[(Fi[GetPlayerId(GetOwningPlayer((GetSpellAbilityUnit())))+1])]
call OA(rl)
if i>'d' then
loop
set u=RA(rl)
exitwhen u==null
if GetUnitPointValue(u)==i then
call IB("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",u,"origin")
call nN(rv,GetSpellAbilityUnit(),u)
endif
endloop
else
loop
set u=RA(rl)
exitwhen u==null
if GetUnitTypeId(u)==fa then
call IB("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",u,"origin")
call nN(rv,GetSpellAbilityUnit(),u)
endif
endloop
endif
endfunction
function SPELL_StasisTotem takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call xN(Mv,u)
call TriggerSleepAction(1.)
call ResetUnitAnimation(u)
endfunction
function SPELL_CityOfMagic takes nothing returns nothing
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if(u==null)or not HB(u,GetSpellAbilityUnit())then
return
endif
call nN(Cv,GetSpellAbilityUnit(),u)
call TriggerSleepAction(1.)
call pA(u)
if GetUnitTypeId(u)=='h03A' then
call TriggerSleepAction(44.5)
call IssueImmediateOrderById(u,852055)
call TriggerSleepAction(.5)
call pA(u)
endif
endfunction
function SPELL_Volcano takes nothing returns nothing
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
local integer i
if Kr then
call VN(qv,GetSpellAbilityUnit(),u)
else
call VN(Pv,GetSpellAbilityUnit(),u)
endif
endfunction
function SPELL_AncientPyramide takes nothing returns nothing
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
call oN(Gv,GetSpellAbilityUnit(),u)
endfunction
function SPELL_ShrineOfDestruction takes nothing returns nothing
local unit u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
local integer i=0
loop
exitwhen((GetUnitAbilityLevel((u),'A06V')>0)==false)
set u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
set i=i+1
if(i>=10)then
return
exitwhen true
endif
endloop
if(u==null)then
return
endif
call XB("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl",u)
set i=Fi[(1+GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())))]
set Gi[i]=(Gi[i]+1)
call MultiboardSetItemValueBJ(ar,4,Xa[i],I2S(Gi[i]))
call KillUnit(u)
endfunction
function SPELL_FrostLauncher takes nothing returns nothing
local unit u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
local fogmodifier f
call XB("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",GetSpellAbilityUnit())
if u==null then
return
endif
call cN('h04G',GetSpellAbilityUnit(),GetSpellAbilityUnit(),20.)
if gE then
set f=CreateFogModifierRadius(GetOwningPlayer(GetSpellAbilityUnit()),FOG_OF_WAR_VISIBLE,GetUnitX(u),GetUnitY(u),128.,true,false)
call FogModifierStart(f)
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
call TriggerSleepAction(.1)
call DestroyFogModifier(f)
set f=null
else
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
endif
endfunction
function SPELL_GreaterFrostLauncher takes nothing returns nothing
local unit u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
local fogmodifier f
call XB("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",GetSpellAbilityUnit())
if u==null then
return
endif
call cN('h04H',GetSpellAbilityUnit(),GetSpellAbilityUnit(),20.)
if gE then
set f=CreateFogModifierRadius(GetOwningPlayer(GetSpellAbilityUnit()),FOG_OF_WAR_VISIBLE,GetUnitX(u),GetUnitY(u),128.,true,false)
call FogModifierStart(f)
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
call TriggerSleepAction(.1)
call DestroyFogModifier(f)
set f=null
else
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
endif
endfunction
function SPELL_Annihilator takes nothing returns nothing
local location l1=GetUnitLoc(GetTriggerUnit())
local location l2
local integer i=0
local real nR=bj_RADTODEG*Atan2(GetUnitY(GetSpellTargetUnit())-GetUnitY(GetTriggerUnit()),GetUnitX(GetSpellTargetUnit())-GetUnitX(GetTriggerUnit()))
set nR=ModuloReal(nR+20,360)
loop
exitwhen i>3
set nR=ModuloReal(nR+350,360)
set l2=rR(l1,'d',nR)
call EN(Q,GetTriggerUnit(),GetLocationX(l2),GetLocationY(l2))
call RemoveLocation(l2)
set i=i+1
endloop
call RemoveLocation(l1)
set l1=null
set l2=null
endfunction
function SPELL_GruntSergeant takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local unit u2
local group g=CreateGroup()
local real xF
local real x=GetUnitX(GetSpellTargetUnit())
local real y=GetUnitY(GetSpellTargetUnit())
local real aR=SquareRoot((GetUnitX(u)-x)*(GetUnitX(u)-x)+(GetUnitY(u)-y)*(GetUnitY(u)-y))
call cN('h09Q',u,u,3)
call IssuePointOrderById(bj_lastCreatedUnit,851984,x,y)
call TriggerSleepAction(aR/ 700)
call iN(cv,u,x,y)
set av=u
call GroupEnumUnitsInRange(g,x,y,300,Rv)
loop
set u2=FirstOfGroup(g)
exitwhen u2==null
call GroupRemoveUnit(g,u2)
set xF=RMinBJ(GetUnitState(u2,UNIT_STATE_MANA),'d')
call SetUnitState(u2,UNIT_STATE_MANA,GetUnitState(u2,UNIT_STATE_MANA)-xF)
if(xF>0)then
call IB("Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdl",u2,"origin")
call UnitDamageTarget(bj_lastCreatedUnit,u2,xF,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
endloop
call DestroyGroup(g)
set g=null
endfunction
function SPELL_MineLayer takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local player p=GetOwningPlayer(u)
local real aR=GetRandomReal(70,350)
local real nR=GetRandomReal(0,360)
local real x=GetUnitX(u)+aR*Cos(nR*bj_DEGTORAD)
local real y=GetUnitY(u)+aR*Sin(nR*bj_DEGTORAD)
call cN('h09M',u,u,3)
call IssuePointOrderById(bj_lastCreatedUnit,851984,x,y)
call TriggerSleepAction(aR/ 700)
set u=CreateUnit(p,'n025',x,y,nR)
call GroupAddUnit(Ki,u)
endfunction
function SPELL_Dragonhawk takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local group g=CreateGroup()
local integer i=0
local unit u2
set av=u
call GroupEnumUnitsInRange(g,GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()),400,Ov)
loop
set u2=FirstOfGroup(g)
set i=i+1
exitwhen u2==null
exitwhen i>4
call GroupRemoveUnit(g,u2)
call aN(ev,u,u2)
endloop
call DestroyGroup(g)
set g=null
endfunction
function SPELL_Druid takes nothing returns nothing
call aN(xv,GetSpellAbilityUnit(),GetSpellTargetUnit())
endfunction
function SPELL_SageDruid takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local group g=CreateGroup()
local integer i=0
local unit u2
call GroupEnumUnitsInRange(g,GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()),350,null)
loop
exitwhen i>2
set u2=FirstOfGroup(g)
exitwhen u2==null
call GroupRemoveUnit(g,u2)
if(not IsUnitType(u2,UNIT_TYPE_DEAD))and((Fi[GetPlayerId(GetOwningPlayer((u2)))+1])!=(Fi[GetPlayerId(GetOwningPlayer((u)))+1]))and IsUnitType(u2,UNIT_TYPE_GROUND)then
set i=i+1
call aN(Hv,u,u2)
endif
endloop
call DestroyGroup(g)
set g=null
endfunction
function SPELL_IceQueen takes nothing returns nothing
call nN(dv,GetSpellAbilityUnit(),GetSpellTargetUnit())
endfunction
function SPELL_AncientWandigoo takes nothing returns nothing
call xN(q,GetSpellAbilityUnit())
call IB("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",GetSpellAbilityUnit(),"origin")
endfunction
function SPELL_Magnataur takes nothing returns nothing
call xN(Fv,GetSpellAbilityUnit())
call IB("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetSpellAbilityUnit(),"origin")
endfunction
function SPELL_ChaosChamp takes nothing returns nothing
call IB("Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl",GetSpellAbilityUnit(),"origin")
call xN(T,GetSpellAbilityUnit())
endfunction
function SPELL_Warlock takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call UnitRemoveAbility(GetSpellAbilityUnit(),'A00F')
call xN(Qv,u)
call IB("Units\\NightElf\\Wisp\\WispExplode.mdl",u,"origin")
call TriggerSleepAction(.3)
call IssuePointOrderByIdLoc(u,851986,Yx[ModuloInteger(Fi[(1+GetPlayerId(GetOwningPlayer(u)))]+1,2)])
call TriggerSleepAction(5)
call IssueImmediateOrderById(u,851993)
call TriggerSleepAction(6.6)
call UnitAddAbility(u,'A00F')
call pA(u)
endfunction
function SPELL_Wizard takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call aN(sv,u,GetSpellTargetUnit())
call TriggerSleepAction(.8)
call pA(u)
endfunction
function SPELL_Sorceress takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call aN(lv,u,GetSpellTargetUnit())
call TriggerSleepAction(.8)
call pA(u)
endfunction
function SPELL_NagaSiren takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call aN(gv,u,GetSpellTargetUnit())
call IssueImmediateOrderById(u,852126)
call TriggerSleepAction(1.)
call MA(u)
endfunction
function SPELL_Troll takes nothing returns nothing
call aN(pv,GetSpellAbilityUnit(),GetSpellTargetUnit())
endfunction
function SPELL_Paladin takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call IssueTargetOrderById(u,852066,GetSpellTargetUnit())
call TriggerSleepAction(1.)
call MA(u)
endfunction
function SPELL_PaladinRezz takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
local location l=GetUnitLoc(u)
local group g
set av=u
set g=XR(900.,l,Vv)
call UnitAddAbility(GetSpellTargetUnit(),'A03L')
if(CountUnitsInGroup(g)>0)then
call IssueImmediateOrderById(u,852094)
call TriggerSleepAction(1.)
call pA(u)
endif
call DestroyGroup(g)
call RemoveLocation(l)
set l=null
set g=null
endfunction
function SPELL_FaerieDragon takes nothing returns nothing
local unit u=GetSpellAbilityUnit()
call TriggerSleepAction(1.2)
call IssuePointOrderByIdLoc(u,851983,Yx[(Fi[GetPlayerId(GetOwningPlayer((u)))+1])])
endfunction
function oF takes unit u returns boolean
if GetUnitAbilityLevel(u,'A03U')==1 then
return true
endif
set I=(Fi[GetPlayerId(GetOwningPlayer((u)))+1])
if Yo[I*4096+GetUnitUserData(u)]>7 then
if kA(u,qx[I])then
return true
else
set Yo[I*4096+GetUnitUserData(u)]=0
if false then
return false
endif
endif
endif
if(not(GetUnitCurrentOrder(u)==0))then
return false
endif
if(not(GetUnitAbilityLevel(u,'A07I')==0))then
return false
endif
return true
endfunction
function rF takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer iF=GetHandleId(t)
local unit u=LoadUnitHandle(kE,0,iF)
call SetUnitPathing(u,true)
call RemoveSavedHandle(kE,0,iF)
call DestroyTimer(t)
set t=null
endfunction
function aF takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer iF=GetHandleId(t)
local unit u=LoadUnitHandle(kE,0,iF)
call pA(u)
call TimerStart(t,2,false,function rF)
endfunction
function nF takes unit u returns nothing
local integer i=GetUnitUserData(u)
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local timer t
if(RAbsBJ(x-Qi[i])+RAbsBJ(y-Ti[i]))>'d' then
set Vr[i]=0
set Qi[i]=GetUnitX(u)
set Ti[i]=GetUnitY(u)
return
endif
set Vr[i]=Vr[i]+1
set Qi[i]=GetUnitX(u)
set Ti[i]=GetUnitY(u)
if(Vr[i]>1)then
set Vr[i]=0
call SetUnitPathing(u,false)
set t=CreateTimer()
call TimerStart(t,.1,false,function aF)
call SaveUnitHandle(kE,0,GetHandleId(t),u)
endif
endfunction
function VF takes nothing returns nothing
local unit u
local integer rl
local integer t=0
loop
exitwhen(t)>1
set rl=xO[t]
call OA(rl)
loop
set u=RA(rl)
exitwhen u==null
if(oF(u))then
call pA(u)
if not Sx then
call nF(u)
endif
endif
endloop
set t=t+1
endloop
endfunction
function EF takes nothing returns boolean
return(Eo==0)
endfunction
function XF takes nothing returns boolean
return(Mi>1)
endfunction
function OF takes nothing returns boolean
return(Mi==1)
endfunction
function RF takes nothing returns boolean
return(Mi<=0)
endfunction
function IF takes nothing returns boolean
return(Eo==1)
endfunction
function AF takes nothing returns boolean
return(Eo==2)
endfunction
function NF takes nothing returns boolean
return(Eo==3)
endfunction
function bF takes nothing returns boolean
return(Eo==4)
endfunction
function BF takes nothing returns boolean
return(Eo==5)
endfunction
function cF takes nothing returns boolean
return(Eo==6)
endfunction
function CF takes nothing returns boolean
return(Eo==7)
endfunction
function dF takes nothing returns boolean
return(Eo==8)
endfunction
function DF takes nothing returns boolean
return(Eo==9)
endfunction
function fF takes nothing returns boolean
return(Fa)
endfunction
function FF takes nothing returns boolean
return(Eo==10)
endfunction
function gF takes nothing returns boolean
return(Eo==11)
endfunction
function GF takes nothing returns boolean
return(Eo==12)
endfunction
function Trig_boonreminder_Func018001 takes nothing returns boolean
return(Eo==12)
endfunction
function hF takes nothing returns nothing
set Mi=((Wx-1)-IMaxBJ(ia[0],ia[1]))
if(EF())then
set fx="|cffFFFF80If you are new to this map, check the |cff80FF00Manual|cffFFFF80 (|cffFFBA17F9|cffFFFF80). You can find some useful basic hints there!|r"
endif
if(IF())then
if(RF())then
set Eo=(Eo+1)
else
if(OF())then
set fx=(("|cffFFFF80There is at least |cffFFDF00"+I2S(Mi))+"|cffFFFF80 additional round after this one. Please don't leave after this round!|r")
else
if(XF())then
set fx=(("|cffFFFF80There are at least |cffFFDF00"+I2S(Mi))+"|cffFFFF80 additional rounds after this one. Please don't leave after this round!|r")
endif
endif
endif
endif
if(AF())then
set fx="|cffFFFF80Your worker has |c00ff0000one|cffFFFF80 rescue strike - use it wisely, it can decide the game!|r"
endif
if(NF())then
set fx="|cffFFFF80If you can't beat the enemy on your lane, a tower may help. Build it in the center area, so it can attack units on both lanes! Note that Chaos & Naga have no towers.|r"
endif
if(bF())then
set fx="|cffFFFF80Try to counter your enemy by building units that deal bonus damage against the enemy's armor type. Type |c00ff0000-armor|cffFFFF80 if you don't know how to counter!|r"
endif
if(BF())then
set fx="|cffFFFF80If you want to learn more about this game or discuss your strategies visit |cffFFBF00http://www.eeve.org|cffFFFF80.|r"
endif
if(cF())then
set fx="|cffFFFF80Each race has at least one very powerful legendary building. However, legendaries require one piece of food and much gold to be built.|r"
endif
if(CF())then
set fx="|cffFFFF80The Main Castle sells items that can be very useful in certain situations. In addition, you can buy another piece of food there.|r"
endif
if(dF())then
set fx="|cffFFFF80Income calculation is very easy: Each building gives you a part of its own price as income. Unit producing buildings give more income than special buildings. Towers give least income.|r"
endif
if(DF())then
set fx="|cffFFFF80Castle Fight is about countering your enemy. Always watch, what your enemies and your own team builds. Then, try to build what helps most in the current situation.|r"
endif
if(FF())then
if(fF())then
set Eo=(Eo+1)
else
set fx="|cffFFFF80Four seconds after you receive the message \"Bounty Incoming!\" a coin will spawn somewhere in your base. If you pick it up with your worker you will gain some bonus gold. But hurry, it disappears fast.|r"
endif
endif
if(gF())then
set fx="|cffFFFF80Castle Fight is a team game. If you are unable to hold your lane or counter your enemy, talk to your team. Hopefully, they will help you out.|r"
endif
if(GF())then
set fx="|cffFFFF80There are many different game modes and modifications for Castle Fight. Try them all! You can find a list of them on the webpage or in the manual.|r"
endif
set fx=("|cff80FF00Hint: |r"+fx)
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,fx)
if((Eo==12))then
set Eo=0
else
set Eo=(Eo+1)
endif
endfunction
function HF takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffFFFF80Bounty incoming!|r")
call StartTimerBJ(zx[0],false,4.)
endfunction
function jF takes nothing returns boolean
return(nr[bj_forLoopAIndex]==false)
endfunction
function JF takes nothing returns nothing
set bj_forLoopAIndex=0
set bj_forLoopAIndexEnd=1
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(jF())then
set ri[bj_forLoopAIndex]=-10
endif
call RemoveItem(mx[bj_forLoopAIndex])
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function kF takes nothing returns boolean
return(nr[bj_forLoopAIndex]==false)
endfunction
function KF takes nothing returns boolean
return(GetItemTypeId(GetEnumItem())=='I000')
endfunction
function lF takes nothing returns nothing
if(KF())then
call RemoveItem(GetEnumItem())
endif
endfunction
function LF takes nothing returns nothing
set bj_forLoopAIndex=0
set bj_forLoopAIndexEnd=1
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(kF())then
set ri[bj_forLoopAIndex]=-10
endif
call EnumItemsInRectBJ(Mx[bj_forLoopAIndex],function lF)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function mF takes nothing returns nothing
set ba=(ba+3.)
call StartTimerBJ(zx[1],false,4.75)
set bj_forLoopAIndex=0
set bj_forLoopAIndexEnd=1
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call CreateItemLoc('I000',GetRandomLocInRect(Mx[bj_forLoopAIndex]))
call AddSpecialEffectLocBJ(GetItemLoc(bj_lastCreatedItem),"Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
set nr[bj_forLoopAIndex]=false
set mx[bj_forLoopAIndex]=bj_lastCreatedItem
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function MF takes nothing returns nothing
set ba=(ba+3.)
call StartTimerBJ(zx[1],false,7.)
set bj_forLoopAIndex=0
set bj_forLoopAIndexEnd=1
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set bj_forLoopBIndex=1
set bj_forLoopBIndexEnd=uo
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
call CreateItemLoc('I000',GetRandomLocInRect(Mx[bj_forLoopAIndex]))
call AddSpecialEffectLocBJ(GetItemLoc(bj_lastCreatedItem),"Abilities\\Spells\\Demon\\DarkPortal\\DarkPortalTarget.mdl")
call DestroyEffect(bj_lastCreatedEffect)
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set nr[bj_forLoopAIndex]=false
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
function pF takes nothing returns nothing
set D=(1+GetPlayerId(GetEnumPlayer()))
set F=jI(D)
set ao[Fi[D]]=ao[Fi[D]]+F
call AdjustPlayerStateBJ(F,GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD)
set Hr[D]=Hr[D]+F
call DisplayTextToPlayer(GetEnumPlayer(),0,0,"Income: |cffFFFF00"+I2S(F)+"|r")
endfunction
function PF takes nothing returns nothing
set ao[0]=0
set ao[1]=0
call ForForce(Ba,function pF)
call kb(ar,4,Xa[0]-1,I2S(ao[0]))
call kb(ar,4,Xa[1]-1,I2S(ao[1]))
endfunction
function qF takes nothing returns nothing
local location l=GetRandomLocInRect(Mx[Fi[(1+GetPlayerId(GetOwningPlayer(GetEnumUnit())))]])
call IssuePointOrderByIdLoc(GetEnumUnit(),851984,l)
call RemoveLocation(l)
set l=null
endfunction
function QF takes nothing returns nothing
call ForGroupBJ(Lo,function qF)
endfunction
function sF takes nothing returns nothing
set yo=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetEnumUnit()))))+1]))])]))
call IssueTargetOrderById(GetEnumUnit(),851983,yo)
endfunction
function SF takes nothing returns nothing
call ForGroupBJ(da,function sF)
endfunction
function tF takes nothing returns boolean
return(GetSpellAbilityId()=='A08Y')
endfunction
function TF takes nothing returns nothing
local location l=GetSpellTargetLoc()
call iN(jv,GetTriggerUnit(),GetLocationX(l),GetLocationY(l))
call RemoveLocation(l)
set l=null
endfunction
function uF takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I008')
endfunction
function UF takes nothing returns nothing
call IN(vv,GetManipulatingUnit(),GetLocationX(aa),GetLocationY(aa))
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+600
endfunction
function wF takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I007')
endfunction
function WF takes nothing returns nothing
call IN(hv,GetManipulatingUnit(),GetLocationX(aa),GetLocationY(aa))
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+1400
endfunction
function yF takes nothing returns boolean
return GetItemTypeId(GetManipulatedItem())=='I004'
endfunction
function YF takes nothing returns nothing
call RemoveItem(GetManipulatedItem())
if px then
call AdjustPlayerStateBJ(1500,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_GOLD)
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cffFF0000You can't buy lumber! No Legendaries is activated!|r")
else
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+1500
call AdjustPlayerStateBJ(1,GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_FOOD_CAP)
endif
endfunction
function zF takes nothing returns boolean
return(Ii==false)
endfunction
function ZF takes nothing returns boolean
return(Ri==false)
endfunction
function vg takes nothing returns nothing
if(ZF())then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Units Only|r has been chosen. You can build only unit producing structures.")
set Ri=true
call TriggerExecute(Xn)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h01P',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h056',true,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
if(zF())then
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h008',true,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endif
endfunction
function eg takes nothing returns boolean
return(Ii==false)
endfunction
function xg takes nothing returns boolean
return(Ea==false)
endfunction
function og takes nothing returns nothing
if(xg())then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Specials|r has been chosen. You can't build special buildings with food cost except towers and Treasure Boxes.")
set Ea=true
call TriggerExecute(Xn)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h01P',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h056',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h014',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h03Q',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h01O',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('o000',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h006',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('n01J',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h073',true,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h05L',true,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
if(eg())then
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h008',true,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endif
endfunction
function rg takes nothing returns boolean
return(Kr==false)
endfunction
function ig takes nothing returns nothing
if(rg())then
set Kr=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Artillery|r has been chosen. You cannot build structures that attack enemy structures.")
call TriggerExecute(Xn)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h001',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h048',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h01E',false,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endfunction
function ag takes nothing returns boolean
return(Sx==false)
endfunction
function ng takes nothing returns nothing
if(ag())then
set Sx=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Caging|r has been chosen. You can trap units with your buildings")
endif
endfunction
function Vg takes nothing returns boolean
return(Ii==false)
endfunction
function Eg takes nothing returns nothing
if(Vg())then
set Ii=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Treasure Box|r has been chosen. You cannot build Treasure Boxes.")
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h008',false,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endfunction
function Xg takes nothing returns boolean
return(vi==false)
endfunction
function Og takes nothing returns nothing
if(Xg())then
set vi=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Bounty|r has been chosen. Neither units nor buildings will give bounty when destroyed.")
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerFlagBJ(PLAYER_STATE_GIVES_BOUNTY,false,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endfunction
function Rg takes nothing returns boolean
return(pr!=1000.)
endfunction
function Ig takes nothing returns nothing
if(Rg())then
set pr=1000.
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Taxes|r has been chosen. You don't have to pay taxes on your income.")
endif
endfunction
function Ag takes nothing returns boolean
return(Ar==false)
endfunction
function Ng takes nothing returns nothing
if(Ag())then
set Ar=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Domination|r has been chosen. You gain extra income by controlling the lanes")
set Ei[0]=xn
set Ei[1]=on
set Da[0]="upper"
set Da[1]="lower"
endif
endfunction
function bg takes nothing returns boolean
return(pr!=12.5)
endfunction
function Bg takes nothing returns nothing
if(bg())then
set pr=12.5
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00High Taxes|r has been chosen. Tax rate increases 10% every 12.5 income.")
endif
endfunction
function cg takes nothing returns boolean
return(ji==false)
endfunction
function Cg takes nothing returns nothing
if(cg())then
set ji=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Items|r has been chosen. The castle doesn't sell any items.")
endif
endfunction
function dg takes nothing returns boolean
return(px==false)
endfunction
function Dg takes nothing returns nothing
if(dg())then
set px=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Legendaries|r has been chosen. You don't get lumber to buy legendary buildings.")
endif
endfunction
function fg takes nothing returns boolean
return(mi==false)
endfunction
function Fg takes nothing returns nothing
if(fg())then
set mi=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Tech Mode|r has been chosen. You need teching to buy stronger buildings.")
endif
endfunction
function gg takes nothing returns boolean
return(Cx==false)
endfunction
function Gg takes nothing returns nothing
if(gg())then
set Cx=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Fixed income|r has been chosen. Players start with 100 gold and 30 gold income. Only treasure boxes increase income.")
endif
endfunction
function hg takes nothing returns boolean
return(fo==false)
endfunction
function Hg takes nothing returns nothing
if(hg())then
set fo=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Rescue Strike|r has been chosen. Your worker doesn't have a Rescue Strike!")
endif
endfunction
function jg takes nothing returns boolean
return(fi==false)
endfunction
function Jg takes nothing returns nothing
if(jg())then
set fi=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Nuclear Battle|r has been chosen. Your Main Castle sells nuke launchers!")
endif
endfunction
function kg takes nothing returns boolean
return(uo!=1)
endfunction
function Kg takes nothing returns nothing
if(kg())then
set Fa=true
set uo=1
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Coin|r has been chosen. There will be a coin spawn every 40 seconds.")
endif
endfunction
function lg takes nothing returns boolean
return(Gr)
endfunction
function Lg takes nothing returns nothing
if(lg())then
set Gr=false
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Dual Race|r has been chosen. Each race can be chosen more than once per team.")
endif
endfunction
function mg takes nothing returns boolean
return(oi==false)
endfunction
function Mg takes nothing returns nothing
if(mg())then
set oi=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Unique Races|r has been chosen. Each race can be chosen only once (even across the teams).")
endif
endfunction
function pg takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00League Mode|r has been chosen! Auto Team Balance disabled!")
call TriggerExecute(yV)
set ii=0
call TriggerExecute(PV)
set Ci=true
endfunction
function Pg takes nothing returns boolean
return(to==false)
endfunction
function qg takes nothing returns nothing
local integer i=1
if(Pg())then
set to=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No AFK|r has been chosen. The AI won't take control over afk players.")
call DisableTrigger(VE)
call DisableTrigger(OE)
call DisableTrigger(RE)
call DisableTrigger(EE)
call DisableTrigger(XE)
endif
loop
exitwhen i>12
if Xr[i]then
set Xr[i]=false
call YR(i)
endif
set i=i+1
endloop
endfunction
function Qg takes nothing returns boolean
return(uo!=10)
endfunction
function sg takes nothing returns nothing
if(Qg())then
set uo=10
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Crazy Coins|r has been chosen. Ten coins will spawn every 40 seconds.")
call DisableTrigger(dV)
call DisableTrigger(cV)
call EnableTrigger(DV)
call EnableTrigger(CV)
endif
endfunction
function Sg takes nothing returns boolean
return(Er==false)
endfunction
function tg takes nothing returns nothing
if(Sg())then
set Er=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00No Air|r has been chosen. You can't buy structures that train flying creeps.")
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SetPlayerUnitAvailableBJ('h03I',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h01S',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h009',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h02P',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h00B',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h015',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h01Y',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h04O',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h06Y',false,Player(-1+(bj_forLoopAIndex)))
call SetPlayerUnitAvailableBJ('h05J',false,Player(-1+(bj_forLoopAIndex)))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endfunction
function Tg takes nothing returns boolean
return(hr==false)
endfunction
function ug takes nothing returns nothing
if(Tg())then
set hr=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Stable Mode|r has been chosen. You can't choose new races.")
set Yr=(Yr-1)
endif
endfunction
function Ug takes nothing returns nothing
local integer tb
if not IsPlayerInForce(GetTriggerPlayer(),er)then
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"You have already agreed!")
return
endif
call ForceRemovePlayer(er,GetTriggerPlayer())
set tb=CountPlayersInForceBJ(er)
if tb>0 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(GetTriggerPlayer()))]+" has agreed, "+I2S(tb)+" more votes needed")
endif
call Sb()
endfunction
function wg takes nothing returns nothing
local string s
set s="Your basic income is |cffFFFF00"+I2S(gI((1+GetPlayerId(GetTriggerPlayer()))))
set s=s+"|r. Your Treasure Box income multiplier is |cffFFFF00 "+R2SW((fI(Kx[((1+GetPlayerId(GetTriggerPlayer())))])),1,2)
set s=s+"|r, boosting your income to |cffFFFF00 "+I2S(hI((1+GetPlayerId(GetTriggerPlayer()))))+"|r"
set s=s+"|r. After paying taxes your income is |cffFFFF00 "+I2S(HI((1+GetPlayerId(GetTriggerPlayer()))))
call DisplayTextToForce(BR(GetTriggerPlayer()),s)
endfunction
function Wg takes nothing returns nothing
if Pr[(1+GetPlayerId(GetTriggerPlayer()))]then
call DisplayTextToPlayer(GetTriggerPlayer(),0,0,"|cffFF0000You have already voted for a draw!|r")
else
set Pr[(1+GetPlayerId(GetTriggerPlayer()))]=true
if(qr-dI())>0 then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(GetTriggerPlayer()))]+" has voted for a draw! |cff0000FF"+I2S((qr-dI()))+"|r more players are needed for a restart.")
else
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,Lr[(1+GetPlayerId(GetTriggerPlayer()))]+" has voted for a draw! |cff0000FF")
call DI()
endif
endif
endfunction
function yg takes nothing returns nothing
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFFF00Armor table:")
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFCC00Chaos damage: |cffFFFF00neutral against all|r")
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFCC00Normal damage:         |cff00FF00good against:|r medium |cffFF0000bad against:|r light")
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFCC00Pierce damage:           |cff00FF00good against:|r light |cffFF0000bad against:|r heavy")
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFCC00Magic damage:           |cff00FF00good against:|r heavy |cffFF0000bad against:|r medium")
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFCC00Siege damage:           |cff00FF00good against:|r fortified  |cffFF0000bad against:|r all others")
call DisplayTextToForce(BR(GetTriggerPlayer()),"|cffFFCC00Note:|r All attack types are |cffFF0000bad|r against divine besides chaos!")
endfunction
function Yg takes nothing returns nothing
call gA((1+GetPlayerId(GetTriggerPlayer())))
endfunction
function zg takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I001')
endfunction
function Zg takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I003')
endfunction
function vG takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I00A')
endfunction
function eG takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I009')
endfunction
function xG takes nothing returns boolean
return(GetItemTypeId(GetManipulatedItem())=='I005')
endfunction
function oG takes nothing returns nothing
if(zg())then
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+150)
endif
if(Zg())then
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+650)
endif
if(vG())then
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+575)
endif
if(eG())then
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+500)
endif
if(xG())then
set Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=(Qo[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]+150)
endif
endfunction
function rG takes nothing returns integer
local integer i=1
local integer iG=-1
local integer aG=1
loop
exitwhen i>12
if(Si[i]>iG)then
set iG=Si[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function nG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(jI(i)>iG)then
set iG=jI(i)
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function VG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(Hr[i]>iG)then
set iG=Hr[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function EG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(Ao[i]>iG)then
set iG=Ao[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function XG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(yr[i]>iG)then
set iG=yr[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function OG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(Zo[i]>iG)then
set iG=Zo[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function RG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(Cr[i]>iG)then
set iG=Cr[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function IG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(tr[i]>iG)then
set iG=tr[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function AG takes nothing returns integer
local integer i=1
local integer iG=0
local integer aG=1
loop
exitwhen i>12
if(So[i]>iG)then
set iG=So[i]
set aG=i
endif
set i=i+1
endloop
return aG
endfunction
function NG takes nothing returns integer
local integer i=1
local integer iG=0
local integer bG=0
local integer aG=1
loop
exitwhen i>12
if(Ia==i)then
set bG=10000
endif
set bG=fA(i)-bG
if(bG>iG)then
set iG=bG
set aG=i
endif
set bG=0
set i=i+1
endloop
return aG
endfunction
function BG takes nothing returns nothing
local string cG=""
local integer FA=0
call eR(2)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,"|cffFFFF80-----------  End of round statistics  -----------|r")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,"Round time: "+mA())
set Jo=R2I((TimerGetElapsed(si)+17)/ 60)
set cG="Highest income: "+Lr[nG()]+" - "+pi+I2S(jI(nG()))+"|r"
if(nG()==VG())then
set cG=cG+" ("+pi+I2S(Hr[VG()])+"|r gold in total)"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
set cG="Most gold gained from income: "+Lr[VG()]+" - "+pi+I2S(Hr[VG()])+"|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
endif
if(uo!=0)then
set cG="Most coins collected: "+Lr[XG()]+" - "+pi+I2S(yr[XG()])+"|r"
if(XG()==OG())then
set cG=cG+" ("+pi+I2S(Zo[OG()])+"|r gold in total)"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
set cG="Most gold gained from coins: "+Lr[OG()]+" - "+pi+I2S(Zo[OG()])+"|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
endif
endif
set FA=fA(NG())
if(NG()==Ia)then
set FA=FA-10000
endif
set cG="Most units killed: "+Lr[RG()]+" - "+pi+I2S(Cr[RG()])+"|r"
if(RG()==NG())then
set cG=cG+" ("+pi+I2S(FA)+"|r gold in total)"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
set cG="Most gold gained from bounty: "+Lr[NG()]+" - "+pi+I2S(FA)+"|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
endif
set cG="Most creepspawning buildings: "+Lr[IG()]+" - "+pi+I2S(tr[IG()])+"|r"
if(IG()==EG())then
set cG=cG+" ("+pi+I2S(Ao[EG()])+"|r units in total)"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
set cG="Most units trained: "+Lr[EG()]+" - "+pi+I2S(Ao[EG()])+"|r"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
endif
if(Ea==false)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,"Most special buildings: "+Lr[AG()]+" - "+pi+I2S(So[AG()])+"|r")
endif
set cG="Most damage dealt with RS: "+Lr[rG()]+" - "+pi+I2S(Si[rG()])+"|r ("+pi+I2S(so[rG()])+"|r units killed)"
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,cG)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20,"|cffFFFF80----------------------------------------------------|r")
set FA=0
set cG=""
endfunction
function CG takes nothing returns nothing
local integer i=0
if KE>4 then
if cx and TimerGetRemaining(Bx)<=0 then
set cx=false
call DestroyTimer(Bx)
set Bx=null
endif
call ForForce(Me,function pc)
set KE=-1
endif
set KE=KE+1
call gN(0)
call gN(1)
call ForForce(Me,function FN)
endfunction
function dG takes integer zR returns nothing
call rc(zR)
call sB(zR)
endfunction
function DG takes integer zR returns nothing
if not IsPlayerInForce(Player(zR-1),Me)then
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[zR]+"|cffCA0000 is AFK!|r AI took control over his units."))
call dG(zR)
call SetPlayerName(Player(zR-1),GetPlayerName(Player(zR-1))+" - AFK")
set Lr[zR]=SubString(Lr[zR],0,StringLength(Lr[zR])-2)+" - AFK|r"
call eR(2)
call EnableTrigger(nE)
endif
endfunction
function fG takes nothing returns nothing
local integer i
if(to==false)then
if(IsPlayerInForce(GetOwningPlayer(GetEnumUnit()),Me)==false)then
set i=GetPlayerId(GetOwningPlayer(GetEnumUnit()))
if not Ur[i+1]then
set ra[i]=ra[i]+1
else
set ra[i]=0
endif
set Ur[i+1]=false
if(ra[i]==20)then
call DisplayTextToPlayer(GetOwningPlayer(GetEnumUnit()),0,0,"|cffCA0000WARNING|r: You did not move your worker for 5 minutes. AI will take control in 30 seconds!")
elseif(ra[i]==22)then
set Xr[i+1]=true
call DG(i+1)
endif
elseif Xr[GetPlayerId(GetOwningPlayer(GetEnumUnit()))+1]then
call DisplayTextToPlayer(GetOwningPlayer(GetEnumUnit()),0,0,"|cffCA0000WARNING|r: AI took control over your units! Type -re to disable AI.")
endif
endif
endfunction
function FG takes nothing returns nothing
call ForGroup(Hx,function fG)
endfunction
function gG takes nothing returns nothing
set Ur[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]=true
endfunction
function GG takes nothing returns nothing
set Ur[(1+GetPlayerId(GetTriggerPlayer()))]=true
endfunction
function hG takes nothing returns nothing
set Xr[(1+GetPlayerId(GetEnumPlayer()))]=true
call DG((1+GetPlayerId(GetEnumPlayer())))
endfunction
function HG takes nothing returns nothing
if Oi then
call ForForce(dr[GetPlayerId(GetTriggerPlayer())],function hG)
else
set Xr[(1+GetPlayerId(GetTriggerPlayer()))]=true
call DG((1+GetPlayerId(GetTriggerPlayer())))
endif
endfunction
function jG takes nothing returns nothing
set Xr[(1+GetPlayerId(GetEnumPlayer()))]=false
call YR((1+GetPlayerId(GetEnumPlayer())))
endfunction
function JG takes nothing returns nothing
if Oi then
call ForForce(dr[GetPlayerId(GetTriggerPlayer())],function jG)
else
set Xr[(1+GetPlayerId(GetTriggerPlayer()))]=false
call YR((1+GetPlayerId(GetTriggerPlayer())))
endif
endfunction
function kG takes nothing returns nothing
local player p=GetTriggerPlayer()
set qr=(qr-1)
set Pr[(1+GetPlayerId(GetTriggerPlayer()))]=false
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,(Lr[(1+GetPlayerId(GetTriggerPlayer()))]+"|cffCA0000 has left the game!|r"))
call dG((1+GetPlayerId(GetTriggerPlayer())))
call SetPlayerName(GetTriggerPlayer(),("Bot "+I2S((1+GetPlayerId(GetTriggerPlayer())))))
set Lr[(1+GetPlayerId(GetTriggerPlayer()))]=(Fo[(1+GetPlayerId(GetTriggerPlayer()))]+(GetPlayerName(GetTriggerPlayer())+"|r"))
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("The leaver's"+(" units are controlled by |cffCA0000AI|r (Bot"+(I2S((1+GetPlayerId(GetTriggerPlayer())))+")!"))))
call eR(2)
call EnableTrigger(nE)
call vc(GetPlayerId(p))
endfunction
function KG takes nothing returns boolean
return(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)!=null)
endfunction
function lG takes integer SB,unit UD returns boolean
local real LG=GetUnitX(UD)-I2R(LE)*lE
local real mG=GetUnitY(UD)-I2R(LE)*lE
local real x=LG
local real y=mG
local real MG=x
local real pG=y
local integer PG=0
local group g
local integer i=0
local integer OI=0
local integer Zb=(LE*2+1)
set av=br[SB]
loop
exitwhen i>=Zb*Zb
set g=CreateGroup()
call GroupEnumUnitsInRange(g,x,y,700,Ev)
set OI=CountUnitsInGroup(g)
call DestroyGroup(g)
set g=null
if OI>PG or(OI==PG and GetRandomInt(0,99)<30)then
set PG=OI
set MG=x
set pG=y
endif
set x=LG+lE*I2R(ModuloInteger(i,Zb))
set y=mG+lE*I2R(i/ Zb)
set i=i+1
endloop
if PG<mE then
return false
endif
call IssuePointOrderById(av,852488,MG,pG)
return true
endfunction
function qG takes nothing returns nothing
local unit u=LoadUnitHandle(ME,1,(LoadInteger(o,0,GetHandleId((GetExpiredTimer())))))
if u!=null and GetUnitTypeId(u)!=0 and IsUnitInGroup(u,me)then
call GroupRemoveUnit(me,u)
endif
call WR(GetExpiredTimer())
call RemoveSavedHandle(ME,1,(LoadInteger(o,0,GetHandleId((GetExpiredTimer())))))
set u=null
endfunction
function QG takes nothing returns nothing
local timer t
local real r
if B and Fi[1+GetPlayerId(GetEnumPlayer())]==Fi[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]and GetUnitAbilityLevel(br[1+GetPlayerId(GetEnumPlayer())],'A005')==1 then
if not lG(1+GetPlayerId(GetEnumPlayer()),GetAttacker())and ge>=1 then
call BI("The AI won't strike, because there are too few attackers around!")
endif
call GroupAddUnit(me,GetTriggerUnit())
set t=wR()
call SaveUnitHandle(ME,1,GetHandleId(t),GetTriggerUnit())
if GetUnitTypeId(GetTriggerUnit())=='hcas' then
set r=15.
else
set r=40.
endif
call TimerStart(t,r,false,function qG)
set B=false
endif
endfunction
function sG takes nothing returns nothing
local unit u=LoadUnitHandle(ME,0,GetHandleId(GetExpiredTimer()))
call RemoveSavedHandle(ME,0,GetHandleId(GetExpiredTimer()))
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
if u!=null then
call GroupRemoveUnit(nx[(Fi[GetPlayerId(GetOwningPlayer((u)))+1])],u)
endif
endfunction
function SG takes nothing returns nothing
local timer t
set R=GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)/ GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE)
if R<=.9 then
set I=(Fi[GetPlayerId(GetOwningPlayer((GetTriggerUnit())))+1])
call GroupAddUnit(ix[I],GetTriggerUnit())
if not IsUnitInGroup(GetTriggerUnit(),nx[I])then
call GroupAddUnit(nx[I],GetTriggerUnit())
set t=CreateTimer()
call TimerStart(t,15.,false,function sG)
call SaveUnitHandle(ME,0,GetHandleId(t),GetTriggerUnit())
set t=null
endif
if R<=.5 then
if De[zi[I]]>uv[I+6]then
call zB(Fi[1+GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])
endif
if R<=.35 then
call GroupAddUnit(ax[I],GetTriggerUnit())
endif
endif
endif
if R>=.6 and IsUnitInGroup(GetTriggerUnit(),me)then
call GroupRemoveUnit(me,GetTriggerUnit())
endif
if R<=.4 and IsUnitType(GetAttacker(),UNIT_TYPE_SAPPER)and not IsUnitInGroup(GetTriggerUnit(),me)and not IsUnitInGroup(GetTriggerUnit(),E)then
set B=true
call ForForce(Me,function QG)
endif
endfunction
function tG takes nothing returns nothing
set ge=3
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"AI Debug ON")
endfunction
function TG takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"AI Debug OFF")
set ge=0
endfunction
function uG takes nothing returns nothing
set ge=1
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"AI Debug ON")
endfunction
function UG takes nothing returns nothing
if Lx then
call DisplayTextToPlayer(Player(0),0,0,"You have already chosen an environment!")
endif
set Lx=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Icy Environment|r has been selected. Note that a custom environment has no influence on gameplay.")
set Ai[0]='Ibsq'
set Ai[1]='Iice'
set Ai[2]='Isnw'
set Ai[3]='Idki'
set Ai[4]='Nsnw'
set Ai[5]='Nsnr'
set Ai[6]='Irbk'
set Ai[7]='Nsnw'
set no[0]='ITtw'
set xa[0]=10
set no[1]='ITtc'
set xa[1]=3
set Zr[0]='B00M'
set Io[0]=.5
set na[0]=.0
set Zr[1]='B00N'
set Io[1]=.5
set na[1]=.0
set Zr[2]='B00O'
set Io[2]=.5
set na[2]=.0
set Zr[3]='B00P'
set Io[3]=.5
set na[3]=.0
set Zr[4]='B00G'
set Io[4]=.97
set na[4]=-30.
call SetTerrainFogExBJ(0,1200.,6000.,0,80.,80.,100.)
set kr=0
call TriggerExecute(DE)
endfunction
function wG takes nothing returns nothing
set Ai[0]='Ibsq'
set Ai[1]='Iice'
set Ai[2]='Isnw'
set Ai[3]='Idki'
set Ai[4]='Nsnw'
set Ai[5]='Nsnr'
set Ai[6]='Irbk'
set no[0]='ITtw'
set xa[0]=10
set no[1]='ITtc'
set xa[1]=3
set Zr[0]='B007'
set Io[0]=1.2
set na[0]=.0
set Zr[1]='B008'
set Io[1]=1.2
set na[1]=.0
set Zr[2]='B009'
set Io[2]=1.2
set na[2]=.0
set Zr[3]='B00A'
set Io[3]=1.2
set na[3]=.0
set Zr[4]='B00G'
set Io[4]=.97
set na[4]=-30.
set kr=0
call TriggerExecute(DE)
endfunction
function WG takes nothing returns nothing
if Lx then
call DisplayTextToPlayer(Player(0),0,0,"You have already chosen an environment!")
endif
set Lx=true
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,"|cffC6FF00Lava Environment|r has been selected. Note that a custom environment has no influence on gameplay.")
set Ai[0]='Ddkr'
set Ai[1]='Dgrs'
set Ai[2]='Dlvc'
set Ai[3]='Dlav'
set Ai[4]='Drds'
set Ai[5]='Ddrt'
set Ai[6]='Dsqd'
set Ai[7]='Dgrs'
set no[0]='B001'
set xa[0]=8
set no[1]='B000'
set xa[1]=10
set Zr[0]='B00H'
set Io[0]=1.1
set na[0]=.0
set Zr[1]='B00J'
set Io[1]=1.1
set na[1]=.0
set Zr[2]='B00K'
set Io[2]=1.1
set na[2]=.0
set Zr[3]='B00L'
set Io[3]=1.1
set na[3]=.0
set Zr[4]='B00I'
set Io[4]=1.
set na[4]=-70.
call SetTerrainFogExBJ(0,1000,3000.,0,50.,.0,.0)
call SetWaterBaseColorBJ('d',.0,.0,0)
set kr=0
call TriggerExecute(DE)
endfunction
function yG takes nothing returns nothing
local integer i=0
local real x
local real y
local real z
local location l
loop
exitwhen i>1
if GetDestructableTypeId(GetEnumDestructable())==Vi[i]then
set x=GetDestructableX(GetEnumDestructable())
set y=GetDestructableY(GetEnumDestructable())
call RemoveDestructable(GetEnumDestructable())
call CreateDestructable(no[i],x,y,GetRandomReal(0,360),1,GetRandomInt(0,xa[i]-1))
return
endif
set i=i+1
endloop
set i=0
loop
exitwhen i>4
if GetDestructableTypeId(GetEnumDestructable())==Ni[i]then
set x=GetDestructableX(GetEnumDestructable())
set y=GetDestructableY(GetEnumDestructable())
set l=GetDestructableLoc(GetEnumDestructable())
set z=GetLocationZ(l)
call RemoveLocation(l)
set l=null
call RemoveDestructable(GetEnumDestructable())
call CreateDestructableZ(Zr[i],x,y,na[i]+z,0,Io[i],1)
return
endif
set i=i+1
endloop
endfunction
function YG takes nothing returns nothing
local real x=0
local real y=kr*512
local real zG
local real ZG
local integer i
local integer j
if(kr<50)then
loop
exitwhen(y>Fr)
set x=0
loop
exitwhen(x>fr)
set i=0
loop
exitwhen i>3
set zG=I2R((i/ 2)*2-1)*x
set ZG=I2R(ModuloInteger(i,2)*2-1)*y
set j=0
loop
exitwhen j>7
if(GetTerrainType(zG,ZG)==Di[j])then
call SetTerrainType(zG,ZG,Ai[j],-1,1,0)
exitwhen true
endif
set j=j+1
endloop
set i=i+1
endloop
set x=x+128
endloop
set y=y+128
if(ModuloReal(y,512)==0)then
set kr=kr+1
call TimerStart(Oa,0,false,null)
return
endif
endloop
set kr=50
call TimerStart(Oa,0,false,null)
return
elseif kr==50 then
set j=0
loop
exitwhen j>6
set Di[j]=Ai[j]
set j=j+1
endloop
call EnumDestructablesInRectAll(bj_mapInitialPlayableArea,function yG)
set j=0
loop
exitwhen j>1
set Vi[j]=no[j]
set j=j+1
endloop
set j=0
loop
exitwhen j>4
set Ni[j]=Zr[j]
set j=j+1
endloop
endif
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 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(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(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(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(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 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(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(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(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(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 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 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(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(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(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(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 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(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(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(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(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)
endfunction
function main takes nothing returns nothing
local weathereffect we
local player p
local unit u
local integer unitID
local trigger t
local real life
local integer LA
local integer vh
local version v
local integer DR
local integer i
call SetCameraBounds(-5632.+GetCameraMargin(CAMERA_MARGIN_LEFT),-3584.+GetCameraMargin(CAMERA_MARGIN_BOTTOM),5632.-GetCameraMargin(CAMERA_MARGIN_RIGHT),3584.-GetCameraMargin(CAMERA_MARGIN_TOP),-5632.+GetCameraMargin(CAMERA_MARGIN_LEFT),3584.-GetCameraMargin(CAMERA_MARGIN_TOP),5632.-GetCameraMargin(CAMERA_MARGIN_RIGHT),-3584.+GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCAshenvale\\DNCAshenvaleTerrain\\DNCAshenvaleTerrain.mdl","Environment\\DNC\\DNCAshenvale\\DNCAshenvaleUnit\\DNCAshenvaleUnit.mdl")
call NewSoundEnvironment("Default")
call SetAmbientDaySound("AshenvaleDay")
call SetAmbientNightSound("AshenvaleNight")
call SetMapMusic("Music",true,0)
set rn=CreateSound("Abilities\\Spells\\Items\\ResourceItems\\ReceiveGold.wav",false,true,true,10,10,"SpellsEAX")
call SetSoundParamsFromLabel(rn,"ReceiveGold")
call SetSoundDuration(rn,589)
set in=CreateSound("Buildings\\Other\\AmmoDump\\AmmoDumpWhat1.wav",false,false,true,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(in,"AmmoDumpWhat")
call SetSoundDuration(in,2383)
call SetSoundChannel(in,5)
call SetSoundVolume(in,'d')
set an=CreateSound("Sound\\Buildings\\Death\\BuildingDeathLargeHuman.wav",false,true,true,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(an,"DeathHumanLargeBuilding")
call SetSoundDuration(an,3460)
call SetSoundDistances(an,600.,12000.)
call SetSoundDistanceCutoff(an,4000.)
set nn=CreateSound("war3mapImported\\alarm4.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundChannel(nn,0)
call SetSoundVolume(nn,127)
call SetSoundPitch(nn,1.)
set ga=Rect(4768.,704.,5632.,1440.)
set Ga=Rect(1536.,-2048.,5632.,2048.)
set ha=Rect(-5632.,-2048.,-1536.,2048.)
set Ha=Rect(4576.,-288.,5152.,288.)
set ja=Rect(-5152.,-288.,-4576.,288.)
set Ja=Rect(-1408.,-2144.,1408.,2176.)
set ka=Rect(-5952.,2176.,5920.,4000.)
set Ka=Rect(-6144.,-4000.,5728.,-2144.)
set la=Rect(4768.,-1440.,5632.,-704.)
set La=Rect(-5632.,32.,-1536.,2080.)
set ma=Rect(1536.,.0,5632.,2048.)
set Ma=Rect(1536.,-2048.,5632.,.0)
set pa=Rect(-5632.,-2080.,-4224.,-704.)
set Pa=Rect(-5632.,-1440.,-4800.,-704.)
set qa=Rect(-5632.,512.,-4224.,1984.)
set Qa=Rect(4224.,480.,5632.,1984.)
set sa=Rect(4224.,-2048.,5632.,-704.)
set Sa=Rect(-4800.,-1696.,-4128.,1408.)
set ta=Rect(4544.,704.,4928.,1440.)
set Ta=Rect(4544.,-1440.,4928.,-704.)
set ua=Rect(-4928.,704.,-4544.,1440.)
set Ua=Rect(-4928.,-1440.,-4544.,-704.)
set wa=Rect(-5632.,704.,-4800.,1440.)
set Wa=Rect(4928.,480.,5632.,2048.)
set ya=Rect(4928.,-1984.,5632.,-512.)
set Ya=Rect(-5632.,512.,-4928.,2048.)
set za=Rect(-5632.,-2048.,-4928.,-512.)
set Za=Rect(-288.,3296.,-96.,3488.)
set vn=Rect(-5632.,-2080.,-1536.,32.)
set en=Rect(4064.,-1696.,4768.,1216.)
set xn=Rect(-160.,448.,160.,1216.)
set on=Rect(-160.,-1216.,160.,-448.)
set p=Player(12)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set p=Player(15)
set u=CreateUnit(p,'h00L',-192.,3392.,270.)
set u=CreateUnit(p,'nshp',320.,1856.,270.)
set u=CreateUnit(p,'nmrk',-256.,-2816.,270.)
call SetUnitColor(u,ConvertPlayerColor(0))
set p=Player(0)
set fE=CreateUnit(p,'hcas',-4864.,.0,270.)
set p=Player(6)
set FE=CreateUnit(p,'hcas',4864.,.0,270.)
set p=Player(15)
set u=CreateUnit(p,'nder',-4735.4,3246.1,109.526)
set u=CreateUnit(p,'nfro',-1091.1,2532.8,224.842)
set u=CreateUnit(p,'nfro',-1750.8,3170.3,12.503)
set u=CreateUnit(p,'nfro',-4208.5,-3103.9,62.844)
set u=CreateUnit(p,'nrac',3575.1,-3410.6,28.565)
set u=CreateUnit(p,'nrac',215.3,-2989.1,39.991)
set u=CreateUnit(p,'nder',-734.9,-2927.2,354.77)
set u=CreateUnit(p,'nder',-778.4,3161.3,100.297)
set u=CreateUnit(p,'nder',486.3,3092.6,147.507)
set u=CreateUnit(p,'nder',2097.6,2634.9,173.293)
set u=CreateUnit(p,'necr',2734.8,2968.,320.909)
set u=CreateUnit(p,'necr',-601.3,1917.2,359.418)
set u=CreateUnit(p,'necr',-2505.3,3205.6,108.405)
set u=CreateUnit(p,'necr',-2553.8,3097.9,314.669)
set u=CreateUnit(p,'nfro',4466.5,3139.7,42.463)
set u=CreateUnit(p,'nfro',539.6,2646.5,108.054)
set u=CreateUnit(p,'necr',-5469.2,2773.2,240.63)
set u=CreateUnit(p,'nrac',-3882.6,3455.9,171.348)
set u=CreateUnit(p,'necr',-2951.9,3480.5,75.248)
set u=CreateUnit(p,'nder',-1995.2,3031.8,320.569)
set u=CreateUnit(p,'nder',-4755.9,-3285.9,96.265)
set u=CreateUnit(p,'necr',-2813.4,-3182.2,270.799)
set u=CreateUnit(p,'nrac',-2009.7,-3134.2,263.79)
set u=CreateUnit(p,'nder',5212.3,-3150.6,44.199)
set u=CreateUnit(p,'nfro',4753.5,-3152.8,349.596)
set u=CreateUnit(p,'nrac',-10.6,3013.2,169.052)
set u=CreateUnit(p,'ndwm',1689.8,-2774.7,192.19)
set u=CreateUnit(p,'ndog',-3610.9,-3243.8,118.216)
set u=CreateUnit(p,'ndog',1334.7,2849.5,136.344)
set u=CreateUnit(p,'ndog',3868.8,3221.9,302.375)
set u=CreateUnit(p,'nshe',-5537.3,3457.1,52.22)
set u=CreateUnit(p,'nsno',824.5,3262.9,175.677)
set u=CreateUnit(p,'nsno',202.1,-2945.4,216.679)
set u=CreateUnit(p,'npnw',745.5,2441.4,238.74)
set u=CreateUnit(p,'npnw',-1503.3,3397.6,70.468)
set u=CreateUnit(p,'nhmc',-1045.4,2540.1,279.314)
set u=CreateUnit(p,'nskk',-1729.,3470.5,317.767)
set u=CreateUnit(p,'nskk',-2433.4,2555.1,311.109)
set u=CreateUnit(p,'nskk',3859.9,-3350.3,329.995)
set u=CreateUnit(p,'ncrb',4721.1,-3370.7,285.192)
set u=CreateUnit(p,'nalb',4473.6,-3164.3,324.601)
set u=CreateUnit(p,'nhmc',4158.9,-3098.4,273.93)
call ConfigureNeutralVictim()
set ZO=Filter(function HR)
set filterIssueHauntOrderAtLocBJ=Filter(function IssueHauntOrderAtLocBJFilter)
set filterEnumDestructablesInCircleBJ=Filter(function VR)
set filterGetUnitsInRectOfPlayer=Filter(function GetUnitsInRectOfPlayerFilter)
set filterGetUnitsOfTypeIdAll=Filter(function GetUnitsOfTypeIdAllFilter)
set filterGetUnitsOfPlayerAndTypeId=Filter(function GetUnitsOfPlayerAndTypeIdFilter)
set filterMeleeTrainedUnitIsHeroBJ=Filter(function MeleeTrainedUnitIsHeroBJFilter)
set filterLivingPlayerUnitsOfTypeId=Filter(function LivingPlayerUnitsOfTypeIdFilter)
set LA=0
loop
exitwhen LA==16
set bj_FORCE_PLAYER[LA]=CreateForce()
call ForceAddPlayer(bj_FORCE_PLAYER[LA],Player(LA))
set LA=LA+1
endloop
set bj_FORCE_ALL_PLAYERS=CreateForce()
call ForceEnumPlayers(bj_FORCE_ALL_PLAYERS,null)
set bj_cineModePriorSpeed=GetGameSpeed()
set bj_cineModePriorFogSetting=IsFogEnabled()
set bj_cineModePriorMaskSetting=IsFogMaskEnabled()
set LA=0
loop
exitwhen LA>=bj_MAX_QUEUED_TRIGGERS
set bj_queuedExecTriggers[LA]=null
set bj_queuedExecUseConds[LA]=false
set LA=LA+1
endloop
set bj_isSinglePlayer=false
set vh=0
set LA=0
loop
exitwhen LA>=12
if(GetPlayerController(Player(LA))==MAP_CONTROL_USER and GetPlayerSlotState(Player(LA))==PLAYER_SLOT_STATE_PLAYING)then
set vh=vh+1
endif
set LA=LA+1
endloop
set bj_isSinglePlayer=(vh==1)
set bj_rescueSound=CreateSoundFromLabel("Rescue",false,false,false,10000,10000)
set bj_questDiscoveredSound=CreateSoundFromLabel("QuestNew",false,false,false,10000,10000)
set bj_questUpdatedSound=CreateSoundFromLabel("QuestUpdate",false,false,false,10000,10000)
set bj_questCompletedSound=CreateSoundFromLabel("QuestCompleted",false,false,false,10000,10000)
set bj_questFailedSound=CreateSoundFromLabel("QuestFailed",false,false,false,10000,10000)
set bj_questHintSound=CreateSoundFromLabel("Hint",false,false,false,10000,10000)
set bj_questSecretSound=CreateSoundFromLabel("SecretFound",false,false,false,10000,10000)
set bj_questItemAcquiredSound=CreateSoundFromLabel("ItemReward",false,false,false,10000,10000)
set bj_questWarningSound=CreateSoundFromLabel("Warning",false,false,false,10000,10000)
set bj_victoryDialogSound=CreateSoundFromLabel("QuestCompleted",false,false,false,10000,10000)
set bj_defeatDialogSound=CreateSoundFromLabel("QuestFailed",false,false,false,10000,10000)
call DelayedSuspendDecayCreate()
set v=VersionGet()
if(v==VERSION_REIGN_OF_CHAOS)then
set bj_MELEE_MAX_TWINKED_HEROES=bj_MELEE_MAX_TWINKED_HEROES_V0
else
set bj_MELEE_MAX_TWINKED_HEROES=bj_MELEE_MAX_TWINKED_HEROES_V1
endif
call InitQueuedTriggers()
call InitRescuableBehaviorBJ()
call InitDNCSounds()
call InitMapRects()
call InitSummonableCaps()
set DR=0
loop
set bj_stockAllowedPermanent[DR]=false
set bj_stockAllowedCharged[DR]=false
set bj_stockAllowedArtifact[DR]=false
set DR=DR+1
exitwhen DR>10
endloop
call SetAllItemTypeSlots(11)
call SetAllUnitTypeSlots(11)
set bj_stockUpdateTimer=CreateTimer()
call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INITIAL_DELAY,false,function hR)
set bj_stockItemPurchased=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(bj_stockItemPurchased,Player(15),EVENT_PLAYER_UNIT_SELL_ITEM,null)
call TriggerAddAction(bj_stockItemPurchased,function RemovePurchasedItem)
call DetectGameStarted()
call ExecuteFunc("eh")
call ExecuteFunc("yR")
call ExecuteFunc("bI")
call ExecuteFunc("JI")
call ExecuteFunc("AA")
call ExecuteFunc("BA")
call ExecuteFunc("fN")
call ExecuteFunc("GN")
call ExecuteFunc("hN")
call ExecuteFunc("HN")
call ExecuteFunc("jN")
call ExecuteFunc("sN")
call ExecuteFunc("SN")
call ExecuteFunc("tN")
call ExecuteFunc("TN")
call ExecuteFunc("uN")
call ExecuteFunc("UN")
call ExecuteFunc("wN")
call ExecuteFunc("WN")
call ExecuteFunc("yN")
call ExecuteFunc("YN")
call ExecuteFunc("zN")
call ExecuteFunc("ZN")
call ExecuteFunc("vb")
call ExecuteFunc("Ob")
call ExecuteFunc("Fb")
call ExecuteFunc("gb")
call ExecuteFunc("Gb")
call ExecuteFunc("hb")
call ExecuteFunc("Hb")
call ExecuteFunc("jb")
call ExecuteFunc("Jb")
call ExecuteFunc("Lb")
call ExecuteFunc("mb")
call ExecuteFunc("Mb")
call ExecuteFunc("xB")
call ExecuteFunc("oB")
call ExecuteFunc("rB")
call ExecuteFunc("iB")
call ExecuteFunc("aB")
call ExecuteFunc("nB")
call ExecuteFunc("VB")
call ExecuteFunc("EB")
call ExecuteFunc("AB")
call ExecuteFunc("NB")
call ExecuteFunc("bB")
call ExecuteFunc("BB")
call ExecuteFunc("cB")
call ExecuteFunc("CB")
call ExecuteFunc("dB")
call ExecuteFunc("DB")
call ExecuteFunc("jB")
call ExecuteFunc("JB")
call ExecuteFunc("kB")
call ExecuteFunc("mB")
call ExecuteFunc("MB")
call ExecuteFunc("pB")
call ExecuteFunc("PB")
call ExecuteFunc("qB")
call ExecuteFunc("QB")
call ExecuteFunc("Bc")
call ExecuteFunc("dc")
call ExecuteFunc("kc")
set i=0
set i=0
loop
exitwhen(i>1)
set Fx[i]=0
set Tx[i]=0
set vo[i]=0
set xo[i]=0
set Io[i]=0
set No[i]=""
set Fo[i]=""
set Go[i]=""
set ho[i]=0
set mo[i]=0
set qo[i]=false
set Wo[i]=false
set Yo[i]=0
set zo[i]=0
set Vr[i]=0
set Lr[i]=""
set Pr[i]=false
set Wr[i]=0
set zr[i]=false
set ei[i]=0
set gi[i]=0
set ki[i]=0
set Qi[i]=0
set Ti[i]=0
set Ui[i]=""
set xa[i]=0
set ra[i]=0
set na[i]=0
set Da[i]=""
set i=i+1
endloop
set Hx=CreateGroup()
set i=0
loop
exitwhen(i>13)
set Jx[i]=0
set eo[i]=0
set Ao[i]=0
set Ko[i]=0
set Qo[i]=0
set so[i]=0
set So[i]=0
set Zo[i]=0
set Xr[i]=false
set Ir[i]=0
set Cr[i]=0
set dr[i]=bj_FORCE_PLAYER[0]
set Dr[i]=0
set Hr[i]=0
set tr[i]=0
set wr[i]=""
set yr[i]=0
set di[i]=false
set Si[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>14)
set Kx[i]=0
set yx[i]=.5
set i=i+1
endloop
set Qx=CreateGroup()
set tx=CreateGroup()
set i=0
loop
exitwhen(i>2)
set wx[i]=0
set zx[i]=CreateTimer()
set Zx[i]=CreateGroup()
set ao[i]=0
set Ro[i]=CreateForce()
set Do[i]=CreateGroup()
set jo[i]=1.
set lo[i]=0
set wo[i]=CreateForce()
set nr[i]=false
set Br[i]=0
set cr[i]=0
set ri[i]=0
set bi[i]=0
set Gi[i]=0
set Ji[i]=""
set zi[i]=0
set Zi[i]=0
set ia[i]=0
set Xa[i]=0
set Ra[i]=0
set i=i+1
endloop
set Wx=1
set i=0
loop
exitwhen(i>20)
set ro[i]=0
set ci[i]=false
set i=i+1
endloop
set io=-1
set Vo=CreateGroup()
set Bo=CreateTimer()
set i=0
loop
exitwhen(i>16)
set co[i]=0
set Sr[i]=CreateGroup()
set i=i+1
endloop
set Ho=DialogCreate()
set ko=CreateTimer()
set Lo=CreateGroup()
set Mo=10
set i=0
loop
exitwhen(i>3)
set po[i]=DialogCreate()
set i=i+1
endloop
set er=CreateForce()
set i=0
loop
exitwhen(i>15)
set Nr[i]=0
set Fi[i]=0
set i=i+1
endloop
set gr=CreateTimer()
set Gr=true
set jr=CreateTimer()
set lr=CreateTimer()
set pr=25.
set Qr=CreateTimer()
set ur=DialogCreate()
set i=0
loop
exitwhen(i>12)
set Ur[i]=false
set ui[i]=0
set i=i+1
endloop
set xi=6
set Xi=CreateForce()
set hi=.15
set Ki=CreateGroup()
set Li=CreateTimer()
set si=CreateTimer()
set Yi=true
set va=CreateGroup()
set Oa=CreateTimer()
set Na=CreateTimer()
set ba=.0
set Ba=CreateForce()
set i=0
loop
exitwhen(i>'x')
set ca[i]=0
set i=i+1
endloop
set da=CreateGroup()
set Vn=CreateTrigger()
call TriggerAddAction(Vn,function tc)
set En=CreateTrigger()
call TriggerRegisterTimerEventSingle(En,.1)
call TriggerAddAction(En,function Tc)
set Xn=CreateTrigger()
call TriggerAddAction(Xn,function AC)
set On=CreateTrigger()
call TriggerRegisterTimerEventSingle(On,.1)
call TriggerAddAction(On,function HC)
set Rn=CreateTrigger()
call TriggerAddAction(Rn,function QC)
set In=CreateTrigger()
call TriggerAddAction(In,function sC)
set An=CreateTrigger()
call TriggerRegisterPlayerChatEvent(An,Player(0),"-",false)
call TriggerAddAction(An,function hd)
set Nn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Nn,EVENT_PLAYER_UNIT_SELL)
call TriggerAddCondition(Nn,Condition(function Hd))
call TriggerAddAction(Nn,function jd)
set bn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(bn,EVENT_PLAYER_UNIT_SELL)
call TriggerAddCondition(bn,Condition(function Jd))
call TriggerAddAction(bn,function kd)
set Bn=CreateTrigger()
call TriggerRegisterTimerEventSingle(Bn,21.)
call TriggerAddAction(Bn,function ld)
set cn=CreateTrigger()
call TriggerRegisterDialogEvent(cn,po[0])
call TriggerAddAction(cn,function Pd)
set Cn=CreateTrigger()
call TriggerAddAction(Cn,function qd)
set dn=CreateTrigger()
call TriggerRegisterDialogEvent(dn,po[1])
call TriggerAddAction(dn,function Sd)
set Dn=CreateTrigger()
call TriggerAddAction(Dn,function td)
set fn=CreateTrigger()
call TriggerRegisterDialogEvent(fn,po[2])
call TriggerAddAction(fn,function Ud)
set Fn=CreateTrigger()
call TriggerRegisterTimerExpireEvent(Fn,gr)
call TriggerAddAction(Fn,function wd)
set gn=CreateTrigger()
call DisableTrigger(gn)
call TriggerRegisterEnterRectSimple(gn,xn)
call TriggerAddCondition(gn,Condition(function Wd))
call TriggerAddAction(gn,function yd)
set Gn=CreateTrigger()
call DisableTrigger(Gn)
call TriggerRegisterLeaveRectSimple(Gn,xn)
call TriggerAddCondition(Gn,Condition(function Yd))
call TriggerAddAction(Gn,function zd)
set hn=CreateTrigger()
call DisableTrigger(hn)
call TriggerRegisterEnterRectSimple(hn,on)
call TriggerAddCondition(hn,Condition(function Zd))
call TriggerAddAction(hn,function vD)
set Hn=CreateTrigger()
call DisableTrigger(Hn)
call TriggerRegisterLeaveRectSimple(Hn,on)
call TriggerAddCondition(Hn,Condition(function eD))
call TriggerAddAction(Hn,function xD)
set jn=CreateTrigger()
call TriggerRegisterTimerExpireEvent(jn,lr)
call TriggerAddAction(jn,function oD)
set Jn=CreateTrigger()
call TriggerRegisterPlayerEventLeave(Jn,Player(0))
call TriggerRegisterPlayerEventLeave(Jn,Player(1))
call TriggerRegisterPlayerEventLeave(Jn,Player(2))
call TriggerRegisterPlayerEventLeave(Jn,Player(3))
call TriggerRegisterPlayerEventLeave(Jn,Player(4))
call TriggerRegisterPlayerEventLeave(Jn,Player(5))
call TriggerRegisterPlayerEventLeave(Jn,Player(6))
call TriggerRegisterPlayerEventLeave(Jn,Player(7))
call TriggerRegisterPlayerEventLeave(Jn,Player(8))
call TriggerRegisterPlayerEventLeave(Jn,Player(9))
call TriggerRegisterPlayerEventLeave(Jn,Player(10))
call TriggerRegisterPlayerEventLeave(Jn,Player(11))
call TriggerAddAction(Jn,function aD)
set kn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(kn,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(kn,Condition(function nD))
call TriggerAddAction(kn,function ED)
set Kn=CreateTrigger()
call TriggerRegisterEnterRectSimple(Kn,Ja)
call TriggerRegisterEnterRectSimple(Kn,ka)
call TriggerRegisterEnterRectSimple(Kn,Ka)
call TriggerAddCondition(Kn,Condition(function XD))
call TriggerAddAction(Kn,function OD)
set ln=CreateTrigger()
call DisableTrigger(ln)
call TriggerAddAction(ln,function RD)
set Ln=CreateTrigger()
call DisableTrigger(Ln)
call TriggerRegisterAnyUnitEventBJ(Ln,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Ln,Condition(function ID))
call TriggerAddAction(Ln,function AD)
set mn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(mn,EVENT_PLAYER_UNIT_CONSTRUCT_FINISH)
call TriggerAddCondition(mn,Condition(function ND))
call TriggerAddAction(mn,function bD)
set Mn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Mn,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterAnyUnitEventBJ(Mn,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerAddCondition(Mn,Condition(function BD))
call TriggerAddAction(Mn,function dD)
set pn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(pn,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(pn,Condition(function DD))
call TriggerAddAction(pn,function FD)
set Pn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Pn,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Pn,Condition(function jD))
call TriggerAddAction(Pn,function JD)
set qn=CreateTrigger()
call TriggerAddAction(qn,function lD)
set Qn=CreateTrigger()
call TriggerAddAction(Qn,function mD)
set sn=CreateTrigger()
call TriggerAddAction(sn,function QD)
set Sn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Sn,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Sn,Condition(function sD))
call TriggerAddAction(Sn,function uD)
set tn=CreateTrigger()
call TriggerAddAction(tn,function wD)
set Tn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Tn,EVENT_PLAYER_UNIT_TRAIN_FINISH)
call TriggerAddAction(Tn,function yD)
set un=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(un,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(un,Condition(function YD))
call TriggerAddAction(un,function zD)
set Un=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Un,EVENT_PLAYER_UNIT_CONSTRUCT_FINISH)
call TriggerAddAction(Un,function rf)
set wn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(wn,EVENT_PLAYER_UNIT_CONSTRUCT_START)
call TriggerAddAction(wn,function af)
set Wn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Wn,EVENT_PLAYER_UNIT_CONSTRUCT_CANCEL)
call TriggerAddAction(Wn,function nf)
set yn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(yn,EVENT_PLAYER_UNIT_UPGRADE_FINISH)
call TriggerAddAction(yn,function Vf)
set Yn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Yn,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Yn,Condition(function Ef))
call TriggerAddAction(Yn,function Xf)
set zn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(zn,EVENT_PLAYER_UNIT_CONSTRUCT_START)
call TriggerAddCondition(zn,Condition(function Of))
call TriggerAddAction(zn,function Rf)
set Zn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Zn,EVENT_PLAYER_UNIT_UPGRADE_START)
call TriggerAddCondition(Zn,Condition(function If))
call TriggerAddAction(Zn,function Af)
set vV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(vV,EVENT_PLAYER_UNIT_UPGRADE_CANCEL)
call TriggerAddAction(vV,function Nf)
set eV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(eV,EVENT_PLAYER_UNIT_CHANGE_OWNER)
call TriggerAddCondition(eV,Condition(function bf))
call TriggerAddAction(eV,function Bf)
set xV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(xV,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(xV,Condition(function cf))
call TriggerAddAction(xV,function Cf)
set oV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(oV,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(oV,Condition(function df))
call TriggerAddAction(oV,function Df)
set rV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(rV,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(rV,Condition(function ff))
call TriggerAddAction(rV,function Ff)
set iV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(iV,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(iV,Condition(function gf))
call TriggerAddAction(iV,function Gf)
set aV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(aV,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(aV,Condition(function hf))
call TriggerAddAction(aV,function Hf)
set nV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(nV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(nV,Condition(function jf))
call TriggerAddAction(nV,function Jf)
set VV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(VV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(VV,Condition(function kf))
call TriggerAddAction(VV,function Kf)
set EV=CreateTrigger()
call TriggerRegisterEnterRectSimple(EV,bj_mapInitialPlayableArea)
call TriggerAddAction(EV,function pf)
set XV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(XV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(XV,Condition(function Pf))
call TriggerAddAction(XV,function qf)
set OV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(OV,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(OV,Condition(function Sf))
call TriggerAddAction(OV,function tf)
set RV=CreateTrigger()
call TriggerAddAction(RV,function wf)
set IV=CreateTrigger()
call TriggerRegisterEnterRectSimple(IV,GetCurrentCameraBoundsMapRectBJ())
call TriggerRegisterAnyUnitEventBJ(IV,EVENT_PLAYER_UNIT_UPGRADE_FINISH)
call TriggerAddCondition(IV,Condition(function yf))
call TriggerAddAction(IV,function Yf)
set AV=CreateTrigger()
call TriggerRegisterTimerExpireEvent(AV,Bo)
call TriggerAddAction(AV,function vF)
set NV=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(NV,4.)
call TriggerAddAction(NV,function VF)
set bV=CreateTrigger()
call DisableTrigger(bV)
call TriggerRegisterTimerEventPeriodic(bV,50.)
call TriggerAddAction(bV,function hF)
set BV=CreateTrigger()
call DisableTrigger(BV)
call TriggerRegisterTimerExpireEvent(BV,Na)
call TriggerAddAction(BV,function HF)
set cV=CreateTrigger()
call TriggerRegisterTimerExpireEvent(cV,zx[1])
call TriggerAddAction(cV,function JF)
set CV=CreateTrigger()
call DisableTrigger(CV)
call TriggerRegisterTimerExpireEvent(CV,zx[1])
call TriggerAddAction(CV,function LF)
set dV=CreateTrigger()
call TriggerRegisterTimerExpireEvent(dV,zx[0])
call TriggerAddAction(dV,function mF)
set DV=CreateTrigger()
call DisableTrigger(DV)
call TriggerRegisterTimerExpireEvent(DV,zx[0])
call TriggerAddAction(DV,function MF)
set fV=CreateTrigger()
call DisableTrigger(fV)
call TriggerRegisterTimerExpireEvent(fV,ko)
call TriggerAddAction(fV,function PF)
set FV=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(FV,9.)
call TriggerAddAction(FV,function QF)
set gV=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(gV,3.)
call TriggerAddAction(gV,function SF)
set GV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(GV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(GV,Condition(function tF))
call TriggerAddAction(GV,function TF)
set hV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(hV,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(hV,Condition(function uF))
call TriggerAddAction(hV,function UF)
set HV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(HV,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(HV,Condition(function wF))
call TriggerAddAction(HV,function WF)
set jV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(jV,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(jV,Condition(function yF))
call TriggerAddAction(jV,function YF)
set JV=CreateTrigger()
call TriggerAddAction(JV,function vg)
set kV=CreateTrigger()
call TriggerAddAction(kV,function og)
set KV=CreateTrigger()
call TriggerAddAction(KV,function ig)
set lV=CreateTrigger()
call TriggerAddAction(lV,function ng)
set LV=CreateTrigger()
call TriggerAddAction(LV,function Eg)
set mV=CreateTrigger()
call TriggerAddAction(mV,function Og)
set MV=CreateTrigger()
call TriggerAddAction(MV,function Ig)
set pV=CreateTrigger()
call TriggerAddAction(pV,function Ng)
set PV=CreateTrigger()
call TriggerAddAction(PV,function Bg)
set qV=CreateTrigger()
call TriggerAddAction(qV,function Cg)
set QV=CreateTrigger()
call TriggerAddAction(QV,function Dg)
set sV=CreateTrigger()
call TriggerAddAction(sV,function Fg)
set SV=CreateTrigger()
call TriggerAddAction(SV,function Gg)
set tV=CreateTrigger()
call TriggerAddAction(tV,function Hg)
set TV=CreateTrigger()
call TriggerAddAction(TV,function Jg)
set uV=CreateTrigger()
call TriggerAddAction(uV,function Kg)
set UV=CreateTrigger()
call TriggerAddAction(UV,function Lg)
set wV=CreateTrigger()
call TriggerAddAction(wV,function Mg)
set WV=CreateTrigger()
call TriggerAddAction(WV,function pg)
set yV=CreateTrigger()
call TriggerAddAction(yV,function qg)
set YV=CreateTrigger()
call TriggerAddAction(YV,function sg)
set zV=CreateTrigger()
call TriggerAddAction(zV,function tg)
set ZV=CreateTrigger()
call TriggerAddAction(ZV,function ug)
set vE=CreateTrigger()
call DisableTrigger(vE)
call TriggerRegisterPlayerChatEvent(vE,Player(0),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(1),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(2),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(3),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(4),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(5),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(6),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(7),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(8),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(9),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(10),"-agree",true)
call TriggerRegisterPlayerChatEvent(vE,Player(11),"-agree",true)
call TriggerAddAction(vE,function Ug)
set eE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(eE,Player(0),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(1),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(2),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(3),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(4),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(5),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(6),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(7),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(8),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(9),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(10),"-income",true)
call TriggerRegisterPlayerChatEvent(eE,Player(11),"-income",true)
call TriggerAddAction(eE,function wg)
set xE=CreateTrigger()
call DisableTrigger(xE)
call TriggerRegisterPlayerChatEvent(xE,Player(0),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(1),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(2),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(3),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(4),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(5),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(6),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(7),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(8),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(9),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(10),"-draw",true)
call TriggerRegisterPlayerChatEvent(xE,Player(11),"-draw",true)
call TriggerAddAction(xE,function Wg)
set oE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(oE,Player(0),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(1),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(2),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(3),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(4),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(5),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(6),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(7),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(8),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(9),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(10),"-armor",true)
call TriggerRegisterPlayerChatEvent(oE,Player(11),"-armor",true)
call TriggerAddAction(oE,function yg)
set rE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(rE,Player(0),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(1),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(2),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(3),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(4),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(5),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(6),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(7),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(8),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(9),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(10),"-stats",true)
call TriggerRegisterPlayerChatEvent(rE,Player(11),"-stats",true)
call TriggerAddAction(rE,function Yg)
set iE=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(iE,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(iE,function oG)
set aE=CreateTrigger()
call TriggerAddAction(aE,function BG)
set nE=CreateTrigger()
call DisableTrigger(nE)
call TriggerRegisterTimerEventPeriodic(nE,2.)
call TriggerAddAction(nE,function CG)
set VE=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(VE,15.)
call TriggerAddAction(VE,function FG)
set EE=CreateTrigger()
call TriggerAddAction(EE,function gG)
set XE=CreateTrigger()
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(0),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(1),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(2),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(3),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(4),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(5),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(6),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(7),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(8),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(9),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(10),true)
call TriggerRegisterPlayerSelectionEventBJ(XE,Player(11),true)
call TriggerAddAction(XE,function GG)
set OE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(OE,Player(0),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(1),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(2),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(3),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(4),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(5),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(6),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(7),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(8),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(9),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(10),"-afk",true)
call TriggerRegisterPlayerChatEvent(OE,Player(11),"-afk",true)
call TriggerAddAction(OE,function HG)
set RE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(RE,Player(0),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(1),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(2),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(3),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(4),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(5),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(6),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(7),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(8),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(9),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(10),"-re",true)
call TriggerRegisterPlayerChatEvent(RE,Player(11),"-re",true)
call TriggerAddAction(RE,function JG)
set IE=CreateTrigger()
call DisableTrigger(IE)
call TriggerRegisterPlayerEventLeave(IE,Player(0))
call TriggerRegisterPlayerEventLeave(IE,Player(1))
call TriggerRegisterPlayerEventLeave(IE,Player(2))
call TriggerRegisterPlayerEventLeave(IE,Player(3))
call TriggerRegisterPlayerEventLeave(IE,Player(4))
call TriggerRegisterPlayerEventLeave(IE,Player(5))
call TriggerRegisterPlayerEventLeave(IE,Player(6))
call TriggerRegisterPlayerEventLeave(IE,Player(7))
call TriggerRegisterPlayerEventLeave(IE,Player(8))
call TriggerRegisterPlayerEventLeave(IE,Player(9))
call TriggerRegisterPlayerEventLeave(IE,Player(10))
call TriggerRegisterPlayerEventLeave(IE,Player(11))
call TriggerAddAction(IE,function kG)
set AE=CreateTrigger()
call DisableTrigger(AE)
call TriggerRegisterAnyUnitEventBJ(AE,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(AE,Condition(function KG))
call TriggerAddAction(AE,function SG)
set NE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(NE,Player(0),"-aidebug3",true)
call TriggerAddAction(NE,function tG)
set bE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(bE,Player(0),"-aidebugoff",true)
call TriggerAddAction(bE,function TG)
set BE=CreateTrigger()
call TriggerRegisterPlayerChatEvent(BE,Player(0),"-aidebugon",true)
call TriggerAddAction(BE,function uG)
set cE=CreateTrigger()
call TriggerAddAction(cE,function UG)
set CE=CreateTrigger()
call TriggerAddAction(CE,function wG)
set dE=CreateTrigger()
call TriggerAddAction(dE,function WG)
set DE=CreateTrigger()
call TriggerRegisterTimerExpireEvent(DE,Oa)
call TriggerAddAction(DE,function YG)
call ConditionalTriggerExecute(Vn)
call ConditionalTriggerExecute(NV)
endfunction
function config takes nothing returns nothing
call SetMapName("|cffFFD700Castle Fight|r v1.14b")
call SetMapDescription("An epic battle between the two castles!

Recommended gamemode is 4on4 with 2 wins.

hf!")
call SetPlayers(10)
call SetTeams(10)
call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER)
call DefineStartLocation(0,-4288.,-64.)
call DefineStartLocation(1,-4288.,320.)
call DefineStartLocation(2,-4288.,64.)
call DefineStartLocation(3,-4288.,-320.)
call DefineStartLocation(4,-4288.,192.)
call DefineStartLocation(5,4288.,-64.)
call DefineStartLocation(6,4288.,-320.)
call DefineStartLocation(7,4288.,64.)
call DefineStartLocation(8,4288.,-192.)
call DefineStartLocation(9,4288.,320.)
call SetPlayerStartLocation(Player(0),0)
call ForcePlayerStartLocation(Player(0),0)
call SetPlayerColor(Player(0),ConvertPlayerColor(0))
call SetPlayerRacePreference(Player(0),RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(0),false)
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_NIGHTELF)
call SetPlayerRaceSelectable(Player(1),false)
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_NIGHTELF)
call SetPlayerRaceSelectable(Player(2),false)
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),false)
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_NIGHTELF)
call SetPlayerRaceSelectable(Player(4),false)
call SetPlayerController(Player(4),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(6),5)
call ForcePlayerStartLocation(Player(6),5)
call SetPlayerColor(Player(6),ConvertPlayerColor(6))
call SetPlayerRacePreference(Player(6),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(6),false)
call SetPlayerController(Player(6),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(7),6)
call ForcePlayerStartLocation(Player(7),6)
call SetPlayerColor(Player(7),ConvertPlayerColor(7))
call SetPlayerRacePreference(Player(7),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(7),false)
call SetPlayerController(Player(7),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(8),7)
call ForcePlayerStartLocation(Player(8),7)
call SetPlayerColor(Player(8),ConvertPlayerColor(8))
call SetPlayerRacePreference(Player(8),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(8),false)
call SetPlayerController(Player(8),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(9),8)
call ForcePlayerStartLocation(Player(9),8)
call SetPlayerColor(Player(9),ConvertPlayerColor(9))
call SetPlayerRacePreference(Player(9),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(9),false)
call SetPlayerController(Player(9),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(10),9)
call ForcePlayerStartLocation(Player(10),9)
call SetPlayerColor(Player(10),ConvertPlayerColor(10))
call SetPlayerRacePreference(Player(10),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(10),false)
call SetPlayerController(Player(10),MAP_CONTROL_USER)
call InitCustomTeams()
call SetStartLocPrioCount(0,1)
call SetStartLocPrio(0,0,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(1,1)
call SetStartLocPrio(1,0,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(2,2)
call SetStartLocPrio(2,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(2,1,4,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(3,2)
call SetStartLocPrio(3,0,0,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(3,1,2,MAP_LOC_PRIO_LOW)
call SetStartLocPrioCount(4,2)
call SetStartLocPrio(4,0,1,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(4,1,2,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(5,2)
call SetStartLocPrio(5,0,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,1,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(6,1)
call SetStartLocPrio(6,0,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(7,1)
call SetStartLocPrio(7,0,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(8,2)
call SetStartLocPrio(8,0,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,1,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(9,2)
call SetStartLocPrio(9,0,5,MAP_LOC_PRIO_LOW)
call SetStartLocPrio(9,1,7,MAP_LOC_PRIO_HIGH)
endfunction
function xh takes nothing returns boolean
local unit u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return true
endif
if GetUnitAbilityLevel(u,'A09L')>0 then
set u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return true
endif
endif
if GetUnitAbilityLevel(u,'A09L')==0 then
call UnitAddAbility(u,'A09L')
endif
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"death")
call TriggerSleepAction(.3)
call SetUnitAnimation(u,"stand")
return true
endfunction
function oh takes nothing returns boolean
local unit u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return true
endif
if GetUnitAbilityLevel(u,'A09L')>0 then
set u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return true
endif
endif
if GetUnitAbilityLevel(u,'A09L')<=1 then
call UnitAddAbility(u,'A09L')
call SetUnitAbilityLevel(u,'A09L',2)
endif
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"death")
call TriggerSleepAction(.3)
call SetUnitAnimation(u,"stand")
return true
endfunction
function rh takes nothing returns boolean
local real Qf=ei[GetUnitPointValue(GetSpellAbilityUnit())]
local integer i=0
local integer OI=20+R2I((Qf-500)/ 50)
local real x
local real y
local real sf
local effect array e
loop
exitwhen i>=OI
set sf=2*bj_PI*i/ OI
set y=Sin(sf)*Qf+GetUnitY(GetTriggerUnit())
set x=Cos(sf)*Qf+GetUnitX(GetTriggerUnit())
if(Fi[GetPlayerId(GetOwningPlayer((GetTriggerUnit())))+1])==Fi[(1+GetPlayerId(GetLocalPlayer()))]then
set e[i]=AddSpecialEffect("Abilities\\Spells\\NightElf\\Barkskin\\BarkSkinTarget.mdl",x,y)
else
set e[i]=AddSpecialEffect(".mdl",x,y)
endif
set i=i+1
endloop
call TriggerSleepAction(6)
set i=0
loop
exitwhen i>=OI
call DestroyEffect(e[i])
set e[i]=null
set i=i+1
endloop
return true
endfunction
function ih takes nothing returns boolean
local unit rN=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetTriggerUnit()))))+1]))]))
call XB("Abilities\\Spells\\Human\\Polymorph\\PolyMorphTarget.mdl",GetTriggerUnit())
if(rN==null)then
return true
endif
if GetUnitAbilityLevel(rN,'A08C')==1 then
set rN=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetTriggerUnit()))))+1]))]))
if(rN==null)then
return true
endif
endif
call IB("Abilities\\Spells\\Human\\ControlMagic\\ControlMagicTarget.mdl",rN,"overhead")
call UnitAddAbility(rN,'A08C')
call UnitAddAbility(rN,'A08D')
call UnitAddAbility(rN,'A08F')
return true
endfunction
function ah takes nothing returns boolean
local integer yI=(Fi[GetPlayerId(GetOwningPlayer((GetTriggerUnit())))+1])
call XB("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",GetTriggerUnit())
call EnableTrigger(OV)
set cr[yI]=cr[yI]+1
return true
endfunction
function nh takes nothing returns boolean
local unit rN=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
local effect e
local fogmodifier f
local boolean b=gE
if rN==null then
return true
endif
set e=AddSpecialEffect("Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl",GetUnitX(GetSpellAbilityUnit()),GetUnitY(GetSpellAbilityUnit()))
if b then
set f=CreateFogModifierRadius(GetOwningPlayer(GetSpellAbilityUnit()),FOG_OF_WAR_VISIBLE,GetUnitX(rN),GetUnitY(rN),1100.,true,false)
call FogModifierStart(f)
endif
if Kr then
call oN(mv,GetSpellAbilityUnit(),rN)
else
call oN(Lv,GetSpellAbilityUnit(),rN)
endif
call TriggerSleepAction(8)
if b then
call DestroyFogModifier(f)
set f=null
endif
call DestroyEffect(e)
set e=null
return true
endfunction
function Vh takes nothing returns boolean
local location uf=GetUnitLoc(GetTriggerUnit())
local location rN=GetRandomLocInRect(Mx[Fi[(1+GetPlayerId(GetOwningPlayer(GetTriggerUnit())))]])
local real nR=AngleBetweenPoints(uf,rN)
local location l=rR(rN,-2500,nR)
local unit Uf
local timer t=CreateTimer()
local integer s=GetHandleId(t)
local effect e
local unit u
call PlaySoundBJ(in)
call PlaySoundBJ(nn)
set u=CreateUnitAtLoc(GetTriggerPlayer(),'h06X',uf,270)
call SetUnitTimeScalePercent(u,20)
set e=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Levelup\\LevelupCaster.mdl",uf)
call DestroyEffect(e)
set e=null
call TriggerSleepAction(5)
set Uf=CreateUnitAtLoc(GetTriggerPlayer(),'h06V',l,nR)
call SaveInteger(JE,s,0,250)
call SaveUnitHandle(JE,s,1,Uf)
call SetUnitFlyHeight(Uf,1500.,.0)
call TimerStart(t,.04,true,function Tf)
call RemoveLocation(l)
set l=null
call RemoveLocation(uf)
set uf=null
set t=null
call RemoveLocation(rN)
set rN=null
call RemoveUnit(u)
return true
endfunction
function Eh takes nothing returns boolean
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
local integer i=0
if u==null then
return true
endif
loop
exitwhen i>5
set do=GetUnitX(u)+64.*Cos(60.*I2R(i)*bj_DEGTORAD)
set Co=GetUnitY(u)+64.*Sin(60.*I2R(i)*bj_DEGTORAD)
if Kr then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()),'n021',do,Co,AngleBetweenPoints(sx,Px))
else
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()),'n01C',do,Co,AngleBetweenPoints(sx,Px))
endif
call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF',9.)
set i=i+1
endloop
return true
endfunction
function Xh takes nothing returns boolean
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if(u==null)then
return true
endif
call IB("Abilities\\Spells\\Undead\\DeathPact\\DeathPactTarget.mdl",u,"origin")
if HB(u,GetSpellAbilityUnit())then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,200.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_SONIC)
endif
return true
endfunction
function Oh takes nothing returns boolean
call RN(iv,GetSpellAbilityUnit())
return true
endfunction
function Rh takes nothing returns boolean
local unit u
local effect e=null
local location l=null
set u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if u==null then
return true
endif
if HB(u,GetSpellAbilityUnit())then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,50000.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
endif
call XB("Abilities\\Spells\\Undead\\DeathCoil\\DeathCoilSpecialArt.mdl",u)
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"work")
call TriggerSleepAction(1.)
call ResetUnitAnimation(u)
return true
endfunction
function Ih takes nothing returns boolean
local integer i=GetRandomInt(0,8)
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
call XB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",GetSpellAbilityUnit())
if u==null then
return true
endif
call IB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",u,"origin")
if not HB(u,GetSpellAbilityUnit())then
return true
endif
if i==0 then
call XB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",u)
call ExplodeUnitBJ(u)
set i=(1+GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())))
set Cr[i]=Cr[i]+1
set Ra[Fi[i]]=Ra[Fi[i]]+1
elseif i==1 then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,50000.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
elseif i==2 then
call UnitDamageTargetBJ(GetSpellAbilityUnit(),u,500.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
elseif i==3 then
call IB("Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl",u,"origin")
call UnitAddAbility(u,'A06T')
call UnitAddAbility(u,'A06U')
call SetUnitLifePercentBJ(u,'d')
elseif i==4 then
call aN(Dv,GetSpellAbilityUnit(),u)
call TriggerSleepAction(1.)
call pA(u)
if GetUnitTypeId(u)=='h03A' then
call TriggerSleepAction(44.5)
call IssueImmediateOrderById(u,852055)
call TriggerSleepAction(.5)
call pA(u)
return true
endif
elseif i==5 then
call nN(fv,GetSpellAbilityUnit(),u)
elseif i==6 then
call XB("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",u)
call LB(u)
call ShowUnit(u,false)
call Ac('n01S',u,GetSpellAbilityUnit(),GetTriggerPlayer())
call RemoveUnit(u)
return true
endif
return true
endfunction
function Ah takes nothing returns boolean
local location l=GetUnitLoc(GetSpellAbilityUnit())
local group g=AR(500.,l)
call XB("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",GetSpellAbilityUnit())
set av=GetSpellAbilityUnit()
call ForGroupBJ(g,function zf)
call DestroyGroup(g)
call RemoveLocation(l)
set g=null
set l=null
return true
endfunction
function Nh takes nothing returns boolean
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if u==null or not HB(u,GetSpellAbilityUnit())then
return true
endif
call nN(W,GetSpellAbilityUnit(),u)
return true
endfunction
function bh takes nothing returns boolean
local unit u=(nA(rO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if(u==null)or not HB(u,GetSpellAbilityUnit())then
return true
endif
call aN(kv,GetSpellAbilityUnit(),u)
return true
endfunction
function Bh takes nothing returns boolean
local unit u=(nA(xO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]))
if(u==null)then
return true
endif
call UnitAddAbility(u,'A03B')
call UnitAddAbility(u,'A03A')
call UnitAddAbility(u,'A03D')
call UnitAddAbility(u,'A08L')
set Mi=GetRandomInt(1,3)
if(Mi==1)then
call UnitAddAbility(u,'A05I')
call UnitAddAbility(u,'A06W')
else
if(Mi==2)then
call UnitAddAbility(u,'A08M')
call UnitAddAbility(u,'A06Y')
else
call UnitAddAbility(u,'A08R')
call UnitAddAbility(u,'A06X')
endif
endif
call IB("Abilities\\Spells\\Undead\\ReplenishHealth\\ReplenishHealthCasterOverhead.mdl",u,"overhead")
call XB("Abilities\\Spells\\Human\\DispelMagic\\DispelMagicTarget.mdl",GetSpellAbilityUnit())
return true
endfunction
function ch takes nothing returns boolean
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
call aN(Jv,GetSpellAbilityUnit(),u)
set u=GetSpellAbilityUnit()
call TriggerSleepAction(.5)
call SetUnitAnimation(u,"attack")
call TriggerSleepAction(1.)
call ResetUnitAnimation(u)
return true
endfunction
function Ch takes nothing returns boolean
local unit u
local unit u2
local real Zf
local integer i=0
local player p=GetOwningPlayer(GetSpellAbilityUnit())
local real x=GetUnitX(GetSpellAbilityUnit())
local real y=GetUnitY(GetSpellAbilityUnit())
set u=GetSpellAbilityUnit()
call SetUnitAnimation(u,"death")
call TriggerSleepAction(1.5)
call TimerStart(Bo,.04,true,null)
set Zf=I2R(Fi[(1+GetPlayerId(p))])*180
loop
exitwhen i>2
set u2=CreateUnit(p,'h08U',x,y,ModuloReal(Zf+GetRandomReal(-55,55)+360,360))
if(Kr)then
call UnitRemoveAbility(u2,'A080')
call UnitAddAbility(u2,'A084')
endif
call GroupAddUnit(tx,u2)
set i=i+1
endloop
call EnableWeatherEffect(kx,true)
call TriggerSleepAction(3.7)
call ResetUnitAnimation(u)
call TriggerSleepAction(2.6)
call EnableWeatherEffect(kx,false)
return true
endfunction
function dh takes nothing returns boolean
local integer i
local unit u
local integer rl
call IB("Abilities\\Spells\\Items\\TomeOfRetraining\\TomeOfRetrainingCaster.mdl",GetSpellAbilityUnit(),"origin")
set fa=GetUnitTypeId((nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])])))
set i=GetUnitPointValueByType(fa)
set rl=xO[(Fi[GetPlayerId(GetOwningPlayer((GetSpellAbilityUnit())))+1])]
call OA(rl)
if i>'d' then
loop
set u=RA(rl)
exitwhen u==null
if GetUnitPointValue(u)==i then
call IB("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",u,"origin")
call nN(rv,GetSpellAbilityUnit(),u)
endif
endloop
else
loop
set u=RA(rl)
exitwhen u==null
if GetUnitTypeId(u)==fa then
call IB("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",u,"origin")
call nN(rv,GetSpellAbilityUnit(),u)
endif
endloop
endif
return true
endfunction
function Dh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call xN(Mv,u)
call TriggerSleepAction(1.)
call ResetUnitAnimation(u)
return true
endfunction
function fh takes nothing returns boolean
local unit u=(nA(xO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
if(u==null)or not HB(u,GetSpellAbilityUnit())then
return true
endif
call nN(Cv,GetSpellAbilityUnit(),u)
call TriggerSleepAction(1.)
call pA(u)
if GetUnitTypeId(u)=='h03A' then
call TriggerSleepAction(44.5)
call IssueImmediateOrderById(u,852055)
call TriggerSleepAction(.5)
call pA(u)
endif
return true
endfunction
function Fh takes nothing returns boolean
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
local integer i
if Kr then
call VN(qv,GetSpellAbilityUnit(),u)
else
call VN(Pv,GetSpellAbilityUnit(),u)
endif
return true
endfunction
function gh takes nothing returns boolean
local unit u=(nA(iO[(aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))])]))
call oN(Gv,GetSpellAbilityUnit(),u)
return true
endfunction
function Gh takes nothing returns boolean
local unit u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
local integer i=0
loop
exitwhen((GetUnitAbilityLevel((u),'A06V')>0)==false)
set u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
set i=i+1
if(i>=10)then
return true
exitwhen true
endif
endloop
if(u==null)then
return true
endif
call XB("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl",u)
set i=Fi[(1+GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())))]
set Gi[i]=(Gi[i]+1)
call MultiboardSetItemValueBJ(ar,4,Xa[i],I2S(Gi[i]))
call KillUnit(u)
return true
endfunction
function hh takes nothing returns boolean
local unit u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
local fogmodifier f
call XB("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",GetSpellAbilityUnit())
if u==null then
return true
endif
call cN('h04G',GetSpellAbilityUnit(),GetSpellAbilityUnit(),20.)
if gE then
set f=CreateFogModifierRadius(GetOwningPlayer(GetSpellAbilityUnit()),FOG_OF_WAR_VISIBLE,GetUnitX(u),GetUnitY(u),128.,true,false)
call FogModifierStart(f)
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
call TriggerSleepAction(.1)
call DestroyFogModifier(f)
set f=null
else
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
endif
return true
endfunction
function Hh takes nothing returns boolean
local unit u=(nA(oO[aO[((Fi[GetPlayerId(GetOwningPlayer(((GetSpellAbilityUnit()))))+1]))]]))
local fogmodifier f
call XB("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",GetSpellAbilityUnit())
if u==null then
return true
endif
call cN('h04H',GetSpellAbilityUnit(),GetSpellAbilityUnit(),20.)
if gE then
set f=CreateFogModifierRadius(GetOwningPlayer(GetSpellAbilityUnit()),FOG_OF_WAR_VISIBLE,GetUnitX(u),GetUnitY(u),128.,true,false)
call FogModifierStart(f)
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
call TriggerSleepAction(.1)
call DestroyFogModifier(f)
set f=null
else
call IssueTargetOrderById(bj_lastCreatedUnit,851985,u)
endif
return true
endfunction
function jh takes nothing returns boolean
local location l1=GetUnitLoc(GetTriggerUnit())
local location l2
local integer i=0
local real nR=bj_RADTODEG*Atan2(GetUnitY(GetSpellTargetUnit())-GetUnitY(GetTriggerUnit()),GetUnitX(GetSpellTargetUnit())-GetUnitX(GetTriggerUnit()))
set nR=ModuloReal(nR+20,360)
loop
exitwhen i>3
set nR=ModuloReal(nR+350,360)
set l2=rR(l1,'d',nR)
call EN(Q,GetTriggerUnit(),GetLocationX(l2),GetLocationY(l2))
call RemoveLocation(l2)
set i=i+1
endloop
call RemoveLocation(l1)
set l1=null
set l2=null
return true
endfunction
function Jh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
local unit u2
local group g=CreateGroup()
local real xF
local real x=GetUnitX(GetSpellTargetUnit())
local real y=GetUnitY(GetSpellTargetUnit())
local real aR=SquareRoot((GetUnitX(u)-x)*(GetUnitX(u)-x)+(GetUnitY(u)-y)*(GetUnitY(u)-y))
call cN('h09Q',u,u,3)
call IssuePointOrderById(bj_lastCreatedUnit,851984,x,y)
call TriggerSleepAction(aR/ 700)
call iN(cv,u,x,y)
set av=u
call GroupEnumUnitsInRange(g,x,y,300,Rv)
loop
set u2=FirstOfGroup(g)
exitwhen u2==null
call GroupRemoveUnit(g,u2)
set xF=RMinBJ(GetUnitState(u2,UNIT_STATE_MANA),'d')
call SetUnitState(u2,UNIT_STATE_MANA,GetUnitState(u2,UNIT_STATE_MANA)-xF)
if(xF>0)then
call IB("Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdl",u2,"origin")
call UnitDamageTarget(bj_lastCreatedUnit,u2,xF,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endif
endloop
call DestroyGroup(g)
set g=null
return true
endfunction
function kh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
local player p=GetOwningPlayer(u)
local real aR=GetRandomReal(70,350)
local real nR=GetRandomReal(0,360)
local real x=GetUnitX(u)+aR*Cos(nR*bj_DEGTORAD)
local real y=GetUnitY(u)+aR*Sin(nR*bj_DEGTORAD)
call cN('h09M',u,u,3)
call IssuePointOrderById(bj_lastCreatedUnit,851984,x,y)
call TriggerSleepAction(aR/ 700)
set u=CreateUnit(p,'n025',x,y,nR)
call GroupAddUnit(Ki,u)
return true
endfunction
function Kh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
local group g=CreateGroup()
local integer i=0
local unit u2
set av=u
call GroupEnumUnitsInRange(g,GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()),400,Ov)
loop
set u2=FirstOfGroup(g)
set i=i+1
exitwhen u2==null
exitwhen i>4
call GroupRemoveUnit(g,u2)
call aN(ev,u,u2)
endloop
call DestroyGroup(g)
set g=null
return true
endfunction
function lh takes nothing returns boolean
call aN(xv,GetSpellAbilityUnit(),GetSpellTargetUnit())
return true
endfunction
function Lh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
local group g=CreateGroup()
local integer i=0
local unit u2
call GroupEnumUnitsInRange(g,GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()),350,null)
loop
exitwhen i>2
set u2=FirstOfGroup(g)
exitwhen u2==null
call GroupRemoveUnit(g,u2)
if(not IsUnitType(u2,UNIT_TYPE_DEAD))and((Fi[GetPlayerId(GetOwningPlayer((u2)))+1])!=(Fi[GetPlayerId(GetOwningPlayer((u)))+1]))and IsUnitType(u2,UNIT_TYPE_GROUND)then
set i=i+1
call aN(Hv,u,u2)
endif
endloop
call DestroyGroup(g)
set g=null
return true
endfunction
function mh takes nothing returns boolean
call nN(dv,GetSpellAbilityUnit(),GetSpellTargetUnit())
return true
endfunction
function Mh takes nothing returns boolean
call xN(q,GetSpellAbilityUnit())
call IB("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",GetSpellAbilityUnit(),"origin")
return true
endfunction
function ph takes nothing returns boolean
call xN(Fv,GetSpellAbilityUnit())
call IB("Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl",GetSpellAbilityUnit(),"origin")
return true
endfunction
function Ph takes nothing returns boolean
call IB("Abilities\\Spells\\NightElf\\BattleRoar\\RoarCaster.mdl",GetSpellAbilityUnit(),"origin")
call xN(T,GetSpellAbilityUnit())
return true
endfunction
function qh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call UnitRemoveAbility(GetSpellAbilityUnit(),'A00F')
call xN(Qv,u)
call IB("Units\\NightElf\\Wisp\\WispExplode.mdl",u,"origin")
call TriggerSleepAction(.3)
call IssuePointOrderByIdLoc(u,851986,Yx[ModuloInteger(Fi[(1+GetPlayerId(GetOwningPlayer(u)))]+1,2)])
call TriggerSleepAction(5)
call IssueImmediateOrderById(u,851993)
call TriggerSleepAction(6.6)
call UnitAddAbility(u,'A00F')
call pA(u)
return true
endfunction
function Qh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call aN(sv,u,GetSpellTargetUnit())
call TriggerSleepAction(.8)
call pA(u)
return true
endfunction
function sh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call aN(lv,u,GetSpellTargetUnit())
call TriggerSleepAction(.8)
call pA(u)
return true
endfunction
function Sh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call aN(gv,u,GetSpellTargetUnit())
call IssueImmediateOrderById(u,852126)
call TriggerSleepAction(1.)
call MA(u)
return true
endfunction
function th takes nothing returns boolean
call aN(pv,GetSpellAbilityUnit(),GetSpellTargetUnit())
return true
endfunction
function Th takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call IssueTargetOrderById(u,852066,GetSpellTargetUnit())
call TriggerSleepAction(1.)
call MA(u)
return true
endfunction
function uh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
local location l=GetUnitLoc(u)
local group g
set av=u
set g=XR(900.,l,Vv)
call UnitAddAbility(GetSpellTargetUnit(),'A03L')
if(CountUnitsInGroup(g)>0)then
call IssueImmediateOrderById(u,852094)
call TriggerSleepAction(1.)
call pA(u)
endif
call DestroyGroup(g)
call RemoveLocation(l)
set l=null
set g=null
return true
endfunction
function Uh takes nothing returns boolean
local unit u=GetSpellAbilityUnit()
call TriggerSleepAction(1.2)
call IssuePointOrderByIdLoc(u,851983,Yx[(Fi[GetPlayerId(GetOwningPlayer((u)))+1])])
return true
endfunction
function wh takes nothing returns boolean
local integer JR=TO
set zE=UE[JR]
loop
exitwhen zE==0
set YE=zE
set zE=QE[YE]
call kR(YE)
endloop
call FlushChildHashtable(yE,JR)
return true
endfunction
function Wh takes nothing returns boolean
set uO=UA(SO,tO)
return true
endfunction
function yh takes nothing returns boolean
local integer JR=TO
set SX=PX[JR]
loop
exitwhen SX==0
set sX=SX
set SX=KX[sX]
call QR(sX)
endloop
return true
endfunction
function Yh takes nothing returns boolean
local integer JR=TO
set HX=FX[JR]
loop
exitwhen HX==0
set hX=HX
set HX=BX[hX]
call SR(hX)
endloop
return true
endfunction
function zh takes nothing returns boolean
local integer JR=TO
set IX=VX[JR]
loop
exitwhen IX==0
set RX=IX
set IX=xX[RX]
call TR(RX)
endloop
call FlushChildHashtable(OX,JR)
return true
endfunction
function eh takes nothing returns nothing
set sO[3]=CreateTrigger()
call TriggerAddAction(sO[3],function xh)
call TriggerAddCondition(sO[3],Condition(function xh))
set sO[30]=CreateTrigger()
call TriggerAddAction(sO[30],function oh)
call TriggerAddCondition(sO[30],Condition(function oh))
set sO[6]=CreateTrigger()
call TriggerAddAction(sO[6],function rh)
call TriggerAddCondition(sO[6],Condition(function rh))
set sO[26]=CreateTrigger()
call TriggerAddAction(sO[26],function ih)
call TriggerAddCondition(sO[26],Condition(function ih))
set sO[35]=CreateTrigger()
call TriggerAddAction(sO[35],function ah)
call TriggerAddCondition(sO[35],Condition(function ah))
set sO[37]=CreateTrigger()
call TriggerAddAction(sO[37],function nh)
call TriggerAddCondition(sO[37],Condition(function nh))
set sO[25]=CreateTrigger()
call TriggerAddAction(sO[25],function Vh)
call TriggerAddCondition(sO[25],Condition(function Vh))
set sO[14]=CreateTrigger()
call TriggerAddAction(sO[14],function Eh)
call TriggerAddCondition(sO[14],Condition(function Eh))
set sO[42]=CreateTrigger()
call TriggerAddAction(sO[42],function Xh)
call TriggerAddCondition(sO[42],Condition(function Xh))
set sO[12]=CreateTrigger()
call TriggerAddAction(sO[12],function Oh)
call TriggerAddCondition(sO[12],Condition(function Oh))
set sO[8]=CreateTrigger()
call TriggerAddAction(sO[8],function Rh)
call TriggerAddCondition(sO[8],Condition(function Rh))
set sO[21]=CreateTrigger()
call TriggerAddAction(sO[21],function Ih)
call TriggerAddCondition(sO[21],Condition(function Ih))
set sO[16]=CreateTrigger()
call TriggerAddAction(sO[16],function Ah)
call TriggerAddCondition(sO[16],Condition(function Ah))
set sO[7]=CreateTrigger()
call TriggerAddAction(sO[7],function Nh)
call TriggerAddCondition(sO[7],Condition(function Nh))
set sO[34]=CreateTrigger()
call TriggerAddAction(sO[34],function bh)
call TriggerAddCondition(sO[34],Condition(function bh))
set sO[4]=CreateTrigger()
call TriggerAddAction(sO[4],function Bh)
call TriggerAddCondition(sO[4],Condition(function Bh))
set sO[32]=CreateTrigger()
call TriggerAddAction(sO[32],function ch)
call TriggerAddCondition(sO[32],Condition(function ch))
set sO[44]=CreateTrigger()
call TriggerAddAction(sO[44],function Ch)
call TriggerAddCondition(sO[44],Condition(function Ch))
set sO[11]=CreateTrigger()
call TriggerAddAction(sO[11],function dh)
call TriggerAddCondition(sO[11],Condition(function dh))
set sO[38]=CreateTrigger()
call TriggerAddAction(sO[38],function Dh)
call TriggerAddCondition(sO[38],Condition(function Dh))
set sO[19]=CreateTrigger()
call TriggerAddAction(sO[19],function fh)
call TriggerAddCondition(sO[19],Condition(function fh))
set sO[40]=CreateTrigger()
call TriggerAddAction(sO[40],function Fh)
call TriggerAddCondition(sO[40],Condition(function Fh))
set sO[29]=CreateTrigger()
call TriggerAddAction(sO[29],function gh)
call TriggerAddCondition(sO[29],Condition(function gh))
set sO[33]=CreateTrigger()
call TriggerAddAction(sO[33],function Gh)
call TriggerAddCondition(sO[33],Condition(function Gh))
set sO[15]=CreateTrigger()
call TriggerAddAction(sO[15],function hh)
call TriggerAddCondition(sO[15],Condition(function hh))
set sO[17]=CreateTrigger()
call TriggerAddAction(sO[17],function Hh)
call TriggerAddCondition(sO[17],Condition(function Hh))
set sO[2]=CreateTrigger()
call TriggerAddAction(sO[2],function jh)
call TriggerAddCondition(sO[2],Condition(function jh))
set sO[18]=CreateTrigger()
call TriggerAddAction(sO[18],function Jh)
call TriggerAddCondition(sO[18],Condition(function Jh))
set sO[23]=CreateTrigger()
call TriggerAddAction(sO[23],function kh)
call TriggerAddCondition(sO[23],Condition(function kh))
set sO[9]=CreateTrigger()
call TriggerAddAction(sO[9],function Kh)
call TriggerAddCondition(sO[9],Condition(function Kh))
set sO[10]=CreateTrigger()
call TriggerAddAction(sO[10],function lh)
call TriggerAddCondition(sO[10],Condition(function lh))
set sO[31]=CreateTrigger()
call TriggerAddAction(sO[31],function Lh)
call TriggerAddCondition(sO[31],Condition(function Lh))
set sO[20]=CreateTrigger()
call TriggerAddAction(sO[20],function mh)
call TriggerAddCondition(sO[20],Condition(function mh))
set sO[1]=CreateTrigger()
call TriggerAddAction(sO[1],function Mh)
call TriggerAddCondition(sO[1],Condition(function Mh))
set sO[22]=CreateTrigger()
call TriggerAddAction(sO[22],function ph)
call TriggerAddCondition(sO[22],Condition(function ph))
set sO[5]=CreateTrigger()
call TriggerAddAction(sO[5],function Ph)
call TriggerAddCondition(sO[5],Condition(function Ph))
set sO[41]=CreateTrigger()
call TriggerAddAction(sO[41],function qh)
call TriggerAddCondition(sO[41],Condition(function qh))
set sO[43]=CreateTrigger()
call TriggerAddAction(sO[43],function Qh)
call TriggerAddCondition(sO[43],Condition(function Qh))
set sO[36]=CreateTrigger()
call TriggerAddAction(sO[36],function sh)
call TriggerAddCondition(sO[36],Condition(function sh))
set sO[24]=CreateTrigger()
call TriggerAddAction(sO[24],function Sh)
call TriggerAddCondition(sO[24],Condition(function Sh))
set sO[39]=CreateTrigger()
call TriggerAddAction(sO[39],function th)
call TriggerAddCondition(sO[39],Condition(function th))
set sO[27]=CreateTrigger()
call TriggerAddAction(sO[27],function Th)
call TriggerAddCondition(sO[27],Condition(function Th))
set sO[28]=CreateTrigger()
call TriggerAddAction(sO[28],function uh)
call TriggerAddCondition(sO[28],Condition(function uh))
set sO[13]=CreateTrigger()
call TriggerAddAction(sO[13],function Uh)
call TriggerAddCondition(sO[13],Condition(function Uh))
set MO=CreateTrigger()
call TriggerAddCondition(MO,Condition(function wh))
set QO=CreateTrigger()
call TriggerAddCondition(QO,Condition(function Wh))
set mO[12]=null
set mO[13]=null
set qO=CreateTrigger()
call TriggerAddCondition(qO,Condition(function yh))
set PO=CreateTrigger()
call TriggerAddCondition(PO,Condition(function Yh))
set pO=CreateTrigger()
call TriggerAddCondition(pO,Condition(function zh))
call ExecuteFunc("lI")
call ExecuteFunc("MI")
call ExecuteFunc("BN")
endfunction
