globals integer array a integer array V integer array E unit array X integer array O integer array R unit array I boolean array A quest array N integer array B integer C=0 rect array D integer F=0 timer array G integer H=0 integer J=0 dialog K=null button L=null button M=null timer P=null integer array q integer array Q integer S=0 integer T=0 player U=null integer w=0 real W=0 real Y=0 unit Z=null boolean vv=false integer ev=0 integer xv=0 integer ov=0 real rv=0 integer iv=0 integer av=0 integer nv=0 fogmodifier array Vv location array Ev integer Xv=0 questitem Ov=null questitem Rv=null real Iv=0 unit Av=null integer array Nv unit array bv effect array Bv item cv=null integer Cv=0 unit dv=null real array Dv integer fv=0 integer array Fv real array gv boolean Gv=false boolean array hv integer array Hv boolean jv=false weathereffect Jv=null integer kv=0 integer Kv=0 unit lv=null unit Lv=null integer mv=0 integer Mv=0 integer array pv integer array Pv rect qv=null timer Qv=null integer sv=0 timer array Sv real array tv string array Tv integer array uv integer array Uv integer wv=0 real array Wv real array yv unit array Yv boolean array zv integer array Zv integer array ve unit array ee integer xe=0 location array oe boolean re=false integer ie=0 integer ae=0 unit array ne integer Ve=0 unit array Ee boolean array Xe integer Oe=0 integer Re=0 item array Ie gamecache Ae=null integer Ne=0 integer be=0 integer Be=0 unit ce=null boolean array Ce integer de=0 integer De=0 integer fe=0 integer Fe=0 effect array ge real array Ge real he=0 unit array He integer je=0 string array Je boolean ke=false integer Ke=0 real le=0 unit Le=null unit array me integer Me=0 multiboard pe=null integer array Pe integer array qe unit array Qe trigger array se integer Se=0 integer te=0 button Te=null boolean ue=false boolean Ue=false real We=0 real ye=0 integer Ye=0 integer ze=0 integer Ze=0 real array vx integer array ex real xx=0 player ox=null boolean array rx integer ix=0 integer array ax integer array nx unit Vx=null integer array Ex real Xx=0 integer Ox=0 effect array Rx unit array Ix integer array Ax integer Nx=0 unit array bx effect array Bx integer cx=0 integer array Cx unit array Dx force Fx=null unit gx=null integer array Gx unit array hx integer array Hx unit jx=null integer array Jx integer kx=0 integer array Kx integer lx=0 boolean Lx=false integer array mx integer Mx=0 integer px=0 unit array Px unit array qx location array Qx item sx=null integer array Sx unit array tx integer Tx=0 boolean array ux unit array Ux integer wx=0 integer Wx=0 integer yx=0 integer array Yx integer array zx boolean array Zx integer array vo real eo=0 real xo=0 integer oo=0 quest ro=null integer array io integer array ao integer array no integer array Vo integer array Eo integer array Xo real array Oo boolean Ro=false real array Io integer array Ao integer No=0 boolean bo=false integer Bo=0 trigger array co integer Co=0 integer array do integer array Do integer array fo integer Fo=0 boolean array go real array Go integer ho=0 integer array Ho integer jo=0 real Jo=0 integer ko=0 integer array Ko integer array lo integer array Lo integer mo=0 real Mo=0 unit po=null real Po=0 unit array qo integer Qo=0 integer so=0 integer So=0 player to=null boolean array To integer array uo integer Uo=0 integer array wo integer array Wo integer array yo trigger Yo=null integer array zo integer Zo=0 unit vr=null integer er=0 integer xr=0 trigger rr=null unit ir=null boolean ar=false boolean nr=false boolean Vr=false integer array Er integer Xr=0 real Rr=0 real array Ir integer array Ar player Nr=null player br=null integer Br=0 integer cr=0 effect array Cr integer array dr integer Dr=0 real array fr real array Fr trigger array gr integer Gr=0 integer hr=0 integer array Hr integer array jr item array Jr unit array kr integer Kr=0 integer array lr unit array Lr integer mr=0 integer array Mr integer array pr integer Pr=0 boolean array qr effect Qr=null integer sr=0 integer Sr=0 integer array tr unit array Tr unit array ur real array Ur real wr=0 real array Wr integer array yr integer array Yr boolean array zr unit array Zr integer vi=0 integer ei=0 integer xi=0 boolean oi=false integer array ri player ii=null integer array ai integer array ni integer array Vi integer array Ei integer array Xi integer array Oi integer array Ri boolean Ii=false integer array Ai integer Ni=0 fogmodifier array bi integer Bi=0 integer ci=0 trigger Ci=null integer array di integer Di=0 integer array fi real array Fi integer gi=0 trigger array Gi integer hi=0 integer Hi=0 integer ji=0 unit array Ji integer array ki unit array Ki real array li integer Li=0 boolean mi=false unit Mi=null integer array pi integer array Pi hashtable qi=null unit array Qi unit array si integer Si=0 integer array ti real array Ti integer array ui unit array Ui real array wi boolean Wi=false integer yi=0 integer Yi=0 rect zi=null real Zi=0 rect va=null rect ea=null rect xa=null rect oa=null rect ra=null rect ia=null rect aa=null rect na=null rect Va=null rect Ea=null rect Xa=null rect Oa=null rect Ra=null rect Ia=null rect Aa=null rect Na=null rect ba=null rect Ba=null rect ca=null rect Ca=null rect da=null rect Da=null rect fa=null rect Fa=null 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 rect rn=null rect in=null rect an=null rect nn=null rect Vn=null rect En=null rect Xn=null rect On=null rect Rn=null rect In=null rect An=null rect Nn=null rect bn=null rect Bn=null rect cn=null rect Cn=null rect dn=null rect Dn=null rect fn=null rect Fn=null rect gn=null rect Gn=null rect hn=null rect Hn=null rect jn=null rect Jn=null rect kn=null rect Kn=null rect ln=null rect Ln=null rect mn=null rect Mn=null rect pn=null rect Pn=null rect qn=null rect Qn=null rect sn=null rect Sn=null rect tn=null rect Tn=null rect un=null rect Un=null rect wn=null rect Wn=null rect yn=null rect Yn=null rect zn=null rect Zn=null rect vV=null rect eV=null rect xV=null rect oV=null rect rV=null rect iV=null rect aV=null rect nV=null rect VV=null rect EV=null rect XV=null rect OV=null rect RV=null rect IV=null rect AV=null rect NV=null rect bV=null rect BV=null rect cV=null rect CV=null rect dV=null rect DV=null rect fV=null rect FV=null rect gV=null rect GV=null rect hV=null rect HV=null rect jV=null rect JV=null rect kV=null rect KV=null rect lV=null rect LV=null rect mV=null rect MV=null rect pV=null rect PV=null rect qV=null rect QV=null rect sV=null rect SV=null rect tV=null rect TV=null rect uV=null rect UV=null rect wV=null rect WV=null rect yV=null rect YV=null rect zV=null rect ZV=null rect vE=null rect eE=null rect xE=null rect oE=null rect rE=null rect iE=null rect aE=null rect nE=null rect VE=null rect EE=null rect XE=null sound OE=null sound RE=null sound IE=null sound AE=null sound NE=null sound bE=null sound BE=null sound cE=null sound CE=null sound dE=null sound DE=null sound fE=null sound FE=null sound gE=null sound GE=null sound hE=null sound HE=null sound jE=null sound JE=null sound kE=null sound KE=null sound lE=null sound LE=null sound mE=null trigger ME=null trigger pE=null trigger PE=null trigger qE=null trigger QE=null trigger sE=null trigger SE=null trigger tE=null trigger TE=null trigger uE=null trigger UE=null trigger wE=null trigger WE=null trigger yE=null trigger YE=null trigger zE=null trigger ZE=null trigger vX=null trigger eX=null trigger xX=null trigger oX=null trigger rX=null trigger aX=null trigger VX=null trigger EX=null trigger XX=null trigger OX=null trigger RX=null trigger IX=null trigger AX=null trigger NX=null trigger bX=null trigger BX=null trigger cX=null trigger CX=null trigger dX=null trigger DX=null trigger fX=null trigger FX=null trigger gX=null trigger GX=null trigger hX=null trigger HX=null trigger jX=null trigger JX=null trigger kX=null trigger KX=null trigger lX=null trigger LX=null trigger mX=null trigger MX=null trigger pX=null trigger PX=null trigger qX=null trigger QX=null trigger sX=null trigger SX=null trigger tX=null trigger TX=null trigger uX=null trigger UX=null trigger wX=null trigger WX=null trigger yX=null trigger YX=null trigger zX=null trigger ZX=null trigger vO=null trigger eO=null trigger xO=null trigger oO=null trigger rO=null trigger aO=null trigger nO=null trigger VO=null trigger EO=null trigger XO=null trigger OO=null trigger RO=null trigger IO=null trigger AO=null trigger NO=null trigger BO=null trigger cO=null trigger CO=null trigger dO=null trigger DO=null trigger fO=null trigger FO=null trigger gO=null trigger GO=null trigger hO=null trigger HO=null trigger jO=null trigger JO=null trigger kO=null trigger KO=null trigger lO=null trigger LO=null trigger mO=null trigger MO=null trigger pO=null trigger PO=null trigger qO=null trigger QO=null trigger sO=null trigger SO=null trigger tO=null trigger TO=null trigger uO=null trigger UO=null trigger wO=null trigger WO=null trigger yO=null trigger YO=null trigger zO=null trigger ZO=null trigger vR=null trigger eR=null trigger xR=null trigger oR=null trigger rR=null trigger aR=null trigger nR=null trigger VR=null trigger ER=null trigger XR=null trigger OR=null trigger RR=null trigger IR=null trigger AR=null trigger NR=null trigger bR=null trigger BR=null trigger cR=null trigger CR=null trigger dR=null trigger DR=null trigger fR=null trigger FR=null trigger gR=null trigger GR=null trigger hR=null trigger HR=null trigger jR=null trigger JR=null trigger kR=null trigger KR=null trigger lR=null trigger LR=null trigger mR=null trigger MR=null trigger pR=null trigger PR=null trigger qR=null trigger QR=null trigger sR=null trigger SR=null trigger tR=null trigger TR=null trigger uR=null trigger UR=null trigger wR=null trigger WR=null trigger yR=null trigger YR=null trigger zR=null trigger ZR=null trigger vI=null trigger eI=null trigger xI=null trigger oI=null trigger rI=null trigger iI=null trigger aI=null trigger nI=null trigger VI=null trigger EI=null trigger XI=null trigger OI=null trigger RI=null trigger II=null trigger AI=null trigger NI=null trigger bI=null trigger BI=null trigger cI=null trigger CI=null trigger dI=null trigger DI=null trigger fI=null trigger FI=null trigger gI=null trigger GI=null trigger hI=null trigger HI=null trigger jI=null trigger JI=null trigger kI=null trigger KI=null trigger lI=null trigger LI=null trigger mI=null trigger MI=null trigger pI=null trigger PI=null trigger qI=null trigger QI=null trigger sI=null trigger SI=null trigger tI=null trigger TI=null trigger uI=null trigger UI=null trigger wI=null trigger WI=null trigger yI=null trigger YI=null trigger zI=null trigger ZI=null trigger vA=null trigger eA=null trigger rA=null trigger aA=null trigger nA=null trigger VA=null trigger EA=null trigger XA=null trigger OA=null trigger RA=null trigger IA=null trigger AA=null trigger NA=null trigger bA=null trigger BA=null trigger cA=null trigger CA=null trigger dA=null trigger DA=null trigger fA=null trigger FA=null trigger gA=null trigger GA=null trigger hA=null trigger HA=null trigger jA=null trigger JA=null trigger kA=null trigger KA=null trigger lA=null trigger LA=null trigger mA=null trigger MA=null trigger pA=null trigger PA=null trigger qA=null trigger QA=null trigger sA=null trigger SA=null trigger tA=null trigger TA=null trigger uA=null trigger UA=null trigger wA=null trigger WA=null trigger YA=null trigger zA=null trigger ZA=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 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 vb=null trigger eb=null trigger xb=null trigger ob=null trigger rb=null trigger ib=null trigger ab=null trigger nb=null trigger Vb=null trigger Eb=null trigger Xb=null trigger Ob=null trigger Rb=null trigger Ib=null trigger Ab=null trigger Nb=null trigger bb=null trigger Bb=null trigger cb=null trigger Cb=null trigger db=null trigger Db=null trigger fb=null trigger Fb=null trigger gb=null trigger Gb=null trigger hb=null trigger Hb=null trigger jb=null trigger Jb=null trigger kb=null trigger Kb=null trigger lb=null trigger Lb=null unit mb=null unit Mb=null unit pb=null unit Pb=null unit qb=null unit Qb=null unit sb=null unit Sb=null unit tb=null unit Tb=null unit ub=null unit Ub=null unit wb=null unit Wb=null unit yb=null unit Yb=null unit zb=null unit Zb=null unit vB=null unit eB=null unit oB=null unit rB=null unit aB=null unit nB=null unit VB=null unit EB=null unit XB=null unit OB=null unit RB=null unit IB=null unit AB=null unit NB=null unit bB=null unit BB=null unit cB=null unit CB=null unit dB=null unit DB=null unit fB=null unit FB=null unit gB=null unit GB=null unit hB=null unit HB=null unit jB=null unit JB=null unit kB=null unit KB=null unit lB=null unit LB=null unit mB=null unit MB=null unit pB=null unit PB=null unit qB=null unit QB=null unit sB=null unit SB=null unit tB=null unit TB=null unit uB=null unit UB=null unit wB=null unit WB=null unit YB=null timer zB=null real vc=0. real ec=0. group xc=null force oc=null boolexpr rc=null endglobals function ac takes real nc returns nothing local real Vc local real st=TimerGetElapsed(zB) if st<=0 then set zB=CreateTimer() call TimerStart(zB,1000000,false,null) endif if(nc>0)then loop set Vc=nc-TimerGetElapsed(zB)+st exitwhen Vc<=0 if(Vc>bj_POLLED_WAIT_SKIP_THRESHOLD)then call TriggerSleepAction(0.1*Vc) else call TriggerSleepAction(bj_POLLED_WAIT_INTERVAL) endif endloop endif endfunction function Ec takes location Xc,real Oc,real Rc returns location return Location(GetLocationX(Xc)+Oc*Cos(Rc*bj_DEGTORAD),GetLocationY(Xc)+Oc*Sin(Rc*bj_DEGTORAD)) endfunction function Ic takes nothing returns boolean local real dx=GetDestructableX(GetFilterDestructable())-vc local real dy=GetDestructableY(GetFilterDestructable())-ec return(dx*dx+dy*dy<=bj_enumDestructableRadius) endfunction function Ac takes rect r,boolexpr Nc returns group set xc=CreateGroup() call GroupEnumUnitsInRect(xc,r,Nc) call DestroyBoolExpr(Nc) return xc endfunction function bc takes real Bc,location cc,boolexpr Nc returns group set xc=CreateGroup() call GroupEnumUnitsInRangeOfLoc(xc,cc,Bc,Nc) return xc endfunction function Cc takes real Bc,location cc returns group set xc=CreateGroup() call GroupEnumUnitsInRangeOfLoc(xc,cc,Bc,rc) return xc endfunction function dc takes integer Dc returns group set xc=CreateGroup() call GroupEnumUnitsOfType(xc,UnitId2String(Dc),rc) return xc endfunction function fc takes player Fc returns group set xc=CreateGroup() call GroupEnumUnitsOfPlayer(xc,Fc,rc) return xc endfunction function Gc takes player Fc returns group set xc=CreateGroup() call SyncSelections() call GroupEnumUnitsSelected(xc,Fc,rc) return xc endfunction function hc takes player Fc returns force set oc=CreateForce() call ForceAddPlayer(oc,Fc) return oc endfunction function lc takes itemtype Lc,integer mc returns nothing local group g set bj_stockPickedItemType=Lc set bj_stockPickedItemLevel=mc set g=CreateGroup() call GroupEnumUnitsOfType(g,"marketplace",rc) call ForGroup(g,function UpdateEachStockBuildingEnum) call DestroyGroup(g) set g=null endfunction function Mc takes nothing returns nothing local integer pickedItemId local itemtype pc local integer Pc=0 local integer qc=0 local integer mc set mc=1 loop if(bj_stockAllowedPermanent[mc])then set qc=qc+1 if(GetRandomInt(1,qc)==1)then set pc=ITEM_TYPE_PERMANENT set Pc=mc endif endif if(bj_stockAllowedCharged[mc])then set qc=qc+1 if(GetRandomInt(1,qc)==1)then set pc=ITEM_TYPE_CHARGED set Pc=mc endif endif if(bj_stockAllowedArtifact[mc])then set qc=qc+1 if(GetRandomInt(1,qc)==1)then set pc=ITEM_TYPE_ARTIFACT set Pc=mc endif endif set mc=mc+1 exitwhen mc>bj_MAX_ITEM_LEVEL endloop if(qc==0)then set pc=null return endif call lc(pc,Pc) set pc=null endfunction function Qc takes nothing returns nothing call Mc() call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INTERVAL,true,function Mc) endfunction function sc takes nothing returns nothing local integer mc set mc=0 loop set bj_stockAllowedPermanent[mc]=false set bj_stockAllowedCharged[mc]=false set bj_stockAllowedArtifact[mc]=false set mc=mc+1 exitwhen mc>bj_MAX_ITEM_LEVEL endloop call SetAllItemTypeSlots(bj_MAX_STOCK_ITEM_SLOTS) call SetAllUnitTypeSlots(bj_MAX_STOCK_UNIT_SLOTS) set bj_stockUpdateTimer=CreateTimer() call TimerStart(bj_stockUpdateTimer,bj_STOCK_RESTOCK_INITIAL_DELAY,false,function Qc) set bj_stockItemPurchased=CreateTrigger() call TriggerRegisterPlayerUnitEvent(bj_stockItemPurchased,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_SELL_ITEM,null) call TriggerAddAction(bj_stockItemPurchased,function RemovePurchasedItem) endfunction function Sc takes nothing returns boolean return true endfunction function tc takes nothing returns nothing local integer Tc local integer uc local version v set rc=Filter(function Sc) set filterIssueHauntOrderAtLocBJ=Filter(function IssueHauntOrderAtLocBJFilter) set filterEnumDestructablesInCircleBJ=Filter(function Ic) 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 Tc=0 loop exitwhen Tc==bj_MAX_PLAYER_SLOTS set bj_FORCE_PLAYER[Tc]=CreateForce() call ForceAddPlayer(bj_FORCE_PLAYER[Tc],Player(Tc)) set Tc=Tc+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 Tc=0 loop exitwhen Tc>=bj_MAX_QUEUED_TRIGGERS set bj_queuedExecTriggers[Tc]=null set bj_queuedExecUseConds[Tc]=false set Tc=Tc+1 endloop set bj_isSinglePlayer=false set uc=0 set Tc=0 loop exitwhen Tc>=bj_MAX_PLAYERS if(GetPlayerController(Player(Tc))==MAP_CONTROL_USER and GetPlayerSlotState(Player(Tc))==PLAYER_SLOT_STATE_PLAYING)then set uc=uc+1 endif set Tc=Tc+1 endloop set bj_isSinglePlayer=(uc==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 endfunction function Uc takes nothing returns nothing call ConfigureNeutralVictim() call tc() call InitQueuedTriggers() call InitRescuableBehaviorBJ() call InitDNCSounds() call InitMapRects() call InitSummonableCaps() call sc() call DetectGameStarted() endfunction function wc takes nothing returns nothing local integer i=0 set i=0 loop exitwhen(i>9) set X[i]=null set i=i+1 endloop set i=0 loop exitwhen(i>9) set R[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set A[i]=true set i=i+1 endloop set i=0 loop exitwhen(i>9) set B[i]=0 set i=i+1 endloop set C=0 set F=75 set i=0 loop exitwhen(i>9) set G[i]=CreateTimer() set i=i+1 endloop set H=0 set J=3 set K=DialogCreate() set P=CreateTimer() set i=0 loop exitwhen(i>9) set q[i]=-1 set i=i+1 endloop set i=0 loop exitwhen(i>22) set Q[i]=0 set i=i+1 endloop set S=0 set T=50 set w=6 set W=1.00 set Y=1.00 set Z=null set vv=false set ev=0 set xv=0 set ov=60 set rv=3.00 set iv=0 set av=0 set nv=0 set Xv=11 set Iv=0.00 set Av=null set i=0 loop exitwhen(i>20) set Nv[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>20) set bv[i]=null set i=i+1 endloop set cv=null set Cv=12 set dv=null set i=0 loop exitwhen(i>9) set Dv[i]=1.00 set i=i+1 endloop set fv=190 set i=0 loop exitwhen(i>9) set Fv[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set gv[i]=1.00 set i=i+1 endloop set Gv=false set i=0 loop exitwhen(i>9) set hv[i]=false set i=i+1 endloop set i=0 loop exitwhen(i>1) set Hv[i]=0 set i=i+1 endloop set jv=true set kv=0 set Kv=0 set lv=null set Lv=null set mv=25 set Mv=100 set i=0 loop exitwhen(i>1) set pv[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>27) set Pv[i]=0 set i=i+1 endloop set qv=null set Qv=CreateTimer() set sv=0 set i=0 loop exitwhen(i>2) set Sv[i]=CreateTimer() set i=i+1 endloop set i=0 loop exitwhen(i>1) set tv[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Tv[i]="" set i=i+1 endloop set i=0 loop exitwhen(i>9) set uv[i]=0 set i=i+1 endloop set wv=2500 set i=0 loop exitwhen(i>9) set Wv[i]=1.00 set i=i+1 endloop set i=0 loop exitwhen(i>9) set yv[i]=1.00 set i=i+1 endloop set i=0 loop exitwhen(i>9) set Yv[i]=null set i=i+1 endloop set i=0 loop exitwhen(i>9) set zv[i]=false set i=i+1 endloop set i=0 loop exitwhen(i>9) set Zv[i]=4 set i=i+1 endloop set i=0 loop exitwhen(i>9) set ve[i]=100 set i=i+1 endloop set i=0 loop exitwhen(i>9) set ee[i]=null set i=i+1 endloop set xe=0 set re=false set ie=1 set ae=0 set i=0 loop exitwhen(i>1) set ne[i]=null set i=i+1 endloop set Ve=0 set i=0 loop exitwhen(i>5) set Ee[i]=null set i=i+1 endloop set i=0 loop exitwhen(i>9) set Xe[i]=false set i=i+1 endloop set Oe='I01F' set Re=0 set i=0 loop exitwhen(i>9) set Ie[i]=null set i=i+1 endloop set Ne=-999 set be=5000 set Be=0 set ce=null set i=0 loop exitwhen(i>9) set Ce[i]=false set i=i+1 endloop set de=0 set De=0 set fe=0 set Fe=0 set i=0 loop exitwhen(i>9) set Ge[i]=1.00 set i=i+1 endloop set he=0.40 set je=0 set i=0 loop exitwhen(i>1) set Je[i]="" set i=i+1 endloop set ke=false set Ke=0 set le=0 set Le=null set i=0 loop exitwhen(i>1) set me[i]=null set i=i+1 endloop set Me=-1 set i=0 loop exitwhen(i>9) set Pe[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set qe[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set Qe[i]=null set i=i+1 endloop set Se=100 set te=-1 set ue=true set Ue=false set We=0.00 set ye=0.00 set Ye=0 set ze=62 set Ze=0 set i=0 loop exitwhen(i>1) set vx[i]=0.42 set i=i+1 endloop set i=0 loop exitwhen(i>1) set ex[i]=0 set i=i+1 endloop set xx=0 set ox=Player(bj_PLAYER_NEUTRAL_EXTRA) set i=0 loop exitwhen(i>1) set rx[i]=false set i=i+1 endloop set ix=1 set i=0 loop exitwhen(i>9) set ax[i]=-1 set i=i+1 endloop set i=0 loop exitwhen(i>1) set nx[i]=0 set i=i+1 endloop set Vx=null set i=0 loop exitwhen(i>9) set Ex[i]=0 set i=i+1 endloop set Xx=0.50 set Ox=0 set i=0 loop exitwhen(i>1) set Ax[i]=0 set i=i+1 endloop set Nx=16 set i=0 loop exitwhen(i>9) set bx[i]=null set i=i+1 endloop set cx=-1 set i=0 loop exitwhen(i>1) set Cx[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>8) set Dx[i]=null set i=i+1 endloop set Fx=CreateForce() set i=0 loop exitwhen(i>1) set Gx[i]=0 set i=i+1 endloop set jx=null set i=0 loop exitwhen(i>1) set Jx[i]=0 set i=i+1 endloop set kx=0 set i=0 loop exitwhen(i>1) set Kx[i]=0 set i=i+1 endloop set lx=5 set Lx=false set i=0 loop exitwhen(i>9) set mx[i]=0 set i=i+1 endloop set Mx=0 set px=0 set sx=null set i=0 loop exitwhen(i>1) set Sx[i]=0 set i=i+1 endloop set Tx=0 set i=0 loop exitwhen(i>1) set ux[i]=false set i=i+1 endloop set wx=0 set Wx=0 set yx=0 set i=0 loop exitwhen(i>1) set Yx[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set zx[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Zx[i]=false set i=i+1 endloop set i=0 loop exitwhen(i>1) set vo[i]=0 set i=i+1 endloop set eo=0 set xo=0 set oo=0 set i=0 loop exitwhen(i>1) set io[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set ao[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set no[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Vo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Eo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Xo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Oo[i]=0 set i=i+1 endloop set Ro=true set i=0 loop exitwhen(i>1) set Io[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Ao[i]=0 set i=i+1 endloop set No=0 set bo=false set Bo=0 set Co=9 set i=0 loop exitwhen(i>1) set do[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Do[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set fo[i]=0 set i=i+1 endloop set Fo=30 set i=0 loop exitwhen(i>1) set go[i]=false set i=i+1 endloop set i=0 loop exitwhen(i>1) set Go[i]=0 set i=i+1 endloop set ho=0 set i=0 loop exitwhen(i>1) set Ho[i]=0 set i=i+1 endloop set jo=0 set Jo=0 set ko=0 set i=0 loop exitwhen(i>1) set Ko[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set lo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Lo[i]=0 set i=i+1 endloop set mo=0 set Mo=0.10 set po=null set Po=0 set Qo=0 set so=0 set So=0 set i=0 loop exitwhen(i>1) set To[i]=false set i=i+1 endloop set i=0 loop exitwhen(i>9) set uo[i]=0 set i=i+1 endloop set Uo=0 set i=0 loop exitwhen(i>1) set wo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Wo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set yo[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set zo[i]=0 set i=i+1 endloop set Zo=0 set vr=null set er=0 set xr=0 set ir=null set ar=false set nr=false set Vr=false set i=0 loop exitwhen(i>1) set Er[i]=0 set i=i+1 endloop set Xr=0 set Rr=1.00 set i=0 loop exitwhen(i>1) set Ir[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Ar[i]=0 set i=i+1 endloop set Br=0 set cr=0 set i=0 loop exitwhen(i>9) set dr[i]=0 set i=i+1 endloop set Dr=0 set i=0 loop exitwhen(i>1) set fr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Fr[i]=0 set i=i+1 endloop set Gr=80 set hr=-100 set i=0 loop exitwhen(i>1) set Hr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set jr[i]=0 set i=i+1 endloop set Kr=0 set mr=0 set i=0 loop exitwhen(i>1) set Mr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set pr[i]=0 set i=i+1 endloop set Pr=0 set i=0 loop exitwhen(i>1) set qr[i]=false set i=i+1 endloop set sr=0 set Sr=0 set i=0 loop exitwhen(i>1) set tr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Ur[i]=0 set i=i+1 endloop set wr=1.00 set i=0 loop exitwhen(i>1) set Wr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set yr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Yr[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set zr[i]=false set i=i+1 endloop set i=0 loop exitwhen(i>1) set Zr[i]=null set i=i+1 endloop set vi=0 set ei=0 set xi=0 set oi=false set i=0 loop exitwhen(i>1) set ri[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set ai[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set ni[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Vi[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Ei[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Xi[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Oi[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Ri[i]=0 set i=i+1 endloop set Ii=false set i=0 loop exitwhen(i>5) set Ai[i]=0 set i=i+1 endloop set Ni=100 set Bi=46 set ci=32 set i=0 loop exitwhen(i>1) set di[i]=0 set i=i+1 endloop set Di=0 set i=0 loop exitwhen(i>1) set fi[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Fi[i]=0 set i=i+1 endloop set gi=0 set hi=0 set Hi=0 set ji=0 set i=0 loop exitwhen(i>1) set ki[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set li[i]=0 set i=i+1 endloop set Li=0 set mi=false set Mi=null set i=0 loop exitwhen(i>1) set pi[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Pi[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>1) set Qi[i]=null set i=i+1 endloop set i=0 loop exitwhen(i>1) set si[i]=null set i=i+1 endloop set Si=0 set i=0 loop exitwhen(i>9) set ti[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set Ti[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set ui[i]=0 set i=i+1 endloop set i=0 loop exitwhen(i>9) set Ui[i]=null set i=i+1 endloop set i=0 loop exitwhen(i>1) set wi[i]=0 set i=i+1 endloop set Wi=false set yi=0 set Yi=0 set zi=null set Zi=0 endfunction function Wc takes nothing returns nothing set OE=CreateSound("Abilities\\Weapons\\Mortar\\MortarImpact.wav",false,true,true,10,10,"MissilesEAX") call SetSoundParamsFromLabel(OE,"Mortar") call SetSoundDuration(OE,1887) set RE=CreateSound("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.wav",false,true,true,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(RE,"ThunderClap") call SetSoundDuration(RE,3451) call SetSoundChannel(RE,10) call SetSoundPitch(RE,0.3) call SetSoundDistances(RE,1000.0,10000.0) call SetSoundDistanceCutoff(RE,5000.0) set IE=CreateSound("Sound\\Music\\mp3Music\\Credits.mp3",false,false,false,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(IE,"CreditsMusic") call SetSoundDuration(IE,83017) call SetSoundChannel(IE,7) call SetSoundVolume(IE,100) set AE=CreateSound("Sound\\Interface\\AutoCastButtonClick1.wav",false,false,false,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(AE,"AutoCastButtonClick") call SetSoundDuration(AE,1132) set NE=CreateSound("Abilities\\Spells\\Items\\AIma\\ManaPotion.wav",false,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(NE,"ManaPotion") call SetSoundDuration(NE,1555) call SetSoundVolume(NE,50) set bE=CreateSound("Abilities\\Spells\\NightElf\\ReviveNightElf\\ReviveNightElf.wav",false,false,true,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(bE,"ReviveNightElf") call SetSoundDuration(bE,3268) call SetSoundChannel(bE,8) set BE=CreateSound("Abilities\\Spells\\Human\\CallToArms\\HumanCallToArmsWhat1.wav",false,false,true,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(BE,"TownHallCallToArms") call SetSoundDuration(BE,3971) call SetSoundChannel(BE,8) call SetSoundPitch(BE,0.9) set cE=CreateSound("war3mapImported\\hb-054.mp3",true,false,false,1,1,"DefaultEAXON") call SetSoundDuration(cE,627) call SetSoundChannel(cE,7) call SetSoundVolume(cE,127) call SetSoundPitch(cE,1.0) set CE=CreateSound("war3mapImported\\hb-105.mp3",true,false,false,1,1,"DefaultEAXON") call SetSoundDuration(CE,1192) call SetSoundChannel(CE,7) call SetSoundVolume(CE,127) call SetSoundPitch(CE,1.0) set dE=CreateSound("war3mapImported\\hb-155.mp3",true,false,false,1,1,"DefaultEAXON") call SetSoundDuration(dE,1688) call SetSoundChannel(dE,7) call SetSoundVolume(dE,127) call SetSoundPitch(dE,1.0) set DE=CreateSound("war3mapImported\\hb-210.mp3",true,false,false,1,1,"DefaultEAXON") call SetSoundDuration(DE,2237) call SetSoundChannel(DE,7) call SetSoundVolume(DE,127) call SetSoundPitch(DE,1.0) set fE=CreateSound("Sound\\Interface\\MapPing.wav",false,false,false,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(fE,"MapPing") call SetSoundDuration(fE,1637) set FE=CreateSound("Abilities\\Spells\\Human\\Defend\\DefendCaster.wav",false,false,true,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(FE,"Defend") call SetSoundDuration(FE,1167) call SetSoundChannel(FE,8) call SetSoundPitch(FE,1.2) set gE=CreateSound("war3mapImported\\nukedetect.mp3",false,false,false,10,10,"HeroAcksEAX") call SetSoundDuration(gE,1871) call SetSoundChannel(gE,8) call SetSoundVolume(gE,127) call SetSoundPitch(gE,1.0) set GE=CreateSound("Sound\\Units\\Combat\\MetalLightSliceFlesh2.wav",false,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(GE,"MetalLightSliceFlesh") call SetSoundDuration(GE,563) call SetSoundChannel(GE,11) set hE=CreateSound("Sound\\Units\\Combat\\MetalMediumBashFlesh1.wav",false,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(hE,"MetalMediumBashFlesh") call SetSoundDuration(hE,604) call SetSoundChannel(hE,11) set HE=CreateSound("Sound\\Interface\\Warning\\Human\\KnightInventoryFull1.wav",false,false,false,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(HE,"InventoryFullHuman") call SetSoundDuration(HE,1498) set jE=CreateSound("Sound\\Units\\Combat\\MetalHeavyBashFlesh3.wav",false,true,true,10,10,"CombatSoundsEAX") call SetSoundParamsFromLabel(jE,"MetalHeavyBashFlesh") call SetSoundDuration(jE,723) set JE=CreateSound("Doodads\\Dungeon\\Terrain\\EggSack\\EggSackDeath1.wav",false,true,true,10,10,"DefaultEAXON") call SetSoundParamsFromLabel(JE,"EggSackDeath") call SetSoundDuration(JE,2099) call SetSoundChannel(JE,5) set kE=CreateSound("Abilities\\Spells\\NightElf\\shadowstrike\\ShadowStrikeBirth1.wav",false,false,true,127,1,"SpellsEAX") call SetSoundParamsFromLabel(kE,"ShadowStrikeBirth") call SetSoundDuration(kE,2194) call SetSoundChannel(kE,8) call SetSoundPitch(kE,0.4) set KE=CreateSound("Abilities\\Spells\\Demon\\RainOfFire\\RainOfFireLoop1.wav",true,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(KE,"RainOfFireLoop") call SetSoundDuration(KE,4000) call SetSoundVolume(KE,85) call SetSoundPitch(KE,0.8) set lE=CreateSound("Abilities\\Spells\\Other\\Incinerate\\Incinerate1.wav",false,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(lE,"IncinerateDeath") call SetSoundDuration(lE,2717) set LE=CreateSound("Units\\Creeps\\HeroTinker\\TinkerMorphAlt1.wav",false,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(LE,"HeroTinkerMorphAlternate") call SetSoundDuration(LE,2711) call SetSoundVolume(LE,115) call SetSoundPitch(LE,1.1) set mE=CreateSound("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareStrike.wav",false,true,true,10,10,"SpellsEAX") call SetSoundParamsFromLabel(mE,"ManaFlareMissile") call SetSoundDuration(mE,791) endfunction function yc takes nothing returns nothing local integer itemID call CreateItem('I01M',-785.5,-1884.6) endfunction function Yc takes nothing returns nothing local player p=Player(9) local unit u local integer unitID local trigger t local real life set u=CreateUnit(p,'o00L',-1230.3,-1615.7,131.930) set mb=CreateUnit(p,'o00C',91.5,-102.3,272.440) set Tb=CreateUnit(p,'O005',-1146.3,-2015.8,73.116) call SetUnitState(Tb,UNIT_STATE_MANA,0) set ub=CreateUnit(p,'O00U',-866.8,-1634.8,189.410) call SetUnitState(ub,UNIT_STATE_MANA,0) set Ub=CreateUnit(p,'O003',-1413.5,-2000.5,236.960) call SetUnitState(Ub,UNIT_STATE_MANA,0) set wb=CreateUnit(p,'O000',-1348.9,-1995.4,191.684) call SetUnitState(wb,UNIT_STATE_MANA,0) set Wb=CreateUnit(p,'O004',-1375.8,-1848.4,111.789) call SetUnitState(Wb,UNIT_STATE_MANA,0) set yb=CreateUnit(p,'O00Y',-1316.0,-1895.9,38.212) call SetUnitState(yb,UNIT_STATE_MANA,0) set Yb=CreateUnit(p,'O00P',-1252.5,-1900.8,218.646) call SetUnitState(Yb,UNIT_STATE_MANA,0) set zb=CreateUnit(p,'O00T',-933.5,-1793.8,31.235) call SetUnitState(zb,UNIT_STATE_MANA,0) set Zb=CreateUnit(p,'O00Q',-1029.9,-2003.9,143.299) call SetUnitState(Zb,UNIT_STATE_MANA,0) set vB=CreateUnit(p,'O00O',-1098.7,-1909.2,32.455) call SetUnitState(vB,UNIT_STATE_MANA,0) set eB=CreateUnit(p,'O002',-881.4,-1710.9,35.597) call SetUnitState(eB,UNIT_STATE_MANA,0) set oB=CreateUnit(p,'O001',-1042.8,-1904.7,248.410) set aB=CreateUnit(p,'O008',-1152.6,-1943.3,264.230) call SetUnitColor(aB,ConvertPlayerColor(11)) set rB=CreateUnit(p,'O00F',-990.7,-1926.3,121.290) set nB=CreateUnit(p,'O009',-931.4,-1673.2,245.760) call SetUnitColor(nB,ConvertPlayerColor(11)) set VB=CreateUnit(p,'O00A',-1371.4,-1924.9,187.450) call SetUnitColor(VB,ConvertPlayerColor(11)) set EB=CreateUnit(p,'O00E',-1090.0,-1978.9,330.630) set OB=CreateUnit(p,'h008',-928.1,-1274.8,49.495) set RB=CreateUnit(p,'o00N',-940.4,-1357.0,188.370) set IB=CreateUnit(p,'o00J',-1435.6,-1346.5,69.280) set AB=CreateUnit(p,'n000',-1210.7,-1297.3,83.940) set NB=CreateUnit(p,'o00H',-890.4,-1900.6,192.170) set mB=CreateUnit(p,'nskk',-1012.6,-1471.2,176.819) set cB=CreateUnit(p,'O014',-879.8,-1547.0,142.200) set CB=CreateUnit(p,'n00X',-887.5,-1822.3,168.930) set DB=CreateUnit(p,'O018',-1217.8,-2008.6,64.070) set FB=CreateUnit(p,'z001',-1287.3,-1973.0,350.580) set GB=CreateUnit(p,'n015',-1476.8,-2019.9,266.921) set gB=CreateUnit(p,'o012',-1565.0,-1154.2,270.000) call SetUnitColor(gB,ConvertPlayerColor(12)) set hB=CreateUnit(p,'n016',-1504.2,-2023.0,329.391) set bB=CreateUnit(p,'O00M',-858.1,-1490.8,153.470) set HB=CreateUnit(p,'O01B',-1524.8,-1912.8,307.750) set jB=CreateUnit(p,'O01C',-1448.9,-1909.8,101.750) set JB=CreateUnit(p,'n01A',-1428.6,-1766.5,126.960) set kB=CreateUnit(p,'n01C',-1449.2,-1805.1,319.830) set KB=CreateUnit(p,'n01D',-1506.7,-1840.5,151.480) set lB=CreateUnit(p,'n01B',-1542.2,-1844.7,148.900) set LB=CreateUnit(p,'h00D',-1657.3,-1240.5,50.600) set BB=CreateUnit(p,'o016',-1557.1,-2011.9,230.430) set MB=CreateUnit(p,'nech',-1000.8,-1432.2,219.096) set pB=CreateUnit(p,'nhmc',-967.0,-1437.9,40.387) set PB=CreateUnit(p,'npng',-1033.6,-1437.9,136.498) set qB=CreateUnit(p,'necr',-1009.0,-1394.6,333.346) set QB=CreateUnit(p,'nrac',-973.1,-1405.8,203.737) set sB=CreateUnit(p,'nsea',-1058.8,-1406.3,62.591) set SB=CreateUnit(p,'nshe',-971.3,-1473.9,315.614) set tB=CreateUnit(p,'nder',-936.6,-1465.7,178.573) set TB=CreateUnit(p,'npig',-1061.2,-1456.1,115.426) set uB=CreateUnit(p,'O010',-828.5,-1112.0,45.430) call SetUnitColor(uB,ConvertPlayerColor(12)) set wB=CreateUnit(p,'O01E',-946.6,-1867.9,290.300) set WB=CreateUnit(p,'ndwm',-1001.7,-1361.5,239.520) call SetUnitColor(WB,ConvertPlayerColor(11)) set YB=CreateUnit(p,'u00D',-874.8,-1054.6,198.670) call SetUnitColor(YB,ConvertPlayerColor(11)) set fB=CreateUnit(p,'n012',-1565.0,-1661.0,160.160) set UB=CreateUnit(p,'O01F',-1024.2,-1816.1,282.390) endfunction function zc takes nothing returns nothing local player p=Player(10) local unit u local integer unitID local trigger t local real life set Mb=CreateUnit(p,'Ulic',-23.7,18.0,352.485) set pb=CreateUnit(p,'Udre',61.2,42.8,119.020) endfunction function Zc takes nothing returns nothing local player p=Player(PLAYER_NEUTRAL_PASSIVE) local unit u local integer unitID local trigger t local real life set u=CreateUnit(p,'ngol',12288.0,12928.0,270.000) call SetResourceAmount(u,1) set u=CreateUnit(p,'ngol',12352.0,4544.0,270.000) call SetResourceAmount(u,1) set u=CreateUnit(p,'ngol',-1216.0,-1536.0,270.000) call SetResourceAmount(u,1) set u=CreateUnit(p,'ngol',2048.0,-11776.0,270.000) call SetResourceAmount(u,1) set u=CreateUnit(p,'ngol',-7488.0,-11648.0,270.000) call SetResourceAmount(u,1) set u=CreateUnit(p,'ngol',-11264.0,11072.0,270.000) call SetResourceAmount(u,1) set u=CreateUnit(p,'ngol',-10368.0,1472.0,270.000) call SetResourceAmount(u,1) endfunction function vC takes nothing returns nothing local player p=Player(PLAYER_NEUTRAL_PASSIVE) local unit u local integer unitID local trigger t local real life set qb=CreateUnit(p,'o00L',12344.8,4561.4,24.830) set Pb=CreateUnit(p,'o00L',12353.1,12926.3,24.830) set Qb=CreateUnit(p,'o00L',-11253.1,11035.2,24.830) set sb=CreateUnit(p,'o00L',-10341.4,1238.2,24.830) set Sb=CreateUnit(p,'o00L',-7711.4,-11603.8,24.830) set tb=CreateUnit(p,'o00L',2088.6,-11778.6,24.830) set XB=CreateUnit(p,'n00I',-1497.5,-1533.9,143.430) set u=CreateUnit(p,'n00Q',-1562.7,-1319.6,89.745) set dB=CreateUnit(p,'h00A',-907.4,-2007.8,302.000) endfunction function eC takes nothing returns nothing endfunction function xC takes nothing returns nothing call Yc() call zc() endfunction function oC takes nothing returns nothing call Zc() call eC() call vC() call xC() endfunction function rC takes nothing returns nothing local weathereffect we set va=Rect(-12736.0,12352.0,-11584.0,13504.0) set ea=Rect(-10944.0,12352.0,-9792.0,13504.0) set xa=Rect(-13888.0,10432.0,-12736.0,11584.0) set oa=Rect(-8000.0,12864.0,-6848.0,14016.0) set ra=Rect(-6464.0,12864.0,-5312.0,14016.0) set ia=Rect(-2752.0,12096.0,-1600.0,13248.0) set aa=Rect(6848.0,12352.0,8000.0,13504.0) set na=Rect(8640.0,12352.0,9792.0,13504.0) set Va=Rect(13760.0,12352.0,14912.0,13504.0) set Ea=Rect(13760.0,7488.0,14912.0,8640.0) set Xa=Rect(11584.0,7488.0,12736.0,8640.0) set Oa=Rect(8512.0,8384.0,9664.0,9536.0) set Ra=Rect(6592.0,8384.0,7744.0,9536.0) set Ia=Rect(-2752.0,9152.0,-1600.0,10304.0) set Aa=Rect(-4160.0,7488.0,-3008.0,8640.0) set Na=Rect(-6592.0,7488.0,-5440.0,8640.0) set ba=Rect(-8000.0,9152.0,-6848.0,10304.0) set Ba=Rect(-10944.0,7488.0,-9792.0,8640.0) set ca=Rect(-14400.0,7488.0,-13248.0,8640.0) set Ca=Rect(-14400.0,4544.0,-13248.0,5696.0) set da=Rect(-10944.0,4544.0,-9792.0,5696.0) set Da=Rect(-8000.0,4544.0,-6848.0,5696.0) set fa=Rect(-2880.0,4544.0,-1728.0,5696.0) set Fa=Rect(-2880.0,2752.0,-1728.0,3904.0) set ga=Rect(-2880.0,960.0,-1728.0,2112.0) set Ga=Rect(-576.0,960.0,576.0,2112.0) set ha=Rect(1216.0,960.0,2368.0,2112.0) set Ha=Rect(3008.0,960.0,4160.0,2112.0) set ja=Rect(192.0,4544.0,1344.0,5696.0) set Ja=Rect(3520.0,4544.0,4672.0,5696.0) set ka=Rect(6464.0,4544.0,7616.0,5696.0) set Ka=Rect(8640.0,4544.0,9792.0,5696.0) set la=Rect(8256.0,2752.0,9408.0,3904.0) set La=Rect(8640.0,960.0,9792.0,2112.0) set ma=Rect(6464.0,960.0,7616.0,2112.0) set Ma=Rect(13760.0,4544.0,14912.0,5696.0) set pa=Rect(11584.0,960.0,12736.0,2112.0) set Pa=Rect(12416.0,-2176.0,13568.0,-1024.0) set qa=Rect(13248.0,-4160.0,14400.0,-3008.0) set Qa=Rect(8640.0,-1984.0,9792.0,-832.0) set sa=Rect(8640.0,-4160.0,9792.0,-3008.0) set Sa=Rect(6464.0,-4160.0,7616.0,-3008.0) set ta=Rect(6464.0,-1984.0,7616.0,-832.0) set Ta=Rect(3392.0,-1728.0,4544.0,-576.0) set ua=Rect(1344.0,-1728.0,2496.0,-576.0) set Ua=Rect(3648.0,-4160.0,4800.0,-3008.0) set wa=Rect(-3904.0,-1984.0,-2752.0,-832.0) set Wa=Rect(-5056.0,-4160.0,-3904.0,-3008.0) set ya=Rect(-6080.0,960.0,-4928.0,2112.0) set Ya=Rect(-8000.0,960.0,-6848.0,2112.0) set za=Rect(-12736.0,960.0,-11584.0,2112.0) set Za=Rect(-14400.0,-64.0,-13248.0,1088.0) set vn=Rect(-14400.0,-4160.0,-13248.0,-3008.0) set en=Rect(-12864.0,-2112.0,-11712.0,-960.0) set xn=Rect(-12608.0,-4160.0,-11456.0,-3008.0) set on=Rect(-10944.0,-2112.0,-9792.0,-960.0) set rn=Rect(-8000.0,-2752.0,-6848.0,-1600.0) set in=Rect(-15552.0,-7104.0,-14400.0,-5952.0) set an=Rect(-13632.0,-7104.0,-12480.0,-5952.0) set nn=Rect(-15648.0,-9344.0,-14496.0,-8192.0) set Vn=Rect(-15552.0,-11584.0,-14400.0,-10432.0) set En=Rect(-13632.0,-11584.0,-12480.0,-10432.0) set Xn=Rect(-10560.0,-7232.0,-9408.0,-6080.0) set On=Rect(-8256.0,-7104.0,-7104.0,-5952.0) set Rn=Rect(-8000.0,-9280.0,-6848.0,-8128.0) set In=Rect(-4800.0,-7104.0,-3648.0,-5952.0) set An=Rect(-2496.0,-8000.0,-1344.0,-6848.0) set Nn=Rect(1536.0,-7296.0,2688.0,-6144.0) set bn=Rect(3520.0,-7104.0,4672.0,-5952.0) set Bn=Rect(1344.0,-9280.0,2496.0,-8128.0) set cn=Rect(-15296.0,-14528.0,-14144.0,-13376.0) set Cn=Rect(-13376.0,-14528.0,-12224.0,-13376.0) set dn=Rect(-10432.0,-12224.0,-9280.0,-11072.0) set Dn=Rect(-9920.0,-14144.0,-8768.0,-12992.0) set fn=Rect(-8000.0,-14144.0,-6848.0,-12992.0) set Fn=Rect(-5056.0,-12224.0,-3904.0,-11072.0) set gn=Rect(-3520.0,-14144.0,-2368.0,-12992.0) set Gn=Rect(-1600.0,-14144.0,-448.0,-12992.0) set hn=Rect(-1600.0,-12224.0,-448.0,-11072.0) set Hn=Rect(3520.0,-12224.0,4672.0,-11072.0) set jn=Rect(3520.0,-14016.0,4672.0,-12864.0) set Jn=Rect(1600.0,-14400.0,2752.0,-13248.0) set kn=Rect(3520.0,-15808.0,4672.0,-14656.0) set Kn=Rect(8896.0,-15904.0,10048.0,-14752.0) set ln=Rect(128.0,7424.0,4736.0,13568.0) set Ln=Rect(7104.0,-9728.0,10752.0,-7072.0) set mn=Rect(10752.0,-9344.0,13728.0,-7456.0) set Mn=Rect(7072.0,-12768.0,8448.0,-10496.0) set pn=Rect(12672.0,-11776.0,13824.0,-9344.0) set Pn=Rect(8448.0,-13312.0,11392.0,-12160.0) set qn=Rect(6656.0,-10496.0,10752.0,-9728.0) set Qn=Rect(13056.0,-12672.0,14048.0,-11776.0) set sn=Rect(10240.0,-12160.0,11264.0,-10624.0) set Sn=Rect(11264.0,-11776.0,12672.0,-11264.0) set tn=Rect(-1472.0,-3904.0,-448.0,-3008.0) set Tn=Rect(5248.0,-15872.0,5888.0,-15296.0) set un=Rect(5248.0,14688.0,5888.0,15328.0) set Un=Rect(-15584.0,-5376.0,-14944.0,-4736.0) set wn=Rect(14944.0,6272.0,15552.0,6912.0) set Wn=Rect(-64.0,-4864.0,704.0,-4032.0) set yn=Rect(-4288.0,-5312.0,-3648.0,-4544.0) set Yn=Rect(-640.0,-9376.0,544.0,-8736.0) set zn=Rect(-6016.0,-11648.0,-5376.0,-10912.0) set Zn=Rect(-11424.0,-9568.0,-10784.0,-8928.0) set vV=Rect(-11072.0,-13760.0,-10432.0,-13120.0) set eV=Rect(-14752.0,-12768.0,-14112.0,-12128.0) set xV=Rect(-12544.0,-8320.0,-11968.0,-7680.0) set oV=Rect(-15552.0,-896.0,-14720.0,-256.0) set rV=Rect(-13760.0,3328.0,-12992.0,4096.0) set iV=Rect(-13568.0,6208.0,-12928.0,7040.0) set aV=Rect(-15456.0,5248.0,-14816.0,5888.0) set nV=Rect(-15520.0,13920.0,-14752.0,14720.0) set VV=Rect(-7200.0,11488.0,-6656.0,12256.0) set EV=Rect(-6656.0,11488.0,-6112.0,12256.0) set XV=Rect(-5120.0,8480.0,-4480.0,9120.0) set OV=Rect(-1856.0,13696.0,-1216.0,14336.0) set RV=Rect(0.0,13920.0,640.0,14752.0) set IV=Rect(11392.0,13920.0,12032.0,14560.0) set AV=Rect(12032.0,14272.0,12672.0,14912.0) set NV=Rect(10240.0,10720.0,10880.0,11360.0) set bV=Rect(5056.0,10112.0,5632.0,10752.0) set BV=Rect(13056.0,2816.0,13696.0,3456.0) set cV=Rect(11776.0,-1920.0,12416.0,-1280.0) set CV=Rect(14080.0,-5248.0,14720.0,-4608.0) set dV=Rect(9472.0,-5248.0,10112.0,-4608.0) set DV=Rect(10912.0,-14336.0,11552.0,-13696.0) set fV=Rect(14784.0,-13312.0,15424.0,-12672.0) set FV=Rect(4416.0,-11008.0,5056.0,-10368.0) set gV=Rect(2816.0,-8768.0,3520.0,-8256.0) set GV=Rect(-64.0,-12544.0,576.0,-11904.0) set hV=Rect(-9376.0,-3424.0,-8736.0,-2784.0) set HV=Rect(-7104.0,3360.0,-6464.0,4000.0) set jV=Rect(-3136.0,-64.0,-2496.0,576.0) set JV=Rect(6272.0,-64.0,6912.0,576.0) set kV=Rect(-1184.0,4032.0,-544.0,4672.0) set KV=Rect(-10208.0,9408.0,-9568.0,10048.0) set lV=Rect(-9024.0,1728.0,-8384.0,2368.0) set LV=Rect(-768.0,-5120.0,-128.0,-4480.0) set mV=Rect(5088.0,-6368.0,5728.0,-5728.0) set MV=Rect(-3808.0,-15392.0,-3328.0,-14656.0) set pV=Rect(4256.0,2784.0,4896.0,3424.0) set PV=Rect(3712.0,3424.0,4352.0,4064.0) set qV=Rect(10176.0,5280.0,10816.0,5920.0) set QV=Rect(-3744.0,10240.0,-3104.0,10880.0) set sV=Rect(-3616.0,-2624.0,-2976.0,-1984.0) set SV=Rect(1088.0,-384.0,1728.0,256.0) set tV=Rect(3008.0,-352.0,3360.0,512.0) set TV=Rect(-9408.0,7136.0,-8768.0,7776.0) set uV=Rect(5440.0,-13952.0,6080.0,-13312.0) set UV=Rect(-5760.0,-1600.0,-4928.0,-640.0) set wV=Rect(9856.0,-128.0,10496.0,512.0) set WV=Rect(-3168.0,-10368.0,-2400.0,-9536.0) set yV=Rect(-14848.0,10592.0,-14208.0,11232.0) set YV=Rect(-4064.0,3392.0,-3264.0,4224.0) set zV=Rect(11712.0,12480.0,12992.0,13376.0) set ZV=Rect(11712.0,4032.0,12992.0,5056.0) set vE=Rect(-1728.0,-2112.0,-704.0,-960.0) set eE=Rect(1472.0,-12352.0,2624.0,-11200.0) set xE=Rect(-8384.0,-12096.0,-6976.0,-11200.0) set oE=Rect(-10816.0,576.0,-9920.0,1984.0) set rE=Rect(-11968.0,10560.0,-10560.0,11456.0) set iE=Rect(-1536.0,-5408.0,-768.0,-4672.0) set aE=Rect(-9280.0,-10656.0,-8960.0,-9600.0) set nE=Rect(-8960.0,-10656.0,-8128.0,-10368.0) set VE=Rect(-8960.0,-9856.0,-8448.0,-9472.0) set EE=Rect(-8448.0,-10368.0,-8096.0,-9600.0) set XE=Rect(-384.0,7424.0,5248.0,13568.0) endfunction function iC takes player oP,string s1 returns nothing if s1!="" then call DisplayTextToPlayer(oP,0,0,"|cffffcc00"+s1+"|r") endif endfunction function aC takes string s1 returns nothing if(s1!="")then call DisplayTextToForce(Fx,"|cffffcc00"+s1+"|r") endif endfunction function VC takes player oP returns nothing call iC(oP,"Inventory is full.") if oP==U then call StartSound(HE) endif endfunction function EC takes handle h returns integer return GetHandleId(h) endfunction function XC takes handle h returns string return I2S(EC(h)) endfunction function OC takes real nc returns nothing local timer t local real Vc if nc>0 then set t=CreateTimer() call TimerStart(t,nc,false,null) loop set Vc=TimerGetRemaining(t) exitwhen Vc<=0 if Vc>10.0 then call TriggerSleepAction(Xx*Vc) elseif Vc>2.0 then call TriggerSleepAction(0.1*Vc) else call TriggerSleepAction(0.1) endif endloop call DestroyTimer(t) endif set t=null endfunction function RC takes real nc returns nothing local timer t local real Vc if nc>0 then set t=CreateTimer() call TimerStart(t,nc,false,null) loop set Vc=TimerGetRemaining(t) exitwhen Vc<=0 if Vc>2.0 then call TriggerSleepAction(0.1*Vc) else call TriggerSleepAction(0.1) endif endloop call DestroyTimer(t) endif set t=null endfunction function IC takes player oP returns boolean return(GetPlayerController(oP)==MAP_CONTROL_USER) endfunction function AC takes player oP returns boolean if IC(oP)then return(GetPlayerSlotState(oP)==PLAYER_SLOT_STATE_PLAYING) else return rx[GetPlayerId(oP)] endif endfunction function NC takes real n returns integer local integer m local integer r set r=R2I(n*100.0) set m=ModuloInteger(r,100) set r=R2I((r-m)/100) if m>49 then return r+1 else return r endif endfunction function bC takes integer i,integer j returns integer return((i-ModuloInteger(i,j))/ j) endfunction function BC takes real cC returns real loop exitwhen((cC>=0.0)and(cC<360.0)) if(cC<0)then set cC=cC+360 else set cC=cC-360 endif endloop return cC endfunction function CC takes real xA,real yA,real xB,real yB returns real local real dx=xB-xA local real dy=yB-yA return SquareRoot(dx*dx+dy*dy) endfunction function dC takes location DC,location fC returns real local real r=DistanceBetweenPoints(DC,fC) call RemoveLocation(DC) call RemoveLocation(fC) return r endfunction function FC takes location gC,location GC,real hC returns boolean local real dx=GetLocationX(GC)-GetLocationX(gC) local real dy=GetLocationY(GC)-GetLocationY(gC) return(dx*dx+dy*dy)>(hC*hC) endfunction function HC takes real xA,real yA,real xB,real yB,real hC returns boolean local real dx=xB-xA local real dy=yB-yA return(dx*dx+dy*dy)>(hC*hC) endfunction function jC takes real xA,real yA,real xB,real yB,real JC,real kC returns boolean local real dx=xB-xA local real dy=yB-yA set dx=dx*dx+dy*dy return(dx>(JC*JC))and(dx<(kC*kC)) endfunction function KC takes location DC,location fC returns real local real r=AngleBetweenPoints(DC,fC) call RemoveLocation(DC) call RemoveLocation(fC) return r endfunction function lC takes unit LC,unit mC returns boolean local real cC=BC(KC(GetUnitLoc(LC),GetUnitLoc(mC))) local real MC=GetUnitFacing(LC) if(MC>300)and(cC<60)then set cC=cC+360 elseif(MC<60)and(cC>300)then set MC=MC+360 endif return(cC<(MC+60))and(cC>(MC-60)) endfunction function pC takes integer iP returns nothing call AddSpecialEffectTarget("war3mapImported\\Glow"+I2S(B[iP])+".mdx",X[iP],"origin") endfunction function PC takes unit qC,real QC,real Bc,real x,real y,real sC,boolean SC,boolean tC,attacktype TC,damagetype uC,weapontype UC returns nothing local group g local unit LC if QC>0 then call RC(QC) endif set g=CreateGroup() call GroupEnumUnitsInRange(g,x,y,Bc,null) loop set LC=FirstOfGroup(g) exitwhen LC==null call UnitDamageTarget(qC,LC,sC,SC,tC,TC,uC,UC) call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set g=null endfunction function wC takes nothing returns boolean local integer i=0 local integer j local integer WC=0 local integer yC local integer YC loop if(Q[i]>0)and IC(Player(i))then set WC=WC+1 set j=WC set Kx[j]=i set yC=IMinBJ(11,bC(uv[i],wv)) loop set j=j-1 exitwhen j<1 set YC=IMinBJ(11,bC(uv[Kx[j]],wv)) exitwhen YC>yC if YC==yC then exitwhen GetStoredInteger(Ae,"herocount","order"+I2S(Kx[j]))8 endloop set Kx[0]=WC return WC>0 endfunction function zC takes player ZC returns player local integer i if ZC==null then if wC()then return Player(Kx[1]) else return null endif endif set i=1 loop exitwhen i>Kx[0] if Kx[i]!=GetPlayerId(ZC)then return Player(Kx[i]) endif set i=i+1 endloop return null endfunction function vd takes integer ed,boolean xd returns nothing local integer i if C<1 then return endif set ed=ed/C if ed<1 then return endif set i=0 loop exitwhen i>8 if(Q[i]>0)and IC(Player(i))then call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD)+ed) if xd then call iC(Player(i),"+"+I2S(ed)+" credits") endif endif set i=i+1 endloop endfunction function od takes integer rd,boolean xd returns nothing local integer i local player oP local integer array ad if(C<1)or(rd<1)then return endif if not wC()then return endif set i=Kx[0] loop set i=i-1 set ad[i]=0 exitwhen i<1 endloop set i=0 loop set ad[i]=ad[i]+1 set rd=rd-1 exitwhen rd<1 set i=i+1 if i==Kx[0]then set i=0 endif endloop set i=0 loop if ad[i]>0 then set oP=Player(Kx[i+1]) call SetPlayerState(oP,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(oP,PLAYER_STATE_RESOURCE_LUMBER)+ad[i]) if xd and not vv then call iC(oP,"+"+I2S(ad[i])+" valor") endif endif set i=i+1 exitwhen i>=Kx[0] endloop endfunction function nd takes integer rd,string Vd,integer ed returns nothing local integer i=0 if Se<1 then call vd(ed,true) else loop exitwhen i>8 if IC(Player(i))and AC(Player(i))then call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_LUMBER)+rd) set Se=Se-rd if not vv then call iC(Player(i),Vd) endif endif set i=i+1 endloop endif endfunction function Ed takes integer iP returns boolean return(X[iP]!=null)and(not Ce[iP]) endfunction function Xd takes unit Od returns boolean return(Od!=null)and Ed(GetPlayerId(GetOwningPlayer(Od))) endfunction function Rd takes integer Id returns nothing local integer i=0 local integer iX=0 loop exitwhen i>8 if(X[i]!=null)and(pv[i*Nx+5]>0)then set iX=iX+1 endif set i=i+1 endloop if iX<1 then return endif set Id=Id/ iX loop if Id<1999 then set iX=Id else set iX=1999 set Id=Id-1999 endif set i=0 loop exitwhen i>8 if Ed(i)and(pv[i*Nx+5]>0)then if IsSuspendedXP(X[i])then call SuspendHeroXPBJ(true,X[i]) call AddHeroXPSwapped(NC(iX*gv[i]*Dv[i]),X[i],true) call SuspendHeroXPBJ(false,X[i]) else call AddHeroXPSwapped(NC(iX*gv[i]*Dv[i]),X[i],true) endif endif set i=i+1 endloop exitwhen iX<1999 call TriggerSleepAction(0.01) endloop endfunction function Ad takes real Nd returns nothing local real nX local boolean bd=false loop if Nd<=1999.0 then set nX=Nd exitwhen nX<1.0 set bd=true else set nX=1999.0 set Nd=Nd-1999.0 endif if(X[0]!=null)and(not Ce[0])then call AddHeroXP(X[0],R2I(nX*gv[0]*Dv[0]*Wv[0]*yv[0]*Ge[0]),true) endif if(X[1]!=null)and(not Ce[1])then call AddHeroXP(X[1],R2I(nX*gv[1]*Dv[1]*Wv[1]*yv[1]*Ge[1]),true) endif if(X[2]!=null)and(not Ce[2])then call AddHeroXP(X[2],R2I(nX*gv[2]*Dv[2]*Wv[2]*yv[2]*Ge[2]),true) endif if(X[3]!=null)and(not Ce[3])then call AddHeroXP(X[3],R2I(nX*gv[3]*Dv[3]*Wv[3]*yv[3]*Ge[3]),true) endif if(X[4]!=null)and(not Ce[4])then call AddHeroXP(X[4],R2I(nX*gv[4]*Dv[4]*Wv[4]*yv[4]*Ge[4]),true) endif if(X[5]!=null)and(not Ce[5])then call AddHeroXP(X[5],R2I(nX*gv[5]*Dv[5]*Wv[5]*yv[5]*Ge[5]),true) endif if(X[6]!=null)and(not Ce[6])then call AddHeroXP(X[6],R2I(nX*gv[6]*Dv[6]*Wv[6]*yv[6]*Ge[6]),true) endif if(X[7]!=null)and(not Ce[7])then call AddHeroXP(X[7],R2I(nX*gv[7]*Dv[7]*Wv[7]*yv[7]*Ge[7]),true) endif if(X[8]!=null)and(not Ce[8])then call AddHeroXP(X[8],R2I(nX*gv[8]*Dv[8]*Wv[8]*yv[8]*Ge[8]),true) endif exitwhen bd call TriggerSleepAction(0.01) endloop endfunction function Bd takes real cd returns nothing set xx=xx+(cd-100.0)*W endfunction function Cd takes integer dd returns nothing local integer i if C<1 then return endif if dd<1 then return endif set i=0 loop exitwhen i>8 if AC(Player(i))then call ModifyHeroSkillPoints(X[i],bj_MODIFYMETHOD_ADD,dd) endif set i=i+1 endloop endfunction function Dd takes nothing returns nothing local integer fd=C+sv if fd>8 then set W=40.0*Y elseif fd>7 then set W=40.5*Y elseif fd>6 then set W=41.0*Y elseif fd>5 then set W=41.5*Y elseif fd>4 then set W=42.0*Y elseif fd>3 then set W=43.0*Y elseif fd>2 then set W=44.0*Y elseif fd>1 then set W=46.0*Y else set W=50.0*Y endif endfunction function Fd takes integer iP returns integer if Lo[iP*15+8]>9 then return 10 else return Lo[iP*15+8] endif endfunction function gd takes integer iP returns boolean return Lo[iP*15+8]>10 endfunction function Gd takes integer iP returns integer local integer yC=Fd(iP) if gd(iP)then return 5 else return bC(yC,3)+1 endif endfunction function hd takes unit LC,integer Hd returns integer local integer i=0 loop if GetItemTypeId(UnitItemInSlot(LC,i))==Hd then return i endif set i=i+1 exitwhen i>5 endloop return-1 endfunction function jd takes unit LC,item Jd returns integer local integer i=0 loop if UnitItemInSlot(LC,i)==Jd then return i endif set i=i+1 exitwhen i>5 endloop return-1 endfunction function kd takes unit Od,integer Hd,item Jd returns boolean local unit Kd=Od local item ld local integer i=0 loop exitwhen Kd==null set i=0 loop set ld=UnitItemInSlot(Kd,i) if(ld!=null)and(ld!=Jd)then if GetItemTypeId(ld)==Hd then return true endif endif set i=i+1 exitwhen i>5 endloop set i=GetPlayerId(GetOwningPlayer(Od)) if Kd!=bx[i]then set Kd=bx[i] else set Kd=null endif endloop return false endfunction function Ld takes integer iP,boolean md returns real local integer Md=Pv[iP*3+2] local real pd=0.0 local real nP=0.0 if Md==1 then set pd=250.00 set nP=20.0 elseif Md==2 then set pd=220.00 set nP=20.0 elseif Md==0 then set pd=290.00 set nP=20.0 else if B[iP]==10 then set pd=230.00+Fd(iP)*4-Xi[iP]*20 elseif tr[iP*19+13]==0 then set pd=230.00 elseif tr[iP*19+13]==1 then set pd=245.00 elseif tr[iP*19+13]==2 then set pd=259.00 elseif tr[iP*19+13]==3 then set pd=272.00 else set pd=284.00 endif set nP=30.0 endif if not md then if Do[iP*Co+1]>0 then set nP=nP-20.0 endif if Ed(iP)and(hd(X[iP],'I02A')>-1)then set pd=pd-nP endif endif if Do[iP*Co+8]>9 then set pd=pd+Do[iP*Co+8] endif set nP=1.0+I2R(ModuloInteger(pv[iP*Nx+11],100))*0.01 return fr[iP]*nP*(pd+I2R(pv[iP*Nx+1])+RMaxBJ(0.0,pv[iP*Nx+7]-1)) endfunction function Pd takes integer iP returns real local integer Md=Pv[iP*3+2] local real pd=0.0 if Md==1 then set pd=250.00 elseif Md==2 then set pd=220.00 elseif Md==0 then set pd=290.00 else if B[iP]==10 then set pd=230.00+Fd(iP)*4 elseif tr[iP*19+13]==0 then set pd=230.00 elseif tr[iP*19+13]==1 then set pd=245.00 elseif tr[iP*19+13]==2 then set pd=259.00 elseif tr[iP*19+13]==3 then set pd=272.00 else set pd=284.00 endif endif return pd+I2R(pv[iP*Nx+1])-Ax[iP*9+2]-Ax[iP*9+5]-Ax[iP*9+8] endfunction function qd takes integer iP returns real local integer Md=Pv[iP*3+2] local real n=GetUnitAbilityLevel(X[iP],'A000') if Md==1 then return 198.7+n*2.7 elseif Md==2 then return 199.1+n*1.1 elseif Md==0 then return 198.8+n*4.8 endif return 200 endfunction function Qd takes nothing returns nothing local real sd=0.0 local real Sd=0.0 local integer td=0 local integer i=0 loop exitwhen i>8 set sd=sd+Q[i] set Sd=Sd+Q[i+13] set i=i+1 endloop set Q[11]=NC(Sd/rv)+Q[22] set Sd=0.0 set i=100 loop if sd>100.0 then set sd=sd-100.0 set Sd=Sd+100.0*(i/100.0) else set Sd=Sd+sd*(i/100.0) exitwhen true endif set i=i-8+fe if i<1 then set i=1 endif endloop set Sd=Sd+Ke set Q[12]=NC(Sd/rv)+Q[22] if te>0 then set i=0 loop exitwhen i>8 set td=td+Fd(i) set i=i+1 endloop set Q[11]=Q[11]+td set Q[12]=Q[12]+td endif call TriggerRegisterTimerEvent(YX,0.1,false) endfunction function Td takes location ud,integer Ud,integer wd returns location local location Wd=Ec(ud,GetRandomInt(Ud,wd),GetRandomInt(0,359)) call RemoveLocation(ud) return Wd endfunction function yd takes rect Yd returns location return Td(GetRectCenter(Yd),60,350) endfunction function zd takes rect Yd returns location return Td(GetRectCenter(Yd),1,480) endfunction function Zd takes rect Yd returns location return Td(GetRectCenter(Yd),35,470) endfunction function vD takes integer i returns string if i==0 then return"|cffFF0303" elseif i==1 then return"|cff0042FF" elseif i==2 then return"|cff1CE6B9" elseif i==3 then return"|cff540081" elseif i==4 then return"|cffFFFC01" elseif i==5 then return"|cffFE8A0E" elseif i==6 then return"|cff20C000" elseif i==7 then return"|cffE55BB0" elseif i==8 then return"|cff959697" elseif i==9 then return"|cff7EBFF1" elseif i==10 then return"|cff106246" elseif i==11 then return"|cff4E2A04" else return"|cffffcc00" endif endfunction function eD takes unit LC,integer i,integer xD returns nothing local integer iR=255 local integer iG=255 local integer iB=255 if i==0 then set iR=224 set iG=0 set iB=0 elseif i==1 then set iR=16 set iG=48 set iB=255 elseif i==2 then set iR=80 set iG=255 set iB=224 elseif i==3 then set iR=96 set iG=0 set iB=160 elseif i==4 then set iR=255 set iG=240 set iB=0 elseif i==5 then set iR=255 set iG=128 set iB=64 elseif i==6 then set iR=64 set iG=224 set iB=0 elseif i==7 then set iR=255 set iG=112 set iB=255 elseif i==8 then set iR=148 set iG=148 set iB=148 elseif i==9 then set iR=96 set iG=128 set iB=255 elseif i==10 then set iR=0 set iG=104 set iB=74 elseif i==11 then set iR=96 set iG=80 set iB=64 elseif i==12 then set iR=56 set iG=56 set iB=56 endif call SetUnitVertexColor(LC,iR,iG,iB,xD) endfunction function oD takes nothing returns nothing local integer iP=0 loop exitwhen iP>8 if(B[iP]==12)and(Yv[iP]!=null)then if Li>1 then call eD(Yv[iP],iP,255) else call eD(Yv[iP],13,255) endif endif set iP=iP+1 endloop endfunction function rD takes integer i returns string local string s if i==0 then set s="Field Medic" elseif i==1 then set s="Tactician" elseif i==3 then set s="Covert Sniper" elseif i==4 then set s="Pyrotechnician" elseif i==5 then set s="Demolitions" elseif i==6 then set s="Heavy Ordnance" elseif i==7 then set s="Psychologist" elseif i==8 then set s="Maverick" elseif i==9 then set s="Cyborg" elseif i==10 then set s="Watchman" elseif i==11 then set s="Tech Ops" else set s="unknown" endif return"|r"+vD(i)+s+"|r|cffffcc00" endfunction function iD takes integer aD,integer nD returns string if aD==0 then set nD=0 elseif aD==1 then set nD=0 elseif aD==3 then set nD=10 elseif aD==4 then set nD=5 elseif aD==5 then set nD=8 elseif aD==6 then set nD=9 elseif aD==7 then set nD=0 elseif aD==9 then set nD=9 elseif aD==10 then if nD==0 then set nD=2 endif elseif aD==11 then set nD=10 endif if nD==10 then return"SR" elseif nD==9 then return"CH" elseif nD==8 then return"RL" elseif nD==5 then return"FL" elseif nD==0 then return"AR" elseif nD==1 then return"LR" elseif nD==2 then return"GL" else return"??" endif endfunction function VD takes integer nD,boolean ED returns string local string s if nD==0 then if ED then set s="(none)" else set s="Skilled" endif elseif nD==1 then set s="Gifted" elseif nD==2 then set s="Survivalist" elseif nD==3 then set s="Dragoon" elseif nD==4 then set s="Acrobat" elseif nD==5 then set s="Swift Learner" elseif nD==6 then set s="Healer" elseif nD==7 then set s="Flower Child" elseif nD==8 then set s="Chem. Reliant" elseif nD==9 then set s="Rad. Resistant" elseif nD==10 then set s="Gadgeteer" elseif nD==11 then set s="Prowler" elseif nD==12 then set s="Energizer" elseif nD==13 then set s="Pack Rat" elseif nD==14 then set s="Engineer" else set s="unknown" endif return"|r|cff8f6adc"+s+"|r|cffffcc00" endfunction function XD takes integer nD returns string local string s if nD==0 then set s="Weaponry" elseif nD==1 then set s="Power Armor" elseif nD==2 then set s="Energy Cells" elseif nD==3 then set s="Cybernetics" elseif nD==4 then set s="Triage" elseif nD==5 then set s="Chemistry" elseif nD==6 then set s="Leadership" elseif nD==7 then set s="Robotics" elseif nD==8 then set s="Espionage" else set s="unknown" endif return"|r|cffdb67a6"+s+"|r|cffffcc00" endfunction function OD takes integer nD returns string local string s if nD<0 then set s="Hidden" elseif nD==0 then set s="Courage" elseif nD==1 then set s="Wiring" elseif nD==2 then set s="Running" elseif nD==3 then set s="Spotting" elseif nD==4 then set s="Toughness" elseif nD==5 then set s="Tinkering" elseif nD==6 then set s="Hacking" else set s="unknown" endif return"|r|cffcefb8c"+s+"|r|cffffcc00" endfunction function RD takes integer i returns string if i==0 then return"|r|cffFF0303Red|r|cffffcc00" elseif i==1 then return"|r|cff0042FFBlue|r|cffffcc00" elseif i==2 then return"|r|cff1CE6B9Teal|r|cffffcc00" elseif i==3 then return"|r|cff540081Purple|r|cffffcc00" elseif i==4 then return"|r|cffFFFC01Yellow|r|cffffcc00" elseif i==5 then return"|r|cffFE8A0EOrange|r|cffffcc00" elseif i==6 then return"|r|cff20C000Green|r|cffffcc00" elseif i==7 then return"|r|cffE55BB0Pink|r|cffffcc00" elseif i==8 then return"|r|cff959697Gray|r|cffffcc00" elseif i==9 then return"|r|cff7EBFF1Light Blue|r|cffffcc00" elseif i==10 then return"|r|cff106246Dark Green|r|cffffcc00" elseif i==11 then return"|r|cff4E2A04Brown|r|cffffcc00" else return"|r|cff000000Black|r|cffffcc00" endif endfunction function ID takes integer i returns string return GetPlayerName(Player(i)) endfunction function AD takes integer i returns string local string s=ID(i) if i==0 then return"|r|cffFF0303"+s+"|r|cffffcc00" elseif i==1 then return"|r|cff0042FF"+s+"|r|cffffcc00" elseif i==2 then return"|r|cff1CE6B9"+s+"|r|cffffcc00" elseif i==3 then return"|r|cff540081"+s+"|r|cffffcc00" elseif i==4 then return"|r|cffFFFC01"+s+"|r|cffffcc00" elseif i==5 then return"|r|cffFE8A0E"+s+"|r|cffffcc00" elseif i==6 then return"|r|cff20C000"+s+"|r|cffffcc00" elseif i==7 then return"|r|cffE55BB0"+s+"|r|cffffcc00" elseif i==8 then return"|r|cff959697"+s+"|r|cffffcc00" elseif i==9 then return"|r|cff7EBFF1"+s+"|r|cffffcc00" elseif i==10 then return"|r|cff106246"+s+"|r|cffffcc00" elseif i==11 then return"|r|cff4E2A04"+s+"|r|cffffcc00" else return"|r|cff000000Neutral|r|cffffcc00" endif endfunction function ND takes integer i returns string local string s=ID(i)+":|r |cffffffff" if i==0 then return"|r|cffFF0303"+s elseif i==1 then return"|r|cff0042FF"+s elseif i==2 then return"|r|cff1CE6B9"+s elseif i==3 then return"|r|cff540081"+s elseif i==4 then return"|r|cffFFFC01"+s elseif i==5 then return"|r|cffFE8A0E"+s elseif i==6 then return"|r|cff20C000"+s elseif i==7 then return"|r|cffE55BB0"+s elseif i==8 then return"|r|cff959697"+s elseif i==9 then return"|r|cff7EBFF1"+s elseif i==10 then return"|r|cff106246"+s elseif i==11 then return"|r|cff4E2A04"+s else return"|r|cff000000Neutral:|r |cffffffff" endif endfunction function bD takes force oF,integer i,location ud,real BD returns nothing if i==0 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,100,1.2,1.2) elseif i==1 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,0,25.9,100) elseif i==2 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,11,90.2,72.5) elseif i==3 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,32.9,0,50.6) elseif i==4 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,100,98.8,0.4) elseif i==5 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,99.6,54.1,5.5) elseif i==6 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,12.5,75.3,0) elseif i==7 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,89.8,35.7,69) elseif i==8 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,58.4,58.8,59.2) elseif i==9 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,49.4,74.9,94.5) elseif i==10 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,6.3,38.4,27.5) elseif i==11 then call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,30.6,16.5,1.6) else call PingMinimapLocForForceEx(oF,ud,BD,bj_MINIMAPPINGSTYLE_FLASHY,15,15,15) endif endfunction function cD takes integer i,location ud,real BD returns nothing call bD(Fx,i,ud,BD) endfunction function CD takes player oP,integer i,location ud,real BD returns nothing local force oF=hc(oP) call bD(oF,i,ud,BD) call DestroyForce(oF) endfunction function dD takes string sP returns integer if sP=="r" then return 0 elseif sP=="b" then return 1 elseif sP=="t" then return 2 elseif sP=="p" then return 3 elseif sP=="y" then return 4 elseif sP=="o" then return 5 elseif sP=="g" then return 6 elseif sP=="k" then return 7 elseif sP=="a" then return 8 else return-1 endif endfunction function DD takes integer fD returns string if fD==0 then return"r" elseif fD==1 then return"b" elseif fD==2 then return"t" elseif fD==3 then return"p" elseif fD==4 then return"y" elseif fD==5 then return"o" elseif fD==6 then return"g" elseif fD==7 then return"k" elseif fD==8 then return"a" else return"" endif endfunction function FD takes player oP,string s,string gD,string GD,string hD returns integer local integer i=0 if s==gD then call iC(oP,"At any time, you may enter one of the following chat strings to "+hD+":") loop exitwhen i>8 if AC(Player(i))then call RC(1.0) call iC(oP,"Enter |r|cffffffff"+gD+" "+DD(i)+"|r|cffffcc00 to "+GD+" "+RD(i)+".") endif set i=i+1 endloop return-1 elseif SubString(s,0,StringLength(gD))!=gD then return-1 endif set i=StringLength(gD)+2 return dD(SubString(s,i-1,i)) endfunction function HD takes trigger jD,player oP,string gD returns nothing local integer i=0 call TriggerRegisterPlayerChatEvent(jD,oP,gD,true) loop exitwhen i>8 call TriggerRegisterPlayerChatEvent(jD,oP,gD+" "+DD(i),true) set i=i+1 endloop endfunction function JD takes nothing returns boolean local gamecache gc=InitGameCache("cheatcheck.w3v") call StoreInteger(gc,"test","test",9) return SaveGameCache(gc) endfunction function kD takes unit LC,string Vd,integer i returns nothing local effect KD=AddSpecialEffectTarget("Abilities\\Spells\\Other\\Silence\\SilenceTarget.mdl",LC,"overhead") local integer j=2 if i>17 then set i=5 else set i=i/ 3 endif loop call AddIndicator(LC,255,0,255,255) set i=i-1 exitwhen i<1 call TriggerSleepAction(1) set j=j-1 if j==0 then call DestroyEffect(KD) endif endloop if j>0 then call TriggerSleepAction(j) call DestroyEffect(KD) endif set KD=null endfunction function lD takes string s,unit LC,integer LD,integer mD,integer MD,boolean pD,real PD,real BD returns nothing local texttag qD=CreateTextTag() call SetTextTagText(qD,s,PD*0.023/ 10) call SetTextTagPosUnit(qD,LC,0) call SetTextTagColor(qD,LD,mD,MD,243) if pD then call SetTextTagVelocity(qD,0,(PD-8.0)*0.005+0.051) endif call SetTextTagPermanent(qD,false) call SetTextTagLifespan(qD,BD) set qD=null endfunction function QD takes string s,unit LC,integer i returns nothing local texttag qD=CreateTextTag() call SetTextTagText(qD,s,0.0153) call SetTextTagPos(qD,GetUnitX(LC)-5.6*i-14,GetUnitY(LC),88) call SetTextTagColor(qD,255,255,255,255) call SetTextTagVelocity(qD,0,0.007) call SetTextTagPermanent(qD,false) call SetTextTagLifespan(qD,1.21+0.12*i) set qD=null endfunction function sD takes integer iP,string Vd returns nothing local integer SD=StringLength(Vd) if Ed(iP)then if SubString(Vd,0,1)==" " then call AddIndicator(X[iP],255,0,255,255) if SD<17 then call QD(Vd,X[iP],SD) else call QD(SubString(Vd,1,16)+"...",X[iP],17) endif else call kD(X[iP],Vd,SD) endif endif endfunction function tD takes nothing returns boolean return GetPlayerTechCount(Player(PLAYER_NEUTRAL_PASSIVE),'R00Z',true)>0 endfunction function TD takes nothing returns nothing call DisableTrigger(ZE) call DisableTrigger(zE) call DestroyTrigger(SX) call DisableTrigger(TX) call DestroyTrigger(WX) call DestroyTrigger(sX) call DisableTrigger(gX) call DisableTrigger(nO) call DisableTrigger(zX) call DisableTrigger(SR) call DisableTrigger(tR) call DisableTrigger(YO) endfunction function uD takes integer i returns nothing local region UD=CreateRegion() call RegionAddRect(UD,D[i]) call StoreInteger(Ae,"warehouses",XC(UD),i) call TriggerRegisterEnterRegion(Nb,UD,null) endfunction function wD takes region UD returns integer return GetStoredInteger(Ae,"warehouses",XC(UD)) endfunction function WD takes nothing returns string local string s local integer i set i=bC(R2I(GetTimeOfDay()*100.0),100) set s="Day "+I2S(ix)+" Hour "+I2S(i)+" |r|cffc2c2c2("+I2S(ix*24+i-36)+" minutes " return s+I2S(bC(ModuloInteger(R2I(GetTimeOfDay()*100.0),100)*60,100))+" seconds)|r" endfunction function yD takes nothing returns boolean local real YD=GetFloatGameState(GAME_STATE_TIME_OF_DAY) return(YD<8.00)or(YD>16.99) endfunction function zD takes nothing returns string local integer i=GetRandomInt(0,5) if i==0 then return"Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodGrunt.mdl" elseif i==1 then return"Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodHeadhunter.mdl" elseif i==2 then return"Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodHeroTaurenChieftain.mdl" elseif i==3 then return"Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodPeon.mdl" elseif i==4 then return"Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodWitchDoctor.mdl" else return"Objects\\Spawnmodels\\Orc\\Orcblood\\OrcBloodHellScream.mdl" endif endfunction function ZD takes unit LC,location ud,string vf returns effect if(LC!=null)and(GetUnitState(LC,UNIT_STATE_LIFE)>0)then return AddSpecialEffectTarget(zD(),LC,vf) else return AddSpecialEffectLoc(zD(),ud) endif endfunction function ef takes string c returns integer if(c=="W")then return 10 elseif(c=="M")then return 9 elseif(c=="m")or(c=="w")or(c=="A")or(c=="O")or(c=="Q")or(c=="&")then return 8 elseif(c=="B")or(c=="G")or(c=="N")or(c=="X")or(c=="Y")or(c=="@")or(c=="")then return 7 elseif(c=="a")or(c=="b")or(c=="c")or(c=="e")or(c=="h")or(c=="k")or(c=="n")or(c=="u")or(c=="z")or(c=="E")or(c=="L")then return 5 elseif(c=="P")or(c=="S")or(c=="T")or(c=="2")or(c=="3")or(c=="5")or(c=="7")or(c=="_")then return 5 elseif(c=="s")or(c=="t")or(c=="F")then return 4 elseif(c=="f")or(c=="j")or(c=="r")or(c=="J")or(c=="-")or(c=="(")or(c==")")or(c=="'")then return 3 elseif(c=="i")or(c=="l")or(c=="I")or(c=="1")or(c==".")or(c==",")or(c=="!")or(c==";")or(c==":")or(c=="|")then return 2 else return 6 endif endfunction function of takes string s returns string local integer rf=StringLength(s)-1 local integer i=0 local integer v=0 local string c local integer array af loop exitwhen i>rf set c=SubString(s,i,i+2) if(c=="|c")or(c=="|C")then set i=i+10 else set af[i]=ef(SubString(s,i,i+1)) set v=v+af[i] set i=i+1 endif endloop if v<68 then return s endif loop exitwhen v<62 set v=v-af[rf] set rf=rf-1 endloop return SubString(s,0,rf+1)+"..." endfunction function nf takes player oP,integer i returns nothing if C==1 then set i=IMaxBJ(-232,IMinBJ(150,i)) else set i=IMaxBJ(-145,IMinBJ(100,i)) endif if i<1 then if oP==U then call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE,1850.0-10*i,0.25) call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK,270.0,0.25) endif else if oP==U then call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE,1650.0+16.67*I2R(i-1),0.25) call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK,304.0-0.14*I2R(i-1),0.25) endif endif if(C>1)and((i>60)or(i<-85))then call TriggerSleepAction(Xx*6.0) if i>60 then call nf(oP,60) else call nf(oP,-85) endif endif set Ho[GetPlayerId(oP)]=i endfunction function Vf takes unit LC,integer Ef,integer Xf,boolean Of returns nothing local integer mc=GetUnitAbilityLevel(LC,Ef) if Of then call SetUnitAbilityLevel(LC,Ef,mc+Xf) call TriggerSleepAction(0.1) if GetUnitAbilityLevel(LC,Ef)!=(mc+Xf)then return endif else call SetUnitAbilityLevel(LC,Ef,Xf) call TriggerSleepAction(0.1) if GetUnitAbilityLevel(LC,Ef)!=Xf then return endif endif call SetUnitAbilityLevel(LC,Ef,mc) endfunction function Rf takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local string h=XC(jD) local integer Lc=GetStoredInteger(Ae,"floattextbldgtype",h) local string s local integer r local integer g local integer b local texttag tt if Lc==1 then set s="Laboratory" set r=191 set g=255 set b=0 elseif Lc==2 then set s="Power Plant" set r=51 set g=204 set b=255 elseif Lc==4 then set s="A.B.M." set r=191 set g=191 set b=191 else set s="???" set r=255 set g=66 set b=255 endif set tt=CreateTextTag() call TriggerSleepAction(0.1) call SetTextTagText(tt,s,0.046) call SetTextTagPos(tt,GetStoredInteger(Ae,"floattextbldglocx",h)-150,GetStoredInteger(Ae,"floattextbldglocy",h),200) call SetTextTagColor(tt,r,g,b,100) call FlushStoredInteger(Ae,"floattextbldgtype",h) call FlushStoredInteger(Ae,"floattextbldglocx",h) call FlushStoredInteger(Ae,"floattextbldglocy",h) call DestroyTrigger(jD) set tt=null set jD=null endfunction function If takes integer Lc,location ud returns nothing local trigger jD if(J>1)and(te<1)then set jD=CreateTrigger() call StoreInteger(Ae,"floattextbldgtype",XC(jD),Lc) call StoreInteger(Ae,"floattextbldglocx",XC(jD),NC(GetLocationX(ud))) call StoreInteger(Ae,"floattextbldglocy",XC(jD),NC(GetLocationY(ud))) call TriggerAddAction(jD,function Rf) call TriggerRegisterTimerEvent(jD,5,false) endif call RemoveLocation(ud) set jD=null endfunction function Af takes integer i returns string local string s if Lo[i*15+10]>0 then set s="KEY " else set s="|r|cffc2c2c2key |r|cffffcc00" endif if Lo[i*15+11]>0 then set s=s+"MOH " else set s=s+"|r|cffc2c2c2moh |r|cffffcc00" endif if Lo[i*15+12]>0 then set s=s+"PCC " else set s=s+"|r|cffc2c2c2pcc |r|cffffcc00" endif if Lo[i*15+13]>0 then set s=s+"COB " else set s=s+"|r|cffc2c2c2cob |r|cffffcc00" endif if Lo[i*15+14]>0 then set s=s+"LSA " else set s=s+"|r|cffc2c2c2lsa |r|cffffcc00" endif if Lo[i*15+15]>0 then set s=s+"REM("+I2S(Lo[i*15+15])+")" else set s=s+"|r|cffc2c2c2rem|r|cffffcc00" endif return s endfunction function Nf takes integer iP returns string local string s if gd(iP)then set s="12" else set s=I2S(Fd(iP)+1)+"/" if Zv[iP]<1 then set s=s+"11" elseif Zv[iP]<2 then set s=s+"10" elseif Zv[iP]<3 then set s=s+"9" elseif Zv[iP]<4 then set s=s+"6" else set s=s+"3" endif endif return s endfunction function bf takes player oP,integer i returns nothing local string s=AD(i)+" - Rank "+Nf(i)+" "+Af(i) call DisplayTimedTextToPlayer(oP,0,0,12,"|cffffcc00"+s+"|r") set s=rD(B[i]-1)+" ("+iD(B[i]-1,Pv[i*3+1])+") " if Pv[i*3+2]==0 then set s=s+"Light" elseif Pv[i*3+2]==1 then set s=s+"Medium" elseif Pv[i*3+2]==2 then set s=s+"Heavy" else set s=s+"Advanced" endif call DisplayTimedTextToPlayer(oP,0,0,12,"|cffffcc00"+s+" Armor|r") set s=VD(Eo[i]-1,false)+" "+XD(do[i]-1)+" " if Fd(i)>7 then set s=s+OD(Lo[i*15+6]) else set s=s+OD(-1) endif call DisplayTimedTextToPlayer(oP,0,0,12,"|cffffcc00"+s+"|r") endfunction function Bf takes integer cf,integer iP returns nothing local string Cf local string df if B[iP]==4 then set Cf="ReplaceableTextures\\CommandButtons\\BTNcentaur.tga" elseif B[iP]==1 then set Cf="ReplaceableTextures\\CommandButtons\\BTNBanditMage.tga" elseif B[iP]==2 then set Cf="ReplaceableTextures\\CommandButtons\\BTNBanditLord.tga" elseif B[iP]==7 then set Cf="ReplaceableTextures\\CommandButtons\\BTNArthas.tga" elseif B[iP]==6 then set Cf="ReplaceableTextures\\CommandButtons\\BTNBloodMage2.tga" elseif B[iP]==10 then set Cf="ReplaceableTextures\\CommandButtons\\BTNAncientOfWonders.blp" elseif B[iP]==9 then set Cf="ReplaceableTextures\\CommandButtons\\BTNPeasant.tga" elseif B[iP]==8 then set Cf="ReplaceableTextures\\CommandButtons\\BTNFlyingMachine.blp" elseif B[iP]==5 then set Cf="ReplaceableTextures\\CommandButtons\\BTNSpellBreaker.blp" elseif B[iP]==11 then set Cf="ReplaceableTextures\\CommandButtons\\BTNHeroDeathKnight.blp" elseif B[iP]==12 then set Cf="ReplaceableTextures\\CommandButtons\\BTNRifleman.blp" else set Cf="ReplaceableTextures\\CommandButtons\\BTNVillagerMan.blp" endif set df="war3mapImported\\RankBuff"+I2S(Gd(iP))+".tga" call MultiboardSetItemIconBJ(pe,1,cf,df) call MultiboardSetItemStyleBJ(pe,1,cf,false,true) call MultiboardSetItemIconBJ(pe,2,cf,Cf) call MultiboardSetItemStyleBJ(pe,2,cf,false,true) call MultiboardSetItemValueBJ(pe,3,cf,vD(B[iP]-1)+"| |r"+vD(iP)+of(ID(iP))+"|r") call MultiboardSetItemStyleBJ(pe,4,cf,false,false) call MultiboardSetItemColorBJ(pe,5,cf,70.0,100.0,70.0,0) call MultiboardSetItemValueBJ(pe,5,cf,"Healthy") call MultiboardSetItemColorBJ(pe,6,cf,0.0,65.0,100.0,0) call MultiboardSetItemValueBJ(pe,6,cf,"||||||||") call MultiboardSetItemStyleBJ(pe,7,cf,false,false) endfunction function Df takes nothing returns nothing call MultiboardSetItemStyleBJ(pe,1,Pe[9],false,false) call MultiboardSetItemIconBJ(pe,2,Pe[9],"war3mapImported\\PASBTNRadiationBuff.tga") call MultiboardSetItemStyleBJ(pe,2,Pe[9],false,true) call MultiboardSetItemValueBJ(pe,3,Pe[9]," ") call MultiboardSetItemStyleBJ(pe,4,Pe[9],false,false) call MultiboardSetItemValueBJ(pe,5,Pe[9]," ") call MultiboardSetItemValueBJ(pe,6,Pe[9]," ") call MultiboardSetItemStyleBJ(pe,7,Pe[9],false,false) endfunction function ff takes integer mc returns nothing local string s="" local integer i=1 set mc=IMinBJ(mc,138) if mc<5 then call MultiboardSetItemColorBJ(pe,3,Pe[9],70.0,70.0,70.0,0) loop exitwhen i>mc set s=s+"||" set i=i+1 endloop elseif mc<10 then call MultiboardSetItemColorBJ(pe,3,Pe[9],0.0,100.0,0.0,0) loop exitwhen i>mc set s=s+"||" set i=i+1 endloop elseif mc<28 then call MultiboardSetItemColorBJ(pe,3,Pe[9],100.0,100.0,0.0,0) set s="||||||||||||||||||" set i=10 loop exitwhen i>mc set s=s+"||" set i=i+2 endloop elseif mc<64 then call MultiboardSetItemColorBJ(pe,3,Pe[9],100.0,50.0,0.0,0) set s="||||||||||||||||||||||||||||||||||||" set i=28 loop exitwhen i>mc set s=s+"||" set i=i+3 endloop else call MultiboardSetItemColorBJ(pe,3,Pe[9],100.0,0.0,0.0,0) set s="||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||" set i=64 loop exitwhen i>mc set s=s+"||" set i=i+5 endloop endif call MultiboardSetItemValueBJ(pe,3,Pe[9],s) endfunction function Ff takes integer cf,integer gf returns nothing if gf==1 then call MultiboardSetItemColorBJ(pe,5,cf,70.0,100.0,70.0,0) call MultiboardSetItemValueBJ(pe,5,cf,"Healthy") elseif gf==2 then call MultiboardSetItemColorBJ(pe,5,cf,100.0,80.0,60.0,0) call MultiboardSetItemValueBJ(pe,5,cf,"Hurt") elseif gf==3 then call MultiboardSetItemColorBJ(pe,5,cf,100.0,60.0,60.0,0) call MultiboardSetItemValueBJ(pe,5,cf,"Critical") elseif gf==4 then call MultiboardSetItemColorBJ(pe,5,cf,60.0,60.0,60.0,0) call MultiboardSetItemValueBJ(pe,5,cf,"Dead") else call MultiboardSetItemColorBJ(pe,5,cf,40.0,40.0,40.0,0) call MultiboardSetItemValueBJ(pe,5,cf,"-") endif endfunction function Gf takes integer cf,integer hf returns nothing if hf==1 then call MultiboardSetItemStyleBJ(pe,6,cf,true,false) call MultiboardSetItemColorBJ(pe,6,cf,0.0,65.0,100.0,0) call MultiboardSetItemValueBJ(pe,6,cf,"||||||||") elseif hf==2 then call MultiboardSetItemStyleBJ(pe,6,cf,true,false) call MultiboardSetItemColorBJ(pe,6,cf,0.0,40.0,100.0,0) call MultiboardSetItemValueBJ(pe,6,cf,"||||||") elseif hf==3 then call MultiboardSetItemStyleBJ(pe,6,cf,true,false) call MultiboardSetItemColorBJ(pe,6,cf,0.0,10.0,100.0,0) call MultiboardSetItemValueBJ(pe,6,cf,"||") else call MultiboardSetItemStyleBJ(pe,6,cf,false,false) endif endfunction function Hf takes integer cf,boolean jf,boolean Jf returns nothing call MultiboardSetItemStyleBJ(pe,4,cf,false,jf) call MultiboardSetItemStyleBJ(pe,7,cf,false,Jf) endfunction function kf takes integer cf,integer gf,integer hf,boolean jf,boolean Jf returns nothing call Ff(cf,gf) call Gf(cf,hf) call Hf(cf,jf,Jf) endfunction function Kf takes unit Od returns boolean return(GetUnitAbilityLevel(Od,'B003')+GetUnitAbilityLevel(Od,'B02H')+GetUnitAbilityLevel(Od,'B00B')+GetUnitAbilityLevel(Od,'B02I')+GetUnitAbilityLevel(Od,'B00C')+GetUnitAbilityLevel(Od,'B02J'))>0 endfunction function lf takes unit Od returns nothing local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer gf=0 local integer hf=1 local real n if X[iP]==null then call kf(Pe[iP],0,0,false,false) return endif set n=GetUnitState(Od,UNIT_STATE_MANA) if n<249.99 then set hf=3 elseif n<899.00 then set hf=2 endif set n=GetUnitState(Od,UNIT_STATE_LIFE) if Ce[iP]then set gf=4 set hf=0 elseif n<167.00 then set gf=3 elseif n<374.00 then set gf=2 elseif AC(Player(iP))then set gf=1 endif call kf(Pe[iP],gf,hf,Kf(Od),UnitHasBuffBJ(Od,'Bprg')) endfunction function Lf takes unit Od returns nothing local integer iP=GetPlayerId(GetOwningPlayer(Od)) local real mf=GetUnitState(Od,UNIT_STATE_LIFE) local integer gf=1 if X[iP]==null then set gf=0 elseif Ce[iP]then set gf=4 elseif mf<167.00 then set gf=3 elseif mf<374.00 then set gf=2 endif call Ff(Pe[iP],gf) endfunction function Mf takes unit Od returns nothing local integer iP=GetPlayerId(GetOwningPlayer(Od)) local real n=GetUnitState(Od,UNIT_STATE_MANA) local integer hf=1 if not Ed(iP)then set hf=0 elseif n<249.99 then set hf=3 elseif n<899.00 then set hf=2 endif call Gf(Pe[iP],hf) endfunction function pf takes unit Od returns nothing local integer iP=GetPlayerId(GetOwningPlayer(Od)) call Hf(Pe[iP],Kf(Od),UnitHasBuffBJ(Od,'Bprg')) endfunction function Pf takes nothing returns nothing local integer i=sv local integer cf=2 set pe=null if(GetPlayerSlotState(Player(4))==PLAYER_SLOT_STATE_PLAYING)and not IC(Player(4))then set i=i-1 endif set pe=CreateMultiboardBJ(7,C+i+1,"Squad Status") call MultiboardSetItemWidthBJ(pe,1,0,1.2) call MultiboardSetItemWidthBJ(pe,2,0,1.2) call MultiboardSetItemWidthBJ(pe,3,0,9.2) call MultiboardSetItemWidthBJ(pe,4,0,1.2) call MultiboardSetItemWidthBJ(pe,5,0,4.3) call MultiboardSetItemWidthBJ(pe,6,0,1.2) call MultiboardSetItemWidthBJ(pe,7,0,1.0) call MultiboardSetItemStyleBJ(pe,1,0,false,false) call MultiboardSetItemStyleBJ(pe,2,0,false,false) call MultiboardSetItemStyleBJ(pe,3,0,true,false) call MultiboardSetItemStyleBJ(pe,4,0,false,false) call MultiboardSetItemStyleBJ(pe,5,0,true,false) call MultiboardSetItemStyleBJ(pe,6,0,true,false) call MultiboardSetItemStyleBJ(pe,7,0,false,false) call MultiboardSetItemIconBJ(pe,4,0,"war3mapImported\\PASBTNInjuryBuff.tga") call MultiboardSetItemIconBJ(pe,7,0,"ReplaceableTextures\\CommandButtons\\BTNAnimateDead.blp") set Pe[9]=1 call Df() set i=0 loop exitwhen i>8 if AC(Player(i))then set Pe[i]=cf call MultiboardSetItemValueBJ(pe,3,cf," "+vD(i)+of(ID(i))+"|r") set cf=cf+1 endif set i=i+1 endloop call MultiboardMinimizeBJ(true,pe) call MultiboardDisplayBJ(true,pe) endfunction function qf takes integer Qf,player Fc,location sf,real Sf returns unit local unit tf=CreateUnitAtLoc(Fc,Qf,sf,Sf) call RemoveLocation(sf) return tf endfunction function Tf takes integer Qf,player Fc,location sf,real Sf returns unit local unit tf=CreateUnitAtLoc(Fc,Qf,sf,Sf) return tf endfunction function uf takes unit LC,real Uf returns nothing local real wf=GetUnitDefaultMoveSpeed(LC) if Uf<58 then call SetUnitMoveSpeed(LC,RMinBJ(wf+ye,wf*1.1)+We+Uf) else call SetUnitMoveSpeed(LC,RMinBJ(wf+ye,wf*1.1)+We+58.0) endif endfunction function Wf takes unit LC,integer i returns nothing call SetUnitUserData(LC,i) set Bv[i]=AddSpecialEffectTarget("Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl",LC,"overhead") endfunction function yf takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local effect KD=AddSpecialEffectTarget(GetStoredString(Ae,"postuniteffect_effect",XC(jD)),LoadUnitHandle(qi,StringHash("postuniteffect_unit"),StringHash(XC(jD))),GetStoredString(Ae,"postuniteffect_attach",XC(jD))) call TriggerSleepAction(Xx) call DestroyEffect(KD) call RemoveSavedHandle(qi,StringHash("postuniteffect_unit"),StringHash(XC(jD))) call FlushStoredString(Ae,"postuniteffect_effect",XC(jD)) call FlushStoredString(Ae,"postuniteffect_attach",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function Yf takes unit LC,string zf,string Zf returns nothing local trigger jD=CreateTrigger() call SaveUnitHandle(qi,StringHash("postuniteffect_unit"),StringHash(XC(jD)),LC) call StoreString(Ae,"postuniteffect_effect",XC(jD),zf) call StoreString(Ae,"postuniteffect_attach",XC(jD),Zf) call TriggerAddAction(jD,function yf) call TriggerRegisterTimerEvent(jD,0.1,false) endfunction function vF takes string eF,string rF returns nothing local integer iF=GetStoredInteger(Ae,"droidremote_remote",eF) local string aF if iF==1 then set aF=GetStoredString(Ae,"droidremote_init",eF) call FlushStoredString(Ae,"droidremote_init",eF) call FlushStoredInteger(Ae,"droidremote_remote",eF) call StoreString(Ae,"droidremote_init",rF,aF) call StoreInteger(Ae,"droidremote_remote",rF,1) endif endfunction function nF takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local string aF=GetStoredString(Ae,"droidremote_range_item",XC(jD)) local unit iO=LoadUnitHandle(qi,StringHash("droidremote_droid"),StringHash(aF)) local unit VF=null if iO!=null then set VF=iO if GetUnitAbilityLevel(VF,'B01H')>0 then if(GetUnitMoveSpeed(VF)<50)and(GetUnitState(VF,UNIT_STATE_MANA)>=5.00)then call SetUnitMoveSpeed(VF,GetStoredInteger(Ae,"droidremote_movespeed",XC(VF))) call UnitRemoveAbility(VF,'Abun') endif elseif GetUnitState(VF,UNIT_STATE_MANA)<4.99 then call SetUnitMoveSpeed(VF,0) call UnitAddAbility(VF,'Abun') endif else call DisableTrigger(jD) endif endfunction function EF takes string XF returns unit local string aF=GetStoredString(Ae,"droidremote_init",XF) return LoadUnitHandle(qi,StringHash("droidremote_droid"),StringHash(aF)) endfunction function OF takes item RF,integer iP returns nothing local unit IF local trigger jD local string aF if GetStoredInteger(Ae,"droidremote_remote",XC(RF))!=1 then call StoreInteger(Ae,"droidremote_remote",XC(RF),1) set aF=XC(RF)+"RED"+I2S(GetRandomInt(100,999)) call StoreString(Ae,"droidremote_init",XC(RF),aF) set jD=CreateTrigger() call DisableTrigger(jD) call TriggerRegisterTimerEventPeriodic(jD,10) call TriggerAddAction(jD,function nF) call StoreString(Ae,"droidremote_range_item",XC(jD),aF) call SaveTriggerHandle(qi,StringHash("droidremote_range_trig"),StringHash(aF),jD) else set IF=EF(XC(RF)) if IF!=null then call SetUnitOwner(IF,Player(iP),true) endif endif endfunction function AF takes nothing returns nothing local unit VF=GetTriggerUnit() if GetUnitAbilityLevel(VF,'B01H')<1 then call TriggerSleepAction(0.1) call SetUnitMoveSpeed(VF,0) call UnitAddAbility(VF,'Abun') call IssueImmediateOrder(VF,"stop") endif endfunction function NF takes unit VF,string aF returns nothing local trigger jD=CreateTrigger() call TriggerRegisterUnitManaEvent(jD,VF,LESS_THAN,4.99) call TriggerAddAction(jD,function AF) call SaveTriggerHandle(qi,StringHash("droidremote_lowenergy"),StringHash(aF),jD) endfunction function bF takes nothing returns nothing local unit VF=GetTriggerUnit() if(GetUnitAbilityLevel(VF,'B01H')>0)and(GetUnitMoveSpeed(VF)<50)then call SetUnitMoveSpeed(VF,GetStoredInteger(Ae,"droidremote_movespeed",XC(VF))) call UnitRemoveAbility(VF,'Abun') endif endfunction function BF takes unit VF,string aF returns nothing local trigger jD=CreateTrigger() call TriggerRegisterUnitManaEvent(jD,VF,GREATER_THAN_OR_EQUAL,5.00) call TriggerAddAction(jD,function bF) call SaveTriggerHandle(qi,StringHash("droidremote_hasenergy"),StringHash(aF),jD) endfunction function cF takes unit VF,integer CF returns nothing local real x=GetUnitX(VF) local real y=GetUnitY(VF) loop exitwhen CF<100 set CF=CF-100 call CreateItem('I02O',x,y) endloop loop exitwhen CF<10 set CF=CF-10 call CreateItem('I02N',x,y) endloop loop exitwhen CF<1 set CF=CF-1 call CreateItem('I02M',x,y) endloop endfunction function dF takes nothing returns nothing local trigger DF=GetTriggeringTrigger() local unit VF=GetDyingUnit() local string fF=XC(VF) local string aF=GetStoredString(Ae,"droidremote_droid_item",fF) local integer FF=GetStoredInteger(Ae,"droidremote_selfpowered",fF) local trigger jD local effect KD local real x local real y local trigger iH local integer i local integer gF=GetStoredInteger(Ae,"herocount","totalplayers") call FlushStoredString(Ae,"droidremote_droid_item",fF) set jD=LoadTriggerHandle(qi,StringHash("droidremote_lowenergy"),StringHash(aF)) call DestroyTrigger(jD) set jD=LoadTriggerHandle(qi,StringHash("droidremote_hasenergy"),StringHash(aF)) call DestroyTrigger(jD) set KD=LoadEffectHandle(qi,StringHash("droidremote_gunfx"),StringHash(fF)) call DestroyEffect(KD) if FF>0 then call cF(VF,GetStoredInteger(Ae,"droidremote_boards",fF)) endif call FlushStoredInteger(Ae,"droidremote_gunfx",fF) call FlushStoredInteger(Ae,"droidremote_energyregen",fF) call FlushStoredInteger(Ae,"droidremote_movespeed",fF) call FlushStoredInteger(Ae,"droidremote_ladbuilt",fF) call FlushStoredInteger(Ae,"droidremote_boards",fF) call FlushStoredInteger(Ae,"droidremote_selfpowered",fF) set iH=LoadTriggerHandle(qi,StringHash("droidremote_deconstruct_trig"),StringHash(fF)) if iH!=null then set jD=iH call RemoveSavedHandle(qi,StringHash("droidremote_deconstruct"),StringHash(XC(jD))) call RemoveSavedHandle(qi,StringHash("droidremote_deconstruct_trig"),StringHash(fF)) call DestroyTrigger(jD) endif call RemoveSavedHandle(qi,StringHash("droidremote_droid"),StringHash(aF)) if gF==1 then set Ke=IMaxBJ(0,Ke-5+(GetHeroLevel(VF)*3)/2) else set Ke=IMaxBJ(0,Ke-(2+2*gF)+(GetHeroLevel(VF)*5)/3) endif set iH=null set i=0 loop exitwhen i>7 if Ki[i]==VF then set Ki[i]=null exitwhen true endif set i=i+1 endloop set Sr=IMaxBJ(0,Sr-1) set x=GetUnitX(VF) set y=GetUnitY(VF) set KD=AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",x,y) call RemoveUnit(VF) call RC(1.0) call DestroyEffect(KD) if FF>0 then call CreateItem('I02H',x,y) endif call Qd() call DestroyTrigger(DF) endfunction function GF takes unit VF returns nothing local trigger jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,VF,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function dF) endfunction function hF takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit VF=LoadUnitHandle(qi,StringHash("droidremote_deconstruct"),StringHash(XC(jD))) local integer CF=GetStoredInteger(Ae,"droidremote_boards",XC(VF)) call cF(VF,CF) call KillUnit(VF) endfunction function HF takes unit VF returns nothing local trigger jD=CreateTrigger() call SaveUnitHandle(qi,StringHash("droidremote_deconstruct"),StringHash(XC(jD)),VF) call SaveTriggerHandle(qi,StringHash("droidremote_deconstruct_trig"),StringHash(XC(VF)),jD) call TriggerAddAction(jD,function hF) call TriggerRegisterTimerEvent(jD,20,false) endfunction function jF takes unit VF returns nothing local trigger jD=LoadTriggerHandle(qi,StringHash("droidremote_deconstruct_trig"),StringHash(XC(VF))) call RemoveSavedHandle(qi,StringHash("droidremote_deconstruct_trig"),StringHash(XC(VF))) call RemoveSavedHandle(qi,StringHash("droidremote_deconstruct"),StringHash(XC(jD))) call DestroyTrigger(jD) endfunction function JF takes unit Od,string XF,integer iP,integer kF,item RF returns nothing local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local string aF=GetStoredString(Ae,"droidremote_init",XF) local unit iO=LoadUnitHandle(qi,StringHash("droidremote_droid"),StringHash(aF)) local string fF local effect fx local integer KF=0 local integer i local integer lF local integer LF=0 local integer mF local integer MF local integer pF local integer PF local unit VF local integer gF if iO!=null then set VF=EF(XF) if HC(GetUnitX(Od),GetUnitY(Od),GetUnitX(VF),GetUnitY(VF),1400)then if GetUnitAbilityLevel(VF,'A0K9')<1 then call iC(oP,"Existing droid cannot be deconstructed because it is out of remote range.") else call iC(oP,"Deconstruction countdown on existing droid cannot be cancelled because it is out of remote range.") endif else if GetUnitAbilityLevel(VF,'A0K9')<1 then call UnitAddAbility(VF,'A0K9') if kF>0 then call iC(oP,"Existing droid will deconstruct in 20 seconds. Use ability again to cancel.") else call iC(oP,"Existing droid will deconstruct in 20 seconds. Use item again to cancel.") endif call HF(VF) else call UnitRemoveAbility(VF,'A0K9') call iC(oP,"Deconstruction countdown on existing droid cancelled.") call jF(VF) endif endif if kF>0 then call Vf(Od,'A08N',1,true) endif return endif set gF=GetStoredInteger(Ae,"herocount","totalplayers") if kF>0 then if GetUnitAbilityLevel(Od,'A09X')>1 then call iC(oP,"Cannot create droid while reconstructing.") call Vf(Od,'A08N',1,true) return endif else if GetUnitState(Od,UNIT_STATE_MANA)<600 then call iC(oP,"Not enough energy to create droid.") return else call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)-600) endif endif set VF=CreateUnit(oP,'O00M',GetUnitX(Od),GetUnitY(Od),0) set fF=XC(VF) set fx=AddSpecialEffectTarget("war3mapImported\\WeaponChain.mdx",VF,"weapon") call SaveEffectHandle(qi,StringHash("droidremote_gunfx"),StringHash(fF),fx) call SetUnitState(VF,UNIT_STATE_MANA,5) if kF>0 then set i=GetHeroLevel(Od) if i<8 then call SetHeroLevel(VF,i+3,false) elseif i<21 then call SetHeroLevel(VF,(i-7)/2+10,false) elseif i<46 then call SetHeroLevel(VF,(i-20)/3+17,false) else call SetHeroLevel(VF,i/2+3,false) endif else call SetHeroLevel(VF,GetHeroLevel(Od)/2+3,false) endif call SuspendHeroXP(VF,false) set Sr=Sr+1 if gF==1 then set Ke=Ke+5*Sr+(GetHeroLevel(VF)*3)/2 else set Ke=Ke+(2+2*gF)*Sr+(GetHeroLevel(VF)*5)/3 endif if kF>0 then call StoreInteger(Ae,"droidremote_ladbuilt",fF,1) call SetUnitColor(VF,ConvertPlayerColor(11)) call SetUnitVertexColor(VF,130,120,145,255) if kF>1 then call UnitRemoveAbility(VF,'A08G') if kF<3 then call UnitAddAbility(VF,'A08H') endif endif call SetHeroAgi(VF,GetHeroAgi(Od,false),true) call SetHeroStr(VF,GetHeroStr(Od,false),true) if fe>1 then call SetUnitAbilityLevel(VF,'A041',19+3*kF) elseif fe>0 then call SetUnitAbilityLevel(VF,'A041',17+3*kF) else call SetUnitAbilityLevel(VF,'A041',16+3*kF) endif if kF==1 then set lF=270 else set lF=270+10*kF endif call UnitRemoveAbility(VF,'A0JK') call UnitAddAbility(VF,'A042') call SetUnitAbilityLevel(VF,'A042',GetHeroStr(VF,false)/25+1) call SetUnitAbilityLevel(VF,'A0JM',1+3*(kF-1)) set LF=LF+kF+GetHeroLevel(Od)/3 if(B[iP]==4)and(GetStoredInteger(Ae,"herocount","totalplayers")==1)then call UnitAddAbility(VF,'A0FK') endif set KF=kF set i=4 loop exitwhen i>7 if Ki[i]==null then set Ki[i]=VF exitwhen true endif set i=i+1 endloop else call StoreInteger(Ae,"droidremote_ladbuilt",fF,0) set lF=310 set i=Pv[iP*3+2] if i==1 then set i=2 set lF=270 elseif i==2 then set i=5 set lF=240 elseif i==3 then set i=4 set lF=250 endif if B[iP]==4 then call UnitAddAbility(VF,'A0FK') elseif Do[iP*Co+8]>0 then call UnitAddAbility(VF,'A0MS') set i=i/ 2 endif set LF=LF+Ar[iP] if B[iP]==12 then set i=GetUnitAbilityLevel(Od,'A000')+i+GetUnitAbilityLevel(X[iP],'A0O0') if fe>1 then call SetUnitAbilityLevel(VF,'A041',IMinBJ(i,25)+3) elseif fe>0 then call SetUnitAbilityLevel(VF,'A041',IMinBJ(i,25)+1) else call SetUnitAbilityLevel(VF,'A041',IMinBJ(i,25)) endif set lF=lF-20+5*IMaxBJ(i-25,0) set LF=LF+(GetUnitAbilityLevel(X[iP],'A0NZ')+1)*3/4 set i=4 loop exitwhen i>7 if Ki[i]==null then set Ki[i]=VF exitwhen true endif set i=i+1 endloop else if fe>1 then call SetUnitAbilityLevel(VF,'A041',GetUnitAbilityLevel(Od,'A000')+i+3) elseif fe>0 then call SetUnitAbilityLevel(VF,'A041',GetUnitAbilityLevel(Od,'A000')+i+1) else call SetUnitAbilityLevel(VF,'A041',GetUnitAbilityLevel(Od,'A000')+i) endif set i=0 loop exitwhen i>3 if Ki[i]==null then set Ki[i]=VF exitwhen true endif set i=i+1 endloop endif call SetUnitAbilityLevel(VF,'A0JM',1+GetPlayerTechCount(oP,'Rhra',true)) endif call IssueImmediateOrder(VF,"manashieldon") call SetUnitMoveSpeed(VF,lF) call StoreInteger(Ae,"droidremote_movespeed",fF,lF) call StoreInteger(Ae,"droidremote_energyregen",fF,-1) if LF>0 then if LF<11 then call SetPlayerTechResearched(oP,'R01H',LF) else call SetPlayerTechResearched(oP,'R01H',10) call SetPlayerTechResearched(oP,'R01L',LF-10) endif endif set i=C-2 if i>0 then call SetPlayerTechResearched(oP,'R01B',i) endif call TriggerRegisterUnitEvent(PN,VF,EVENT_UNIT_HERO_SKILL) set i=GetHeroLevel(VF) set mF=IMaxBJ(i-19,0)/4 set MF=(i+1)/10 set pF=IMaxBJ(i-13,0)/3 set PF=1+i/5 set i=mF+MF+pF+PF call UnitModifySkillPoints(VF,i-GetHeroSkillPoints(VF)) set i=mF loop exitwhen i<1 call SelectHeroSkill(VF,'A0JJ') set i=i-1 endloop set i=MF loop exitwhen i<1 call SelectHeroSkill(VF,'A0JI') set i=i-1 endloop set i=pF loop exitwhen i<1 call SelectHeroSkill(VF,'A0C1') set i=i-1 endloop set i=PF loop exitwhen i<1 call SelectHeroSkill(VF,'A005') set i=i-1 endloop call UnitModifySkillPoints(VF,KF-GetHeroSkillPoints(VF)) call SaveUnitHandle(qi,StringHash("droidremote_droid"),StringHash(aF),VF) call StoreString(Ae,"droidremote_droid_item",fF,aF) call GF(VF) call NF(VF,aF) call BF(VF,aF) call TriggerRegisterUnitEvent(EI,VF,EVENT_UNIT_SPELL_EFFECT) call IssueTargetOrder(VF,"smart",Od) if(RF!=null)and(bx[iP]!=null)then call StoreInteger(Ae,"droidremote_selfpowered",fF,1) call UnitAddAbility(VF,'A0KM') call SetItemPosition(RF,GetUnitX(VF),GetUnitY(VF)) call RemoveItem(RF) else call StoreInteger(Ae,"droidremote_selfpowered",fF,0) call SetUnitAbilityLevel(VF,'A0MX',2) endif call TriggerSleepAction(0.1) call EnableTrigger(LoadTriggerHandle(qi,StringHash("droidremote_range_trig"),StringHash(aF))) call Qd() endfunction function qF takes integer QF returns integer if QF==0 then return 100 elseif QF==1 then return 103 elseif QF==2 then return 105 elseif QF==3 then return 110 elseif QF==4 then return 115 elseif QF==5 then return 120 elseif QF==6 then return 130 elseif QF==7 then return 135 elseif QF==8 then return 150 elseif QF==9 then return 165 else return 1000000 endif endfunction function sF takes integer Lc returns boolean local boolean SF=UnitHasItem(dv,cv) local location tF=GetItemLoc(cv) if cv==null then call RemoveLocation(tF) return false endif call RemoveItem(cv) set cv=null if SF then set cv=UnitAddItemByIdSwapped(Lc,dv) else set cv=CreateItemLoc(Lc,tF) endif call RemoveLocation(tF) return true endfunction function TF takes item Jd,location ud returns nothing if Jd!=null then call SetItemPosition(Jd,GetLocationX(ud),GetLocationY(ud)) endif call RemoveLocation(ud) endfunction function uF takes unit Od returns boolean local item Jd local integer i=0 loop exitwhen i>5 set Jd=UnitItemInSlot(Od,i) exitwhen Jd==null set i=i+1 endloop return i==6 endfunction function UF takes item Jd returns nothing local string XF=XC(Jd) local string aF=GetStoredString(Ae,"droidremote_init",XF) local unit iO=LoadUnitHandle(qi,StringHash("droidremote_droid"),StringHash(aF)) if iO!=null then call KillUnit(EF(XF)) endif endfunction function wF takes item Jd,integer iP,integer WF returns boolean local integer Hd local integer i=0 local integer YF=0 loop exitwhen i>5 if Jr[iP*6+i]==Jd then if Jd==null then return false endif if WF>0 then set Jr[iP*6+i]=null set Hd=GetItemTypeId(Jd) loop if lr[YF]==Hd then set lr[YF]=-1 exitwhen true endif set YF=YF+1 exitwhen YF>3 endloop if WF>1 then if GetItemTypeId(Jd)=='I02H' then call UF(Jd) endif call RemoveItem(Jd) endif endif return true endif set i=i+1 endloop return false endfunction function zF takes unit LC,item Jd,integer ZF returns boolean local integer i=0 local boolean b=true local integer WC=0 local integer array vg local item eg loop exitwhen not b exitwhen i>ZF set eg=UnitItemInSlot(LC,i) if i==ZF then if eg!=null then set b=false else call UnitAddItem(LC,Jd) endif else if eg==null then set vg[WC]=i set WC=WC+1 call UnitAddItem(LC,CreateItem('I02L',-1060.00,-3400.00)) endif endif set i=i+1 endloop loop exitwhen WC<1 set WC=WC-1 set eg=UnitItemInSlot(LC,vg[WC]) call RemoveItem(eg) endloop return b endfunction function xg takes unit og,unit rg,integer ZF returns nothing local item ig=UnitItemInSlot(og,ZF) local item ag=UnitItemInSlot(rg,ZF) if ag!=null then call UnitRemoveItemFromSlot(rg,ZF) endif call zF(rg,ig,ZF) if ag!=null then call zF(og,ag,ZF) endif endfunction function ng takes unit Od,integer Vg,integer Eg,item Xg returns item local item Jd local integer i=0 loop set Jd=UnitItemInSlot(Od,i) exitwhen(Jd!=null)and(GetItemTypeId(Jd)==Vg)and(GetItemCharges(Jd)5 endloop if i<6 then return Jd endif if(GetUnitPointValue(Od)==3)and(pv[GetPlayerId(GetOwningPlayer(Od))*Nx+13]>0)then return ng(bx[GetPlayerId(GetOwningPlayer(Od))],Vg,Eg,Xg) endif return null endfunction function Og takes unit LC,item Jd,integer Rg returns boolean local integer Lc=GetItemTypeId(Jd) local integer Ig=GetItemCharges(Jd) local integer Ag local item Ng if Ig0)then if(GetUnitPointValue(LC)==3)or(GetUnitTypeId(LC)=='o015')then set wd=wd+wd endif elseif(Hd=='I00Y')and(pv[iP*Nx+6]>0)then if(GetUnitPointValue(LC)==3)or(GetUnitTypeId(LC)=='o015')then set wd=8 endif endif if(wd>1)and(pv[iP*Nx+10]>15)then if(GetUnitPointValue(LC)==3)or(GetUnitTypeId(LC)=='o015')then set wd=wd+IMaxBJ(1,wd/4) endif endif return wd endfunction function Bg takes unit LC,integer Hd,item Jd returns boolean local integer wd=0 if Hd=='I00A' then set wd=bg(LC,Hd) elseif Hd=='I00B' then set wd=bg(LC,Hd) elseif Hd=='I00C' then set wd=bg(LC,Hd) elseif Hd=='I01E' then set wd=bg(LC,Hd) elseif Hd=='I00Y' then set wd=bg(LC,Hd) endif if wd>0 then call Og(LC,Jd,wd) return true endif return false endfunction function cg takes unit Od,item Jd returns boolean local integer iP if not uF(Od)then call UnitAddItem(Od,Jd) return true endif set iP=GetPlayerId(GetOwningPlayer(Od)) if(GetUnitPointValue(Od)==3)and(pv[iP*Nx+13]>0)and not uF(bx[iP])then call UnitAddItem(bx[iP],Jd) return true endif return false endfunction function Cg takes unit Od returns nothing local effect KD call AttachSoundToUnit(NE,Od) call SetSoundVolume(NE,82) call StartSound(NE) call KillSoundWhenDone(NE) set KD=AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIma\\AImaTarget.mdl",Od,"origin") call RC(1.5) call DestroyEffect(KD) set KD=null endfunction function dg takes integer iP returns boolean if pv[iP*Nx+12]<2 then return false endif set pv[iP*Nx+12]=1 call SetUnitState(X[iP],UNIT_STATE_MANA,GetUnitState(X[iP],UNIT_STATE_MANA)+500.0) call TriggerRegisterTimerEvent(LoadTriggerHandle(qi,StringHash("energizertrigger"),iP),150.0,false) call iC(Player(iP),"Energizer battery used.") call DestroyEffect(Bx[iP]) call Cg(X[iP]) return true endfunction function Dg takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"energizerplayer",XC(jD)) set pv[iP*Nx+12]=2 set Bx[iP]=AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl",X[iP],"overhead") if Ed(iP)then call iC(Player(iP),"Energizer battery finished recharging.") if GetUnitState(X[iP],UNIT_STATE_MANA)<250.0 then call dg(iP) endif endif endfunction function fg takes integer iP returns nothing local trigger jD=CreateTrigger() call TriggerAddAction(jD,function Dg) call StoreInteger(Ae,"energizerplayer",XC(jD),iP) call SaveTriggerHandle(qi,StringHash("energizertrigger"),iP,jD) set Bx[iP]=AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaFlare\\ManaFlareTarget.mdl",X[iP],"overhead") endfunction function Fg takes unit Od,item gg returns nothing local integer Gg=GetItemCharges(gg) local integer Lc=GetItemTypeId(gg) if Gg==1 then if Lc=='I00B' then call RemoveItem(gg) elseif not sF('I000')then return endif else call SetItemCharges(gg,Gg-1) if(Gg==Cv)and(Lc=='I01S')then call SetUnitLifeBJ(mb,1.00) endif endif call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+500.0) call Cg(Od) endfunction function hg takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"backpackplayer",XC(jD)) if not IsUnitSelected(bx[iP],Player(iP))then call DisableTrigger(jD) return endif call SetUnitPosition(bx[iP],GetUnitX(X[iP]),GetUnitY(X[iP])) endfunction function Hg takes integer iP returns nothing local trigger jD=CreateTrigger() set bx[iP]=qf('o015',Player(iP),GetUnitLoc(X[iP]),0) call SetUnitAbilityLevelSwapped('A0D0',bx[iP],6) if B[iP]==9 then call TriggerRegisterUnitEvent(XA,bx[iP],EVENT_UNIT_PICKUP_ITEM) call TriggerRegisterUnitEvent(OA,bx[iP],EVENT_UNIT_DROP_ITEM) endif call StoreInteger(Ae,"backpackplayer",XC(jD),iP) call SaveTriggerHandle(qi,StringHash("backpacktrigger"),iP,jD) call TriggerAddAction(jD,function hg) call TriggerRegisterTimerEventPeriodic(jD,0.50) endfunction function jg takes unit Jg returns nothing local integer Gg=1 local integer i=GetRandomInt(1,9) if i<4 then set Gg=i set i='I00B' elseif i<6 then set Gg=(i-3)*4 set i='I00A' elseif i<7 then set i='I01K' elseif i<8 then set i='I01L' elseif i<9 then set i='I003' else set i='I007' endif call SetItemCharges(CreateItem(i,GetUnitX(Jg),GetUnitY(Jg)),Gg) endfunction function kg takes integer iP returns boolean local unit Jg=LoadUnitHandle(qi,StringHash("petrat_rat"),iP) local real x=GetUnitX(X[iP]) local real y=GetUnitY(X[iP]) call IssuePointOrder(Jg,"move",x,y) if HC(GetUnitX(Jg),GetUnitY(Jg),x,y,500)then call iC(Player(iP),"Your rat is far away, but the cheese's scent has her scurrying towards you.") call SetUnitMoveSpeed(Jg,522) return false endif call SetUnitMoveSpeed(Jg,GetUnitDefaultMoveSpeed(Jg)) call jg(Jg) call iC(Player(iP),"Your rat had collected an item, but she dropped it in favor of the cheese!") call StoreInteger(Ae,"petrat_rummage_item",I2S(iP),-2) return true endfunction function Kg takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"petrat_scurry_player",XC(jD)) if GetPlayerSlotState(Player(iP))!=PLAYER_SLOT_STATE_LEFT then call IssuePointOrder(LoadUnitHandle(qi,StringHash("petrat_rat"),iP),"move",GetUnitX(X[iP]),GetUnitY(X[iP])) call TriggerRegisterTimerEvent(jD,GetRandomInt(30,60),false) return endif call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function lg takes integer iP returns nothing local trigger jD=CreateTrigger() local unit Jg=qf('n00R',Player(iP),GetUnitLoc(X[iP]),0) call SaveUnitHandle(qi,StringHash("petrat_rat"),iP,Jg) call StoreInteger(Ae,"petrat_scurry_player",XC(jD),iP) call TriggerAddAction(jD,function Kg) call TriggerRegisterTimerEvent(jD,GetRandomInt(30,60),false) endfunction function Lg takes item Jd,integer mg,integer Mg,unit LC returns nothing local integer Hd local integer Gg local string eF=XC(Jd) set Gg=GetItemCharges(Jd) call RemoveItem(Jd) set Jd=CreateItem(mg,GetUnitX(LC),GetUnitY(LC)) call SetItemCharges(Jd,Gg) call SetItemUserData(Jd,Mg) if(mg=='I02H')or(mg=='I02I')then call vF(eF,XC(Jd)) endif call UnitAddItem(LC,Jd) endfunction function pg takes item Jd,integer Pg,unit LC returns boolean if Pg==0 then return false endif call Lg(Jd,GetItemTypeId(Jd)+Pg,Pg,LC) return true endfunction function qg takes integer iA,integer iB returns integer if iA<0 then return iA else return ModuloInteger(iA,iB) endif endfunction function Qg takes item Jd,unit LC returns integer local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer sg=GetHeroInt(LC,true)+pv[iP*Nx+10] local integer id=GetItemTypeId(Jd) if(id=='I00Y')or(id=='I00Z')then set sg=sg+pv[iP*Nx+6] elseif((id>'I004')and(id<'I009'))or((id>'I024')and(id<'I029'))or((id>'I03K')and(id<'I03P'))then set sg=sg+Do[iP*Co+5] endif if((qF(GetItemLevel(Jd))-100)*2/(2+pv[iP*Nx+14])+100)>sg then if GetItemUserData(Jd)<1 then if wF(Jd,iP,2)then return 0 else return 1 endif endif elseif qg(GetItemUserData(Jd),10)>0 then return-1 endif return 0 endfunction function Sg takes unit LC returns nothing local item Jd local integer i=0 local item array tg local integer WC=0 loop exitwhen i>5 set Jd=UnitItemInSlot(LC,i) if Jd!=null then set tg[WC]=Jd set WC=WC+1 endif set i=i+1 endloop set i=WC-1 loop exitwhen i<0 call pg(tg[i],Qg(tg[i],LC),LC) set i=i-1 endloop endfunction function Tg takes unit LC returns boolean local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer Hd if pv[iP*Nx+2]>0 then set Hd=GetStoredInteger(Ae,"integrated_vest",I2S(iP)) if Hd>0 then call UnitRemoveAbility(LC,GetStoredInteger(Ae,"integrated_armor",I2S(iP))) call CreateItem(Hd,GetUnitX(LC),GetUnitY(LC)) call StoreInteger(Ae,"integrated_vest",I2S(iP),0) return true endif endif return false endfunction function ug takes item Xg,unit LC returns boolean local item Jd local integer i local itemtype Lc=GetItemType(Xg) if Lc==ITEM_TYPE_PERMANENT then if IsItemPawnable(Xg)then if Tg(LC)then return false endif else set i=GetItemTypeId(Xg) if(i=='I03W')or(i=='I03V')then if Tg(LC)then return false endif else call UnitRemoveItem(LC,Xg) return true endif endif endif if(Lc==ITEM_TYPE_PERMANENT)or(Lc==ITEM_TYPE_ARTIFACT)or(Lc==ITEM_TYPE_PURCHASABLE)or(Lc==ITEM_TYPE_CAMPAIGN)then set i=0 loop exitwhen i>5 set Jd=UnitItemInSlot(LC,i) if(Jd!=null)and(Jd!=Xg)and(GetItemType(Jd)==Lc)then call UnitRemoveItem(LC,Xg) return true endif set i=i+1 endloop endif return false endfunction function Ug takes item Xg,unit LC returns boolean local integer Lc=GetItemTypeId(Xg) local integer i=0 local item Jd loop exitwhen i>5 set Jd=UnitItemInSlot(LC,i) if(Jd!=null)and(Jd!=Xg)and(GetItemTypeId(Jd)==Lc)then call UnitRemoveItem(LC,Xg) return true endif set i=i+1 endloop return false endfunction function wg takes unit LC,integer i returns nothing local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer Wg=i local integer yg=1 local effect KD if Wg<5 then set yg=0 if Wg==2 then set Wg=3 set i=3 endif elseif Wg>4 then set yg=3 endif if(i>0)and UnitHasBuffBJ(LC,'B003')then set i=i-1 call UnitRemoveAbility(LC,'B003') elseif(yg>0)and UnitHasBuffBJ(LC,'B02H')then set i=i-1 set yg=yg-1 call UnitRemoveAbility(LC,'B02H') endif if(i>0)and UnitHasBuffBJ(LC,'B00C')then set i=i-1 call UnitRemoveAbility(LC,'B00C') set Wv[iP]=1.0 if ex[iP]>0 then call SetHeroInt(LC,GetHeroInt(LC,false)+ex[iP],true) set ex[iP]=0 call Sg(LC) endif elseif(yg>0)and UnitHasBuffBJ(LC,'B02J')then set i=i-1 set yg=yg-1 call UnitRemoveAbility(LC,'B02J') set Wv[iP]=1.0 if ex[iP]>0 then call SetHeroInt(LC,GetHeroInt(LC,false)+ex[iP],true) set ex[iP]=0 call Sg(LC) endif endif if(i>0)and UnitHasBuffBJ(LC,'B00B')then set i=i-1 call UnitRemoveAbility(LC,'B00B') elseif(yg>0)and UnitHasBuffBJ(LC,'B02I')then set i=i-1 set yg=yg-1 call UnitRemoveAbility(LC,'B02I') endif if(Wg>4)and UnitHasBuffBJ(LC,'BUsl')then call UnitRemoveAbility(LC,'BUsl') endif if(Wg>3)or(i3)or(i0 then set oG=oG+3 endif call CameraClearNoiseForPlayer(oP) if oG>10 then call Yg(oP,100.0,56.0,400.0,56.0) elseif oG>9 then call Yg(oP,100.0,28.0,400.0,28.0) elseif oG>8 then call Yg(oP,100.0,14.0,400.0,14.0) elseif oG>7 then call Yg(oP,100.0,7.0,400.0,7.0) elseif oG>6 then call Yg(oP,65.0,4.0,275.0,4.0) elseif oG>5 then call Yg(oP,50.0,3.0,190.0,3.0) elseif oG>4 then call Yg(oP,20.0,3.0,140.0,3.0) elseif oG>3 then call Yg(oP,0.0,0.0,140.0,2.0) endif endfunction function rG takes integer iP,integer aG returns nothing call StoreInteger(Ae,I2S(iP),"drugoverdose",aG) set aG=aG-bC(pv[iP*Nx+8],2) if aG>7 then set Ge[iP]=0.01+0.009*Do[iP*Co+5] elseif aG>6 then set Ge[iP]=0.10+0.015*Do[iP*Co+5] elseif aG>5 then set Ge[iP]=0.50+0.025*Do[iP*Co+5] elseif aG>4 then set Ge[iP]=0.90+0.005*Do[iP*Co+5] else set Ge[iP]=1.00 endif call xG(Player(iP)) endfunction function nG takes integer iP returns nothing local string aF=I2S(iP) local integer sg=GetStoredInteger(Ae,aF,"drugmentat")-1 local integer VG=GetStoredInteger(Ae,aF,"drugbuffout")-1 local integer EG=GetStoredInteger(Ae,aF,"drugspeed")-1 local integer XG=GetStoredInteger(Ae,aF,"drugresets") call StoreInteger(Ae,aF,"drugresets",XG+1) if pv[iP*Nx+7]>0 then if sg>-1 then call UnitRemoveAbility(X[iP],'A070'+sg) set yv[iP]=yv[iP]-0.10*(sg+1) endif if VG>-1 then call UnitRemoveAbility(X[iP],'A080'+VG) endif if EG>-1 then call UnitRemoveAbility(X[iP],'A07I'+EG) set pv[iP*Nx+7]=1 call SetUnitMoveSpeed(X[iP],Ld(iP,false)) endif else if sg>-1 then call UnitRemoveAbility(X[iP],'A06R'+sg) endif if VG>-1 then call UnitRemoveAbility(X[iP],'A07Q'+VG) endif if EG>-1 then call UnitRemoveAbility(X[iP],'A07A'+EG) endif endif call StoreInteger(Ae,aF,"drugmentat",0) call StoreInteger(Ae,aF,"drugbuffout",0) call StoreInteger(Ae,aF,"drugspeed",0) call rG(iP,0) endfunction function OG takes integer iP returns boolean return GetStoredInteger(Ae,I2S(iP),"drugoverdose")<8 endfunction function RG takes integer iP,integer Lc,string IG returns nothing local string aF=I2S(iP) local integer XG=GetStoredInteger(Ae,aF,"drugresets") local integer mc=GetStoredInteger(Ae,aF,IG) local integer AG local real BD=120.0 if Lc==1 then if pv[iP*Nx+7]>0 then set AG='A070' else set AG='A06R' endif elseif Lc==2 then if pv[iP*Nx+7]>0 then set AG='A080' else set AG='A07Q' endif elseif Lc==3 then if pv[iP*Nx+7]>0 then set AG='A07I' else set AG='A07A' endif else return endif call StoreInteger(Ae,aF,IG,mc+1) call rG(iP,GetStoredInteger(Ae,aF,"drugoverdose")+1) if mc>0 then call UnitRemoveAbility(X[iP],AG+mc-1) endif call UnitAddAbility(X[iP],AG+mc) if Lc==1 then call TriggerSleepAction(0.01) call Sg(X[iP]) endif if AG=='A080' then call wg(X[iP],2) set BD=BD-1.0 elseif AG=='A070' then set yv[iP]=yv[iP]+0.10 elseif AG=='A07I' then set pv[iP*Nx+7]=1+IMinBJ(50,20*(mc+1)) call SetUnitMoveSpeed(X[iP],Ld(iP,false)) endif call OC((BD*(1+pv[iP*Nx+8]))/(1+IMinBJ(1,pv[iP*Nx+7]))) if XG!=GetStoredInteger(Ae,aF,"drugresets")then return endif set mc=GetStoredInteger(Ae,aF,IG) call StoreInteger(Ae,aF,IG,mc-1) call rG(iP,GetStoredInteger(Ae,aF,"drugoverdose")-1) if mc>0 then call UnitRemoveAbility(X[iP],AG+mc-1) endif set mc=mc-1 if mc>0 then call UnitAddAbility(X[iP],AG+mc-1) endif if Lc==1 then call TriggerSleepAction(0.01) call Sg(X[iP]) endif if AG=='A070' then set yv[iP]=yv[iP]-0.10 elseif AG=='A07I' then set pv[iP*Nx+7]=1+IMinBJ(50,20*mc) call SetUnitMoveSpeed(X[iP],Ld(iP,false)) endif endfunction function NG takes item BG returns boolean local integer Mg=GetItemUserData(BG) local integer cG=ModuloInteger(bC(Mg,10),100) local integer lF=ModuloInteger(bC(Mg,1000),100) local integer CG=ModuloInteger(bC(Mg,100000),100) return(cG+lF+CG)>=Fo endfunction function dG takes item BG,real x,real y returns nothing local integer Mg=GetItemUserData(BG) local integer i set i=ModuloInteger(bC(Mg,100000),100) loop exitwhen i<1 call CreateItem('I01K',x,y) set i=i-1 endloop set i=ModuloInteger(bC(Mg,1000),100) loop exitwhen i<1 call CreateItem('I01L',x,y) set i=i-1 endloop set i=ModuloInteger(bC(Mg,10),100) loop exitwhen i<1 call CreateItem('I003',x,y) set i=i-1 endloop call SetItemUserData(BG,ModuloInteger(Mg,10)+Mg/10000000*10000000) endfunction function DG takes item BG,unit LC returns nothing call dG(BG,GetUnitX(LC),GetUnitY(LC)) endfunction function fG takes item BG,integer Hd returns nothing local integer Mg=GetItemUserData(BG) if Hd=='I01K' then set Mg=Mg+100000 elseif Hd=='I01L' then set Mg=Mg+1000 elseif Hd=='I003' then set Mg=Mg+10 endif call SetItemUserData(BG,Mg) endfunction function FG takes item BG,integer Hd,player oP,boolean xd returns boolean if(Hd=='I01K')or(Hd=='I01L')or(Hd=='I003')then if not NG(BG)then call fG(BG,Hd) return true endif if xd then call iC(oP,"Pouch is full.") endif return false endif if xd then call iC(oP,"Invalid item for pouch.") endif return false endfunction function gG takes item GG,item BG returns string local integer hG=GetItemUserData(GG) local integer HG=ModuloInteger(bC(hG,100000),100) local integer jG=ModuloInteger(bC(hG,1000),100) local integer JG=ModuloInteger(bC(hG,10),100) local integer kG=GetItemUserData(BG) local integer KG=ModuloInteger(bC(kG,100000),100) local integer lG=ModuloInteger(bC(kG,1000),100) local integer LG=ModuloInteger(bC(kG,10),100) if(HG+jG+JG)<1 then return"Target pouch is empty." endif loop exitwhen(KG+lG+LG)>=Fo exitwhen LG>5 exitwhen JG<1 set LG=LG+1 set JG=JG-1 endloop loop exitwhen(KG+lG+LG)>=Fo exitwhen jG<1 set lG=lG+1 set jG=jG-1 endloop loop exitwhen(KG+lG+LG)>=Fo exitwhen HG<1 set KG=KG+1 set HG=HG-1 endloop loop exitwhen(KG+lG+LG)>=Fo exitwhen JG<1 set LG=LG+1 set JG=JG-1 endloop call SetItemUserData(GG,ModuloInteger(hG,10)+hG/10000000*10000000+HG*100000+jG*1000+JG*10) call SetItemUserData(BG,ModuloInteger(kG,10)+kG/10000000*10000000+KG*100000+lG*1000+LG*10) if(HG+jG+JG)<1 then return"Added all drugs from target pouch." endif call dG(GG,GetItemX(GG),GetItemY(GG)) return"Pouch is full." endfunction function mG takes item BG,item Jd,player oP,boolean xd returns boolean local integer Hd=GetItemTypeId(Jd) if(Hd=='I01H')and(BG!=Jd)then if not NG(BG)then if xd then call iC(oP,gG(Jd,BG)) else call gG(Jd,BG) endif return true elseif xd then call iC(oP,"Pouch is full.") endif elseif FG(BG,Hd,oP,xd)then call RemoveItem(Jd) return true endif return false endfunction function MG takes unit pG returns item local integer i=0 local item BG loop exitwhen i>5 set BG=UnitItemInSlot(pG,i) if(BG!=null)and(GetItemTypeId(BG)=='I01H')then return BG endif set i=i+1 endloop return null endfunction function PG takes unit pG,item Jd,player oP returns boolean local item BG=MG(pG) if BG!=null then return mG(BG,Jd,oP,false) endif return false endfunction function qG takes player oP,integer iP,item Jd returns nothing if not PG(bx[iP],Jd,oP)then if uF(bx[iP])then if uF(X[iP])then call VC(oP) else call iC(oP,"(backpack is full)") call UnitAddItem(X[iP],Jd) endif else call UnitAddItem(bx[iP],Jd) endif endif endfunction function QG takes integer Hd,unit LC,integer iP returns boolean local item BG=Ie[iP] if uF(LC)then if BG==null then if pv[iP*Nx+13]>0 then set BG=MG(bx[iP]) if BG!=null then return FG(BG,Hd,Player(iP),true) endif endif call VC(Player(iP)) return false else return FG(BG,Hd,Player(iP),true) endif endif call UnitAddItemById(LC,Hd) return true endfunction function sG takes item BG,player oP returns nothing local integer Mg=GetItemUserData(BG) local integer cG=ModuloInteger(bC(Mg,10),100) local integer lF=ModuloInteger(bC(Mg,1000),100) local integer CG=ModuloInteger(bC(Mg,100000),100) local string SG="" local string tG="" local string TG="" if(ModuloInteger(Mg/10000000,3)/ 1)==2 then set SG="²´³" elseif(ModuloInteger(Mg/10000000,3)/ 1)==1 then set SG="¹´³" endif if(ModuloInteger(Mg/10000000,9)/ 3)==2 then set tG="²´³" elseif(ModuloInteger(Mg/10000000,9)/ 3)==1 then set tG="¹´³" endif if(ModuloInteger(Mg/10000000,27)/ 9)==2 then set TG="²´³" elseif(ModuloInteger(Mg/10000000,27)/ 9)==1 then set TG="¹´³" endif call iC(oP,"Pouch:|r |cFFD7BA3F"+I2S(CG)+TG+" Buffout|r |cFF9AE249"+I2S(lF)+tG+" Speed|r |cFFBB3FD4"+I2S(cG)+SG+" Mentats|r |cffc2c2c2("+I2S(CG+lF+cG)+"/"+I2S(Fo)+")") endfunction function uG takes item BG,integer Mg,integer UG,string IG,integer Lc,unit LC,player oP returns nothing if ModuloInteger(bC(Mg,UG),100)<1 then call iC(oP,"Pouch contains no "+IG+".") else call SetItemUserData(BG,Mg-UG) call CreateItem(Lc,GetUnitX(LC),GetUnitY(LC)) endif endfunction function wG takes item BG,integer WG,unit LC,player oP returns nothing local integer Mg=GetItemUserData(BG) local boolean yG=Do[GetPlayerId(oP)*Co+5]>0 if WG=='A06F' then if OG(GetPlayerId(oP))then if yG and((ModuloInteger(Mg/10000000,27)/9)>0)then call SetItemUserData(BG,Mg-90000000) call RG(GetPlayerId(oP),2,"drugbuffout") elseif ModuloInteger(bC(Mg,100000),100)>0 then if yG then call SetItemUserData(BG,Mg-100000+180000000) else call SetItemUserData(BG,Mg-100000) endif call RG(GetPlayerId(oP),2,"drugbuffout") else call iC(oP,"Pouch contains no Buffout.") endif else call iC(oP,"Cannot use until another drug wears off.") endif elseif WG=='A06C' then call uG(BG,Mg,100000,"Buffout",'I01K',LC,oP) elseif WG=='A06H' then if OG(GetPlayerId(oP))then if yG and((ModuloInteger(Mg/10000000,9)/3)>0)then call SetItemUserData(BG,Mg-30000000) call RG(GetPlayerId(oP),3,"drugspeed") elseif ModuloInteger(bC(Mg,1000),100)>0 then if yG then call SetItemUserData(BG,Mg-1000+60000000) else call SetItemUserData(BG,Mg-1000) endif call RG(GetPlayerId(oP),3,"drugspeed") else call iC(oP,"Pouch contains no Speed.") endif else call iC(oP,"Cannot use until another drug wears off.") endif elseif WG=='A06D' then call uG(BG,Mg,1000,"Speed",'I01L',LC,oP) elseif WG=='A06G' then if OG(GetPlayerId(oP))then if yG and((ModuloInteger(Mg/10000000,3)/1)>0)then call SetItemUserData(BG,Mg-10000000) call RG(GetPlayerId(oP),1,"drugmentat") elseif ModuloInteger(bC(Mg,10),100)>0 then if yG then call SetItemUserData(BG,Mg-10+20000000) else call SetItemUserData(BG,Mg-10) endif call RG(GetPlayerId(oP),1,"drugmentat") else call iC(oP,"Pouch contains no Mentats.") endif else call iC(oP,"Cannot use until another drug wears off.") endif elseif WG=='A06A' then call uG(BG,Mg,10,"Mentats",'I003',LC,oP) endif endfunction function YG takes integer Hd,location ud,integer Ud,integer wd returns nothing local real x=GetLocationX(ud) local real y=GetLocationY(ud) set wd=GetRandomInt(Ud,wd) loop exitwhen wd<1 call CreateItem(Hd,x+GetRandomInt(-85,85),y+GetRandomInt(-85,85)) set wd=wd-1 endloop endfunction function zG takes player oP,boolean ZG returns boolean local integer iP=GetPlayerId(oP) if(GetPlayerTechCount(oP,'Rhra',true)8 if(Q[i]>0)and IC(Player(i))then set tF=GetUnitLoc(X[i]) call PanCameraToTimedLocForPlayer(U,tF,1.00) call SetCameraFieldForPlayer(U,CAMERA_FIELD_ROTATION,BC(GetUnitFacing(X[i])-180),1) call SetCameraFieldForPlayer(U,CAMERA_FIELD_TARGET_DISTANCE,700.00,1) call SetCameraFieldForPlayer(U,CAMERA_FIELD_ANGLE_OF_ATTACK,315.00,1) call TransmissionFromUnitTypeWithNameBJ(Fx,Player(i),'O004'+ModuloInteger(i,2),"ELITE S.W.A.T.",tF,null,"|n"+GetPlayerName(Player(i))+"|n"+GetUnitName(X[i]),bj_TIMETYPE_SET,5.00,true) call RemoveLocation(tF) endif set i=i+1 endloop call ResetToGameCameraForPlayer(U,0) endfunction function ah takes unit nh returns nothing local location tF=GetUnitLoc(nh) call SetCameraQuickPositionLocForPlayer(U,tF) call RemoveLocation(tF) endfunction function Xh takes unit LC,real Oh returns nothing local location tF=GetUnitLoc(LC) call PanCameraToTimedLocForPlayer(U,tF,Oh) call SetCameraFieldForPlayer(U,CAMERA_FIELD_ROTATION,BC(GetUnitFacing(LC)-180),Oh) call SetCameraFieldForPlayer(U,CAMERA_FIELD_TARGET_DISTANCE,600.00,Oh) call SetCameraFieldForPlayer(U,CAMERA_FIELD_ANGLE_OF_ATTACK,330.00,Oh) call RemoveLocation(tF) endfunction function Rh takes unit Od,unit Ih,string hD returns nothing call UnitAddIndicatorBJ(Ih,100,0,100,0) call QuestMessageBJ(Fx,bj_QUESTMESSAGE_UNITACQUIRED,"|cffffff00"+GetUnitName(Ih)+"|r |cffffcc00"+hD+"|r") endfunction function Ah takes player oP,real LD,real mD,real MD,real BD,string Nh,real bh,real Bh returns nothing if BD==0 then set bh=Bh endif if oP==U then call SetCineFilterTexture(Nh) call SetCineFilterBlendMode(BLEND_MODE_BLEND) call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE) call SetCineFilterStartUV(0,0,1,1) call SetCineFilterEndUV(0,0,1,1) call SetCineFilterStartColor(PercentTo255(LD),PercentTo255(mD),PercentTo255(MD),PercentTo255(100-bh)) call SetCineFilterEndColor(PercentTo255(LD),PercentTo255(mD),PercentTo255(MD),PercentTo255(100-Bh)) call SetCineFilterDuration(BD) call DisplayCineFilter(true) endif endfunction function ch takes nothing returns nothing local timer Ch=GetExpiredTimer() local integer i=0 loop exitwhen i>8 exitwhen Ch==Sv[i*2] set i=i+1 endloop if i<9 then call DestroyTimer(Sv[i*2]) set Sv[i*2]=null call Ah(Player(i),tv[i*6],tv[i*6+1],tv[i*6+2],tv[i*6+5],Tv[i],tv[i*6+4],tv[i*6+3]) endif endfunction function dh takes nothing returns nothing local timer Ch=GetExpiredTimer() local integer i=0 loop exitwhen i>8 exitwhen Ch==Sv[i*2+1] set i=i+1 endloop if i<9 then call DestroyTimer(Sv[i*2+1]) set Sv[i*2+1]=null if Player(i)==U then call DisplayCineFilter(false) endif endif endfunction function Dh takes player oP,real fh,real Fh,real gh,string Nh,real LD,real mD,real MD,real Gh,real hh returns nothing local integer iP=GetPlayerId(oP) if(Gh>99.9)and(hh>=Gh)then return endif if(Sv[iP*2]!=null)then call DestroyTimer(Sv[iP*2]) set Sv[iP*2]=null endif if(Sv[iP*2+1]!=null)then call DestroyTimer(Sv[iP*2+1]) set Sv[iP*2+1]=null endif set tv[iP*6]=LD set tv[iP*6+1]=mD set tv[iP*6+2]=MD set tv[iP*6+3]=Gh set tv[iP*6+4]=hh set tv[iP*6+5]=gh set Tv[iP]=Nh call Ah(oP,LD,mD,MD,fh,Nh,Gh,hh) set Sv[iP*2]=CreateTimer() call TimerStart(Sv[iP*2],fh+Fh,false,function ch) set Sv[iP*2+1]=CreateTimer() call TimerStart(Sv[iP*2+1],fh+Fh+gh,false,function dh) endfunction function Hh takes player oP,real BD,real LD,real mD,real MD,real jh returns nothing call Dh(oP,BD*0.5,0,BD*0.5,"ReplaceableTextures\\CameraMasks\\White_mask.blp",LD,mD,MD,100,jh) endfunction function Jh takes nothing returns nothing local integer kh=Kv if kh>=5 then call SetTerrainFogExBJ(0,700,3600,100,10,50,0) call EnableWeatherEffect(Jv,true) elseif kh==4 then call SetTerrainFogExBJ(0,760,4200,75,10,50,0) call EnableWeatherEffect(Jv,true) elseif kh==3 then call SetTerrainFogExBJ(0,820,4800,50,10,50,0) call EnableWeatherEffect(Jv,true) elseif kh==2 then call SetTerrainFogExBJ(0,880,5400,30,10,50,0) call EnableWeatherEffect(Jv,true) elseif kh==1 then call SetTerrainFogExBJ(0,940,6000,15,10,50,0) call EnableWeatherEffect(Jv,true) elseif kh==0 then call SetTerrainFogExBJ(0,1000,6600,5,10,50,0) call EnableWeatherEffect(Jv,true) else call SetTerrainFogExBJ(0,1180,8400,1,10,50,0) call EnableWeatherEffect(Jv,false) endif endfunction function Kh takes nothing returns nothing local integer kh=Kv+1 if kh<1 then call UnitRemoveAbility(lv,'A056') call UnitRemoveAbility(lv,'A058') else if GetUnitAbilityLevel(lv,'A056')<1 then call UnitAddAbility(lv,'A056') call UnitAddAbility(lv,'A058') endif call SetUnitAbilityLevel(lv,'A056',kh) call SetUnitAbilityLevel(lv,'A058',kh) endif set kh=kh-2 if kh<1 then call UnitRemoveAbility(Lv,'A057') else if GetUnitAbilityLevel(Lv,'A057')<1 then call UnitAddAbility(Lv,'A057') endif call SetUnitAbilityLevel(Lv,'A057',kh) endif endfunction function lh takes nothing returns nothing local integer i=0 loop exitwhen i>7 if Dx[i]!=null then call RemoveUnit(Dx[i]) set Dx[i]=null endif set i=i+1 endloop set i=0 loop exitwhen i>3 exitwhen(i+2)>Kv set Dx[i*2]=CreateUnit(Player(10),'n00T'+i,0,0,0) set Dx[i*2+1]=CreateUnit(Player(11),'n00T'+i,0,0,0) set i=i+1 endloop endfunction function Lh takes nothing returns nothing local integer kh=kv local integer i=0 loop exitwhen i>8 call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_FOOD_USED,kh) set i=i+1 endloop endfunction function mh takes integer Mh returns nothing local integer i=0 set Be=0 loop exitwhen jo<=i if i5 then set Kv=5 endif endif if Kv!=qh then call Jh() call Kh() call lh() call TriggerExecute(jb) endif call Lh() endfunction function Qh takes nothing returns nothing local integer kh=0 local player p=Player(PLAYER_NEUTRAL_PASSIVE) loop exitwhen kh>32 call SetUnitUserData(qf('hfoo',p,zd(D[kh]),270),GetRandomInt(0,6)) set kh=kh+1 endloop set kv=kh call Ph() endfunction function sh takes nothing returns boolean if kv<130 then set kv=kv+1 return true endif return false endfunction function Sh takes unit th returns nothing call SetUnitVertexColor(th,160,160,0,255) call TriggerRegisterUnitEvent(lb,th,EVENT_UNIT_DEATH) endfunction function Th takes nothing returns boolean local location ud local integer i=GetRandomInt(0,999) if sh()then if i<25 then set ud=GetRandomLocInRect(Ln) elseif i<45 then set ud=GetRandomLocInRect(mn) elseif i<57 then set ud=GetRandomLocInRect(Mn) elseif i<68 then set ud=GetRandomLocInRect(pn) elseif i<77 then set ud=GetRandomLocInRect(Pn) elseif i<86 then set ud=GetRandomLocInRect(qn) elseif i<92 then set ud=GetRandomLocInRect(Qn) elseif i<97 then set ud=GetRandomLocInRect(sn) elseif i<99 then set ud=GetRandomLocInRect(Sn) elseif i<150 then set ud=GetRandomLocInRect(ln) elseif i<160 then set ud=GetRandomLocInRect(aE) elseif i<170 then set ud=GetRandomLocInRect(nE) elseif i<180 then set ud=GetRandomLocInRect(EE) elseif i<190 then set ud=GetRandomLocInRect(VE) else set ud=zd(D[GetRandomInt(0,H)]) endif if GetRandomInt(0,999)<(177*fe-10*fe*ix*ix)then call Sh(qf('hfoo',Player(PLAYER_NEUTRAL_PASSIVE),ud,270)) else call qf('hfoo',Player(PLAYER_NEUTRAL_PASSIVE),ud,270) endif return true endif return false endfunction function uh takes real x,real y,boolean Uh returns nothing local unit th local integer i=0 local integer wh local real Wh if(kv<2)or((kv<4)and(Nv[5]<3))or((kv<6)and(Nv[5]<1))then return endif if Uh then set i=1 endif if GetRandomInt(0,6*J*J*J-2*fe)<(3+i)then set wh=30*i+3*Ye set i=GetRandomInt(1+Mx,2+fe+2*i) loop exitwhen i<1 if sh()then set th=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'hfoo',x+GetRandomInt(-160,160),y+GetRandomInt(-160,160),GetRandomInt(0,359)) call SetUnitUserData(th,997) call UnitAddAbility(th,'Aloc') call UnitAddAbility(th,'A03D') set Wh=GetRandomInt(40+wh-jo,80+3*wh-3*jo) if fe>1 then set Wh=Wh+jo/ 2.0 endif call SetUnitState(th,UNIT_STATE_LIFE,Wh) set Wh=0.73*(RMinBJ(Wh,85)/85.0) call SetUnitScale(th,Wh,Wh,Wh) call SetUnitVertexColor(th,60,150,0,207) endif set i=i-1 endloop endif set th=null endfunction function yh takes nothing returns nothing local location ud=GetRectCenter(qv) local integer i=0 local player oP local integer Lc if te>0 then set Lc='o00D' else set Lc='o00V'+J-1 endif loop exitwhen i>8 set oP=Player(i) call Tf(Lc,oP,ud,0) set i=i+1 endloop call RemoveLocation(ud) endfunction function Yh takes player oP,unit LC,integer zh,string Zh returns nothing local unit vH=CreateUnit(oP,'o00J',GetUnitX(LC),GetUnitY(LC),0.00) call UnitAddAbility(vH,zh) call IssueTargetOrder(vH,Zh,LC) call TriggerSleepAction(0.01) call RemoveUnit(vH) set vH=null endfunction function eH takes player oP,unit LC,integer zh,string Zh,integer mc returns nothing local unit vH=CreateUnit(oP,'o00J',GetUnitX(LC),GetUnitY(LC),0.00) call UnitAddAbility(vH,zh) call SetUnitAbilityLevel(vH,zh,mc) call IssueTargetOrder(vH,Zh,LC) call TriggerSleepAction(0.01) call RemoveUnit(vH) set vH=null endfunction function xH takes unit Od returns item local item Jd local integer i=0 loop set Jd=UnitItemInSlot(Od,i) if(Jd!=null)and((GetItemTypeId(Jd)=='I01S')or(GetItemTypeId(Jd)=='I00B'))then return Jd endif set i=i+1 exitwhen i>5 endloop set i=GetPlayerId(GetOwningPlayer(Od)) if(GetUnitPointValue(Od)==3)and(pv[i*Nx+13]>0)then return xH(bx[i]) endif return null endfunction function oH takes nothing returns nothing local unit Od=GetTriggerUnit() local item Jd if GetUnitAbilityLevel(Od,'B030')>0 then call TriggerRegisterTimerEvent(Gi[GetPlayerId(GetOwningPlayer(Od))],0.1,false) endif if(GetStoredInteger(Ae,"unitmakingbattery",XC(Od))==0)and Xd(Od)then if not dg(GetPlayerId(GetOwningPlayer(Od)))then set Jd=xH(Od) if(Jd!=null)then call Fg(Od,Jd) else call Mf(Od) endif endif else call Mf(Od) endif set Od=null set Jd=null endfunction function rH takes nothing returns nothing call Mf(GetTriggerUnit()) endfunction function aH takes unit LC returns nothing local trigger o=CreateTrigger() call TriggerRegisterUnitManaEvent(o,LC,LESS_THAN,249.99) call TriggerAddAction(o,function oH) set o=CreateTrigger() call TriggerRegisterUnitManaEvent(o,LC,GREATER_THAN,250.99) call TriggerAddAction(o,function rH) set o=CreateTrigger() call TriggerRegisterUnitManaEvent(o,LC,LESS_THAN,899.00) call TriggerAddAction(o,function rH) set o=CreateTrigger() call TriggerRegisterUnitManaEvent(o,LC,GREATER_THAN,900.00) call TriggerAddAction(o,function rH) endfunction function nH takes unit Od,player oP,integer iP returns nothing local effect VH=AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodFootman.mdl",Od,"chest") local real EH=GetUnitState(Od,UNIT_STATE_LIFE) local integer VG=NC(GetHeroStr(Od,true)) local integer i=NC(GetHeroStr(Od,false)) local integer t local integer b set VG=i+bC(VG-i,4) call SetUnitState(Od,UNIT_STATE_LIFE,EH-RMinBJ(EH*0.08+0.01*fe,20.0+(100.0/VG)*2.0*fe)) set i=GetRandomInt((VG/4)*3,VG+(VG/8)) if i<33 then set i=5+fe elseif i<46 then set i=4+fe elseif i<60 then set i=3+fe elseif i<85 then set i=2+fe elseif i<120 then set i=1+fe elseif i<140 then set i=0+fe elseif i<170 then set i=IMaxBJ(fe-1,0) else set i=IMaxBJ(fe-2,0) endif if Ex[iP]>0 then if(Ex[iP]>20)then set i=0 elseif(Ex[iP]>10)and(i>0)then set i=1 endif set Ex[iP]=Ex[iP]+i call RC(0.5) call DestroyEffect(VH) return endif call TriggerSleepAction(0.5*Xx) call DestroyEffect(VH) if not Ed(iP)then return endif if Ex[iP]>0 then if(Ex[iP]>20)then set i=0 elseif(Ex[iP]>10)and(i>0)then set i=1 endif set Ex[iP]=Ex[iP]+i return endif set t=0 set b=0 set Ex[iP]=i if i>0 then loop call RC(3.5+b) exitwhen Ex[iP]<1 set i=i-Ex[iP] if i>=0 then set b=IMinBJ(b+i*3,3) set t=IMinBJ(5,t+1+i) else set b=0 set t=1 endif set VH=AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\HumanBloodFootman.mdl",Od,"chest") set EH=GetUnitState(Od,UNIT_STATE_LIFE) if EH>2 then call SetUnitState(Od,UNIT_STATE_LIFE,EH-RMinBJ(EH*(0.08+0.01*fe),20.0-(3-fe)*t+fe)) endif set i=IMaxBJ(Ex[iP]-1,0) set Ex[iP]=i call RC(0.5) call DestroyEffect(VH) exitwhen Ex[iP]<1 endloop endif if Ed(iP)then call UnitRemoveAbility(Od,'Blsh') endif endfunction function XH takes unit Od,unit OH returns boolean local effect KD if(OH==null)or(GetStoredInteger(Ae,I2S(GetPlayerId(GetOwningPlayer(Od))),"riotshield_equipped")<0)then return false endif if lC(Od,OH)then set KD=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl",Od,"origin") call TriggerSleepAction(Xx) call DestroyEffect(KD) return true endif return false endfunction function RH takes unit Od,player oP,integer iP,integer IH,unit OH returns boolean local unit vH if(pv[iP*Nx+2]==0)and(GetRandomInt(1-12*Ex[iP],219)12 then return 2*NH-12 else return NH endif endfunction function bH takes unit Od,player oP,integer iP,integer IH,unit OH returns boolean local unit vH local integer nD local boolean BH if GetRandomInt(0,119+68*pv[iP*Nx+2])3)and((GetUnitAbilityLevel(Od,'B003')>0)or(GetUnitAbilityLevel(Od,'B02H')>0)) if(fe>0)and BH then if pv[iP*Nx+2]==0 then call SetUnitAbilityLevel(vH,'A023',2) else call SetUnitAbilityLevel(vH,'A032',2) endif call lD("ANKLE",Od,255,255,0,true,7.5,0.8) else call lD("ankle",Od,255,255,0,true,8,0.8) endif call IssueTargetOrder(vH,"slow",Od) elseif nD==1 then call UnitAddAbility(vH,'A024') set BH=(C>3)and((GetUnitAbilityLevel(Od,'B00B')>0)or(GetUnitAbilityLevel(Od,'B02I')>0)) if(fe>0)and BH then call SetUnitAbilityLevel(vH,'A024',2) call lD("WRIST",Od,255,255,0,true,7.5,0.8) else call lD("wrist",Od,255,255,0,true,8,0.8) endif call IssueTargetOrder(vH,"curse",Od) else call UnitAddAbility(vH,'A025') set BH=(C>3)and((GetUnitAbilityLevel(Od,'B00C')>0)or(GetUnitAbilityLevel(Od,'B02J')>0)) if(fe>0)and BH then call SetUnitAbilityLevel(vH,'A025',2) call lD("HEAD",Od,255,255,0,true,7.5,0.8) else call lD("head",Od,255,255,0,true,8,0.8) endif call IssueTargetOrder(vH,"faeriefire",Od) set Wv[iP]=0.70 if ex[iP]==0 then if B[iP]==8 then set ex[iP]=bC(GetHeroInt(Od,false)-100-AH(Od),Yr[iP]) else set ex[iP]=bC(GetHeroInt(Od,false)-100,Yr[iP]) endif call SetHeroInt(Od,GetHeroInt(Od,false)-ex[iP],true) call Sg(Od) endif endif if oP==U then call CameraSetSourceNoiseEx(400,100000000,true) endif call PlaySoundOnUnitBJ(hE,100,Od) call Hh(oP,0.6,100,0,0,50) call KillSoundWhenDoneBJ(GetLastPlayedSound()) call RC(0.5) call xG(oP) call pf(Od) call RC(4) call RemoveUnit(vH) call OC(145.5) if nD==2 then if not UnitHasBuffBJ(Od,'B00C')and not UnitHasBuffBJ(Od,'B02J')then set Wv[iP]=1.0 if ex[iP]>0 then call SetHeroInt(Od,GetHeroInt(Od,false)+ex[iP],true) set ex[iP]=0 call Sg(Od) endif endif endif call pf(Od) endif return true endif return false endfunction function cH takes unit Od,integer IH,unit OH returns nothing local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) if not Ed(iP)or(uo[iP]>0)then return endif if GetRandomInt(0,1)==0 then if not bH(Od,oP,iP,IH,OH)then call RH(Od,oP,iP,IH,OH) endif else if not RH(Od,oP,iP,IH,OH)then call bH(Od,oP,iP,IH,OH) endif endif endfunction function CH takes unit Od returns nothing local real x=GetUnitX(Od) local real y=GetUnitY(Od) local lightning fx=null local effect KD=null local integer iP=0 if not Xd(Od)or((GetUnitState(Od,UNIT_STATE_MAX_LIFE)-GetUnitState(Od,UNIT_STATE_LIFE))<200.0)then return endif loop exitwhen iP>8 if ur[iP*4]!=null then if GetUnitState(ur[iP*4],UNIT_STATE_MANA)>=249.5 then if not HC(x,y,GetUnitX(ur[iP*4]),GetUnitY(ur[iP*4]),630)then set fx=AddLightning("LEAS",true,GetUnitX(ur[iP*4]),GetUnitY(ur[iP*4]),x,y) set KD=AddSpecialEffectTarget("Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl",Od,"origin") call SetUnitState(Od,UNIT_STATE_LIFE,GetUnitState(Od,UNIT_STATE_LIFE)+200) call SetUnitState(ur[iP*4],UNIT_STATE_MANA,GetUnitState(ur[iP*4],UNIT_STATE_MANA)-250) set iP=8 endif endif endif set iP=iP+1 endloop if fx!=null then call TriggerSleepAction(0.1) call DestroyLightning(fx) call DestroyEffect(KD) set fx=null endif endfunction function dH takes nothing returns nothing local unit Od=GetTriggerUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) if Ce[iP]then set Od=null return endif if ge[iP]==null then set ge[iP]=AddSpecialEffectTarget("Objects\\Spawnmodels\\Other\\HumanBloodCinematicEffect\\HumanBloodCinematicEffect.mdl",Od,"chest") if pv[iP*Nx+2]>0 then call UnitAddAbility(Od,'A0CT'+IMinBJ(bC(GetHeroStr(Od,false)-60,25),2)) endif if Do[iP*Co+3]>0 then call UnitAddAbility(Od,'A0HB') endif endif call Lf(Od) if GetUnitAbilityLevel(Od,'B02L')>0 then call TriggerSleepAction(0.1) call CH(Od) endif set Od=null endfunction function DH takes nothing returns nothing local unit Od=GetTriggerUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) if ge[iP]!=null then call DestroyEffect(ge[iP]) set ge[iP]=null if pv[iP*Nx+2]>0 then call UnitRemoveAbility(Od,'A0CT') call UnitRemoveAbility(Od,'A0CU') call UnitRemoveAbility(Od,'A0CV') endif if Do[iP*Co+3]>0 then call UnitRemoveAbility(Od,'A0HB') endif endif call Lf(Od) endfunction function fH takes nothing returns nothing call Lf(GetTriggerUnit()) endfunction function FH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[0],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[0]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[0],NC(gH*gH),OH) endfunction function GH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[1],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[1]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[1],NC(gH*gH),OH) endfunction function hH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[2],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[2]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[2],NC(gH*gH),OH) endfunction function HH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[3],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[3]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[3],NC(gH*gH),OH) endfunction function jH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[4],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[4]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[4],NC(gH*gH),OH) endfunction function JH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[5],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[5]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[5],NC(gH*gH),OH) endfunction function kH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[6],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[6]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[6],NC(gH*gH),OH) endfunction function KH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[7],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[7]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[7],NC(gH*gH),OH) endfunction function lH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif elseif GetUnitAbilityLevel(X[8],'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif if ge[8]!=null then set gH=(gH*3.0)/ 85.0+he else set gH=gH/ 85.0+he endif call cH(X[8],NC(gH*gH),OH) endfunction function LH takes unit mH,unit OH returns nothing local unit vH=qf('o00J',GetOwningPlayer(mH),GetUnitLoc(mH),0) call UnitAddAbility(vH,'A0KJ') if(fe>0)and(UnitHasBuffBJ(mH,'B02G')or((GetPlayerId(GetOwningPlayer(OH))>9)and IsUnitType(OH,UNIT_TYPE_HERO)and not IsUnitType(OH,UNIT_TYPE_ANCIENT)))then call SetUnitAbilityLevel(vH,'A0KJ',2) call lD("SERVO",mH,255,255,0,true,7.5,0.8) else call lD("servo",mH,255,255,0,true,8,0.8) endif call IssueTargetOrder(vH,"slow",mH) call TriggerSleepAction(0.1) call RemoveUnit(vH) endfunction function MH takes nothing returns nothing local real gH=GetEventDamage()*9.9 local unit OH local unit mH if gH<45.1 then return endif set OH=GetEventDamageSource() if OH==null then set gH=gH*0.10101 if gH<45.1 then return endif set mH=GetTriggerUnit() else set mH=GetTriggerUnit() if GetUnitAbilityLevel(mH,'BNms')<1 then set gH=gH*0.10101 if gH<45.1 then return endif endif endif set gH=gH/ 85.0+he if GetRandomInt(0,125+6*C)-1 then call UnitRemoveAbility(QH,'AId4') call StoreInteger(Ae,I2S(sH),"riotshield_protecting",-1) call iC(Player(sH),"|r|cffff8000NOTE|r |cffffcc00Riot Shield is no longer protecting ally.") call StoreInteger(Ae,I2S(iP),"riotshield_cadet",-1) endif if IsUnitType(QH,UNIT_TYPE_ANCIENT)then call UnitRemoveType(QH,UNIT_TYPE_ANCIENT) endif call DestroyTrigger(jD) endfunction function SH takes unit QH returns nothing local trigger jD=CreateTrigger() call TriggerAddAction(jD,function qH) call TriggerRegisterUnitEvent(jD,QH,EVENT_UNIT_DEATH) endfunction function tH takes player oP,integer iP,location ud,real TH,real EH,integer mc returns nothing local integer Lc local integer j if mc<1 then set Yv[iP]=CreateUnitAtLoc(oP,'O00E',ud,TH) else call ReviveHeroLoc(Yv[iP],ud,false) if GetStoredInteger(Ae,"radresistlevel",XC(Yv[iP]))>0 then call UnitAddType(Yv[iP],UNIT_TYPE_ANCIENT) endif endif call RemoveLocation(ud) set se[iP]=CreateTrigger() call TriggerRegisterUnitEvent(se[iP],Yv[iP],EVENT_UNIT_HERO_REVIVABLE) call TriggerAddAction(se[iP],function PH) call SH(Yv[iP]) call SetUnitState(Yv[iP],UNIT_STATE_LIFE,EH) if mc<1 then if mc<-1 then call SetHeroLevel(Yv[iP],-1*mc,true) endif call SuspendHeroXP(Yv[iP],true) call TriggerRegisterUnitEvent(yI,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(YI,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(zI,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call UnitModifySkillPoints(Yv[iP],1+bC(Fd(iP)+2,3)) call SelectHeroSkill(Yv[iP],'A07Z') if ee[iP+9]==null then set ee[iP+9]=CreateUnit(oP,'n00M',GetUnitX(Yv[iP]),GetUnitY(Yv[iP]),0) endif call SetHeroStr(Yv[iP],20,true) call SetHeroAgi(Yv[iP],10,true) call SetHeroInt(Yv[iP],100,true) set Lc=GetRandomInt(0,2) if Lc==0 then call SetHeroStr(Yv[iP],GetHeroStr(Yv[iP],false)+60,true) elseif Lc==1 then call SetHeroAgi(Yv[iP],GetHeroAgi(Yv[iP],false)+8,true) else call SetHeroInt(Yv[iP],GetHeroInt(Yv[iP],false)+10,true) call SetUnitMoveSpeed(Yv[iP],300) endif else call SuspendHeroXP(Yv[iP],true) endif call IssueImmediateOrder(Yv[iP],"manashieldon") endfunction function uH takes unit LC,integer iP returns boolean if IsUnitType(LC,UNIT_TYPE_HERO)then if(pv[iP*Nx+9]>0)and(GetUnitPointValue(LC)==3)then return true endif elseif GetUnitAbilityLevel(LC,'A09P')>0 then return true endif return false endfunction function UH takes integer iP returns nothing local integer wH=ai[iP] local integer WH=Pv[iP*3+2] if B[iP]==2 then if(Yv[iP]!=null)and(GetUnitTypeId(Yv[iP])=='n005')and(GetUnitAbilityLevel(Yv[iP],'Aloc')>0)then call UnitRemoveAbility(Yv[iP],'Awan') call IssueTargetOrder(Yv[iP],"smart",X[iP]) endif endif if GetStoredInteger(Ae,"radresistlevel",XC(X[iP]))>0 then if not uH(X[iP],iP)then call UnitAddType(X[iP],UNIT_TYPE_ANCIENT) endif endif if WH==0 then if wH<12 then return endif elseif WH==1 then if wH<10 then return endif elseif wH<6 then return endif call IssueImmediateOrder(X[iP],"manashieldon") call IssueImmediateOrder(X[iP],"stop") endfunction function yH takes integer iP returns nothing local location ud=GetUnitLoc(hx[iP]) local real f=GetUnitFacing(hx[iP]) local real n=GetUnitState(hx[iP],UNIT_STATE_LIFE) call RemoveUnit(ee[iP]) set ee[iP]=null call RemoveUnit(hx[iP]) set hx[iP]=null call DestroyFogModifier(bi[iP]) call tH(Player(iP),iP,ud,f,n,GetHeroLevel(Yv[iP])) endfunction function YH takes integer i returns boolean local location ud set A[i]=true call DestroyFogModifier(Vv[i]) if GetPlayerSlotState(Player(i))!=PLAYER_SLOT_STATE_LEFT then set ud=GetUnitLoc(I[i]) call RemoveUnit(I[i]) set I[i]=null call TriggerSleepAction(0.01) call ReviveHeroLoc(X[i],ud,false) set Ce[i]=false if(B[i]==4)and(GetUnitAbilityLevel(X[i],'A04G'+Fv[i])<1)then call UnitAddAbility(X[i],'A04G'+Fv[i]) else if(B[i]!=4)and(Do[i*Co+8]>0)and(GetUnitAbilityLevel(X[i],'A0MS')<1)then call UnitAddAbility(X[i],'A0MS') endif if B[i]==5 then call UnitRemoveAbility(X[i],'A0JU') call UnitRemoveAbility(X[i],'A0JV') call SetUnitAbilityLevel(X[i],'A01B',3) call SetUnitAbilityLevel(X[i],'A0JT',1) call UnitRemoveAbility(X[i],'Boar') elseif B[i]==11 then call SetUnitAbilityLevel(X[i],'A0CN',9) call SetPlayerAbilityAvailable(Player(i),'A0CN',true) endif endif if Mr[i]>0 then set mx[i]=mx[i]-2*Mr[i] set Mr[i]=0 if mx[i]>0 then call UnitAddAbility(X[i],V[mx[i]-1]) endif endif set Dv[i]=1.00-RMinBJ(0.04*RMaxBJ(io[i],0),0.25) call RemoveLocation(ud) call UH(i) call lf(X[i]) return true endif call ExplodeUnitBJ(I[i]) return false endfunction function zH takes integer ZH returns boolean local integer i=0 local boolean vj=false loop exitwhen i>8 if i!=ZH then if not A[i]and(ax[i]==ZH)and YH(i)then set vj=true endif endif set i=i+1 endloop return vj endfunction function ej takes integer xj returns boolean local integer i=0 local boolean vj=false local location ud loop exitwhen i>8 if not A[i]then if(Fd(i)==0)and(GetHeroLevel(X[i])<=xj)then if YH(i)then set vj=true endif endif endif set i=i+1 endloop return vj endfunction function oj takes unit Od,integer iP returns nothing local integer NH if(io[iP]>0)and(mo<1)then if Do[iP*Co+1]<1 then set NH=GetUnitAbilityLevel(Od,'A03H') if NH==7 then call SetUnitAbilityLevel(Od,'A03H',1) elseif(fe>0)and(NH<6)and(ix>1)then if(ix>2)or(NH<3)then call SetUnitAbilityLevel(Od,'A03H',NH+1) endif endif endif endif endfunction function rj takes player ij,integer aj returns boolean local integer i=0 local location ud local unit vH local boolean nj=false loop exitwhen i>8 if not A[i]then set nj=true if GetUnitState(I[i],UNIT_STATE_LIFE)>99 then set A[i]=true call DestroyFogModifier(Vv[i]) if GetPlayerSlotState(Player(i))!=PLAYER_SLOT_STATE_LEFT then set ud=GetUnitLoc(I[i]) call RemoveUnit(I[i]) set I[i]=null call TriggerSleepAction(0.01) call ReviveHeroLoc(X[i],ud,false) set Ce[i]=false if(B[i]==4)and(GetUnitAbilityLevel(X[i],'A04G'+Fv[i])<1)then call UnitAddAbility(X[i],'A04G'+Fv[i]) else if(B[i]!=4)and(Do[i*Co+8]>0)and(GetUnitAbilityLevel(X[i],'A0MS')<1)then call UnitAddAbility(X[i],'A0MS') endif if B[i]==5 then call UnitRemoveAbility(X[i],'A0JU') call UnitRemoveAbility(X[i],'A0JV') call SetUnitAbilityLevel(X[i],'A01B',3) call SetUnitAbilityLevel(X[i],'A0JT',1) call UnitRemoveAbility(X[i],'Boar') elseif B[i]==11 then call SetUnitAbilityLevel(X[i],'A0CN',9) call SetPlayerAbilityAvailable(Player(i),'A0CN',true) endif endif if Mr[i]>0 then set mx[i]=mx[i]-2*Mr[i] set Mr[i]=0 if mx[i]>0 then call UnitAddAbility(X[i],V[mx[i]-1]) endif endif call oj(X[i],i) set Dv[i]=0.25-RMinBJ(0.04*RMaxBJ(io[i],0),0.25) call RemoveLocation(ud) call UH(i) set vH=CreateUnit(ij,'o00J',GetUnitX(X[i]),GetUnitY(X[i]),0) call UnitAddAbility(vH,'A027') call SetUnitAbilityLevel(vH,'A027',Pv[i*3+2]+1) call SetUnitState(X[i],UNIT_STATE_MANA,wi[Pv[i*3+2]+Xi[i]]) call IssueTargetOrder(vH,"cripple",X[i]) call RC(2) call lf(X[i]) call RC(2) call RemoveUnit(vH) call OC(wi[Pv[i*3+2]+5]) if GetUnitAbilityLevel(X[i],'Bprg')<1 then set Dv[i]=1.00-RMinBJ(0.04*RMaxBJ(io[i],0),0.25) call pf(X[i]) endif else call ExplodeUnitBJ(I[i]) endif return true endif endif if hx[i]!=null then set nj=true if GetUnitState(hx[i],UNIT_STATE_LIFE)>1 then call yH(i) return true endif endif set i=i+1 endloop return not nj endfunction function Vj takes player ij,integer aj returns nothing if not rj(ij,aj)then call TriggerSleepAction(0.25) if not rj(ij,aj)then call TriggerSleepAction(1.00) if not rj(ij,aj)then call TriggerSleepAction(5.00) call rj(ij,aj) endif endif endif endfunction function Ej takes unit Xj returns nothing local player oP=GetOwningPlayer(Xj) local integer iP=GetPlayerId(oP) local location ud local unit vH if not A[iP]then set A[iP]=true call DestroyFogModifier(Vv[iP]) set ud=GetUnitLoc(I[iP]) call RemoveUnit(I[iP]) set I[iP]=null call TriggerSleepAction(0.01) call ReviveHeroLoc(X[iP],ud,false) set Ce[iP]=false if(B[iP]==4)and(GetUnitAbilityLevel(X[iP],'A04G'+Fv[iP])<1)then call UnitAddAbility(X[iP],'A04G'+Fv[iP]) else if(B[iP]!=4)and(Do[iP*Co+8]>0)and(GetUnitAbilityLevel(X[iP],'A0MS')<1)then call UnitAddAbility(X[iP],'A0MS') endif if B[iP]==5 then call UnitRemoveAbility(X[iP],'A0JU') call UnitRemoveAbility(X[iP],'A0JV') call SetUnitAbilityLevel(X[iP],'A01B',3) call SetUnitAbilityLevel(X[iP],'A0JT',1) call UnitRemoveAbility(X[iP],'Boar') elseif B[iP]==11 then call SetUnitAbilityLevel(X[iP],'A0CN',9) call SetPlayerAbilityAvailable(Player(iP),'A0CN',true) endif endif if Mr[iP]>0 then set mx[iP]=mx[iP]-2*Mr[iP] set Mr[iP]=0 if mx[iP]>0 then call UnitAddAbility(X[iP],V[mx[iP]-1]) endif endif call oj(X[iP],iP) set Dv[iP]=0.25-RMinBJ(0.04*RMaxBJ(io[iP],0),0.25) call RemoveLocation(ud) call UH(iP) set vH=CreateUnit(oP,'o00J',GetUnitX(X[iP]),GetUnitY(X[iP]),0) call UnitAddAbility(vH,'A027') call SetUnitAbilityLevel(vH,'A027',Pv[iP*3+2]+1) call SetUnitState(X[iP],UNIT_STATE_MANA,wi[Pv[iP*3+2]+Xi[iP]]) call IssueTargetOrder(vH,"cripple",X[iP]) call RC(2) call lf(X[iP]) call RC(2) call RemoveUnit(vH) call OC(wi[Pv[iP*3+2]+5]) if not UnitHasBuffBJ(X[iP],'Bprg')then set Dv[iP]=1.00-RMinBJ(0.04*RMaxBJ(io[iP],0),0.25) call pf(X[iP]) endif else call TriggerSleepAction(0.5) if Ce[iP]then set A[iP]=false endif endif endfunction function Oj takes unit LC,location ud,integer Rj returns nothing local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) set A[iP]=false set I[iP]=CreateCorpse(oP,'n003',GetLocationX(ud),GetLocationY(ud),BC(GetUnitFacing(LC)+Rj)) call SetUnitBlendTime(I[iP],0) call SetUnitAnimation(I[iP],"decay bone") call GroupAddUnit(bj_suspendDecayBoneGroup,I[iP]) call TimerStart(bj_delayedSuspendDecayTimer,0.05,false,null) set Vv[iP]=CreateFogModifierRadiusLoc(oP,FOG_OF_WAR_VISIBLE,ud,128.00,true,false) call FogModifierStart(Vv[iP]) call lf(LC) endfunction function Ij takes nothing returns nothing local unit LC=GetEnumUnit() local integer Aj=GetUnitPointValue(LC) local unit VF local player Nj local string XF if(Aj==3)or(Aj==4)or(Aj==8)then if GetUnitTypeId(LC)!='O00M' then call KillUnit(LC) endif elseif(Aj<3)or(Aj==5)or(Aj==7)then if GetUnitAbilityLevel(LC,'Aloc')>0 then call UnitAddAbility(LC,'Awan') else set Nj=zC(GetOwningPlayer(LC)) if Nj!=null then call SetUnitOwner(LC,Nj,false) if(Aj==5)and IsUnitType(LC,UNIT_TYPE_HERO)then set XF=GetStoredString(Ae,"droidremote_ladlink",XC(LC)) if XF!="" then set VF=EF(XF) if VF!=null then call SetUnitOwner(VF,Nj,false) endif endif endif endif endif endif endfunction function bj takes integer iP returns nothing local effect array KD local integer i=0 loop exitwhen i>3 if ur[iP*4+i]!=null then set KD[i]=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(ur[iP*4+i]),GetUnitY(ur[iP*4+i])) if Wr[iP*4+i]<0 then set Wr[iP*4+i]=0 else set Wr[iP*4+i]=GetUnitState(ur[iP*4+i],UNIT_STATE_MANA) endif call RemoveUnit(ur[iP*4+i]) set ur[iP*4+i]=null else set KD[i]=null endif set i=i+1 endloop call TriggerSleepAction(Xx) set i=0 loop exitwhen i>3 if KD[i]!=null then call DestroyEffect(KD[i]) set KD[i]=null endif set i=i+1 endloop endfunction function Bj takes nothing returns nothing local trigger jD=GetTriggeringTrigger() call bj(GetStoredInteger(Ae,"postdismissreturners_player",XC(jD))) call FlushStoredInteger(Ae,"postdismissreturners_player",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function cj takes integer iP returns nothing local trigger jD=CreateTrigger() call StoreInteger(Ae,"postdismissreturners_player",XC(jD),iP) call TriggerAddAction(jD,function Bj) call TriggerRegisterTimerEvent(jD,0.1,false) endfunction function Cj takes player oP,string s returns nothing local integer iP=GetPlayerId(oP) local integer ed local integer rd local integer i local item Jd local location tF=GetUnitLoc(X[iP]) local group g local location ud if(iP==Xv)then set Xv=11 endif set i=0 loop exitwhen i>8 if yr[i]==iP then set yr[i]=-1 endif set i=i+1 endloop if(J>1)and zH(iP)then call aC("Victimized players have been revived.") endif if IC(oP)then set C=C-1 set fo[iP]=0 else set sv=sv-1 endif call wC() set g=fc(oP) call ForGroup(g,function Ij) call DestroyGroup(g) if B[iP]==11 then call cj(iP) endif if pv[iP*Nx+13]>0 then call UnitRemoveItemFromSlot(bx[iP],0) call UnitRemoveItemFromSlot(bx[iP],1) call UnitRemoveItemFromSlot(bx[iP],2) call UnitRemoveItemFromSlot(bx[iP],3) call UnitRemoveItemFromSlot(bx[iP],4) call UnitRemoveItemFromSlot(bx[iP],5) call RemoveUnit(bx[iP]) endif set ud=Td(GetRectCenter(vE),40,350) set i=0 loop set Jd=UnitRemoveItemFromSlot(Px[iP],i) if Jd!=null then call SetItemPositionLoc(Jd,ud) endif set i=i+1 exitwhen i>5 endloop set i=0 loop if GetUnitAbilityLevel(Px[iP],'A0EA'+i)>1 then call CreateItem('I02M'+i,GetLocationX(ud),GetLocationY(ud)) endif set i=i+1 exitwhen i>2 endloop call RemoveLocation(ud) call RemoveUnit(Px[iP]) call RemoveUnit(Px[iP+9]) set Px[iP]=null if not A[iP]then set A[iP]=true call DestroyFogModifier(Vv[iP]) call SetUnitInvulnerable(I[iP],true) endif set X[iP]=null set Q[iP]=0 set Q[iP+13]=0 set uv[iP]=0 if Ko[iP]>0 then set Ko[iP]=0 set Ko[9]=Ko[10] set i=0 loop exitwhen i>8 if Ko[i]>0 then set Ko[i]=Ko[9] if Ko[9]>3 then set Ko[9]=Ko[9]-3 endif endif set i=i+1 endloop endif if(Cx[iP]>0)and(Cx[9]<10)then set Cx[iP]=0 set Cx[9]=Cx[9]-1 endif set ed=GetPlayerState(oP,PLAYER_STATE_RESOURCE_GOLD) set rd=GetPlayerState(oP,PLAYER_STATE_RESOURCE_LUMBER) call Dd() if pv[iP*Nx+9]>0 then set jo=IMaxBJ(0,jo-1) call mh(pv[iP*Nx+9]) call Ph() set Ai[0]=Ai[0]-1 endif if Do[iP*Co+6]>0 then set ho=ho-1 endif if pv[iP*Nx+14]>0 then set Kr=Kr-1 endif call kf(Pe[iP],0,0,false,false) call RC(3.0) call aC(s) call vd(ed,true) call od(rd,true) call PostTriggerExecuteBJ(jX,true) if vr!=null then call SetUnitAbilityLevel(vr,'A0J7',IMaxBJ(1,GetUnitAbilityLevel(vr,'A0J7')-1)) endif if J>1 then call SetUnitVertexColor(qf('n00Y',Player(PLAYER_NEUTRAL_PASSIVE),tF,0),255,255,255,90) else call RemoveLocation(tF) endif if(fe>0)and(mo<1)then if C>6 then set hr=7 elseif C>3 then set hr=6 elseif C>2 then set hr=5 elseif C>1 then set hr=4 else set hr=2 endif endif if(not oi)and(C==1)and(fe>1)then set fe=1 call aC("|r|cffff8000WARNING|r |cffffcc00You cannot continue Extinction with only one player.") call RC(6) set i=0 loop exitwhen i>8 if Ed(i)then call KillUnit(X[i]) endif endloop endif endfunction function dj takes integer iP,player oP returns nothing local trigger jD local integer i=0 call ModifyHeroSkillPoints(X[iP],bj_MODIFYMETHOD_ADD,ie) loop exitwhen i==ie call SelectHeroSkill(X[iP],'A000') set i=i+1 endloop call SetPlayerAbilityAvailable(oP,'A0BE',false) call SetPlayerAbilityAvailable(oP,'A0HA',false) call SetPlayerAbilityAvailable(oP,'A0CL',false) call SetPlayerAbilityAvailable(oP,'A0P4',false) call SetPlayerAbilityAvailable(oP,'A0ED',false) call SetPlayerAbilityAvailable(oP,'A0JL',false) set ex[iP]=0 set nx[iP]=0 set Rx[iP*3]=null set Rx[iP*3+1]=null set Rx[iP*3+2]=null set Ix[iP*3]=null set Ix[iP*3+1]=null set Ix[iP*3+2]=null set i=0 loop exitwhen i>8 set Ax[iP*9+i]=0 set i=i+1 endloop if(GetUnitTypeId(X[iP])=='O005')then set B[iP]=4 set Ir[iP]=1.0 call SetPlayerAbilityAvailable(oP,'A01U',false) call SetPlayerAbilityAvailable(oP,'A0KC',false) call SetPlayerAbilityAvailable(oP,'A00J',true) call SetPlayerTechResearchedSwap('Rhse',1,oP) call TriggerRegisterUnitEvent(mI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(pI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(qI,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(MI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(QI,X[iP],EVENT_UNIT_PICKUP_ITEM) call TriggerRegisterUnitEvent(sI,X[iP],EVENT_UNIT_DROP_ITEM) elseif(GetUnitTypeId(X[iP])=='O000')then set B[iP]=1 call SetPlayerTechResearched(oP,'Rhfc',1) call SetPlayerTechResearched(oP,'R000',1) call TriggerRegisterUnitEvent(SI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(fR,X[iP],EVENT_UNIT_HERO_LEVEL) call TriggerRegisterUnitEvent(TI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(uI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(tI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(rI,X[iP],EVENT_UNIT_SUMMON) elseif(GetUnitTypeId(X[iP])=='O002')then set B[iP]=2 call SetPlayerTechResearchedSwap('Rhan',1,oP) call TriggerRegisterUnitEvent(CR,X[iP],EVENT_UNIT_HERO_LEVEL) call TriggerRegisterUnitEvent(wI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(WI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(ZI,X[iP],EVENT_UNIT_SPELL_EFFECT) call UnitAddAbilityBJ('A020',X[iP]) if xe==0 then call UnitAddAbility(X[iP],'A04N') call UnitAddAbility(X[iP],'A021') set xe=1 elseif xe==1 then call UnitAddAbility(X[iP],'A04O') call UnitAddAbility(X[iP],'A05J') set xe=2 else call UnitAddAbility(X[iP],'A04P') call UnitAddAbility(X[iP],'A04Z') set xe=0 endif set Pi[iP]=0 elseif(GetUnitTypeId(X[iP])=='O004')then set B[iP]=7 set pi[iP]=0 call SetPlayerAbilityAvailable(oP,'A0P1',false) call TriggerRegisterPlayerUnitEventSimple(UR,oP,EVENT_PLAYER_UNIT_DEATH) call TriggerRegisterPlayerUnitEventSimple(wR,oP,EVENT_PLAYER_UNIT_SUMMON) call TriggerRegisterUnitEvent(cA,X[iP],EVENT_UNIT_SPELL_CHANNEL) call TriggerRegisterUnitEvent(CA,X[iP],EVENT_UNIT_SPELL_ENDCAST) call TriggerRegisterUnitEvent(dA,X[iP],EVENT_UNIT_SPELL_CHANNEL) call TriggerRegisterUnitEvent(DA,X[iP],EVENT_UNIT_SPELL_ENDCAST) call TriggerRegisterUnitEvent(bA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(BA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(fA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(gA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(GA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(RA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitManaEvent(NA,X[iP],LESS_THAN,996.99) call TriggerRegisterUnitManaEvent(NA,X[iP],GREATER_THAN,998.99) call TriggerRegisterPlayerUnitEvent(hA,oP,EVENT_PLAYER_UNIT_ISSUED_ORDER,null) set qo[iP*5]=null set qo[iP*5+1]=null set qo[iP*5+2]=null set qo[iP*5+3]=null set qo[iP*5+4]=null set Yv[iP]=qf('o016',oP,GetUnitLoc(X[iP]),0) call UnitAddAbility(Yv[iP],'A0CB') call UnitAddAbility(Yv[iP],'A0CC') call UnitAddAbility(Yv[iP],'A0CD') call UnitAddAbility(Yv[iP],'A0CE') call TriggerRegisterUnitEvent(IA,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerEventEndCinematic(AA,oP) set Gx[iP*5]=0 set Gx[iP*5+1]=0 set Gx[iP*5+2]=0 set Gx[iP*5+3]=0 set Gx[iP*5+4]=0 call SetPlayerAbilityAvailableBJ(false,'A0C0',oP) call SetPlayerAbilityAvailableBJ(false,'A0C2',oP) call SetPlayerAbilityAvailableBJ(false,'A0C3',oP) call SetPlayerAbilityAvailableBJ(false,'A0C4',oP) call SetPlayerAbilityAvailableBJ(false,'A0C5',oP) call SetPlayerAbilityAvailableBJ(false,'A0C6',oP) set go[iP]=true call SetPlayerAbilityAvailable(oP,'A08A',false) call SetPlayerAbilityAvailable(oP,'A03F',false) call SetPlayerAbilityAvailable(oP,'A08Q',false) call UnitAddAbility(X[iP],'A08Q') elseif(GetUnitTypeId(X[iP])=='O003')then set B[iP]=6 call TriggerRegisterUnitEvent(mA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(pA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(PA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(MA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(LA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(HA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(qA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerUnitEventSimple(jA,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerUnitEventSimple(KA,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerUnitEventSimple(JA,oP,EVENT_PLAYER_UNIT_ISSUED_ORDER) call TriggerRegisterPlayerUnitEventSimple(kA,oP,EVENT_PLAYER_UNIT_ISSUED_ORDER) call TriggerRegisterPlayerUnitEventSimple(lA,oP,EVENT_PLAYER_UNIT_SUMMON) set kr[iP]=qf('n017',oP,GetUnitLoc(X[iP]),0) elseif(GetUnitTypeId(X[iP])=='O00U')then set B[iP]=10 call TriggerRegisterUnitEvent(QA,X[iP],EVENT_UNIT_HERO_SKILL) call TriggerRegisterUnitEvent(sA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(tA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(uA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(UA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(TA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(wA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(SA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(dR,X[iP],EVENT_UNIT_HERO_LEVEL) call StoreInteger(Ae,"borgforcefieldturnoffdone",I2S(iP),0) set vx[iP]=0.42 set wo[iP]=wo[iP]+1 elseif(GetUnitTypeId(X[iP])=='O014')then set B[iP]=8 call SetPlayerTechResearched(oP,'R01W',1) call TriggerRegisterUnitEvent(AR,X[iP],EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(eA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(rA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(aA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(nA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(FR,X[iP],EVENT_UNIT_HERO_LEVEL) elseif(GetUnitTypeId(X[iP])=='O018')then set B[iP]=5 call TriggerRegisterUnitEvent(DR,X[iP],EVENT_UNIT_HERO_LEVEL) call TriggerRegisterUnitEvent(YA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(WA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(zA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(ZA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(vN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(eN,X[iP],EVENT_UNIT_SPELL_EFFECT) call SetUnitAbilityLevel(X[iP],'A01B',3) set Go[iP*2]=0 set Go[iP*2+1]=1 elseif(GetUnitTypeId(X[iP])=='O01E')then set B[iP]=12 set Li=Li+1 call SetPlayerAbilityAvailable(oP,'A0NA',false) call SetPlayerAbilityAvailable(oP,'A0NO',false) call SetPlayerAbilityAvailable(oP,'A0O2',false) call SetPlayerAbilityAvailable(oP,'A0O4',false) call SetPlayerAbilityAvailable(oP,'A0O6',false) call SetPlayerAbilityAvailable(oP,'A0O8',false) call SetPlayerAbilityAvailable(oP,'A0O9',false) call UnitAddAbility(X[iP],'A0NO') set Yv[iP]=CreateUnit(oP,'O01F',GetUnitX(X[iP]),GetUnitY(X[iP]),GetUnitFacing(X[iP])) call oD() call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_SET,0) call SuspendHeroXP(Yv[iP],true) call SetUnitMoveSpeed(Yv[iP],qd(iP)) call TriggerRegisterUnitEvent(XI,Yv[iP],EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(hN,Yv[iP],EVENT_UNIT_HERO_SKILL) call TriggerRegisterUnitEvent(HN,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(FN,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(JN,Yv[iP],EVENT_UNIT_DAMAGED) call TriggerRegisterUnitEvent(hR,X[iP],EVENT_UNIT_HERO_LEVEL) call TriggerRegisterUnitEvent(BN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(cN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(fN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(gN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitManaEvent(GN,X[iP],LESS_THAN,248.99) call TriggerRegisterUnitManaEvent(GN,X[iP],GREATER_THAN,250.99) call TriggerRegisterUnitManaEvent(GN,X[iP],LESS_THAN,898.99) call TriggerRegisterUnitManaEvent(GN,X[iP],GREATER_THAN,900.99) call TriggerRegisterUnitManaEvent(GN,X[iP],LESS_THAN,1496.99) call TriggerRegisterUnitManaEvent(GN,X[iP],GREATER_THAN,1498.99) call UnitAddAbility(X[iP],'A0NW'+gi) if gi==0 then set gi=1 else set gi=0 endif call TriggerRegisterTimerEvent(jN,0,false) elseif(GetUnitTypeId(X[iP])=='O01B')or(GetUnitTypeId(X[iP])=='O01C')then set B[iP]=11 call TriggerRegisterUnitEvent(gR,X[iP],EVENT_UNIT_HERO_LEVEL) call TriggerRegisterUnitEvent(rN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(iN,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(aN,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitManaEvent(nN,X[iP],LESS_THAN,5) call TriggerRegisterUnitEvent(EN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(XN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(ON,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(RN,X[iP],EVENT_UNIT_SPELL_CHANNEL) call TriggerRegisterUnitEvent(IN,X[iP],EVENT_UNIT_SPELL_ENDCAST) call TriggerRegisterPlayerUnitEventSimple(xN,oP,EVENT_PLAYER_UNIT_DEATH) call TriggerRegisterUnitEvent(AN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerEventEndCinematic(NN,oP) call TriggerRegisterPlayerUnitEvent(VN,oP,EVENT_PLAYER_UNIT_ISSUED_ORDER,null) set go[iP]=true set Ur[iP]=0.0 set li[iP]=0.0 call SetPlayerAbilityAvailable(oP,'A0L3',false) call SetPlayerAbilityAvailable(oP,'A0L4',false) call SetPlayerAbilityAvailable(oP,'A0L5',false) call SetPlayerAbilityAvailable(oP,'A0L6',false) call SetPlayerAbilityAvailable(oP,'A0L7',false) call SetPlayerAbilityAvailable(oP,'A0L8',false) call UnitAddAbility(X[iP],'A0L3') call UnitAddAbility(X[iP],'A0L4') call UnitAddAbility(X[iP],'A0L5') call UnitAddAbility(X[iP],'A0L6') call UnitAddAbility(X[iP],'A0L7') call UnitAddAbility(X[iP],'A0L8') set Ei[iP]=0 call SetUnitAbilityLevel(X[iP],'A0CN',9) call SetPlayerAbilityAvailable(oP,'A0CN',true) call SetUnitAbilityLevel(X[iP],'A0LZ',(GetUnitTypeId(X[iP])-'O01B')*8+1) set Tr[iP*3]=qf('o016',oP,GetUnitLoc(X[iP]),0) call UnitAddAbility(Tr[iP*3],'A0LB') call UnitAddAbility(Tr[iP*3],'A0LC') call UnitAddAbility(Tr[iP*3],'A0LD') call UnitAddAbility(Tr[iP*3],'A0LE') call TriggerRegisterUnitEvent(bN,Tr[iP*3],EVENT_UNIT_SPELL_EFFECT) set Tr[iP*3+1]=qf('o016',oP,GetUnitLoc(X[iP]),0) call UnitAddAbility(Tr[iP*3+1],'A0LF') call UnitAddAbility(Tr[iP*3+1],'A0LG') call UnitAddAbility(Tr[iP*3+1],'A0LH') call UnitAddAbility(Tr[iP*3+1],'A0LI') call TriggerRegisterUnitEvent(bN,Tr[iP*3+1],EVENT_UNIT_SPELL_EFFECT) set Tr[iP*3+2]=qf('o016',oP,GetUnitLoc(X[iP]),0) call UnitAddAbility(Tr[iP*3+2],'A0LJ') call UnitAddAbility(Tr[iP*3+2],'A0LK') call UnitAddAbility(Tr[iP*3+2],'A0LL') call UnitAddAbility(Tr[iP*3+2],'A0LM') call UnitAddAbility(Tr[iP*3+2],'A0LN') call UnitAddAbility(Tr[iP*3+2],'A0LO') call UnitAddAbility(Tr[iP*3+2],'A0LP') call UnitAddAbility(Tr[iP*3+2],'A0LQ') call TriggerRegisterUnitEvent(bN,Tr[iP*3+2],EVENT_UNIT_SPELL_EFFECT) set ur[iP*4]=null set ur[iP*4+1]=null set ur[iP*4+2]=null set ur[iP*4+3]=null if GetStoredInteger(Ae,"herocount","totalplayers")<2 then call SetUnitAbilityLevel(X[iP],'A0KR',5) endif else set B[iP]=9 call SetPlayerAbilityAvailable(oP,'A0OD',false) call TriggerRegisterUnitEvent(EA,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(zR,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(GR,X[iP],EVENT_UNIT_HERO_LEVEL) call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),0) if GetUnitTypeId(X[iP])=='O00Q' then call TriggerRegisterUnitEvent(pA,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(PA,X[iP],EVENT_UNIT_ISSUED_ORDER) set kr[iP]=qf('n017',oP,GetUnitLoc(X[iP]),0) endif call TriggerRegisterUnitEvent(vI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(tI,X[iP],EVENT_UNIT_SPELL_EFFECT) set Yv[iP]=CreateUnit(oP,'O001',GetUnitX(X[iP]),GetUnitY(X[iP]),GetUnitFacing(X[iP])) call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,1) call SuspendHeroXP(Yv[iP],true) call SetUnitAbilityLevel(X[iP],'A0BX',qe[iP]) set Vo[iP]=0 call TriggerRegisterUnitEvent(eI,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(oI,Yv[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(xI,Yv[iP],EVENT_UNIT_HERO_SKILL) call TriggerRegisterUnitEvent(ZR,Yv[iP],EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(VA,Yv[iP],EVENT_UNIT_HERO_SKILL) set Xo[iP]=0 set Io[iP]=-0.2 if qe[iP]==1 then call SetUnitAbilityLevel(Yv[iP],'Aihn',2) call TriggerRegisterUnitEvent(yR,Yv[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(yR,Yv[iP],EVENT_UNIT_ISSUED_POINT_ORDER) call TriggerRegisterUnitEvent(yR,Yv[iP],EVENT_UNIT_ISSUED_TARGET_ORDER) call UnitRemoveAbility(Yv[iP],'A0AC') call UnitAddAbility(Yv[iP],'A0OD') elseif qe[iP]==2 then call SetPlayerTechResearched(oP,'R00S',1) call SetUnitMoveSpeed(Yv[iP],200.0) call UnitRemoveAbility(Yv[iP],'A03I') call SetHeroInt(Yv[iP],2,true) call TriggerRegisterUnitManaEvent(WR,Yv[iP],LESS_THAN,249.99) else call SetPlayerTechResearched(oP,'R00R',1) call TriggerRegisterUnitEvent(YR,Yv[iP],EVENT_UNIT_ISSUED_TARGET_ORDER) call TriggerRegisterUnitEvent(YR,Yv[iP],EVENT_UNIT_ISSUED_ORDER) call SetUnitMoveSpeed(Yv[iP],270.00) call UnitRemoveAbility(Yv[iP],'A0AC') endif call SelectHeroSkill(Yv[iP],'A07Z') if(qe[iP]==1)or(qe[iP]==2)then call IssueImmediateOrder(Yv[iP],"manashieldon") endif set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,Yv[iP],EVENT_UNIT_DAMAGED) call TriggerAddAction(jD,function MH) endif endfunction function Dj takes unit LC,real fj returns nothing call SetUnitState(LC,UNIT_STATE_MANA,RMaxBJ(0,GetUnitState(LC,UNIT_STATE_MANA)/ GetUnitState(LC,UNIT_STATE_MAX_MANA)*(GetUnitState(LC,UNIT_STATE_MAX_MANA)-fj))) endfunction function Fj takes unit LC,real fj returns nothing call SetUnitState(LC,UNIT_STATE_MANA,RMaxBJ(0,GetUnitState(LC,UNIT_STATE_MAX_MANA)/(GetUnitState(LC,UNIT_STATE_MAX_MANA)-fj)*GetUnitState(LC,UNIT_STATE_MANA))) endfunction function gj takes integer iP,integer Ef returns nothing local unit VF=null local integer i=0 loop exitwhen i>4 set VF=qo[iP*5+i] if VF!=null then if Ef=='A0CC' then call SetUnitAcquireRangeBJ(VF,550+75*Gx[iP*5+2]) elseif Ef=='A0CD' then call SetUnitAbilityLevel(VF,'A042',1+Gx[iP*5+3]*4) call SetHeroStr(VF,Gx[iP*5+3]*100,true) elseif Ef=='A0CE' then call SetUnitMoveSpeed(VF,Pd(iP)+Gx[iP*5+4]*30) else call SetUnitAbilityLevel(VF,'A041',GetUnitAbilityLevel(VF,'A041')+1) endif endif set i=i+1 endloop endfunction function Gj takes integer iP returns nothing local integer NH call SetPlayerAbilityAvailable(Player(iP),'A0C6',Gx[iP*5]>0) call SetPlayerAbilityAvailable(Player(iP),'A0C0',Gx[iP*5]<1) if Gx[iP*5+1]==1 then call SetPlayerAbilityAvailable(Player(iP),'A0C2',true) endif set NH=GetUnitAbilityLevel(X[iP],'A0C2') loop exitwhen NH>Gx[iP*5+1] call StoreInteger(Ae,"unitmakingbattery",XC(X[iP]),1) call UnitRemoveAbility(X[iP],a[IMaxBJ((NH-2),0)]) call UnitAddAbility(X[iP],a[IMaxBJ((NH-1),0)]) call StoreInteger(Ae,"unitmakingbattery",XC(X[iP]),0) call Dj(X[iP],250.0) set NH=NH+1 endloop call SetUnitAbilityLevel(X[iP],'A0C2',Gx[iP*5+1]+1) if Gx[iP*5+1]<8 then call SetUnitAbilityLevel(Yv[iP],'A0CB',Gx[iP*5+1]+1) else call SetPlayerAbilityAvailable(Player(iP),'A0CB',false) endif if(pi[iP]==1)and(Gx[iP*5+1]>0)then set pi[iP]='A0OS'+Gx[iP*5+1]-1 call UnitAddAbility(X[iP],pi[iP]) elseif(pi[iP]>='A0OS')and(pi[iP]!=('A0OS'+Gx[iP*5+1]-1))then call UnitRemoveAbility(X[iP],pi[iP]) set pi[iP]='A0OS'+Gx[iP*5+1]-1 call UnitAddAbility(X[iP],pi[iP]) endif if Gx[iP*5+2]==1 then call SetPlayerAbilityAvailable(Player(iP),'A0C3',true) endif if Gx[iP*5+2]>0 then call SetPlayerTechResearched(Player(iP),'R013',Gx[iP*5+2]) call SetPlayerTechResearched(Player(iP),'R01R',Gx[iP*5+2]) endif call SetUnitAbilityLevel(X[iP],'A0C3',Gx[iP*5+2]+1) if Gx[iP*5+2]<4 then call SetUnitAbilityLevel(Yv[iP],'A0CC',Gx[iP*5+2]+1) else call SetPlayerAbilityAvailable(Player(iP),'A0CC',false) endif if Gx[iP*5+3]==1 then call SetPlayerAbilityAvailable(Player(iP),'A0C4',true) endif if Gx[iP*5+3]>0 then call SetPlayerTechResearched(Player(iP),'R01C',Gx[iP*5+3]) endif call SetUnitAbilityLevel(X[iP],'A0C4',Gx[iP*5+3]+1) if Gx[iP*5+3]<3 then call SetUnitAbilityLevel(Yv[iP],'A0CD',Gx[iP*5+3]+1) else call SetPlayerAbilityAvailable(Player(iP),'A0CD',false) endif if Gx[iP*5+4]==1 then call SetPlayerAbilityAvailable(Player(iP),'A0C5',true) endif call SetUnitAbilityLevel(X[iP],'A0C5',Gx[iP*5+4]+1) if Gx[iP*5+4]<1 then call SetUnitAbilityLevel(Yv[iP],'A0CE',Gx[iP*5+4]+1) else call SetPlayerAbilityAvailable(Player(iP),'A0CE',false) endif endfunction function hj takes integer iP returns nothing local integer i=GetUnitAbilityLevel(X[iP],'A0KV')+Do[iP*Co] if i==0 then call SetUnitAbilityLevel(X[iP],'A0P5',49) else call SetUnitAbilityLevel(X[iP],'A0P5',i*5-i*tr[iP*19+11]) endif endfunction function Hj takes integer iP returns nothing local player oP=Player(iP) local integer i call SetPlayerAbilityAvailable(oP,'A0L3',tr[iP*19]>0) call SetPlayerAbilityAvailable(oP,'A0L6',(tr[iP*19]<1)and(GetUnitAbilityLevel(X[iP],'A0L0')>0)) call SetPlayerAbilityAvailable(oP,'A0L4',tr[iP*19+5]>0) call SetPlayerAbilityAvailable(oP,'A0L7',(tr[iP*19+5]<1)and(GetUnitAbilityLevel(X[iP],'A0L1')>0)) call SetPlayerAbilityAvailable(oP,'A0L5',tr[iP*19+10]>0) call SetPlayerAbilityAvailable(oP,'A0L8',(tr[iP*19+10]<1)and(GetUnitAbilityLevel(X[iP],'A0L2')>0)) call SetUnitAbilityLevel(X[iP],'A0L6',tr[iP*19+1]+tr[iP*19+2]+tr[iP*19+3]+tr[iP*19+4]) set i=0 if tr[iP*19+6]>0 then set i=i+1 endif if tr[iP*19+7]>0 then set i=i+1 endif if tr[iP*19+8]>0 then set i=i+1 endif if tr[iP*19+9]>0 then set i=i+1 endif if i>3 then set i=34 elseif i>2 then set i=21 elseif i>1 then set i=7 elseif i>0 then set i=0 else set i=1 endif call SetUnitAbilityLevel(X[iP],'A0L7',i+tr[iP*19+6]+tr[iP*19+7]+tr[iP*19+8]+tr[iP*19+9]) call hj(iP) call SetUnitAbilityLevel(X[iP],'A0LR',tr[iP*19+11]+1) call SetUnitAbilityLevel(X[iP],'A0LS',tr[iP*19+12]+1) call SetUnitAbilityLevel(X[iP],'A0LT',tr[iP*19+13]+1) if pv[iP*Nx+4]>0 then call SetUnitAbilityLevel(X[iP],'A0LU',tr[iP*19+14]+6) else call SetUnitAbilityLevel(X[iP],'A0LU',tr[iP*19+14]+1) endif call SetUnitAbilityLevel(X[iP],'A0LV',tr[iP*19+15]+1) call SetUnitAbilityLevel(X[iP],'A0LW',tr[iP*19+16]+1) call SetUnitAbilityLevel(X[iP],'A0LX',tr[iP*19+17]+1) call SetUnitAbilityLevel(X[iP],'A0LY',tr[iP*19+18]+1) endfunction function jj takes integer nD,integer iP returns nothing if nD==0 then call ModifyHeroSkillPoints(X[iP],bj_MODIFYMETHOD_ADD,pv[iP*Nx]) call SelectHeroSkill(X[iP],'A000') call SelectHeroSkill(X[iP],'A0MW') call SelectHeroSkill(X[iP],'A004') call SelectHeroSkill(X[iP],'A04W') call SelectHeroSkill(X[iP],'A003') call SelectHeroSkill(X[iP],'A00F') call SelectHeroSkill(X[iP],'A0A7') call SelectHeroSkill(X[iP],'A01V') call SelectHeroSkill(X[iP],'A0A8') call SelectHeroSkill(X[iP],'A00C') call SelectHeroSkill(X[iP],'A0BT') call SelectHeroSkill(X[iP],'A002') call SelectHeroSkill(X[iP],'A02Y') call SelectHeroSkill(X[iP],'A036') call SelectHeroSkill(X[iP],'A00A') call SelectHeroSkill(X[iP],'A05B') call SelectHeroSkill(X[iP],'A01K') call SelectHeroSkill(X[iP],'A00K') call SelectHeroSkill(X[iP],'A04C') call SelectHeroSkill(X[iP],'A04M') call SelectHeroSkill(X[iP],'A00B') call SelectHeroSkill(X[iP],'A04B') call SelectHeroSkill(X[iP],'A008') if B[iP]==7 then set Gx[iP*5]=Gx[iP*5]-1 set Gx[iP*5+1]=Gx[iP*5+1]+1 call Gj(iP) endif call SelectHeroSkill(X[iP],'A051') call SelectHeroSkill(X[iP],'A09C') call SelectHeroSkill(X[iP],'A046') call SelectHeroSkill(X[iP],'A0B0') call SelectHeroSkill(X[iP],'A0B1') call SelectHeroSkill(X[iP],'A0B2') call SelectHeroSkill(X[iP],'A0EF') call SelectHeroSkill(X[iP],'A0EM') call SelectHeroSkill(X[iP],'A0EN') call SelectHeroSkill(X[iP],'A0KV') call SelectHeroSkill(X[iP],'A0L0') call SelectHeroSkill(X[iP],'A0L1') call SelectHeroSkill(X[iP],'A0L2') if B[iP]==11 then call Hj(iP) endif call SelectHeroSkill(X[iP],'A0NY') call SelectHeroSkill(X[iP],'A0NZ') call SelectHeroSkill(X[iP],'A0O0') elseif nD==1 then call UnitAddItemById(X[iP],'I002') call SetUnitMoveSpeed(X[iP],Ld(iP,false)) set Yr[iP]=Yr[iP]*2-1 elseif nD==2 then call UnitAddItemByIdSwapped('I009',X[iP]) call StoreInteger(Ae,"integrated_vest",I2S(iP),0) elseif nD==3 then set wo[iP]=wo[iP]+2 call SetPlayerTechResearched(Player(iP),'R00E',GetPlayerTechCount(Player(iP),'R00E',true)+3) call SetPlayerTechResearched(Player(iP),'R008',GetPlayerTechCount(Player(iP),'R008',true)+2) set ai[iP]=ai[iP]+1 call SetPlayerTechResearched(Player(iP),'Rhde',IMaxBJ(ai[iP],1)) call SetPlayerTechResearched(Player(iP),'R00N',IMaxBJ(ai[iP],1)) elseif nD==4 then if(Pv[iP*3]!='O00U')and(Pv[iP*3]!='O01B')and(Pv[iP*3]!='O01C')then call SetUnitAbilityLevel(X[iP],'A05D',4+GetUnitAbilityLevel(X[iP],'A05D')) endif elseif nD==5 then set yv[iP]=yv[iP]+I2R(pv[iP*Nx+5])/100.0 set Ko[iP]=Ko[9] if Ko[9]>3 then set Ko[9]=Ko[9]-3 endif elseif nD==9 then call UnitAddType(X[iP],UNIT_TYPE_ANCIENT) set jo=jo+1 call mh(pv[iP*Nx+9]) if Fd(iP)>0 then call SetPlayerTechResearchedSwap('R00M',GetPlayerTechCount(Player(iP),'R00M',true)+4,Player(iP)) endif set Ai[0]=Ai[0]+1 elseif nD==11 then call UnitAddAbility(X[iP],'Ault') set zr[iP]=false call TriggerRegisterUnitEvent(KI,X[iP],EVENT_UNIT_ISSUED_ORDER) if yD()then call ModifyHeroStat(bj_HEROSTAT_AGI,X[iP],bj_MODIFYMETHOD_ADD,bC(pv[iP*Nx+11],100)) call SetUnitMoveSpeed(X[iP],Ld(iP,false)) endif elseif nD==12 then set nD=GetUnitAbilityLevel(X[iP],'A00A')+mx[iP] if nD>0 then call UnitRemoveAbility(X[iP],V[nD-1]) endif set mx[iP]=mx[iP]+2 call UnitAddAbility(X[iP],V[nD+1]) call fg(iP) if GetUnitState(X[iP],UNIT_STATE_MANA)<250.0 then call dg(iP) endif call SetUnitAbilityLevel(X[iP],'A01W',2) elseif nD==13 then call SetPlayerTechResearchedSwap('R011',1,Player(iP)) call lg(iP) call Hg(iP) call TriggerRegisterUnitEvent(bI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(BI,bx[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(CI,bx[iP],EVENT_UNIT_DROP_ITEM) call TriggerRegisterUnitEvent(dI,bx[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerEventEndCinematic(cI,Player(iP)) call SetUnitAbilityLevel(Px[iP],'A0FA',2) elseif nD==14 then call SetPlayerTechResearchedSwap('R011',1,Player(iP)) call SetUnitAbilityLevel(X[iP],'A03M',2) call TriggerRegisterUnitEvent(kI,X[iP],EVENT_UNIT_SPELL_EFFECT) set Kr=Kr+1 endif endfunction function Jj takes integer iP returns nothing if pv[iP*Nx]>0 then call jj(0,iP) endif if pv[iP*Nx+1]>0 then call jj(1,iP) endif if pv[iP*Nx+2]>0 then call jj(2,iP) endif if pv[iP*Nx+3]>0 then call jj(3,iP) endif if pv[iP*Nx+4]>0 then call jj(4,iP) endif if pv[iP*Nx+5]>0 then call jj(5,iP) endif if pv[iP*Nx+9]>0 then call jj(9,iP) endif if pv[iP*Nx+11]>0 then call jj(11,iP) endif if pv[iP*Nx+12]>0 then call jj(12,iP) endif if pv[iP*Nx+13]>0 then call jj(13,iP) endif if pv[iP*Nx+14]>0 then call jj(14,iP) endif endfunction function kj takes integer nD,integer iP,boolean Kj returns nothing local integer lj=0 if nD==0 then set lj=5 elseif nD==1 then set lj=30 elseif nD==2 then set lj=10 elseif nD==3 then set lj=2 elseif nD==4 then set lj=1 elseif nD==5 then set lj=30 elseif nD==6 then set lj=50 elseif nD==7 then set lj=1 elseif nD==8 then set lj=4 set Fo=Fo+6 elseif nD==9 then set lj=4 elseif nD==10 then set lj=22 elseif nD==11 then if yD()then set lj=3210 else set lj=3200 endif elseif nD==12 then set lj=2 elseif nD==13 then set lj=1 elseif nD==14 then set lj=1 else return endif set pv[iP*Nx+nD]=pv[iP*Nx+nD]+lj if not Kj then set Eo[iP]=nD+1 else call SetUnitAbilityLevel(X[iP],'A039',nD+1) endif endfunction function Lj takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local player oP=GetTriggerPlayer() local string s=GetEventPlayerChatString() local boolean b=false local integer j local integer i local item Jd=null call DisableTrigger(jD) set i=FD(oP,s,"-promote","promote","give the indicated player an extra skill point. You may promote one person") if i<0 then call EnableTrigger(jD) return endif if not AC(Player(i))then call iC(oP,"That player is not in the current game.") call EnableTrigger(jD) return endif if(fo[i]>1)then call iC(oP,"That player has already received a field promotion.") call EnableTrigger(jD) return endif if(fo[i]<1)then if IC(Player(i))then call iC(oP,"That player cannot be promoted at this time.") else call iC(oP,"Computer allies cannot be promoted.") endif call EnableTrigger(jD) return endif if(i==GetPlayerId(oP))then set j=0 loop exitwhen j>8 exitwhen b if(j!=i)and IC(Player(j))and AC(Player(j))and(fo[j]<2)then set b=true endif set j=j+1 endloop if b then call iC(oP,"You must promote an ally.") call EnableTrigger(jD) return endif endif set j=GetPlayerId(oP) call ModifyHeroSkillPoints(X[i],bj_MODIFYMETHOD_ADD,1) set fo[i]=2 call iC(Player(i),"You received a field promotion, increasing your skill points by 1.") if(i!=j)then call iC(oP,"You successfully promoted your comrade.") endif if Ed(j)then set i=0 loop exitwhen i>5 set Jd=UnitItemInSlot(X[j],i) if(Jd!=null)and(GetItemTypeId(Jd)=='I03I')then call UnitRemoveItem(X[j],Jd) exitwhen true endif set i=i+1 endloop endif set Jd=null call DestroyTrigger(jD) set jD=null endfunction function mj takes nothing returns nothing if GetItemTypeId(GetManipulatedItem())=='I03I' then call RemoveItem(GetManipulatedItem()) call DisableTrigger(GetTriggeringTrigger()) call DestroyTrigger(GetTriggeringTrigger()) endif endfunction function Mj takes integer iP returns nothing local trigger jD=CreateTrigger() call TriggerAddAction(jD,function mj) call TriggerRegisterUnitEvent(jD,X[iP],EVENT_UNIT_DROP_ITEM) set jD=CreateTrigger() call TriggerAddAction(jD,function Lj) call HD(jD,Player(iP),"-promote") set jD=null endfunction function pj takes integer nD,integer iP returns nothing local integer i local integer Pj local unit LC if nD==0 then set Pj=GetUnitTypeId(X[iP]) if(Pj=='O000')or(Pj=='O00Y')or(Pj=='O014')or(Pj=='O002')then set i=GetUnitAbilityLevel(X[iP],'A004') call SetUnitAbilityLevel(X[iP],'A0H5',i+Do[iP*Co]) call SetUnitAbilityLevel(X[iP],'A0H9',i+Do[iP*Co]) call SetPlayerTechResearched(Player(iP),'R019',1) call SetPlayerTechResearched(Player(iP),'R010',i+Do[iP*Co]) call SetPlayerTechResearched(Player(iP),'R00J',IMinBJ(i+Do[iP*Co],18)) elseif(Pj=='O00T')or(Pj=='O018')then set i=GetUnitAbilityLevel(X[iP],'A04W') if i<1 then call UnitAddAbility(X[iP],'A0DH') else call UnitRemoveAbility(X[iP],'A0DH'+i) endif call SetUnitAbilityLevel(X[iP],'A0DH',i+Do[iP*Co]) call UnitAddAbility(X[iP],'A0DH'+i+Do[iP*Co]) call SetPlayerTechResearched(Player(iP),'R00J',IMinBJ(i+Do[iP*Co],18)) elseif(Pj=='O005')or(Pj=='O00O')or(Pj=='O01E')then set i=GetUnitAbilityLevel(X[iP],'A0MW') call SetPlayerTechResearched(Player(iP),'Rhri',i+Do[iP*Co]) call SetPlayerTechResearched(Player(iP),'R00K',IMinBJ(i+Do[iP*Co],10)) elseif(Pj=='O00Q')or(Pj=='O003')then set i=GetUnitAbilityLevel(X[iP],'A00F') if i<1 then call UnitAddAbility(X[iP],'A0H6') endif call SetUnitAbilityLevel(X[iP],'A0H6',i+Do[iP*Co]) call SetPlayerTechResearched(Player(iP),'R00K',IMinBJ(i+Do[iP*Co],10)) elseif(Pj=='O00U')or(Pj=='O004')or(Pj=='O00P')then set i=GetUnitAbilityLevel(X[iP],'A003') if i>0 then if B[iP]==10 then call UnitRemoveAbility(X[iP],'A0KK') else call UnitRemoveAbility(X[iP],'A0H7') endif endif if B[iP]==10 then call UnitAddAbility(X[iP],'A0KL') call SetUnitAbilityLevel(X[iP],'A0KL',i+Do[iP*Co]) else call UnitAddAbility(X[iP],'A0HF') call SetUnitAbilityLevel(X[iP],'A0HF',i+Do[iP*Co]) endif call SetPlayerTechResearched(Player(iP),'R00V',IMinBJ(i+Do[iP*Co],18)) call SetPlayerTechResearched(Player(iP),'Rhfl',1) else set i=GetUnitAbilityLevel(X[iP],'A0KV') if i<1 then call UnitAddAbility(X[iP],'A0KW'+Pj-'O01B') endif call SetUnitAbilityLevel(X[iP],'A0KW'+Pj-'O01B',i+Do[iP*Co]) call SetPlayerTechResearched(Player(iP),'R01N'+Pj-'O01B',IMinBJ(i+Do[iP*Co],10)) call SetPlayerTechResearched(Player(iP),'R01P',IMinBJ(i+Do[iP*Co],10)) call hj(iP) endif set Ar[iP]=i+Do[iP*Co] elseif nD==1 then if B[iP]==5 then call SetUnitAbilityLevel(X[iP],'A0E8',Pv[iP*3+2]+1+Do[iP*Co+1]) else call SetUnitAbilityLevel(X[iP],'A05C',Pv[iP*3+2]+1+Do[iP*Co+1]) endif call SetPlayerTechResearched(Player(iP),'R00E',GetPlayerTechCount(Player(iP),'R00E',true)+1) call SetPlayerTechResearched(Player(iP),'R01E',2) elseif nD==2 then call TriggerRegisterUnitEvent(eb,X[iP],EVENT_UNIT_PICKUP_ITEM) call TriggerRegisterUnitEvent(xb,X[iP],EVENT_UNIT_DROP_ITEM) elseif nD==3 then if(B[iP]==2)or(B[iP]==6)or(B[iP]==10)or(B[iP]==12)then set i=4 elseif(B[iP]==1)or(B[iP]==8)then set i=5 else set i=3 endif call SetHeroInt(X[iP],GetHeroInt(X[iP],false)+i,true) call UnitAddItemById(X[iP],'I020') set Yr[iP]=Yr[iP]*2-1 elseif nD==6 then if(B[iP]==2)or(B[iP]==6)or(B[iP]==10)or(B[iP]==12)then set Do[iP*Co+6]=13 elseif(B[iP]==1)or(B[iP]==8)then set Do[iP*Co+6]=14 endif call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER)+Do[iP*Co+6]) call zF(X[iP],CreateItem('I03I',GetUnitX(X[iP]),GetUnitY(X[iP])),5) call Mj(iP) set ho=ho+1 elseif nD==7 then set LC=CreateUnit(Player(iP),ri[B[iP]],GetUnitX(X[iP]),GetUnitY(X[iP]),GetUnitFacing(X[iP])) call SetUnitColor(LC,PLAYER_COLOR_BROWN) if((Fd(iP)+1)>8)and(Lo[iP*15+6]==2)then call SetUnitMoveSpeed(LC,Pd(iP)+15) else call SetUnitMoveSpeed(LC,Pd(iP)) endif call UnitAddAbility(LC,'Aeth') call TriggerRegisterUnitEvent(TR,LC,EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(uR,LC,EVENT_UNIT_SPELL_EFFECT) call IssueTargetOrder(LC,"smart",X[iP]) elseif nD==8 then if B[iP]==4 then call SetUnitAbilityLevel(X[iP],'A01T',2) set Do[iP*Co+8]=5 call SetUnitMoveSpeed(X[iP],Ld(iP,false)) call SetUnitAbilityLevel(X[iP],'A05D',8+GetUnitAbilityLevel(X[iP],'A05D')) else call UnitAddAbility(X[iP],'A0MR') call UnitAddAbility(X[iP],'A0MS') if Pv[iP*3+2]==0 then set ai[iP]=ai[iP]-1 elseif Pv[iP*3+2]==1 then set ai[iP]=ai[iP]-2 else set ai[iP]=ai[iP]-3 endif call SetPlayerTechResearched(Player(iP),'Rhde',IMaxBJ(ai[iP],1)) call SetPlayerTechResearched(Player(iP),'R00N',IMaxBJ(ai[iP],1)) call TriggerRegisterUnitEvent(lI,X[iP],EVENT_UNIT_ISSUED_ORDER) call TriggerRegisterUnitEvent(LI,X[iP],EVENT_UNIT_ISSUED_POINT_ORDER) if Fd(iP)>2 then set ni[iP*2]=3 set ni[iP*2+1]=3 else set ni[iP*2]=0 set ni[iP*2+1]=0 endif endif endif endfunction function qj takes integer iP returns nothing if Do[iP*Co]>0 then set wo[iP]=wo[iP]+1 call pj(0,iP) elseif B[iP]==1 then call pj(0,iP) endif if Do[iP*Co+1]>0 then call pj(1,iP) endif if Do[iP*Co+2]>0 then call pj(2,iP) endif if Do[iP*Co+3]>0 then call pj(3,iP) endif if Do[iP*Co+6]>0 then call pj(6,iP) endif if Do[iP*Co+7]>0 then call pj(7,iP) endif if Do[iP*Co+8]>0 then call pj(8,iP) endif endfunction function Qj takes integer nD,integer iP,boolean ED returns nothing local integer lj=0 if nD==0 then set lj=1 elseif nD==1 then set lj=4 elseif nD==2 then set lj=2 elseif nD==3 then set lj=1 elseif nD==4 then set lj=25 elseif nD==5 then set lj=10 elseif nD==6 then set lj=12 elseif nD==7 then set lj=1 elseif nD==8 then set lj=1 else return endif set Do[iP*Co+nD]=Do[iP*Co+nD]+lj if not ED then set do[iP]=nD+1 endif endfunction function sj takes integer iP,integer Sj returns nothing if Sj==0 then set Wo[iP]=1 return endif if Sj==1 then call UnitAddAbility(X[iP],'A0MQ') return endif if Sj==2 then set pv[iP*Nx+1]=pv[iP*Nx+1]+15 call SetUnitMoveSpeed(X[iP],Ld(iP,false)) return endif if Sj==3 then call SetPlayerTechResearched(Player(iP),'R01X',1) return endif if Sj==4 then call UnitAddItemById(X[iP],'I021') call UnitAddItemById(X[iP],'I021') call UnitAddAbility(X[iP],'A0J4') return endif if Sj==5 then set pv[iP*Nx+10]=pv[iP*Nx+10]+3 return endif if Sj==6 then call SetPlayerTechResearched(Player(iP),'R01A',1) set yo[iP]=9999 set yo[10]=yo[10]+1600-160*yo[9] set yo[9]=yo[9]+1 set yo[11]=yo[10]/ yo[9] return endif endfunction function tj takes unit Od,integer Tj returns boolean local item BG local integer Mg=0 if uv[GetPlayerId(GetOwningPlayer(Od))]'A0FW' if yj then call UnitRemoveAbility(o,i) else call UnitAddAbility(o,i) endif set i=i+1 endloop if yj then call UnitRemoveAbility(o,'A0N8') else call UnitAddAbility(o,'A0N8') endif elseif Wj==1 then set c=GetUnitUserData(o) set i='A0GT' loop exitwhen i>'A0GZ' if yj then call UnitRemoveAbility(o,i) else set e=i-'A0GT' if(e==0)and((c==1)or(c==2)or(c==3)or(c==4))then call UnitAddAbility(o,i) if c==1 then call SetUnitAbilityLevel(o,i,3) elseif c==4 then call SetUnitAbilityLevel(o,i,2) endif elseif(e==1)and((c==0)or(c==4)or(c==10))then call UnitAddAbility(o,i) if c==4 then call SetUnitAbilityLevel(o,i,2) endif elseif(e==2)and((c==5)or(c==7)or(c==4))then call UnitAddAbility(o,i) if c==4 then call SetUnitAbilityLevel(o,i,2) elseif c==7 then call SetUnitAbilityLevel(o,i,3) endif elseif(e==3)and((c==6)or(c==4))then call UnitAddAbility(o,i) if c==4 then call SetUnitAbilityLevel(o,i,2) endif elseif(e==4)and((c==8)or(c==4))then call UnitAddAbility(o,i) if c==4 then call SetUnitAbilityLevel(o,i,2) endif elseif(e==5)and((c==9))then call UnitAddAbility(o,i) elseif(e==6)and((c==9))then call UnitAddAbility(o,i) endif endif set i=i+1 endloop elseif Wj==2 then set c=GetUnitUserData(o) set i='A0H0' loop exitwhen i>'A0H3' if yj then call UnitRemoveAbility(o,i) else set e=i-'A0H0' if(e==0)and(c!=7)and(c!=9)then call UnitAddAbility(o,i) elseif(e==1)and(c!=7)and(c!=9)then call UnitAddAbility(o,i) elseif(e==2)and(c!=7)and(c!=9)then call UnitAddAbility(o,i) elseif(e==3)and((c==7)or(c==9))then call UnitAddAbility(o,i) endif endif set i=i+1 endloop elseif Wj==3 then set c=GetUnitUserData(o) set i='A0GA' loop exitwhen i>('A0GA'+Nx/2-1) if yj then call UnitRemoveAbility(o,i) else set e=i-'A0GA' call UnitAddAbility(o,i) if(e==4)and((c==7)or(c==9))then call SetUnitAbilityLevel(o,i,2) endif endif set i=i+1 endloop if yj then call UnitRemoveAbility(o,'A0GS') else call UnitAddAbility(o,'A0GS') endif elseif Wj==4 then set i='A0GA'+Nx/2 loop exitwhen i>('A0GA'+Nx-1) if yj then call UnitRemoveAbility(o,i) else call UnitAddAbility(o,i) endif set i=i+1 endloop if yj then call UnitRemoveAbility(o,'A0GS') else call UnitAddAbility(o,'A0GS') call SetUnitAbilityLevel(o,'A0GS',2) endif elseif Wj==5 then set c=GetUnitUserData(o) set i='A0G0' loop exitwhen i>('A0G0'+Co-1) if yj then call UnitRemoveAbility(o,i) else set e=i-'A0G0' call UnitAddAbility(o,i) if(e==3)or(e==6)then if(c==2)or(c==6)or(c==7)or(c==10)then call SetUnitAbilityLevel(o,i,2) elseif(c==1)or(c==3)then call SetUnitAbilityLevel(o,i,3) endif elseif e==8 then if c==0 then call SetUnitAbilityLevel(o,i,4) elseif Pv[GetPlayerId(GetOwningPlayer(o))*3+2]>1 then call SetUnitAbilityLevel(o,i,3) elseif Pv[GetPlayerId(GetOwningPlayer(o))*3+2]>0 then call SetUnitAbilityLevel(o,i,2) endif endif endif set i=i+1 endloop elseif Wj==6 then set i='A0FX' loop exitwhen i>'A0FZ' if yj then call UnitRemoveAbility(o,i) else call UnitAddAbility(o,i) endif set i=i+1 endloop endif endfunction function Yj takes unit o,integer Wj returns nothing if GetUnitAbilityLevel(o,'A0FW')>0 then if Wj==0 then return endif call wj(o,0,true) else call wj(o,GetUnitAbilityLevel(o,'A0H4'),true) endif call wj(o,Wj,false) endfunction function zj takes integer i returns nothing local integer j=0 loop exitwhen j>8 if i!=j then call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_PASSIVE,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_HELP_REQUEST,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_HELP_RESPONSE,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_XP,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_SPELLS,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_VISION,true) endif set j=j+1 endloop call SetPlayerTeam(Player(i),2) call SetPlayerState(Player(i),PLAYER_STATE_ALLIED_VICTORY,1) endfunction function Zj takes integer iP returns nothing local location ud local real vJ local integer yC local player oP=Player(iP) local item Jd if(Pv[iP*3]=='O00Y')and(qe[iP]==0)and IC(oP)then call Yj(I[iP],6) call SelectUnitForPlayerSingle(I[iP],oP) return endif set ud=Qx[iP] if(I[iP]==null)or(GetUnitState(I[iP],UNIT_STATE_LIFE)<1)then set vJ=0 else set vJ=GetUnitFacing(I[iP]) endif call RemoveUnit(I[iP]) set I[iP]=null set yC=Fd(iP)+1 set Px[iP]=qf('h00B',oP,GetUnitLoc(dB),0) call SetUnitInvulnerable(Px[iP],true) set Px[iP+9]=qf('n011',oP,GetUnitLoc(Px[iP]),0) if yC>5 then call SetPlayerTechResearched(oP,'Rhst',1) call TriggerRegisterUnitEvent(ob,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(rb,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(ab,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(nb,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(ib,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(Vb,Px[iP],EVENT_UNIT_PICKUP_ITEM) call TriggerRegisterUnitEvent(Eb,Px[iP],EVENT_UNIT_DROP_ITEM) call TriggerRegisterUnitEvent(Ob,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(Rb,Px[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterPlayerEventEndCinematic(Ib,oP) else call TriggerRegisterUnitEvent(Xb,Px[iP],EVENT_UNIT_PICKUP_ITEM) call UnitRemoveAbility(Px[iP],'A0E1') call UnitRemoveAbility(Px[iP],'A0E2') call UnitRemoveAbility(Px[iP],'A0E3') call UnitRemoveAbility(Px[iP],'A0EA') call UnitRemoveAbility(Px[iP],'A0EB') call UnitRemoveAbility(Px[iP],'A0EC') endif call zj(iP) set ge[iP]=null set X[iP]=CreateUnitAtLoc(oP,Pv[iP*3]-Pv[iP*3+1],ud,vJ) if(GetUnitTypeId(X[iP])=='O00T')or(GetUnitTypeId(X[iP])=='O018')then call AddSpecialEffectTarget("war3mapImported\\WeaponFlame.mdx",X[iP],"weapon") endif call StoreInteger(Ae,"unitmakingbattery",XC(X[iP]),0) call StoreInteger(Ae,"validatingitem",XC(X[iP]),0) call SetUnitAbilityLevel(X[iP],'A03H',7) call SetPlayerAbilityAvailable(oP,'A03H',true) call pH(X[iP],iP) call aH(X[iP]) call TriggerRegisterUnitEvent(fI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(IR,X[iP],EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(ZE,X[iP],EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(kR,X[iP],EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(wN,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(GI,X[iP],EVENT_UNIT_SPELL_CAST) call TriggerRegisterUnitEvent(dI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(DI,X[iP],EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(BR,X[iP],EVENT_UNIT_HERO_SKILL) call TriggerRegisterUnitEvent(bR,X[iP],EVENT_UNIT_HERO_SKILL) call TriggerRegisterUnitEvent(TN,X[iP],EVENT_UNIT_PICKUP_ITEM) call TriggerRegisterUnitEvent(uN,X[iP],EVENT_UNIT_DROP_ITEM) if not IC(oP)then call TriggerRegisterUnitEvent(SN,X[iP],EVENT_UNIT_ISSUED_ORDER) endif set hx[iP]=null call dj(iP,oP) call pC(iP) if Pv[iP*3]=='O003' then if yC<4 then call UnitAddAbility(X[iP],'A03J') else call UnitAddAbility(X[iP],'A044') set ee[iP]=qf('n00B',oP,GetUnitLoc(X[iP]),0) if yC>9 then call SetUnitAbilityLevel(X[iP],'A03A',3) elseif yC>6 then call SetUnitAbilityLevel(X[iP],'A03A',2) endif endif elseif Pv[iP*3]=='O00U' then set ee[iP]=qf('n00A',oP,GetUnitLoc(X[iP]),0) elseif Pv[iP*3]=='O004' then set ee[iP]=qf('n00N',oP,GetUnitLoc(X[iP]),0) call SetUnitAbilityLevel(X[iP],'A049',IMinBJ(4,1+bC(yC-1,3))) elseif Pv[iP*3]=='O002' then if yC>9 then call SetUnitAbilityLevel(X[iP],'A05N',3) elseif yC>6 then call SetUnitAbilityLevel(X[iP],'A05N',2) endif set ee[iP]=qf('n00H',oP,GetUnitLoc(X[iP]),0) set ee[iP+9]=qf('n00M',oP,GetUnitLoc(X[iP]),0) call StoreInteger(Ae,I2S(iP),"riotshield_cadet",-1) elseif B[iP]==12 then call StoreInteger(Ae,I2S(iP),"riotshield_cadet",-1) elseif Pv[iP*3]=='O014' then set yv[iP]=yv[iP]+I2R(yC-1)*0.025 set ee[iP]=qf('n00O',oP,GetUnitLoc(X[iP]),0) set ee[iP+9]=qf('n00P',oP,GetUnitLoc(X[iP]),0) set Yv[iP]=null elseif(Yv[iP]!=null)and(B[iP]==9)then if yC>10 then call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,4) else call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,bC(yC-1,3)) endif elseif B[iP]==11 then call SetUnitAbilityLevel(X[iP],'A0KS',IMinBJ(Gd(iP),4)+1) if mx[iP]>0 then call UnitRemoveAbility(X[iP],V[mx[iP]-1]) endif set mx[iP]=mx[iP]+IMinBJ(Gd(iP),4)+1 call UnitAddAbility(X[iP],V[mx[iP]-1]) endif if(B[iP]==10)or(B[iP]==11)then call SetUnitAbilityLevel(X[iP],'A0BH',Eo[iP]) else call SetUnitAbilityLevel(X[iP],'A09A',Eo[iP]) endif call SetPlayerTechResearched(oP,'Rhla',Pv[iP*3+2]+1) if B[iP]==5 then call SetUnitAbilityLevel(X[iP],'A0E8',Pv[iP*3+2]+1) else call SetUnitAbilityLevel(X[iP],'A05C',Pv[iP*3+2]+1) endif call SetPlayerAbilityAvailable(oP,'A05E'+IMinBJ(Pv[iP*3+2],2),true) call SetUnitMoveSpeed(X[iP],Ld(iP,true)) call SetPlayerTechResearched(oP,'R006',yC) if yC>10 then call SetHeroAgi(X[iP],GetHeroAgi(X[iP],false)+10,true) call ModifyHeroSkillPoints(X[iP],bj_MODIFYMETHOD_ADD,4) else if yC>1 then call SetHeroAgi(X[iP],GetHeroAgi(X[iP],false)+yC-1,true) endif call ModifyHeroSkillPoints(X[iP],bj_MODIFYMETHOD_ADD,bC(yC-1,3)) endif if B[iP]==5 then call ModifyHeroSkillPoints(X[iP],bj_MODIFYMETHOD_ADD,bC(yC-1,3)) elseif B[iP]==4 then call SetUnitAbilityLevel(X[iP],'A03L',4-bC(yC-1,3)) set gr[iP]=null elseif B[iP]==12 then call SetHeroInt(X[iP],GetHeroInt(X[iP],false)+bC(yC-1,3),true) call SetUnitAbilityLevel(X[iP],'A0NN',1+bC(yC-1,3)) endif set ve[iP]=ve[iP]+IMaxBJ(0,yC-3)*(yC+5) if yC>1 then call SetPlayerTechResearched(oP,'R00M',IMinBJ(4,1+bC(yC-1,3))) endif call qj(iP) call Jj(iP) if yC>8 then call sj(iP,Lo[iP*15+6]) endif call SelectUnitForPlayerSingle(X[iP],oP) call PanCameraToTimedLocForPlayer(oP,ud,0.25) call RemoveLocation(ud) if gd(iP)then call uj(X[iP]) call SetUnitAbilityLevel(X[iP],'A028',12) call SetUnitAbilityLevel(X[iP],'A017',12) endif if IC(oP)then call StoreInteger(Ae,"herocount","order"+I2S(iP),GetStoredInteger(Ae,"herocount","order")) call StoreInteger(Ae,"herocount","order",GetStoredInteger(Ae,"herocount","order")+1) endif call PostTriggerExecuteBJ(jX,true) if pv[iP*Nx+9]>0 then call Ph() endif if B[iP]==11 then call UnitAddAbility(X[iP],'A0P4') call hj(iP) call SetPlayerAbilityAvailable(oP,'A0P5',true) endif set yC=GetStoredInteger(Ae,"herocount","totalplayers") if yC==1 then if not tj(X[iP],3+pv[iP*Nx+8]/4)then call UnitAddItemById(X[iP],'I001') endif call SetItemCharges(UnitAddItemById(X[iP],'I00A'),16) call Uj(X[iP],10) else call tj(X[iP],pv[iP*Nx+8]/4) if yC==2 then call UnitAddItemById(X[iP],'I00A') call Uj(X[iP],4) elseif yC==3 then call SetItemCharges(UnitAddItemById(X[iP],'I00A'),4) call Uj(X[iP],2) elseif yC==4 then if GetStoredInteger(Ae,"herocount","yeller")==1 then call StoreInteger(Ae,"herocount","yeller",2) call Uj(X[iP],2) else call Uj(X[iP],1) endif endif endif if IC(oP)then set fo[iP]=1 endif call Bf(Pe[iP],iP) if Ho[iP]==9999 then call nf(oP,30) endif call TriggerSleepAction(0.1) if U==oP then call MultiboardMinimize(pe,false) endif if(B[iP]==1)or(B[iP]==2)or(B[iP]==8)or(GetUnitTypeId(X[iP])=='O00Y')then call UnitAddAbility(X[iP],'A0H5') call UnitAddAbility(X[iP],'A0HA') set yC=GetUnitAbilityLevel(X[iP],'A004')+Do[iP*Co] call SetUnitAbilityLevel(X[iP],'A0H5',yC) call SetUnitAbilityLevel(X[iP],'A0H9',yC) if B[iP]==1 then call SetUnitAbilityLevel(X[iP],'A0H8',1+Do[iP*Co]) endif elseif(B[iP]==6)or(GetUnitTypeId(X[iP])=='O00Q')then call UnitAddAbility(X[iP],'A0CL') call SetUnitAbilityLevel(X[iP],'A0CK',GetUnitAbilityLevel(X[iP],'A00F')+Do[iP*Co]) endif if Do[iP*Co+1]<1 then call SetPlayerTechResearched(oP,'R01E',1) endif call bf(oP,iP) endfunction function eJ takes integer nD returns integer if nD==1 then return 10 elseif nD==2 then return 9 elseif nD==3 then return 8 elseif nD==4 then return 5 elseif nD==5 then return 1 else return 0 endif endfunction function xJ takes nothing returns integer local integer oJ=10 local integer rJ=10 local integer iJ=10 local integer aJ=10 local integer nJ=10 local integer VJ=10 local integer EJ=10 local integer i=0 loop exitwhen i>8 if Pv[i*3]=='O005' then if oJ==10 then set oJ=IMaxBJ(0,oJ-5) else set oJ=IMaxBJ(0,oJ-3) endif elseif Pv[i*3]=='O000' then if rJ==10 then set rJ=IMaxBJ(1,rJ-4) else set rJ=IMaxBJ(1,rJ-2) endif elseif Pv[i*3]=='O002' then set iJ=IMaxBJ(0,iJ-4) elseif Pv[i*3]=='O014' then set EJ=IMaxBJ(0,EJ-8) elseif Pv[i*3]=='O00Y' then set aJ=IMaxBJ(1,aJ-2) elseif Pv[i*3]=='O004' then if nJ==10 then set nJ=IMaxBJ(1,nJ-4) else set nJ=IMaxBJ(1,nJ-2) endif elseif Pv[i*3]=='O003' then if VJ==10 then set VJ=IMaxBJ(1,VJ-4) else set VJ=IMaxBJ(1,VJ-2) endif endif set i=i+1 endloop set rJ=rJ+oJ set iJ=iJ+rJ set aJ=aJ+iJ set nJ=nJ+aJ set VJ=VJ+nJ set EJ=EJ+VJ set i=GetRandomInt(0,EJ+3) if i-1 then call aC("UNSUPPORTED CLASS INIT FOR PLAYER "+I2S(iP)) return 0 endif set RJ=-1 set IJ=0 set AJ=GetRandomInt(0,2) if aD==-2 then if iP==0 then set RJ=1 set AJ=1 elseif iP==1 then set RJ=2 set AJ=1 elseif iP==2 then set RJ=7 set AJ=3 elseif iP==3 then set RJ=0 set AJ=0 elseif iP==4 then set RJ=8 set AJ=2 elseif iP==5 then set RJ=6 set AJ=1 elseif iP==6 then set RJ=5 set AJ=2 elseif iP==7 then set RJ=3 set AJ=1 elseif iP==8 then set RJ=4 set AJ=2 set IJ=eJ(4) set qe[iP]=1 endif endif set Pv[iP*3]=XJ(RJ) if(Pv[iP*3]=='O00Y')and(IJ==0)then set IJ=eJ(GetRandomInt(0,4)) set qe[iP]=GetRandomInt(1,3) endif set Pv[iP*3+1]=IJ if Pv[iP*3]=='O00U' then set Pv[iP*3+2]=3 else set Pv[iP*3+2]=AJ endif if IC(Player(iP))then set Eo[iP]=GetRandomInt(0,14) set do[iP]=GetRandomInt(0,7) else set Eo[iP]=9 set do[iP]=7 endif return do[iP] endfunction function NJ takes integer Qf,location sf,real Sf,boolean bJ returns unit local unit BJ=null if iv<(fv/ 2)then set iv=iv+1 set BJ=CreateUnitAtLoc(Player(11),Qf,sf,Sf) elseif nv<(fv/ 2)then set nv=nv+1 set BJ=CreateUnitAtLoc(Player(10),Qf,sf,Sf) call SetUnitColor(BJ,PLAYER_COLOR_BROWN) elseif bJ then set av=av+1 endif if BJ!=null then call SetUnitState(BJ,UNIT_STATE_LIFE,RMaxBJ(1,GetUnitState(BJ,UNIT_STATE_LIFE)-GetRandomInt(0,99))) call uf(BJ,0.0) set av=av-1 if av<0 then set av=0 endif if(No>0)and(Qf=='n008')then set No=No-1 call SetUnitUserData(BJ,Ao[No]) endif endif call RemoveLocation(sf) return BJ endfunction function cJ takes unit LC returns nothing call IssuePointOrder(LC,"attack",GetRandomInt(600,4300),GetRandomInt(8000,13000)) endfunction function CJ takes unit LC,unit mC returns nothing if Wi then if not IsUnitType(LC,UNIT_TYPE_ANCIENT)then call cJ(LC) return endif endif if mC==null then set mC=Z endif if GetUnitState(mC,UNIT_STATE_LIFE)>0 then call IssuePointOrder(LC,"attack",GetUnitX(mC)+GetRandomInt(-499,499),GetUnitY(mC)+GetRandomInt(-499,499)) else call cJ(LC) endif endfunction function dJ takes nothing returns unit local integer i=0 local integer WC=0 local unit array DJ loop exitwhen i>8 if Ed(i)then set DJ[WC]=X[i] set WC=WC+1 endif set i=i+1 endloop if WC==0 then return null endif return DJ[GetRandomInt(0,WC-1)] endfunction function fJ takes nothing returns nothing set Z=dJ() endfunction function FJ takes unit LC returns boolean local integer gJ=GetUnitCurrentOrder(LC) return(gJ==lo[0])or(gJ==lo[1])or(gJ==lo[2]) endfunction function GJ takes unit hJ,boolean HJ returns boolean if(Nv[5]<1)and(kv<4)then return false endif if GetRandomInt(0,99)<(5*jo)then return false endif if(Kv>-1)and sh()then call Ph() set Zr[vi]=hJ set vi=vi+1 call TriggerRegisterUnitEvent(XO,hJ,EVENT_UNIT_DEATH) call SetUnitVertexColor(hJ,80,199,0,255) call AddSpecialEffectTarget("Objects\\InventoryItems\\ThunderLizardEgg\\ThunderLizardEgg.mdl",hJ,"hand right") call UnitAddAbility(hJ,'A00N') call SetUnitState(hJ,UNIT_STATE_MANA,500) call UnitAddAbility(hJ,'AId0') call UnitAddAbility(hJ,'A0AA') if HJ and(GetRandomInt(0,J)==0)then call UnitAddAbility(hJ,'Afzy') endif if GetRandomInt(0,J-1)==0 then call UnitAddAbility(hJ,'Ahea') endif return true endif return false endfunction function jJ takes unit hJ returns boolean call SetUnitUserData(hJ,998) call TriggerRegisterUnitEvent(IO,hJ,EVENT_UNIT_DEATH) call SetUnitVertexColor(hJ,255,255,0,255) return false endfunction function JJ takes unit hJ returns boolean if(fe<2)or(mo>0)or(ix<2)or(Yi<1)then return true elseif GetRandomInt(1,64+C+Ai[4])<65 then set Ai[4]=Ai[4]+C/ 3 return true endif call aC("|r|cffff8000WARNING|r |cffffcc00Creature with intense nuclear radiation detected!") set Ai[4]=0 set Yi=Yi-10 call UnitAddAbility(hJ,'A0F4') call UnitAddAbility(hJ,'AIlz') call UnitAddAbility(hJ,'A0P7') call UnitAddAbility(hJ,'A0P8') call UnitAddAbility(hJ,'A0PB') call UnitAddAbility(hJ,'A0P9') call UnitAddAbility(hJ,'A0I0'+IMinBJ(ix-2,3)) call SetUnitScale(hJ,1.52,1.52,1.72) call SetUnitUserData(hJ,999) call SetUnitVertexColor(hJ,200,40,20,255) call TriggerRegisterUnitEvent(DO,hJ,EVENT_UNIT_DEATH) call TriggerRegisterUnitEvent(fO,hJ,EVENT_UNIT_SPELL_EFFECT) return false endfunction function kJ takes unit LC,boolean KJ,integer Mg returns nothing if KJ then set cr=cr+1 call TriggerRegisterUnitEvent(dO,LC,EVENT_UNIT_DEATH) endif call SetUnitUserData(LC,Mg) call UnitAddAbility(LC,'A0F6') call UnitAddAbility(LC,'AIdn') call UnitAddAbility(LC,'A03Z') call UnitAddAbility(LC,'A0JS') call SetUnitAbilityLevel(LC,'A02T',Mg+fe-1) call SetUnitVertexColor(LC,90,70,50,255) endfunction function lJ takes unit hJ,integer LJ returns boolean if GetRandomInt(0,8)0)and(GetRandomInt(0,16-C-(mo/33))<1)and(GetUnitTypeId(hJ)=='n008')then call UnitAddAbility(hJ,'A0F6') call UnitAddAbility(hJ,'Arel') call UnitAddAbility(hJ,'A0F4') call UnitAddAbility(hJ,'AIlz') if(fe>1)and(ix>1)then call UnitAddAbility(hJ,'A0I0'+IMinBJ(ix-2,3)) endif call UnitAddAbility(hJ,'A0DB') call UnitAddAbility(hJ,'A0DC') call SetUnitScale(hJ,1.39,1.39,1.5) else if GetRandomInt(0,2)5 then call UnitAddAbility(hJ,'Afzy') elseif MJ>2 then call UnitAddAbility(hJ,'Ahea') elseif MJ>0 then call UnitAddAbility(hJ,'Apsh') endif endfunction function pJ takes integer PJ,boolean bJ returns nothing local integer i local integer j=J set i=GetRandomInt(4-J+bC(Q[12],90)+te,6-j+NC(Q[12]/30.0+Iv/4.8)+te) if mo<1 then if i>21 then set i=21 endif set j=NC(i*0.25)+1 if(i>j)and(GetRandomInt(1,4)70))or(Wi and(mo<80))then if i>(2+C/2)then set i=2+C/2 endif elseif i>30 then set i=30 endif loop exitwhen i<1 set Yx[yx]='n008' set vo[yx]=GetRandomInt(1,13) set zx[yx]=-1 set Zx[yx]=bJ set yx=yx+1 set i=i-1 endloop endif call TriggerRegisterTimerEvent(LX,0,false) endfunction function qJ takes location QJ,integer Ud,integer wd,integer WC returns nothing local location ud local unit BJ loop exitwhen WC<1 set ud=Ec(QJ,GetRandomInt(Ud,wd),GetRandomInt(0,359)) set BJ=qf('u005',Player(10),ud,GetRandomInt(0,359)) set nv=nv+1 call SetUnitColor(BJ,PLAYER_COLOR_BROWN) call SetUnitMoveSpeed(BJ,GetUnitDefaultMoveSpeed(BJ)+30/J) call UnitAddAbility(BJ,'AIat') call TriggerSleepAction(0.01) call CJ(BJ,null) set WC=WC-1 endloop endfunction function sJ takes unit SJ,integer tJ,location TJ returns nothing local player uJ=GetOwningPlayer(SJ) local unit UJ local unit KD local location tF=GetUnitLoc(SJ) set KD=CreateUnitAtLoc(uJ,'o00J',tF,GetUnitFacing(SJ)) call UnitAddAbility(KD,'A030') set UJ=CreateUnitAtLoc(uJ,'o00N',TJ,0) call IssueTargetOrder(KD,"drunkenhaze",UJ) call RC(DistanceBetweenPoints(tF,TJ)*0.0012) call RemoveLocation(tF) set tF=null call RemoveUnit(KD) call RemoveUnit(UJ) set UJ=CreateUnitAtLoc(uJ,'n000',TJ,0.00) call UnitAddAbility(UJ,E[tJ]) set KD=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'n000',TJ,0.00) call StopSoundBJ(OE,false) call PlaySoundOnUnitBJ(OE,100,KD) call ExplodeUnitBJ(UJ) call TriggerSleepAction(1.1*Xx) call RemoveUnit(UJ) call RemoveUnit(KD) call RemoveLocation(TJ) set UJ=null set KD=null set uJ=null endfunction function wJ takes nothing returns boolean return(not IsUnitType(GetFilterUnit(),UNIT_TYPE_MECHANICAL)and not IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))or(GetUnitTypeId(GetFilterUnit())=='U009') endfunction function WJ takes nothing returns nothing local unit LC=GetEnumUnit() local integer Aj=GetUnitPointValue(LC) if(Aj<6)or(Aj>100)then call PauseUnit(LC,true) endif endfunction function yJ takes nothing returns nothing local unit LC=GetEnumUnit() local integer Aj=GetUnitPointValue(LC) if(Aj<6)or(Aj>100)then call PauseUnit(LC,false) endif endfunction function YJ takes unit SJ,integer tJ,location TJ returns nothing local player uJ=GetOwningPlayer(SJ) local unit zJ local unit vH local location tF=GetUnitLoc(SJ) local location ZJ local group g set vH=CreateUnitAtLoc(uJ,'o00J',tF,GetUnitFacing(SJ)) call UnitAddAbility(vH,'A01X') call SetUnitAbilityLevel(vH,'A01X',tJ) set zJ=CreateUnitAtLoc(uJ,'o00N',TJ,0) call IssueTargetOrder(vH,"drunkenhaze",zJ) call RC(DistanceBetweenPoints(tF,TJ)*0.0012) if tJ>7 then set ZJ=GetUnitLoc(zJ) set g=bc(263.0,ZJ,Condition(function wJ)) call ForGroup(g,function WJ) if tJ>15 then call RC(3.0) elseif tJ>13 then call RC(2.0) else call RC(1.0) endif call ForGroup(g,function yJ) call DestroyGroup(g) call RemoveLocation(ZJ) endif call RemoveLocation(tF) call RemoveUnit(vH) call RemoveUnit(zJ) call RemoveLocation(TJ) set g=null set tF=null set vH=null set zJ=null set uJ=null set ZJ=null endfunction function vk takes unit Od,unit ek returns nothing local real xk=3.0*IMinBJ(IMaxBJ(GetHeroInt(Od,true)-115,0),50) local lightning fx=AddLightning("CHIM",true,GetUnitX(Od),GetUnitY(Od),GetUnitX(ek),GetUnitY(ek)) local integer Lc=GetUnitTypeId(ek) local integer i=GetUnitAbilityLevel(ek,'S001') local boolean ok=IsUnitType(ek,UNIT_TYPE_HERO) local boolean rk=IsUnitType(ek,UNIT_TYPE_ANCIENT) if xk>0.0 then if(GetUnitState(Od,UNIT_STATE_MAX_MANA)-GetUnitState(Od,UNIT_STATE_MANA))>=xk then call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+xk) set xk=0.0 endif endif if Lc=='O010' then set Zi=Zi+12 if Zi>30 then set Zi=30 endif endif if(i>0)and((Lc!='n00S')or(i==1))then call TriggerSleepAction(Xx) if xk>0.0 then call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+xk) endif call DestroyLightning(fx) set fx=null return endif call UnitRemoveAbility(ek,'Ahea') if i==0 then if GetUnitState(ek,UNIT_STATE_LIFE)>10.0 then call SetUnitState(ek,UNIT_STATE_LIFE,GetUnitState(ek,UNIT_STATE_LIFE)-10.0) endif call UnitAddAbility(ek,'S002') if ok or rk then call UnitAddAbility(ek,'S003') if rk and(Lc!='O010')then call IssueImmediateOrder(ek,"stop") endif else call UnitAddAbility(ek,'S001') call UnitAddAbility(ek,'A0MN') endif if(Lc!='u001')and not ok and not rk then call UnitAddAbility(ek,'Aeth') endif else call SetUnitAbilityLevel(ek,'S001',1) call SetUnitAbilityLevel(ek,'A0MN',1) endif if GetUnitAbilityLevel(ek,'AIlz')>0 then call SetUnitAbilityLevel(ek,'S001',2) call SetUnitAbilityLevel(ek,'A0MN',2) if GetUnitAbilityLevel(ek,'A0P7')>0 then call SetUnitAbilityLevel(ek,'A0P7',IMinBJ(GetUnitAbilityLevel(ek,'A0P7')+1,5)) endif endif call UnitRemoveAbility(ek,'Bfzy') call UnitRemoveAbility(ek,'Buhf') call UnitRemoveAbility(ek,'Broa') call UnitRemoveAbility(ek,'A0JS') call UnitRemoveAbility(ek,'A0F6') call UnitRemoveAbility(ek,'A0F5') call UnitRemoveAbility(ek,'Afzy') call UnitRemoveAbility(ek,'B009') call UnitRemoveAbility(ek,'Apsh') call UnitRemoveAbility(ek,'A0AA') call UnitRemoveAbility(ek,'A03N') call UnitRemoveAbility(ek,'Aens') call UnitRemoveAbility(ek,'ANbl') call UnitRemoveAbility(ek,'A0JG') if Lc=='n00S' then if i==0 then call SetUnitUserData(ek,GetUnitUserData(ek)+1) endif elseif not ok and not rk then call SetUnitUserData(ek,999) endif call TriggerSleepAction(Xx) if xk>0.0 then call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+xk) endif call DestroyLightning(fx) call RC(1) if(ok or rk)and(ek!=null)and(GetUnitState(ek,UNIT_STATE_LIFE)>1)then call UnitRemoveAbility(ek,'S003') call UnitRemoveAbility(ek,'S002') endif set fx=null endfunction function ik takes player oP returns nothing local integer iP=GetPlayerId(oP) local unit Od=X[iP] if Ed(iP)then call IssueImmediateOrder(Od,"manashieldoff") endif call SetPlayerAbilityAvailableBJ(false,'A053',oP) call SetPlayerAbilityAvailableBJ(false,'A05E',oP) call SetPlayerAbilityAvailableBJ(false,'A05F',oP) call SetPlayerAbilityAvailableBJ(false,'A05G',oP) call SetPlayerAbilityAvailableBJ(false,'A05H',oP) call SetPlayerAbilityAvailableBJ(false,'A05I',oP) call SetPlayerAbilityAvailableBJ(true,'A040',oP) if Ed(iP)then call IssueImmediateOrder(Od,"manashieldon") endif endfunction function RedVictoryNanites takes nothing returns nothing local integer i=0 loop exitwhen i>8 if Q[i]>0 then call ik(Player(i)) endif set i=i+1 endloop endfunction function ak takes unit LC returns nothing local integer iP=GetPlayerId(GetOwningPlayer(LC)) local location ud local effect KD local string Vd="" local integer nk=0 local integer Vk local boolean Ek=false if vv then return endif if(Nv[12]<1)and(Nv[11]<1)and(C==1)and(fe==1)and(mo<1)then if GetStoredInteger(Ae,"herocount","totalplayers")==1 then if not HC(GetUnitX(LC),GetUnitY(LC),-966,-4250,500)then set Nv[12]=1 call QD("Hmm, now what?",LC,16) call TriggerRegisterTimerEvent(oR,GetRandomInt(3,10),false) return endif endif endif if not Xd(LC)then set LC=I[iP] set Vd="Please revive me!" elseif pv[iP*Nx+12]>0 then if(GetUnitState(LC,UNIT_STATE_MAX_MANA)-GetUnitState(LC,UNIT_STATE_MANA))>=500.0 then if dg(iP)then set Ek=true elseif(GetUnitState(LC,UNIT_STATE_MANA)<250)and(GetUnitAbilityLevel(LC,'B030')>0)then call TriggerRegisterTimerEvent(Gi[iP],0,false) endif endif elseif(GetUnitState(LC,UNIT_STATE_MANA)<250)and(GetUnitAbilityLevel(LC,'B030')>0)then call TriggerRegisterTimerEvent(Gi[iP],0,false) endif if LC==null then return endif if Vd=="" then if Kf(LC)then set nk=1 endif if UnitHasBuffBJ(LC,'Blsh')then set nk=nk+2 endif if GetUnitState(LC,UNIT_STATE_LIFE)<168 then if nk>2 then set Vd="I'm injured, wounded, and need healing!" elseif nk>1 then set Vd="I'm wounded and need healing!" elseif nk>0 then set Vd="I'm injured and need healing!" else set Vd="I desparately need healing!" endif else if nk>2 then set Vd="I'm injured and wounded, please help!" elseif nk>1 then set Vd="I'm wounded, please bandage me!" elseif nk>0 then set Vd="I'm injured, please help!" elseif not Ek then set Vk=GetRandomInt(0,9) if Vk==0 then set Vd="Help me out over here!" elseif Vk==1 then set Vd="Hey! Give me a hand." elseif Vk==2 then set Vd="Requesting backup!" elseif Vk==3 then set Vd="Assistance needed now!" elseif Vk==4 then set Vd="Back me up, please!" elseif Vk==5 then set Vd="Immediate aid needed!" elseif Vk==6 then set Vd="Can I have some backup?" elseif Vk==7 then set Vd="Help needed, my location!" elseif Vk==8 then set Vd="Over here! Quickly!" else set Vd="Help! I need assistance." endif endif endif endif if Vd=="" then return endif set KD=AddSpecialEffectTarget("Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl",LC,"overhead") set ud=GetUnitLoc(LC) call cD(iP,ud,4) call RemoveLocation(ud) call aC(ND(iP)+Vd) call StopSoundBJ(fE,false) call PlaySoundBJ(fE) call TriggerSleepAction(2.75*Xx) call DestroyEffect(KD) call CH(LC) endfunction function Xk takes unit Ok,boolean Rk returns nothing local string Ik=XC(Ok) local integer Ak=GetStoredInteger(Ae,"apc_stage",Ik) if Rk then if(Ak>3)then if GetUnitUserData(Ok)>1 then call aC("A.P.C. destroyed! Civilian casualties: "+I2S(GetUnitUserData(Ok)-1)) endif else if GetUnitUserData(Ok)>0 then call aC("A.P.C. destroyed! Civilian casualties: "+I2S(GetUnitUserData(Ok))) endif endif endif call FlushStoredInteger(Ae,"apc_stage",Ik) call FlushStoredInteger(Ae,"apc_exit",Ik) call RemoveSavedHandle(qi,StringHash("apc_trig_board_apc"),StringHash(XC(LoadTriggerHandle(qi,StringHash("apc_trig_board"),StringHash(Ik))))) if Ak<2 then call DestroyTrigger(LoadTriggerHandle(qi,StringHash("apc_trig_board"),StringHash(Ik))) call FlushStoredInteger(Ae,"apc_trig_board_done",Ik) else call StoreInteger(Ae,"apc_trig_board_done",Ik,1) endif call RemoveSavedHandle(qi,StringHash("apc_trig_board"),StringHash(Ik)) call RemoveSavedHandle(qi,StringHash("apc_trig_dismiss_apc"),StringHash(XC(LoadTriggerHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik))))) call DisableTrigger(LoadTriggerHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik))) call DestroyTrigger(LoadTriggerHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik))) call RemoveSavedHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik)) if not Rk then call DestroyTrigger(LoadTriggerHandle(qi,StringHash("apc_trig_death"),StringHash(Ik))) endif call RemoveSavedHandle(qi,StringHash("apc_trig_death"),StringHash(Ik)) endfunction function Nk takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit Ok=GetDyingUnit() call Xk(Ok,true) call DestroyTrigger(jD) endfunction function bk takes nothing returns boolean local unit LC=GetFilterUnit() return(GetUnitPointValue(LC)<3)and(GetUnitUserData(LC)<1)and(LC!=bv[1]) endfunction function Bk takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit Ok=LoadUnitHandle(qi,StringHash("apc_trig_board_apc"),StringHash(XC(jD))) local string Ik=XC(Ok) local integer iP local location ud local group g local integer ck local integer i=0 local integer Ck=0 local unit array dk local unit LC if(GetStoredInteger(Ae,"apc_trig_board_done",Ik)>0)or(Ok==null)or not(GetUnitState(Ok,UNIT_STATE_LIFE)>0)then call FlushStoredInteger(Ae,"apc_trig_board_done",Ik) call DisableTrigger(jD) call DestroyTrigger(jD) return endif set ud=GetUnitLoc(Ok) set g=bc(500,ud,Condition(function bk)) loop set LC=FirstOfGroup(g) exitwhen LC==null set dk[Ck]=LC set Ck=Ck+1 call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set i=0 loop exitwhen i>=Ck call SetUnitUserData(dk[i],1) call IssuePointOrderLoc(dk[i],"move",ud) set i=i+1 endloop call RC(2.5) call RemoveLocation(ud) if(GetStoredInteger(Ae,"apc_trig_board_done",Ik)>0)or(Ok==null)or not(GetUnitState(Ok,UNIT_STATE_LIFE)>0)then set i=0 loop exitwhen i>=Ck if(dk[i]!=null)then call SetUnitUserData(dk[i],0) endif set i=i+1 endloop call FlushStoredInteger(Ae,"apc_trig_board_done",Ik) call DisableTrigger(jD) call DestroyTrigger(jD) return endif set ck=GetUnitUserData(Ok) set i=0 loop exitwhen i>=Ck exitwhen ck>7 if(dk[i]!=null)then if(GetUnitState(dk[i],UNIT_STATE_LIFE)>0)then set iP=GetPlayerId(GetOwningPlayer(dk[i])) if dk[i]==Yv[iP]then call DestroyTrigger(se[iP]) set se[iP]=null set Yv[iP]=null set ee[iP]=qf('n00H',Player(iP),GetUnitLoc(X[iP]),0) endif call RemoveUnit(dk[i]) set ck=ck+1 else call SetUnitUserData(dk[i],0) endif endif set i=i+1 endloop call SetUnitUserData(Ok,ck) loop exitwhen i>=Ck if(dk[i]!=null)then call SetUnitUserData(dk[i],0) endif set i=i+1 endloop if ck>7 then call StoreInteger(Ae,"apc_stage",Ik,3) endif if(ck>7)or(GetStoredInteger(Ae,"apc_trig_board_done",Ik)>0)then call FlushStoredInteger(Ae,"apc_trig_board_done",Ik) call DisableTrigger(jD) call DestroyTrigger(jD) endif endfunction function Dk takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit Ok local integer fk local location tF set Ok=LoadUnitHandle(qi,StringHash("apc_trig_dismiss_apc"),StringHash(XC(jD))) set fk=GetStoredInteger(Ae,"apc_exit",XC(Ok)) if fk==1 then set tF=GetRectCenter(Tn) elseif fk==2 then set tF=GetRectCenter(Un) elseif fk==3 then set tF=GetRectCenter(un) else set tF=GetRectCenter(wn) endif call RemoveGuardPosition(Ok) call IssuePointOrderLoc(Ok,"move",tF) call TriggerSleepAction(1) call RemoveLocation(tF) call TriggerRegisterTimerEvent(jD,30,false) endfunction function Fk takes integer gk returns nothing local integer i local location ud local location Gk local unit Ok local string Ik local trigger jD set i=GetRandomInt(1,4) if i==1 then set ud=GetRectCenter(Tn) if GetRandomInt(0,2)==0 then set Gk=GetRectCenter(xE) else set Gk=GetRectCenter(eE) endif elseif i==2 then set ud=GetRectCenter(Un) if GetRandomInt(0,2)==0 then set Gk=GetRectCenter(xE) else set Gk=GetRectCenter(oE) endif elseif i==3 then set ud=GetRectCenter(un) if GetRandomInt(0,2)==0 then set Gk=GetRectCenter(zV) else set Gk=GetRectCenter(rE) endif else set ud=GetRectCenter(wn) if GetRandomInt(0,2)==0 then set Gk=GetRectCenter(zV) else set Gk=GetRectCenter(ZV) endif endif if not vv then if gk>0 then call aC("A.P.C. en route to bomb shelter in "+I2S(gk)+" seconds...") else call aC("A.P.C. en route to bomb shelter...") endif call PingMinimapLocForForceEx(Fx,Gk,5.00,bj_MINIMAPPINGSTYLE_SIMPLE,57.81,85.16,100.0) call SetCameraQuickPositionLocForPlayer(U,Gk) endif if gk>0 then call OC(gk) endif set Ok=Tf('h000',Player(9),ud,bj_UNIT_FACING) set Ik=XC(Ok) call StoreInteger(Ae,"apc_exit",Ik,i) call StoreInteger(Ae,"apc_stage",Ik,1) set jD=CreateTrigger() call TriggerRegisterTimerEventPeriodic(jD,5.00) call DisableTrigger(jD) call TriggerAddAction(jD,function Bk) call SaveTriggerHandle(qi,StringHash("apc_trig_board"),StringHash(Ik),jD) call SaveUnitHandle(qi,StringHash("apc_trig_board_apc"),StringHash(XC(jD)),Ok) call StoreInteger(Ae,"apc_trig_board_done",Ik,0) set jD=CreateTrigger() call DisableTrigger(jD) call TriggerAddAction(jD,function Dk) call SaveTriggerHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik),jD) call SaveUnitHandle(qi,StringHash("apc_trig_dismiss_apc"),StringHash(XC(jD)),Ok) set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,Ok,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function Nk) call SaveTriggerHandle(qi,StringHash("apc_trig_death"),StringHash(Ik),jD) call RemoveGuardPosition(Ok) call IssuePointOrderLoc(Ok,"move",Gk) call RemoveLocation(ud) call RemoveLocation(Gk) endfunction function hk takes nothing returns boolean return(GetUnitTypeId(GetFilterUnit())=='hfoo') endfunction function Hk takes integer jk,integer Jk returns nothing local integer i=IMinBJ(jk,Me-Jk) loop loop set i=i-1 exitwhen i<0 exitwhen(me[i]!=null)and(GetUnitState(me[i],UNIT_STATE_LIFE)>0) endloop exitwhen i<0 if GetUnitTypeId(me[i])=='hfoo' then call PingMinimapForForceEx(Fx,GetUnitX(me[i]),GetUnitY(me[i]),9.8,0,50.4,74.6,5.1) else call PingMinimapForForceEx(Fx,GetUnitX(me[i]),GetUnitY(me[i]),4.9,0,62.7,72.5,5.1) endif endloop set i=1 loop exitwhen i>Jk exitwhen(Me-i)<0 if(me[Me-i]!=null)and(GetUnitState(me[Me-i],UNIT_STATE_LIFE)>0)then call PingMinimapForForceEx(Fx,GetUnitX(me[Me-i]),GetUnitY(me[Me-i]),9.8,0,50.4,74.6,5.1) endif set i=i+1 endloop endfunction function kk takes nothing returns nothing local real x=eo local real y=xo local real xF local real yF local real Kk local real lk local unit Lk local integer i=Me-1 loop exitwhen i1 then set i=vi-1 loop exitwhen i<0 set me[Me]=Zr[i] set Me=Me+1 set i=i-1 endloop endif set i=Me if i>(Mk+pk)then set jD=CreateTrigger() call TriggerAddAction(jD,function kk) set oo=1 loop exitwhen i<2 call TriggerRegisterTimerEvent(jD,0,false) set i=i-1 endloop call TriggerSleepAction(0.1) call DestroyTrigger(jD) endif set jD=null call StartSound(bE) if qk==1 then call aC("Scanning for rad frags near "+AD(GetPlayerId(GetOwningPlayer(Od)))+"...") elseif qk==2 then call aC("Scanning for rad frags near |r"+vD(GetPlayerId(GetOwningPlayer(Od)))+GetHeroProperName(Od)+"|r|cffffcc00...") else call aC("Scanning for radiation fragments...") endif call Hk(Mk,pk) call TriggerSleepAction(Xx) set Me=-1 endfunction function Qk takes location ud returns nothing local integer i=0 local location array sk local real array Sk local fogmodifier tk set sk[GetPlayerId(U)]=GetCameraTargetPositionLoc() set Sk[GetPlayerId(U)]=DistanceBetweenPoints(sk[GetPlayerId(U)],ud) call RemoveLocation(sk[GetPlayerId(U)]) loop exitwhen i>8 call CameraSetEQNoiseForPlayer(Player(i),RMaxBJ(2.0,7.0-Sk[GetPlayerId(U)]/1000.0)) call Dh(Player(i),0.10,0.75,0.5,"ReplaceableTextures\\CameraMasks\\White_mask.blp",100,88,72,100.0,RMinBJ(99.0,RMaxBJ(1.0,Sk[GetPlayerId(U)]*8.0/100.0-70.0))) set i=i+1 endloop call TriggerSleepAction(0.10) set tk=CreateFogModifierRadiusLocBJ(true,Player(9),FOG_OF_WAR_VISIBLE,ud,128.00) call StopSoundBJ(RE,false) call PlaySoundAtPointBJ(RE,100,ud,0) call TriggerSleepAction(0.10) call DestroyFogModifier(tk) endfunction function Tk takes nothing returns nothing local integer i=0 loop exitwhen i>8 call xG(Player(i)) set i=i+1 endloop endfunction function uk takes integer Uk returns nothing set De=Uk call ff(De) endfunction function wk takes location ud,integer iP,integer yC returns integer local integer Wk local unit yk call Qk(ud) set Wk=Xr set yk=CreateUnitAtLoc(Player(iP),'o00R',ud,0) if yC>8 then call UnitAddAbility(yk,'A0C9') elseif yC>5 then call UnitAddAbility(yk,'A0C8') elseif yC>-1 then call UnitAddAbility(yk,'A03E') elseif yC>-2 then call UnitAddAbility(yk,'A0IL') else call UnitAddAbility(yk,'A0PA') endif call ExplodeUnitBJ(yk) call TriggerSleepAction(0.25*Xx) set Wk=Xr-Wk if yC>0 then call uk((1+De)*2+(IMaxBJ(2,Wk)-1)*Wk) else call uk(De+1) endif call TriggerSleepAction(1.2*Xx) call Tk() return Wk endfunction function Yk takes unit VF,unit LC,real zk returns nothing local lightning fx=AddLightningEx("DRAM",true,GetUnitX(VF),GetUnitY(VF),50,GetUnitX(LC),GetUnitY(LC),50) local real Zk=GetUnitState(LC,UNIT_STATE_MANA) local real vK=GetUnitState(VF,UNIT_STATE_MANA) local real eK=GetUnitState(VF,UNIT_STATE_MAX_MANA) if zk>Zk then set zk=Zk endif if zk>(eK-vK)then set zk=eK-vK endif call SetUnitState(LC,UNIT_STATE_MANA,Zk-zk) call SetUnitState(VF,UNIT_STATE_MANA,vK+zk) call TriggerSleepAction(0.1) call DestroyLightning(fx) set fx=null endfunction function xK takes unit ek,unit oK returns nothing local player oP=GetOwningPlayer(oK) local integer iP=GetPlayerId(oP) local real gH=195.0 local integer rK=21 local integer iK=GetPlayerTechCount(oP,'R016',true) local integer aK=5+iK local integer nK=4*iK+15*GetPlayerTechCount(oP,'R008',true) local integer VK=GetUnitAbilityLevel(oK,'A0MW')+Do[iP*Co] local real EK local real XK=1.0 local real OK=1.0 if GetUnitAbilityLevel(oK,'Broa')>0 then set XK=Rr endif if GetUnitAbilityLevel(oK,'B02N')>0 then set OK=wr endif if VK>0 then set EK=1.8+0.2*VK set VK=5+5*VK endif set gH=GetRandomReal(gH+aK+nK,gH+aK*rK+nK) if(GetRandomInt(0,99)7 endfunction function AK takes unit hJ,unit oK returns nothing local group NK=RK(99.00,100.0,GetUnitX(oK),GetUnitY(oK),GetUnitX(hJ),GetUnitY(hJ),Condition(function IK)) call xK(FirstOfGroup(NK),X[GetPlayerId(GetOwningPlayer(oK))]) call DestroyGroup(NK) set NK=null endfunction function bK takes integer mc returns integer if mc>3 then return 336 endif return 120+72*mc endfunction function BK takes integer mc returns integer if mc>3 then return 144 endif return 96+16*mc endfunction function cK takes unit CK returns nothing local integer iP=GetPlayerId(GetOwningPlayer(CK)) local integer iT local integer i=0 local integer dK local integer DK local integer fK if(B[iP]!=8)or(Yv[iP]==null)then return endif set iT=GetPlayerId(GetOwningPlayer(Yv[iP])) loop exitwhen i>2 exitwhen Ix[iT*3+i]==CK set i=i+1 endloop if i<3 then set dK=Ax[iT*9+i*3] set DK=Ax[iT*9+i*3+1] set fK=Ax[iT*9+i*3+2] set yv[iT]=yv[iT]-0.01*dK call SetHeroAgi(X[iT],GetHeroAgi(X[iT],false)-DK,true) set pv[iT*Nx+1]=pv[iT*Nx+1]-fK if fK>0 then call SetUnitMoveSpeed(X[iT],Ld(iT,false)) endif call DestroyEffect(Rx[iT*3+i]) set Rx[iT*3+i]=null set Ix[iT*3+i]=null set Ax[iT*9+i*3]=0 set Ax[iT*9+i*3+1]=0 set Ax[iT*9+i*3+2]=0 endif set Yv[iP]=null endfunction function FK takes unit Od returns nothing local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer i=0 loop exitwhen i>2 if Ix[iP*3+i]!=null then call cK(Ix[iP*3+i]) endif set i=i+1 endloop endfunction function gK takes integer dK returns integer if dK==0 then return 0 endif return 4+dK endfunction function GK takes integer fK returns integer if fK==0 then return 0 endif return 1+fK*4 endfunction function hK takes unit Od,unit LC,integer Lc returns nothing local player oP=GetOwningPlayer(Od) local integer iT=GetPlayerId(GetOwningPlayer(LC)) local integer Mh=GetUnitAbilityLevel(Od,'A0B0'+Lc) local integer dK=gK(GetUnitAbilityLevel(Od,'A0B0')) local integer DK=GetUnitAbilityLevel(Od,'A0B1')*2 local integer fK=GK(GetUnitAbilityLevel(Od,'A0B2')) call cK(Od) if Lc==0 then set dK=20+Mh*5 elseif Lc==1 then set DK=Mh*5 else set fK=4+Mh*12 endif if Od==LC then set dK=NC(dK*0.8) set DK=NC(DK*0.8) set fK=NC(fK*0.8) endif set yv[iT]=yv[iT]+0.01*dK call SetHeroAgi(LC,GetHeroAgi(LC,false)+DK,true) set pv[iT*Nx+1]=pv[iT*Nx+1]+fK if Lc==0 then set Rx[iT*3+Lc]=AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIob\\AIobTarget.mdl",LC,"overhead") elseif Lc==1 then set Rx[iT*3+Lc]=AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIfb\\AIfbTarget.mdl",LC,"overhead") else set Rx[iT*3+Lc]=AddSpecialEffectTarget("Abilities\\Spells\\Items\\OrbSlow\\OrbSlow.mdl",LC,"overhead") endif if fK>0 then call SetUnitMoveSpeed(LC,Ld(iT,false)) endif set Ix[iT*3+Lc]=Od set Ax[iT*9+Lc*3]=dK set Ax[iT*9+Lc*3+1]=DK set Ax[iT*9+Lc*3+2]=fK set Yv[GetPlayerId(oP)]=LC endfunction function HK takes unit LC returns boolean local integer jK local string aF=XC(LC) if uH(LC,GetPlayerId(GetOwningPlayer(LC)))then call FlushStoredInteger(Ae,"radresistlevel",aF) return false endif set jK=GetStoredInteger(Ae,"radresistlevel",aF) call StoreInteger(Ae,"radresistlevel",aF,jK-1) if jK==1 then call FlushStoredInteger(Ae,"radresistlevel",aF) call UnitRemoveType(LC,UNIT_TYPE_ANCIENT) endif return true endfunction function JK takes unit LC,integer nc returns nothing local integer jK local string aF local integer iP=GetPlayerId(GetOwningPlayer(LC)) if uH(LC,iP)then return endif set aF=XC(LC) set jK=GetStoredInteger(Ae,"radresistlevel",aF) call StoreInteger(Ae,"radresistlevel",aF,jK+1) if jK==0 then call UnitAddType(LC,UNIT_TYPE_ANCIENT) endif if nc<1 then return endif call OC(nc) set jK=GetStoredInteger(Ae,"radresistlevel",aF) call StoreInteger(Ae,"radresistlevel",aF,jK-1) if jK==1 then call FlushStoredInteger(Ae,"radresistlevel",aF) if(LC!=null)and not uH(LC,iP)and IsUnitType(LC,UNIT_TYPE_ANCIENT)then call UnitRemoveType(LC,UNIT_TYPE_ANCIENT) endif endif endfunction function kK takes integer aD,integer KK returns integer if(aD=='O005')then return 0 elseif(aD=='O000')then return 1 elseif(aD=='O002')then return 2 elseif(aD=='O00Y')then if(KK==10)then return 11 elseif(KK==9)then return 12 elseif(KK==8)then return 13 elseif(KK==5)then return 14 else return 10 endif elseif(aD=='O004')then return 4 elseif(aD=='O003')then return 5 elseif(aD=='O00U')then return 6 elseif(aD=='O014')then return 3 elseif(aD=='O018')then return 7 elseif(aD=='O01C')then if(KK==1)then return 8 else return 9 endif elseif(aD=='O01E')then return 15 else return 10 endif endfunction function lK takes integer i returns integer if(i==0)then return'O005' elseif(i==1)then return'O000' elseif(i==2)then return'O002' elseif(i>9)and(i<15)then return'O00Y' elseif(i==4)then return'O004' elseif(i==5)then return'O003' elseif(i==6)then return'O00U' elseif(i==3)then return'O014' elseif(i==7)then return'O018' elseif(i>7)and(i<10)then return'O01C' elseif(i==15)then return'O01E' else return 0 endif endfunction function LK takes integer i returns integer if(i==11)then return 10 elseif(i==12)then return 9 elseif(i==13)then return 8 elseif(i==14)then return 5 elseif(i==8)then return 1 else return 0 endif endfunction function mK takes integer i,integer SD returns string local string s=I2S(i) loop exitwhen StringLength(s)>=SD set s="0"+s endloop return s endfunction function MK takes integer pK,integer PK,integer qK,integer QK,boolean sK,integer SK returns integer local real nX=1.00 local integer wd=wv*15 local integer NH=bC(pK,wv) local integer tK=0 if NH>10 then return pK elseif NH==10 then if fe>2 then return pK+wv else return pK endif elseif NH==9 then if QK>2 then set nX=0.01 elseif QK==2 then set nX=0.10 endif elseif NH==8 then if QK>2 then set nX=0.05 elseif QK==2 then set nX=0.20 endif elseif NH==7 then if QK>2 then set nX=0.10 endif elseif NH==6 then if QK>2 then set nX=0.15 endif elseif NH==5 then if QK>2 then set nX=0.20 endif elseif NH<3 then if QK<2 then set nX=2.50 elseif QK<3 then set nX=1.75 endif endif if qK>3 then set wd=wv*3-1 elseif qK>2 then set wd=wv*6-1 elseif qK>1 then set wd=wv*9-1 elseif qK>0 then set wd=wv*10-1 endif if te>0 then set nX=1.0 elseif sK then set tK=be+SK endif if NH<3 then set PK=IMinBJ(IMinBJ(wd,wv*4-1),pK+IMaxBJ(1,NC(I2R(PK+tK)*nX))) else set PK=IMinBJ(wd,pK+IMaxBJ(1,IMinBJ(wv,NC(I2R(PK+tK)*nX)))) endif if PK==wd then set PK=PK+1000000*qK endif return PK endfunction function TK takes integer iP,real uK returns integer local integer UK=bC(uv[iP],wv) local integer Id=MK(uv[iP],bC(GetHeroXP(X[iP]),NC(100.0/uK)),Zv[iP],J,uK>0.99,0) local integer wK local integer QK=0 if Id>=1000000 then set QK=bC(Id,1000000) set Id=ModuloInteger(Id,1000000) endif set wK=bC(Id,wv) if Id>uv[iP]then set uv[iP]=Id if wK>10 then return 13 elseif wK==10 then return 12 elseif(wK==9)and(wK>UK)then return 10 elseif wK>UK then return QK else return QK+5 endif else if UK>9 then return-10 elseif UK>8 then return-1 elseif UK>5 then return-2 elseif UK>2 then return-3 else return-4 endif endif endfunction function WK takes integer i returns string if i<0 then set i=-1*i endif if i==2 then return"Insane difficulty" elseif i==3 then return"Hard difficulty" elseif i==4 then return"Normal difficulty" else return"Insane perfectly" endif endfunction function yK takes nothing returns boolean if JD()or re or ke then call aC("You did not gain rank experience.") if not re then call aC("Rank may be gained only in LAN and Battle.net games.") else call aC("Rank experience is not awarded to cheaters.") endif if uv[GetPlayerId(U)]==0 then call iC(U,"|r|cff00ff00HINT|r |cffffcc00You can always create a LAN game with only one player.") endif return false endif return true endfunction function YK takes string c returns integer if(c=="a")or(c=="A")then return 12 elseif(c=="b")or(c=="B")then return 25 elseif(c=="c")or(c=="C")then return 23 elseif(c=="d")or(c=="D")then return 22 elseif(c=="e")or(c=="E")then return 13 elseif(c=="f")or(c=="F")then return 36 elseif(c=="g")or(c=="G")then return 35 elseif(c=="h")or(c=="H")then return 24 elseif(c=="i")or(c=="I")then return 14 elseif(c=="j")or(c=="J")then return 30 elseif(c=="k")or(c=="K")then return 33 elseif(c=="l")or(c=="L")then return 32 elseif(c=="m")or(c=="M")then return 31 elseif(c=="n")or(c=="N")then return 21 elseif(c=="o")or(c=="O")then return 15 elseif(c=="p")or(c=="P")then return 19 elseif(c=="q")or(c=="Q")then return 37 elseif(c=="r")or(c=="R")then return 26 elseif(c=="s")or(c=="S")then return 18 elseif(c=="t")or(c=="T")then return 20 elseif(c=="u")or(c=="U")then return 17 elseif(c=="v")or(c=="V")then return 28 elseif(c=="w")or(c=="W")then return 34 elseif(c=="x")or(c=="X")then return 27 elseif(c=="y")or(c=="Y")then return 16 elseif(c=="z")or(c=="Z")then return 29 elseif c=="0" then return 9 elseif c=="1" then return 11 elseif c=="2" then return 8 elseif c=="3" then return 10 elseif c=="4" then return 6 elseif c=="5" then return 2 elseif c=="6" then return 3 elseif c=="7" then return 7 elseif c=="8" then return 5 elseif c=="9" then return 4 elseif c=="_" then return 1 elseif c=="-" then return 38 elseif c=="!" then return 39 elseif c=="." then return 40 elseif(c=="(")or(c==")")then return 41 elseif(c=="[")or(c=="]")then return 42 else return 43 endif endfunction function zK takes string s returns integer local integer i=1 local integer l=StringLength(s) local integer lj=0 loop set lj=lj+YK(SubString(s,i-1,i))*(ModuloInteger(i,3)+1) set i=i+1 exitwhen i>l endloop return lj endfunction function ZK takes string vl,integer aD,integer WH,integer el,integer xl,integer Sj,integer QK,integer yC,integer Id,integer ol,integer rl,integer il,integer al,integer nl,integer Vl returns string local integer i=zK(vl)*(Sj+1)+(aD+4)*(aD+6)+(yC+1)*(Id+1)+(xl+1)*7654-(el+1)*419-(WH+1)*50 set i=i+(ol+1)*4+(rl+1)*9+(il+1)*19+(al+1)*39+(nl+1)*79+(Vl+1)*159 set i=i+100*(QK+1)*ModuloInteger(i,1000) loop exitwhen i<100000 set i=ModuloInteger(i,100000)+bC(i,100000) endloop return mK(i,5) endfunction function El takes string vl,integer Xl returns string local string Ol local string Rl="" if(Xl==1)or(Xl==0)then set Ol="Lineage Protected" set Rl=Rl+ZK(vl,1,0,1,0,3,0,6,0,0,1,0,1,1,1) endif if(Xl==2)or(Xl==0)then set Ol="Contact Established" set Rl=Rl+ZK(vl,2,1,3,3,2,0,7,0,0,1,1,1,0,0) endif if(Xl==3)or(Xl==0)then set Ol="Mission Received" set Rl=Rl+ZK(vl,3,2,5,6,1,0,8,0,0,1,1,0,1,3) endif if(Xl==4)or(Xl==0)then set Ol="Future Ensured" set Rl=Rl+ZK(vl,4,3,7,9,0,0,9,0,0,0,1,1,1,2) endif if Xl==0 then return SubString(Rl,1,6)+SubString(Rl,7,12)+SubString(Rl,13,18)+SubString(Rl,19,20) endif return"|cffffcc00"+Ol+":|r |cff00ff00"+SubString(Rl,0,Xl-1)+SubString(Rl,Xl,5)+"|r" endfunction function Il takes integer Xl returns nothing local string Vd local force oF=null local integer iP=0 if JD()or re or ke then call aC("Quest cannot be completed by cheaters.") return endif if Xl==1 then call aC("My family is indebted to you. When you're experiencing a nightmare alone,") call aC("call for |r|cffc2c2c2help|r|cffffcc00 at the RCPD HQ.") call RC(3) elseif Xl==2 then call aC("..attempting communication.. umbrella interference..") call aC("..you must |r|cffc2c2c2-search|r|cffffcc00 ChronoTech crate.. important..") call RC(2) elseif Xl==3 then call aC("I've inherited a debt to you that I shall honor, but first, the future must be ensured. You need to |r|cffc2c2c2-train|r|cffffcc00 as many new officers as possible.") call RC(4) elseif Xl==4 then set Vd="Because of you, there is genuine hope for the future!" elseif Xl==5 then set Vd="The future looks promising, but you still need to |r|cffc2c2c2-train|r|cffffcc00 more new officers." else return endif if Xl>3 then loop exitwhen iP>8 if gd(iP)then call iC(Player(iP),Vd) endif set iP=iP+1 endloop call RC(3) endif set iP=0 loop exitwhen iP>8 if Xl<4 then set oF=hc(Player(iP)) call DisplayTimedTextToForce(oF,60,El(ID(iP),Xl)) call DestroyForce(oF) elseif gd(iP)and(Xl==4)then set oF=hc(Player(iP)) call DisplayTimedTextToForce(oF,60,El(ID(iP),Xl)) call DestroyForce(oF) endif set iP=iP+1 endloop set oF=null endfunction function Al takes string vl,integer nD returns string local integer i=0 local integer aD=Lo[nD+2] local integer Sj=Lo[nD+6] if aD==6 then if Sj==3 then set Sj=1 endif elseif aD==7 then if Sj==1 then set Sj=6 elseif Sj==3 then set Sj=2 endif elseif(aD==8)or(aD==9)then if Sj==3 then set Sj=6 endif elseif aD==4 then if Sj==6 then set Sj=3 endif elseif aD==1 then if Sj==4 then set Sj=3 endif elseif aD==3 then if Sj==6 then set Sj=4 endif elseif aD==0 then if Sj==2 then set Sj=3 endif elseif aD==5 then if Sj==3 then set Sj=6 endif elseif aD==2 then if Sj==6 then set Sj=3 endif endif return ZK(vl,Lo[nD+2],Lo[nD+3],Lo[nD+4],Lo[nD+5],Sj,Lo[nD+7],Lo[nD+8],Lo[nD+9],Lo[nD+10],Lo[nD+11],Lo[nD+12],Lo[nD+13],Lo[nD+14],Lo[nD+15]) endfunction function Nl takes integer aD,integer WH,integer el,integer xl,integer Sj,integer QK,integer yC,integer Id,integer ol,integer rl,integer il,integer al,integer nl,integer Vl returns string local integer bl local integer Bl=GetRandomInt(0,4)*2 if Sj>0 then if aD==0 then if Sj==1 then set Sj=1 elseif Sj==2 then set Sj=2 elseif Sj==5 then set Sj=3 else set Sj=0 endif elseif aD==1 then if Sj==1 then set Sj=1 elseif Sj==4 then set Sj=2 elseif Sj==6 then set Sj=3 else set Sj=0 endif elseif aD==2 then if Sj==1 then set Sj=1 elseif Sj==2 then set Sj=2 elseif Sj==6 then set Sj=3 else set Sj=0 endif elseif aD==3 then if Sj==1 then set Sj=1 elseif Sj==3 then set Sj=2 elseif Sj==6 then set Sj=3 else set Sj=0 endif elseif(aD>9)and(aD<15)then if Sj==2 then set Sj=1 elseif Sj==4 then set Sj=2 elseif Sj==5 then set Sj=3 else set Sj=0 endif elseif aD==4 then if Sj==6 then set Sj=1 elseif Sj==4 then set Sj=2 elseif Sj==5 then set Sj=3 else set Sj=0 endif elseif aD==5 then if Sj==2 then set Sj=1 elseif Sj==4 then set Sj=2 elseif Sj==3 then set Sj=3 else set Sj=0 endif elseif aD==6 then if Sj==3 then set Sj=1 elseif Sj==2 then set Sj=2 elseif Sj==6 then set Sj=3 else set Sj=0 endif elseif aD==7 then if Sj==3 then set Sj=1 elseif Sj==5 then set Sj=2 elseif Sj==1 then set Sj=3 else set Sj=0 endif elseif(aD>7)and(aD<10)then if Sj==4 then set Sj=1 elseif Sj==5 then set Sj=2 elseif Sj==3 then set Sj=3 else set Sj=0 endif else set Sj=0 endif endif if aD==6 then set WH=2 elseif aD==8 then set aD=6 set WH=0 elseif aD==9 then set aD=6 set WH=1 elseif aD>9 then set aD=aD-10 set Bl=Bl+1 endif if WH>2 then set WH=2 endif if yC>10 then if(ol+rl)>1 then set yC=14 elseif ol>0 then set yC=13 elseif rl>0 then set yC=12 endif endif if yC>8 then if QK<4 then if il<1 then set QK=1 else set QK=2 endif else if il<1 then set QK=3 endif endif elseif(yC>5)and(QK<2)then set QK=2 elseif(yC>2)and(QK<1)then set QK=1 endif if yC<9 then if QK<3 then set al=0 set nl=0 elseif QK<1 then set Vl=0 endif endif set bl=bC(Id,10)+50*yC+50*15*QK+50*15*5*al+50*15*5*2*nl+50*15*5*2*2*Vl set bl=bl+50*15*5*2*2*4*(aD+8*WH+8*3*el+8*3*18*xl+8*3*18*9*Sj) return I2S(Bl)+mK(bl,9)+I2S(ModuloInteger(Id,10)) endfunction function cl takes string Cl,integer nD returns nothing local integer Bl=S2I(SubString(Cl,0,1)) local integer dl=S2I(SubString(Cl,1,10)) set Lo[nD+9]=S2I(SubString(Cl,10,11))+10*ModuloInteger(dl,50) set dl=bC(dl,50) set Lo[nD+8]=ModuloInteger(dl,15) set dl=bC(dl,15) if Lo[nD+8]>13 then set Lo[nD+10]=1 set Lo[nD+11]=1 elseif Lo[nD+8]>12 then set Lo[nD+10]=1 set Lo[nD+11]=0 elseif Lo[nD+8]>11 then set Lo[nD+10]=0 set Lo[nD+11]=1 else set Lo[nD+10]=0 set Lo[nD+11]=0 endif if Lo[nD+8]>10 then set Lo[nD+8]=11 endif set Lo[nD+7]=ModuloInteger(dl,5) set dl=bC(dl,5) set Lo[nD+12]=0 if Lo[nD+8]>8 then if Lo[nD+7]>3 then set Lo[nD+12]=1 elseif Lo[nD+7]>2 then set Lo[nD+7]=4 else if Lo[nD+7]>1 then set Lo[nD+12]=1 elseif Lo[nD+7]<1 then set Lo[nD+1]=1 endif set Lo[nD+7]=3 endif elseif(Lo[nD+8]>5)and(Lo[nD+7]<2)then set Lo[nD+1]=1 elseif(Lo[nD+8]>2)and(Lo[nD+7]<1)then set Lo[nD+1]=1 endif set Lo[nD+13]=ModuloInteger(dl,2) set dl=bC(dl,2) if(Lo[nD+13]>0)and(Lo[nD+7]<3)then set Lo[nD+1]=1 endif set Lo[nD+14]=ModuloInteger(dl,2) set dl=bC(dl,2) if(Lo[nD+14]>0)and(Lo[nD+7]<3)then set Lo[nD+1]=1 endif set Lo[nD+15]=ModuloInteger(dl,4) set dl=bC(dl,4) if(Lo[nD+15]>0)and(Lo[nD+7]<1)then set Lo[nD+1]=1 endif set Lo[nD+2]=ModuloInteger(dl,8) set dl=bC(dl,8) set Lo[nD+3]=ModuloInteger(dl,3) set dl=bC(dl,3) if ModuloInteger(Bl,2)==1 then set Lo[nD+2]=Lo[nD+2]+10 if Lo[nD+2]>15 then set Lo[nD+1]=1 endif elseif Lo[nD+2]==6 then if Lo[nD+3]<1 then set Lo[nD+2]=8 elseif Lo[nD+3]<2 then set Lo[nD+2]=9 endif set Lo[nD+3]=3 endif set Lo[nD+4]=ModuloInteger(dl,18) set dl=bC(dl,18) if Lo[nD+4]>15 then set Lo[nD+1]=1 endif set Lo[nD+5]=ModuloInteger(dl,9) set dl=bC(dl,9) set Lo[nD+6]=ModuloInteger(dl,4) if Lo[nD+6]>0 then if Lo[nD+2]==0 then if Lo[nD+6]==1 then set Lo[nD+6]=1 elseif Lo[nD+6]==2 then set Lo[nD+6]=2 else set Lo[nD+6]=5 endif elseif Lo[nD+2]==1 then if Lo[nD+6]==1 then set Lo[nD+6]=1 elseif Lo[nD+6]==2 then set Lo[nD+6]=4 else set Lo[nD+6]=6 endif elseif Lo[nD+2]==2 then if Lo[nD+6]==1 then set Lo[nD+6]=1 elseif Lo[nD+6]==2 then set Lo[nD+6]=2 else set Lo[nD+6]=6 endif elseif Lo[nD+2]==3 then if Lo[nD+6]==1 then set Lo[nD+6]=1 elseif Lo[nD+6]==2 then set Lo[nD+6]=3 else set Lo[nD+6]=6 endif elseif(Lo[nD+2]>9)and(Lo[nD+2]<15)then if Lo[nD+6]==1 then set Lo[nD+6]=2 elseif Lo[nD+6]==2 then set Lo[nD+6]=4 else set Lo[nD+6]=5 endif elseif Lo[nD+2]==4 then if Lo[nD+6]==1 then set Lo[nD+6]=6 elseif Lo[nD+6]==2 then set Lo[nD+6]=4 else set Lo[nD+6]=5 endif elseif Lo[nD+2]==5 then if Lo[nD+6]==1 then set Lo[nD+6]=2 elseif Lo[nD+6]==2 then set Lo[nD+6]=4 else set Lo[nD+6]=3 endif elseif Lo[nD+2]==6 then if Lo[nD+6]==1 then set Lo[nD+6]=3 elseif Lo[nD+6]==2 then set Lo[nD+6]=2 else set Lo[nD+6]=6 endif elseif Lo[nD+2]==7 then if Lo[nD+6]==1 then set Lo[nD+6]=3 elseif Lo[nD+6]==2 then set Lo[nD+6]=5 else set Lo[nD+6]=1 endif elseif(Lo[nD+2]>7)and(Lo[nD+2]<10)then if Lo[nD+6]==1 then set Lo[nD+6]=4 elseif Lo[nD+6]==2 then set Lo[nD+6]=5 else set Lo[nD+6]=3 endif else set Lo[nD+6]=0 endif endif endfunction function Dl takes string Cl,integer nD returns boolean set Lo[nD+1]=0 call cl(Cl,nD) return Lo[nD+1]==0 endfunction function fl takes string Fl,string Rl,integer nD returns boolean local integer i if StringLength(Rl)!=16 then return false endif if StringLength(Fl)<3 then return false endif set i=S2I(SubString(Rl,0,1))+2 set Rl=Rl+SubString(Rl,1,i-1) set Rl=SubString(Rl,0,1)+SubString(Rl,i-1,i+14) if not Dl(SubString(Rl,0,3)+SubString(Rl,4,7)+SubString(Rl,8,11)+SubString(Rl,13,15),nD)then return false endif set Rl=SubString(Rl,15,16)+SubString(Rl,11,13)+SubString(Rl,7,8)+SubString(Rl,3,4) if Rl!=Al(Fl,nD)then return false endif return true endfunction function gl takes player oP,string Rl returns boolean local integer iP=GetPlayerId(oP) local integer nD=iP*15 if not fl(GetPlayerName(oP),Rl,nD)then return false endif set Pv[iP*3]=lK(Lo[nD+2]) if Pv[iP*3]==0 then return false endif set Pv[iP*3+1]=LK(Lo[nD+2]) set Pv[iP*3+2]=Lo[nD+3] set Eo[iP]=Lo[nD+4] if Eo[iP]>14 then return false endif set do[iP]=Lo[nD+5] set Zv[iP]=4-Lo[nD+7] if Lo[nD+8]>9 then set uv[iP]=wv*Lo[nD+8] else set uv[iP]=wv*Lo[nD+8]+(wv/500)*Lo[nD+9] endif return true endfunction function Gl takes string Fl,integer nD returns string local integer i local string hl=Nl(Lo[nD+2],Lo[nD+3],Lo[nD+4],Lo[nD+5],Lo[nD+6],Lo[nD+7],Lo[nD+8],Lo[nD+9],Lo[nD+10],Lo[nD+11],Lo[nD+12],Lo[nD+13],Lo[nD+14],Lo[nD+15]) local string Hl=Al(Fl,nD) set hl=SubString(hl,0,3)+SubString(Hl,4,5)+SubString(hl,3,6)+SubString(Hl,3,4)+SubString(hl,6,9)+SubString(Hl,1,3)+SubString(hl,9,11)+SubString(Hl,0,1) set i=S2I(SubString(hl,0,1)) return SubString(hl,0,1)+SubString(hl,16-i,16)+SubString(hl,1,16-i) endfunction function jl takes integer iP,integer QK,integer Id returns string local integer nD=iP*15 set Lo[nD+7]=4-QK set Lo[nD+8]=bC(Id,wv) if Lo[nD+8]>9 then set Lo[nD+9]=0 else set Lo[nD+9]=bC(ModuloInteger(Id,wv),wv/500) endif return Gl(GetPlayerName(Player(iP)),nD) endfunction function Jl takes integer iP,integer kl returns nothing local string s local string Kl local force oF=hc(Player(iP)) if not Ue then call ClearTextMessagesBJ(oF) endif if ID(iP)!=Je[iP]then call iC(Player(iP),"You did not gain rank experience.") call iC(Player(iP),"Your name changed during the game.") elseif kl>=0 then set Kl=I2S(IMinBJ(999,bC(ModuloInteger(uv[iP]*1000,wv*1000),wv))) if StringLength(Kl)==1 then set Kl="0."+Kl else set Kl=SubString(Kl,0,StringLength(Kl)-1)+"."+SubString(Kl,StringLength(Kl)-1,StringLength(Kl)) endif if kl==14 then call DisplayTimedTextToForce(oF,30,"|cffffcc00You've unlocked the Pyrotechnician class!|r") elseif kl==13 then call DisplayTimedTextToForce(oF,30,"|cffffcc00You're no longer a hero. You are a legend!|r") elseif kl==12 then call DisplayTimedTextToForce(oF,30,"|cffffcc00You've become a national hero!|r") elseif kl==10 then call DisplayTimedTextToForce(oF,30,"|cffffcc00You've achieved the highest standard rank!|r") call DisplayTimedTextToForce(oF,30,"|cffffcc00Progress to next rank: |r|cffffff00"+Kl+"|r") elseif kl==11 then call DisplayTimedTextToForce(oF,30,"|cffffcc00You've achieved max cyborg rank.|r") else if kl<5 then call DisplayTimedTextToForce(oF,30,"|cffffcc00You've been promoted!|r") else call DisplayTimedTextToForce(oF,30,"|cffffcc00You've gained rank experience.|r") set kl=kl-5 endif call DisplayTimedTextToForce(oF,30,"|cffffcc00Progress to next rank: |r|cffffff00"+Kl+"|r") if kl>0 then call DisplayTimedTextToForce(oF,30,"|cffff8000NOTE |r|cffffcc00You must beat "+WK(kl)+" before you can gain more rank experience.|r") endif endif set s=jl(iP,Zv[iP],uv[iP]) call DisplayTimedTextToForce(oF,600,"|cffffcc00Rank Code:|r") call DisplayTimedTextToForce(oF,600,"|cff00ff00"+SubString(s,0,4)+" "+SubString(s,4,8)+" "+SubString(s,8,12)+" "+SubString(s,12,16)+"|r") else call DisplayTimedTextToForce(oF,600,"|cffffcc00You did not gain rank experience.|r") if kl==-10 then call DisplayTimedTextToForce(oF,600,"|cffffcc00You have the highest standard rank.|r") elseif kl==-11 then call DisplayTimedTextToForce(oF,600,"|cffffcc00Cyborgs cannot advance higher.|r") else call DisplayTimedTextToForce(oF,600,"|cffffcc00You must beat "+WK(kl)+".|r") endif endif call DestroyForce(oF) endfunction function ll takes nothing returns nothing call FogMaskEnable(true) call FogEnable(true) call SetGameSpeed(MAP_SPEED_NORMAL) call LockGameSpeedBJ() set J=3 set U=GetLocalPlayer() set Fx=GetPlayersAll() set to=Player(11) set Nr=Player(10) set br=Player(bj_PLAYER_NEUTRAL_VICTIM) set ii=Player(PLAYER_NEUTRAL_PASSIVE) call EnableDawnDusk(false) call SetFloatGameState(GAME_STATE_TIME_OF_DAY,12.00) call UseTimeOfDayBJ(true) call SetPlayerOnScoreScreenBJ(false,Player(9)) call SetPlayerOnScoreScreenBJ(false,Nr) call SetPlayerOnScoreScreenBJ(false,to) set lv=Mb set Lv=pb call SetReservedLocalHeroButtons(1) set Ae=InitGameCache("SwatAfterSwap.w3v") set qi=InitHashtable() set no[GetPlayerId(U)]=GetAllyColorFilterState() call SetAllyColorFilterState(1) call SetPlayerName(Player(9),"Police") call SetPlayerName(Nr,"Enemy") call SetPlayerName(to,"Enemy") call DisableRestartMission(true) call UnitAddAbility(HB,'A0L8') call UnitAddAbility(HB,'A0P4') set zi=Rect(-15650,-15900,15650,15400) endfunction function Ll takes nothing returns nothing set ME=CreateTrigger() call TriggerAddAction(ME,function ll) endfunction function ml takes nothing returns nothing local integer i local player oP set lo[0]=OrderId("") set lo[1]=OrderId("stop") set lo[2]=OrderId("move") set lo[3]=OrderId("holdposition") set lo[4]=OrderId("smart") set lo[5]=OrderId("attack") set i=0 loop exitwhen i>8 set oP=Player(i) if i!=4 then set rx[i]=false else set rx[i]=false endif set i=i+1 endloop call StartMeleeAI(Player(10),"war3mapImported\\PassiveZombie.ai") call StartMeleeAI(Player(11),"war3mapImported\\PassiveZombie.ai") endfunction function Ml takes nothing returns nothing set pE=CreateTrigger() call TriggerAddAction(pE,function ml) endfunction function pl takes nothing returns nothing local integer i=0 local integer wd=9*Nx-1 loop exitwhen(i>wd) set pv[i]=0 set i=i+1 endloop set i=0 set wd=9*Co-1 loop exitwhen(i>wd) set Do[i]=0 set i=i+1 endloop set Lo[0]=15 set i=0 loop exitwhen i>8 set fo[i]=0 set Lo[i*15+1]=0 set Lo[i*15+2]=0 set Lo[i*15+3]=0 set Lo[i*15+4]=0 set Lo[i*15+5]=0 set Lo[i*15+6]=0 set Lo[i*15+7]=0 set Lo[i*15+8]=0 set Lo[i*15+9]=0 set Lo[i*15+10]=0 set Lo[i*15+11]=0 set Lo[i*15+12]=0 set Lo[i*15+13]=0 set Lo[i*15+14]=0 set Lo[i*15+15]=0 set i=i+1 endloop set i=0 loop exitwhen i>107 set Hr[i]=0 set i=i+1 endloop set lr[0]=-1 set lr[1]=-1 set lr[2]=-1 set lr[3]=-1 set wi[0]=980.0 set wi[1]=700.0 set wi[2]=448.0 set wi[3]=448.0 set wi[4]=308.0 set wi[5]=16.0 set wi[6]=56.0 set wi[7]=116.0 set wi[8]=146.0 set a[0]='A00N' set a[1]='A00L' set a[2]='A00M' set a[3]='A007' set a[4]='A00O' set a[5]='A00P' set a[6]='A00Q' set a[7]='A00R' set a[8]='A08L' set a[9]='A08K' set a[10]='A08J' set a[11]='A08I' set a[12]='A03T' set a[13]='A08M' set a[14]='A08X' set V[0]='A00S' set V[1]='A00T' set V[2]='A00U' set V[3]='A009' set V[4]='A00V' set V[5]='A00W' set V[6]='A00X' set V[7]='A00Y' set V[8]='A00Z' set V[9]='A010' set V[10]='A011' set V[11]='A012' set V[12]='A013' set V[13]='A014' set V[14]='A015' set V[15]='A016' set V[16]='A0AZ' set V[17]='A0B3' set V[18]='A0B4' set V[19]='A0B5' set V[20]='A0B6' set V[21]='A0B7' set V[22]='A0B8' set V[23]='A0B9' set V[24]='A0BM' set V[25]='A0BL' set V[26]='A0BK' set V[27]='A0BJ' set V[28]='A0BN' set V[29]='A0BO' set V[30]='A0CG' set V[31]='A0I5' set V[32]='A0CQ' set V[33]='A0CR' set V[34]='A0CS' set V[35]='A0IS' set Hx[0]='AItx' set Hx[1]='AItf' set Hx[2]='AItc' set Hx[3]='AItg' set Hx[4]='AItn' set Hx[5]='AIth' set Hx[6]='AItl' set Hx[7]='AIti' set Hx[8]='AItk' set Hx[9]='AItj' set Hx[10]='AIt9' set E[0]='A0KU' set E[1]='A01D' set E[2]='A01J' set E[3]='A01I' set E[4]='A01E' set E[5]='A01C' set E[6]='A01F' set E[7]='A01G' set E[8]='A01H' set E[9]='A0HG' set Uv[1]='A034' set Uv[2]='A02U' set Uv[3]='A02Q' set Uv[4]='A029' set Uv[5]='A02A' set Uv[6]='A02B' set Uv[7]='A02L' set Uv[8]='A02M' set Uv[9]='A02N' set Uv[10]='A02P' set Uv[11]='A05O' set Ev[0]=GetPlayerStartLocationLoc(Player(0)) set Ev[1]=GetPlayerStartLocationLoc(Player(1)) set Ev[2]=GetPlayerStartLocationLoc(Player(2)) set Ev[3]=GetPlayerStartLocationLoc(Player(3)) set Ev[4]=GetPlayerStartLocationLoc(Player(4)) set Ev[5]=GetPlayerStartLocationLoc(Player(5)) set Ev[6]=GetPlayerStartLocationLoc(Player(6)) set Ev[7]=GetPlayerStartLocationLoc(Player(7)) set Ev[8]=GetPlayerStartLocationLoc(Player(8)) set se[0]=null set se[1]=null set se[2]=null set se[3]=null set se[4]=null set se[5]=null set se[6]=null set se[7]=null set se[8]=null set jr[0]=3000 set jr[1]=3000 set jr[2]=3000 set jr[3]=3000 set jr[4]=1680 set jr[5]=960 set jr[6]=670 set jr[7]=520 set jr[8]=420 set jr[9]=360 set jr[10]=310 set jr[11]=270 set ri[12]='ndwm' set ri[11]='npng' set ri[10]='nhmc' set ri[9]='nshe' set ri[8]='nrac' set ri[7]='npig' set ri[6]='nech' set ri[5]='nsea' set ri[4]='nskk' set ri[2]='nder' set ri[1]='necr' set yo[9]=0 set yo[10]=0 set Wo[9]=436 set Ri[0]=15 set Ri[1]=10 set Ri[2]=12 set Ri[3]=12 set Ri[4]=8 set Ri[5]=0 set Qr=null set Ji[0]=null set Ji[1]=null set Ji[2]=null set Ji[3]=null set Ji[4]=null set Ji[5]=null set Ki[0]=null set Ki[1]=null set Ki[2]=null set Ki[3]=null set Ki[4]=null set Ki[5]=null set Ki[6]=null set Ki[7]=null endfunction function Pl takes nothing returns nothing set PE=CreateTrigger() call TriggerAddAction(PE,function pl) endfunction function ql takes nothing returns nothing call RemoveUnit(Tb) call RemoveUnit(ub) call RemoveUnit(Ub) call RemoveUnit(wb) call RemoveUnit(Wb) call RemoveUnit(yb) call RemoveUnit(Yb) call RemoveUnit(zb) call RemoveUnit(Zb) call RemoveUnit(vB) call RemoveUnit(eB) call RemoveUnit(oB) call RemoveUnit(rB) call RemoveUnit(aB) call RemoveUnit(nB) call RemoveUnit(VB) call RemoveUnit(EB) call RemoveUnit(IB) call RemoveUnit(AB) call RemoveUnit(RB) call RemoveUnit(OB) call RemoveUnit(NB) call RemoveUnit(bB) call RemoveUnit(cB) call RemoveUnit(CB) call RemoveUnit(DB) call RemoveUnit(fB) call RemoveUnit(FB) call RemoveUnit(GB) call RemoveUnit(hB) call RemoveUnit(jB) call RemoveUnit(HB) call RemoveUnit(JB) call RemoveUnit(kB) call RemoveUnit(KB) call RemoveUnit(lB) call RemoveUnit(LB) call RemoveUnit(BB) call RemoveUnit(tB) call RemoveUnit(SB) call RemoveUnit(sB) call RemoveUnit(TB) call RemoveUnit(mB) call RemoveUnit(PB) call RemoveUnit(qB) call RemoveUnit(MB) call RemoveUnit(pB) call RemoveUnit(QB) call RemoveUnit(uB) call RemoveUnit(wB) call RemoveUnit(UB) call RemoveUnit(WB) call RemoveUnit(YB) call DestroyTrigger(GetTriggeringTrigger()) endfunction function Ql takes nothing returns nothing set qE=CreateTrigger() call TriggerRegisterTimerEventSingle(qE,0.01) call TriggerAddAction(qE,function ql) endfunction function sl takes nothing returns nothing call CreateQuestBJ(bj_QUESTTYPE_REQ_DISCOVERED,"Rescue Civilians","Inoculate zombies with an antidote provided by the Scientist. Eventually, these zombies will be cured of the virus and revert to their human form. Lead these civilians to an APC or powered Televac at a bomb shelter (green minimap dots).","ReplaceableTextures\\CommandButtons\\BTNVillagerWoman.blp") set N[1]=GetLastCreatedQuestBJ() call CreateQuestBJ(bj_QUESTTYPE_REQ_DISCOVERED,"Restore Power","Find the locations of the city's malfunctioning power plants (blue minimap dots). Transfer enough energy to the reactors to fill their storage cells. Once city power has been restored, automated black markets will become operational, and Televacs will regenerate energy.","ReplaceableTextures\\CommandButtons\\BTNControlMagic.blp") set N[2]=GetLastCreatedQuestBJ() call CreateQuestBJ(bj_QUESTTYPE_REQ_DISCOVERED,"Reduce Radiation","The city-wide radiation level is dangerously high and can only be decreased by destroying radiation fragments. Find and destroy these until the current level is less than or equal to the safe level. Radiation is harmful to unprotected humans but seems to benefit the undead.","ReplaceableTextures\\CommandButtons\\BTNInfernalStone.blp") set N[3]=GetLastCreatedQuestBJ() call CreateQuestBJ(bj_QUESTTYPE_REQ_DISCOVERED,"Survive","Your objective is simply to survive as long as you can. If you last until Day 3, your rank experience award will not be halved by defeat.","ReplaceableTextures\\CommandButtons\\BTNVillagerMan.blp") set N[4]=GetLastCreatedQuestBJ() set Nv[5]=0 endfunction function Sl takes nothing returns nothing set QE=CreateTrigger() call TriggerAddAction(QE,function sl) endfunction function tl takes nothing returns nothing local integer i=0 local integer j loop exitwhen i>9 set j=0 loop exitwhen j>9 if(i!=j)and((i==9)or(j==9))then call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_PASSIVE,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_HELP_REQUEST,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_HELP_RESPONSE,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_XP,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_SPELLS,true) call SetPlayerAlliance(Player(i),Player(j),ALLIANCE_SHARED_VISION,true) endif set j=j+1 endloop set i=i+1 endloop call SetPlayerTeam(Player(9),2) call SetPlayerState(Player(9),PLAYER_STATE_ALLIED_VICTORY,1) endfunction function Tl takes nothing returns nothing set sE=CreateTrigger() call TriggerAddAction(sE,function tl) endfunction function ul takes integer IH returns nothing local integer Vk=GetRandomInt(0,99) local integer Hd=-1 local location tF if GetRandomInt(0,99)8 set oP=Player(i) set eL=IC(oP) set Px[i]=null set ao[i]=99999 set Ho[i]=9999 set Ko[i]=0 set Mr[i]=0 set wo[i]=3 set Ar[i]=0 set fr[i]=1.0 set Cr[i]=null set Vi[i]=0 set Jr[i*6]=null set Jr[i*6+1]=null set Jr[i*6+2]=null set Jr[i*6+3]=null set Jr[i*6+4]=null set Jr[i*6+5]=null set ai[i]=0 set Xi[i]=0 set Wo[i]=0 set Wo[i+10]=0 set Oi[i]=0 set pr[i]=0 set Yr[i]=3 if(GetPlayerSlotState(oP)==PLAYER_SLOT_STATE_PLAYING)and eL then if eL then set C=C+1 else set sv=sv+1 endif set Q[i]=1 call SetPlayerOnScoreScreenBJ(eL,oP) if(i==4)and not eL then set ud=GetRectCenter(qv) call CreateItemLoc('I02K',ud) call RemoveLocation(ud) call StoreInteger(Ae,"herocount","yeller",1) else set io[i]=0 call SetPlayerAbilityAvailable(oP,'A040',false) call SetPlayerAbilityAvailable(oP,'A053',false) call SetPlayerAbilityAvailable(oP,'A00G',false) call SetPlayerAbilityAvailable(oP,'A03H',false) call SetPlayerAbilityAvailable(oP,'A0CN',false) call SetPlayerAbilityAvailable(oP,'A0P5',false) call SetPlayerAbilityAvailable(oP,'A0NR',false) call SetPlayerAbilityAvailable(oP,'A0NS',false) call SetPlayerAbilityAvailable(oP,'A0NT',false) call SetPlayerAbilityAvailable(oP,'A0NU',false) call SetPlayerAbilityAvailable(oP,'A0NV',false) call SetPlayerAbilityAvailable(oP,'A0CK',false) call SetPlayerAbilityAvailable(oP,'A05E',false) call SetPlayerAbilityAvailable(oP,'A05F',false) call SetPlayerAbilityAvailable(oP,'A05G',false) call SetPlayerAbilityAvailable(oP,'A05H',false) call SetPlayerAbilityAvailable(oP,'A05I',false) call SetPlayerTechResearched(oP,'R00P',3) call SetPlayerTechResearched(oP,'R00O',6) set oe[i]=GetRectCenter(vE) call TriggerRegisterPlayerUnitEvent(pN,oP,EVENT_PLAYER_HERO_SKILL,null) call TriggerRegisterPlayerUnitEvent(RR,oP,EVENT_PLAYER_HERO_REVIVABLE,null) call TriggerRegisterPlayerUnitEvent(AI,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(II,oP,EVENT_PLAYER_UNIT_PICKUP_ITEM,null) call TriggerRegisterPlayerUnitEvent(tN,oP,EVENT_PLAYER_UNIT_PICKUP_ITEM,null) call TriggerRegisterPlayerUnitEvent(UN,oP,EVENT_PLAYER_UNIT_USE_ITEM,null) call TriggerRegisterPlayerUnitEvent(cR,oP,EVENT_PLAYER_HERO_LEVEL,null) call TriggerRegisterPlayerUnitEvent(RI,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(FI,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(FA,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(mN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(LN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(qN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(kN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(KN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(lN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(MN,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(nI,oP,EVENT_PLAYER_HERO_SKILL,null) call TriggerRegisterPlayerUnitEvent(VI,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(EO,oP,EVENT_PLAYER_UNIT_DEATH,null) call TriggerRegisterPlayerUnitEvent(JI,oP,EVENT_PLAYER_UNIT_SPELL_EFFECT,null) call TriggerRegisterPlayerUnitEvent(OR,oP,EVENT_PLAYER_UNIT_PAWN_ITEM,null) if eL then call StoreInteger(Ae,"herocount","order"+I2S(i),9) call TriggerRegisterPlayerEventLeave(NR,oP) call TriggerRegisterPlayerUnitEvent(PI,oP,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null) call TriggerRegisterPlayerUnitEvent(jI,oP,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER,null) call TriggerRegisterPlayerChatEvent(JR,oP,"",false) set Zl=oP else call SetPlayerAbilityAvailable(oP,'A001',false) call SetPlayerAbilityAvailable(oP,'A052',false) set ao[i]=0 endif set zo[i]=0 call StoreInteger(Ae,I2S(i),"drugoverdose",0) call StoreInteger(Ae,I2S(i),"drugresets",0) call StoreInteger(Ae,I2S(i),"drugmentat",0) call StoreInteger(Ae,I2S(i),"drugbuffout",0) call StoreInteger(Ae,I2S(i),"drugspeed",0) set Sx[i*4]=0 set Sx[i*4+1]=0 set Sx[i*4+2]=0 set Sx[i*4+3]=0 call StoreInteger(Ae,I2S(i),"riotshield_equipped",-1) call StoreInteger(Ae,I2S(i),"riotshield_protecting",-1) set Qx[i]=Td(GetRectCenter(qv),100,350) set I[i]=Tf('n003',oP,Qx[i],GetRandomInt(0,359)) call SetUnitInvulnerable(I[i],true) call UnitRemoveAbility(I[i],'A08U') call UnitRemoveAbility(I[i],'Aegr') call UnitRemoveAbility(I[i],'A03V') if eL then call CreateUnit(oP,'n00C',14000,10500,0) endif endif endif set i=i+1 endloop if C>6 then set Ko[10]=13 elseif C>3 then set Ko[10]=10 else set Ko[10]=7 endif set Ko[9]=Ko[10] call StoreInteger(Ae,"herocount","order",0) call StoreInteger(Ae,"herocount","totalplayers",C+sv) if not Ul(C+sv)then set Oe='I001' endif set lx=(C+sv)/2+1 if C==1 then if sv==0 then call TriggerRegisterPlayerChatEvent(oX,Zl,"-level",false) call TriggerRegisterPlayerChatEvent(rX,Zl,"-credits",false) call TriggerRegisterPlayerChatEvent(aX,Zl,"-valor",false) call TriggerRegisterPlayerChatEvent(eX,Zl,"-advnanites",true) call TriggerRegisterPlayerChatEvent(xX,Zl,"-atme",true) endif endif if C==1 then set vL=GetPlayerName(Zl) set i=0 loop exitwhen i>8 if i!=GetPlayerId(Zl)then if i==0 then call wl(i,vL,"Frostickle","redscull") elseif i==1 then call wl(i,vL,"trihero","tmjdisorder") elseif i==2 then call wl(i,vL,"Irish","Socrates") elseif i==3 then call wl(i,vL,"gunslinger","Ace") elseif i==4 then call wl(i,vL,"Echo One","Telperion") elseif i==5 then call wl(i,vL,"Bushmaster","Wolfmann") elseif i==6 then call wl(i,vL,"Wulfdane","katto") elseif i==7 then call wl(i,vL,"Danger Boy","Light Waves") else call wl(i,vL,"Tyrant","Wolvaroo") endif endif set i=i+1 endloop endif call TriggerRegisterTimerEvent(TE,0.1,false) call DestroyTrigger(SE) endfunction function xL takes nothing returns nothing set SE=CreateTrigger() call TriggerAddAction(SE,function zl) endfunction function oL takes nothing returns nothing call SetPlayerAllianceStateBJ(Nr,br,bj_ALLIANCE_ALLIED_VISION) call SetPlayerAllianceStateBJ(to,br,bj_ALLIANCE_ALLIED_VISION) call SetPlayerAllianceStateBJ(Player(0),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(1),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(2),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(3),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(4),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(5),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(6),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(7),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(8),br,bj_ALLIANCE_UNALLIED) call SetPlayerAllianceStateBJ(Player(9),br,bj_ALLIANCE_UNALLIED) endfunction function rL takes nothing returns nothing set tE=CreateTrigger() call TriggerRegisterTimerEventSingle(tE,0.1) call TriggerAddAction(tE,function oL) endfunction function iL takes integer Ud,integer wd,integer Hd,real Wh,integer aL,rect nL returns nothing local location tF local integer i=GetRandomInt(Ud,wd) loop exitwhen i<=0 set tF=GetRandomLocInRect(nL) call CreateDestructableLoc(Hd,tF,GetRandomDirectionDeg(),Wh,aL) call RemoveLocation(tF) set i=i-1 endloop endfunction function VL takes rect nL returns nothing local integer i=GetRandomInt(1,5) if i==3 then call iL(1,4,'LTbx',1,0,nL) call iL(1,5,'LTbr',1,0,nL) elseif i==4 then call iL(1,1,'LTba',2,0,nL) call iL(0,2,'LTbx',1,0,nL) call iL(1,3,'LTbr',1,0,nL) elseif i==5 then call iL(1,1,'LTcr',2,GetRandomInt(0,1),nL) call iL(0,1,'LTcr',2,GetRandomInt(0,1),nL) call iL(0,1,'LTcr',2,GetRandomInt(0,1),nL) call iL(0,3,'LTbx',1,0,nL) call iL(1,2,'LTbr',1,0,nL) endif endfunction function EL takes nothing returns nothing local integer i local integer Vk local rect eg local location ud call SetUnitFacingTimed(dB,GetRandomInt(0,359),0) set bv[0]=qf('n00K',Player(PLAYER_NEUTRAL_PASSIVE),GetRandomLocInRect(vE),GetRandomInt(0,359)) call Wf(bv[0],1) call TriggerRegisterTimerEvent(zO,30,false) call StoreString(Ae,"scientist","Greeting","Once I develop an antidote, you can use it to cure zombies of the virus!") call TriggerRegisterEnterRectSimple(Bb,zV) call TriggerRegisterLeaveRectSimple(cb,zV) call TriggerRegisterEnterRectSimple(Bb,ZV) call TriggerRegisterLeaveRectSimple(cb,ZV) call TriggerRegisterEnterRectSimple(Bb,rE) call TriggerRegisterLeaveRectSimple(cb,rE) call TriggerRegisterEnterRectSimple(Bb,eE) call TriggerRegisterLeaveRectSimple(cb,eE) call TriggerRegisterEnterRectSimple(Bb,xE) call TriggerRegisterLeaveRectSimple(cb,xE) call TriggerRegisterEnterRectSimple(Bb,oE) call TriggerRegisterLeaveRectSimple(cb,oE) call TriggerRegisterEnterRectSimple(Bb,vE) call TriggerRegisterLeaveRectSimple(cb,vE) call TriggerRegisterEnterRectSimple(Cb,vE) call TriggerRegisterLeaveRectSimple(db,vE) set D[0]=va set D[1]=ea set D[2]=xa set D[3]=oa set D[4]=ra set D[5]=ia set D[6]=aa set D[7]=na set D[8]=Va set D[9]=Ea set D[10]=Xa set D[11]=Oa set D[12]=Ra set D[13]=Ia set D[14]=Aa set D[15]=Na set D[16]=ba set D[17]=Ba set D[18]=ca set D[19]=Ca set D[20]=da set D[21]=Da set D[22]=fa set D[23]=Fa set D[24]=ga set D[25]=Ga set D[26]=ha set D[27]=Ha set D[28]=ja set D[29]=Ja set D[30]=ka set D[31]=Ka set D[32]=la set D[33]=La set D[34]=ma set D[35]=Ma set D[36]=pa set D[37]=Pa set D[38]=qa set D[39]=Qa set D[40]=sa set D[41]=Sa set D[42]=ta set D[43]=Ta set D[44]=ua set D[45]=Ua set D[46]=wa set D[47]=Wa set D[48]=ya set D[49]=Ya set D[50]=za set D[51]=Za set D[52]=vn set D[53]=en set D[54]=xn set D[55]=on set D[56]=rn set D[57]=in set D[58]=an set D[59]=nn set D[60]=Vn set D[61]=En set D[62]=Xn set D[63]=On set D[64]=Rn set D[65]=In set D[66]=An set D[67]=Nn set D[68]=bn set D[69]=Bn set D[70]=cn set D[71]=Cn set D[72]=dn set D[73]=Dn set D[74]=fn set D[75]=Fn set D[76]=gn set D[77]=Gn set D[78]=hn set D[79]=Hn set D[80]=jn set D[81]=Jn set D[82]=kn set D[83]=Kn set i=83 loop exitwhen i<0 set Vk=GetRandomInt(0,i) set eg=D[Vk] set D[Vk]=D[i] set D[i]=eg set i=i-1 endloop call VL(Wn) call VL(yn) call VL(Yn) call VL(zn) call VL(Zn) call VL(vV) call VL(eV) call VL(xV) call VL(oV) call VL(rV) call VL(iV) call VL(aV) call VL(nV) call VL(VV) call VL(EV) call VL(XV) call VL(OV) call VL(RV) call VL(IV) call VL(AV) call VL(NV) call VL(bV) call VL(BV) call VL(cV) call VL(CV) call VL(dV) call VL(DV) call VL(fV) call VL(FV) call VL(gV) call VL(GV) call VL(hV) call VL(HV) call VL(jV) call VL(JV) call VL(kV) call VL(KV) call VL(lV) call VL(LV) call VL(mV) call VL(MV) call VL(pV) call VL(PV) call VL(qV) call VL(QV) call VL(sV) call VL(SV) call VL(tV) call VL(TV) call VL(uV) call VL(UV) call VL(wV) call VL(WV) call VL(yV) call VL(YV) call TriggerRegisterTimerEvent(uE,0.1,false) call DestroyTrigger(TE) endfunction function XL takes nothing returns nothing set TE=CreateTrigger() call TriggerAddAction(TE,function EL) endfunction function OL takes nothing returns nothing set Jv=AddWeatherEffect(GetPlayableMapRect(),'FDgl') set Kv=-2 set mv=GetFoodMade('o00D') set Mv=100 call TriggerRegisterTimerEvent(BX,0.1,false) call DestroyTrigger(uE) endfunction function RL takes nothing returns nothing set uE=CreateTrigger() call TriggerAddAction(uE,function OL) endfunction function IL takes nothing returns nothing local integer i=0 loop exitwhen(i>81) set Hv[i]=0 set i=i+1 endloop endfunction function AL takes nothing returns nothing local integer i=0 loop exitwhen(i>9) set Cx[i]=0 set i=i+1 endloop endfunction function NL takes nothing returns nothing local integer i=0 local player oP loop exitwhen i>8 set oP=Player(i) if AC(oP)and IC(oP)then call TriggerRegisterPlayerChatEvent(qR,oP,"-view",false) call TriggerRegisterPlayerChatEvent(QR,oP,"-pool",false) call TriggerRegisterPlayerChatEvent(sR,oP,"-chat",true) endif set i=i+1 endloop call RC(9.9) set i=0 call IL() call AL() loop exitwhen i>8 set oP=Player(i) if AC(oP)and IC(oP)then call HD(MR,oP,"-kick") call HD(pR,oP,"-info") call TriggerRegisterPlayerChatEvent(PR,oP,"-time",true) call TriggerRegisterPlayerChatEvent(LR,oP,"-revive",true) call TriggerRegisterPlayerChatEvent(hI,oP,"help",true) call TriggerRegisterPlayerChatEvent(HI,oP,"-dead",true) call TriggerRegisterPlayerChatEvent(mR,oP,"-perfect",true) call TriggerRegisterPlayerChatEvent(aR,oP,"-train",true) endif set i=i+1 endloop endfunction function bL takes nothing returns nothing set UE=CreateTrigger() call TriggerRegisterTimerEventSingle(UE,0.1) call TriggerAddAction(UE,function NL) endfunction function BL takes nothing returns nothing call CreateQuestBJ(bj_QUESTTYPE_OPT_DISCOVERED,"Info: Game","Swat was created by Red and assisted by Enigma. Special thanks to Trihero & BikeHelmet for their extensive feedback, and also to all the forumers and fans who've contributed. Website: |cffffff00http://redscull.com/swat|r","ReplaceableTextures\\CommandButtons\\BTNPenguin.blp") call CreateQuestItemBJ(GetLastCreatedQuestBJ(),"Map version B091207") call CreateQuestItemBJ(GetLastCreatedQuestBJ(),"Released December 7, 2009") call CreateQuestItemBJ(GetLastCreatedQuestBJ(),"Warcraft III version 1.24.2.6378") endfunction function cL takes nothing returns nothing set wE=CreateTrigger() call TriggerAddAction(wE,function BL) endfunction function CL takes integer aD,integer dL,integer IH,rect Yd returns nothing if GetRandomInt(0,dL)2)and(Aj<6) endfunction function KL takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit jL=LoadUnitHandle(qi,StringHash("warehouses_sight"),StringHash(XC(jD))) local unit JL if GetStoredBoolean(Ae,"warehouses_isabm",XC(jD))then set JL=ne[GetStoredInteger(Ae,"warehouses_shop",XC(jD))] else set JL=LoadUnitHandle(qi,StringHash("warehouses_shop"),StringHash(XC(jD))) endif call DisableTrigger(jD) call RemoveSavedHandle(qi,StringHash("warehouses_sight"),StringHash(XC(jD))) call RemoveSavedHandle(qi,StringHash("warehouses_shop"),StringHash(XC(jD))) call FlushStoredInteger(Ae,"warehouses_isabm",XC(jD)) call HL(jL,JL) call DestroyTrigger(jD) endfunction function lL takes rect LL returns nothing call qf('o00K',Player(9),GetRectCenter(LL),0.00) endfunction function mL takes rect LL,integer Lc,unit JL,integer ML returns nothing local unit jL=qf('o00K',Player(PLAYER_NEUTRAL_PASSIVE),GetRectCenter(LL),0.00) local trigger jD=CreateTrigger() call SetUnitUserData(jL,5+Lc) call TriggerAddCondition(jD,Condition(function kL)) call TriggerAddAction(jD,function KL) call SaveUnitHandle(qi,StringHash("warehouses_sight"),StringHash(XC(jD)),jL) if JL!=null then call StoreBoolean(Ae,"warehouses_isabm",XC(jD),false) call SaveUnitHandle(qi,StringHash("warehouses_shop"),StringHash(XC(jD)),JL) else call StoreBoolean(Ae,"warehouses_isabm",XC(jD),true) call StoreInteger(Ae,"warehouses_shop",XC(jD),ML) endif call TriggerRegisterEnterRectSimple(jD,LL) endfunction function pL takes unit PL returns nothing local unit BJ=qf('ncg2',Player(PLAYER_NEUTRAL_PASSIVE),Td(GetUnitLoc(PL),175,450),GetRandomInt(0,359)) call SetUnitColor(BJ,ConvertPlayerColor(12)) call SetUnitInvulnerable(BJ,true) call SetUnitTimeScale(BJ,0.01) call UnitAddAbility(BJ,'A04T') call SetUnitExploded(BJ,true) call SaveUnitHandle(qi,StringHash("reactor_droid"),StringHash(XC(PL)),BJ) if GetStoredInteger(Ae,"herocount","totalplayers")>3 then if GetRandomInt(1,J*J*J)<4 then call StoreInteger(Ae,"reactor_droid_active",XC(PL),1) return endif endif call StoreInteger(Ae,"reactor_droid_active",XC(PL),0) endfunction function qL takes unit PL,unit LC returns nothing local unit VF local integer i=GetStoredInteger(Ae,"reactor_droid_active",XC(PL)) call StoreInteger(Ae,"reactor_droid_active",XC(PL),-1) if(i>0)or((i>-1)and(fe>0)and(C>1))then set VF=LoadUnitHandle(qi,StringHash("reactor_droid"),StringHash(XC(PL))) call SetUnitOwner(VF,Player(10),false) set nv=nv+1 call SetUnitInvulnerable(VF,false) call SetUnitTimeScale(VF,1) call PlaySoundOnUnitBJ(LE,100,VF) call UnitAddAbility(VF,'AIdn') call IssueTargetOrder(VF,"attack",LC) endif set VF=null endfunction function QL takes nothing returns nothing local unit sL=GetTriggerUnit() local trigger jD=GetTriggeringTrigger() local integer SL if GetUnitUserData(sL)==99 then set sL=null set jD=null return endif if(GetUnitState(sL,UNIT_STATE_MANA)<(GetUnitState(sL,UNIT_STATE_MAX_MANA)-200))then set sL=null set jD=null return endif call DisableTrigger(jD) call DisableTrigger(jX) call UnitRemoveAbility(sL,'A060') call UnitRemoveAbility(sL,'A061') call UnitRemoveAbility(sL,'A062') call RemoveUnit(Ee[6+ModuloInteger(GetUnitUserData(sL),10)]) set SL=bC(GetUnitUserData(sL),10) call SetUnitUserData(sL,99) call IssueImmediateOrder(sL,"stop") call UnitRemoveAbility(sL,'A00I') call AddSpecialEffect("Abilities\\Spells\\Other\\Drain\\ManaDrainTarget.mdl",GetUnitX(sL),GetUnitY(sL)) call lD(I2S(R2I(GetUnitState(sL,UNIT_STATE_MAX_MANA))),sL,0,255,255,true,10,0.75) call RemoveSavedHandle(qi,StringHash("reactor_droid"),StringHash(XC(sL))) call FlushStoredInteger(Ae,"reactor_droid_active",XC(sL)) call FlushStoredMission(Ae,XC(sL)) call FlushStoredInteger(Ae,"reactor_explosions",XC(sL)) if SL>1 then call DestroyEffect(LoadEffectHandle(qi,StringHash("reactor_effect2"),StringHash(XC(sL)))) call RemoveSavedHandle(qi,StringHash("reactor_effect2"),StringHash(XC(sL))) endif call DestroyEffect(LoadEffectHandle(qi,StringHash("reactor_effect1"),StringHash(XC(sL)))) call RemoveSavedHandle(qi,StringHash("reactor_effect1"),StringHash(XC(sL))) loop exitwhen Nv[6]<1 call RC(3) endloop set Nv[6]=1 set Ve=Ve+1 if fe>1 then set Q[22]=Q[22]+C*3/Ve endif call QuestItemSetDescriptionBJ(Rv,"Restore "+I2S(IMaxBJ(0,w-Ve))+" more reactor(s)") if Ve5 then call TriggerRegisterTimerEvent(gb,GetRandomInt(1110,1350),false) endif endif call PostTriggerExecuteBJ(zE,true) set Nv[6]=0 call vd((300-100*Mx)*(J+SL-1)+600,true) call Rd(900+150*(SL*SL-4+J)) call DestroyTrigger(jD) set sL=null set jD=null endfunction function tL takes unit Od,unit sL,trigger jD returns nothing local integer iP local string Vd local integer TL local location ud call DisableTrigger(jD) set ud=GetUnitLoc(sL) set TL=bC(GetUnitUserData(sL),10) if TL==1 then set Vd="This reactor looks damaged." call SaveEffectHandle(qi,StringHash("reactor_effect1"),StringHash(XC(sL)),AddSpecialEffectLoc("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",ud)) elseif TL==2 then set Vd="This reactor looks badly damaged." call SaveEffectHandle(qi,StringHash("reactor_effect1"),StringHash(XC(sL)),AddSpecialEffectLoc("Abilities\\Weapons\\FarseerMissile\\FarseerMissile.mdl",ud)) call SaveEffectHandle(qi,StringHash("reactor_effect2"),StringHash(XC(sL)),AddSpecialEffectLoc("Abilities\\Spells\\Items\\AIlb\\AIlbTarget.mdl",ud)) else set Vd="This reactor looks severely damaged." call SaveEffectHandle(qi,StringHash("reactor_effect1"),StringHash(XC(sL)),AddSpecialEffectLoc("Abilities\\Weapons\\VengeanceMissile\\VengeanceMissile.mdl",ud)) call SaveEffectHandle(qi,StringHash("reactor_effect2"),StringHash(XC(sL)),AddSpecialEffectLoc("Abilities\\Spells\\Items\\AIlb\\AIlbTarget.mdl",ud)) endif call If(2,ud) set iP=GetPlayerId(GetOwningPlayer(Od)) call QuestMessageBJ(Fx,bj_QUESTMESSAGE_ALWAYSHINT,ND(iP)+Vd+"|r") call ah(Od) call sD(iP,Vd) endfunction function uL takes nothing returns nothing local unit LC=GetTriggerUnit() local trigger jD if(GetUnitPointValue(LC)==3)or(GetUnitTypeId(LC)=='O00E')or(GetUnitTypeId(LC)=='O001')then set jD=GetTriggeringTrigger() call tL(LC,LoadUnitHandle(qi,StringHash("reactor_reactor"),StringHash(XC(jD))),jD) call RemoveSavedHandle(qi,StringHash("reactor_reactor"),StringHash(XC(jD))) call DestroyTrigger(jD) endif set LC=null set jD=null endfunction function UL takes real x,real y returns nothing local integer iP local unit ek local group g=CreateGroup() call GroupEnumUnitsInRange(g,x,y,6500.00,null) loop set ek=FirstOfGroup(g) exitwhen ek==null set iP=GetPlayerId(GetOwningPlayer(ek)) if(iP>9)and(iP<12)and(GetUnitPointValue(ek)>100)then call IssuePointOrder(ek,"attack",x+GetRandomReal(-800,800),y+GetRandomReal(-800,800)) endif call GroupRemoveUnit(g,ek) endloop call DestroyGroup(g) set g=null endfunction function wL takes location WL returns nothing local location ud local integer i=0 loop if(qx[i]!=null)and(GetUnitState(qx[i],UNIT_STATE_LIFE)>0)then set ud=GetUnitLoc(qx[i]) if FC(ud,WL,1999)then call IssuePointOrderLoc(qx[i],"blink",WL) endif call RemoveLocation(ud) endif set i=i+1 exitwhen i>4 endloop call RemoveLocation(WL) set ud=null endfunction function yL takes real x,real y returns unit local unit YL=null local real zL=0 local unit LC local group g=CreateGroup() call GroupEnumUnitsInRange(g,x,y,300.00,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if(GetUnitPointValue(LC)<6)and(GetUnitState(LC,UNIT_STATE_MANA)>99)and(GetUnitAbilityLevel(LC,'BUsl')<1)then if GetUnitState(LC,UNIT_STATE_MANA)>zL then set zL=GetUnitState(LC,UNIT_STATE_MANA) set YL=LC endif endif call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set g=null return YL endfunction function ZL takes unit PL,unit LC returns nothing local integer iP=0 local unit vH=null local unit vm=qf('o00J',Player(12),GetUnitLoc(PL),0.00) local real n=GetUnitState(PL,UNIT_STATE_MANA) local real nT=n local real nX local effect array KD loop exitwhen iP>8 if Ed(iP)then if GetUnitAbilityLevel(X[iP],'B00M')>0 then set KD[iP]=AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(X[iP]),GetUnitY(X[iP])) set nX=GetUnitState(X[iP],UNIT_STATE_MANA) set nT=nT+nX call SetUnitState(X[iP],UNIT_STATE_MANA,0) call lD("-"+I2S(NC(nX)),X[iP],255,255,0,true,8,0.75) elseif X[iP]==LC then set KD[iP]=AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(LC),GetUnitY(LC)) else set KD[iP]=null endif endif set iP=iP+1 endloop set KD[9]=AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl",GetUnitX(PL),GetUnitY(PL)) call SetUnitState(PL,UNIT_STATE_MANA,n*(0.6+0.05*J-0.15*RMinBJ(fe,1.333))) call UnitAddAbility(vm,'AOw2') call SetUnitAbilityLevel(vm,'AOw2',IMaxBJ(1,C+sv)) call IssueImmediateOrder(vm,"stomp") call PC(vm,0,600,GetUnitX(PL),GetUnitY(PL),nT/(1.0+J-RMinBJ(fe,1.5)*0.5),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) call PlaySoundOnUnitBJ(mE,127,PL) call TriggerSleepAction(0.1) if not IsUnitType(LC,UNIT_TYPE_MECHANICAL)then set vH=qf('o00J',Player(12),GetUnitLoc(LC),0.00) call UnitAddAbility(vH,'A0CY') call IssueTargetOrder(vH,"sleep",LC) endif call TriggerSleepAction(0.1) call lD("-"+I2S(NC(n*(0.4-0.05*J+0.15*RMinBJ(fe,1.333)))),PL,255,255,0,true,10,0.75) call RemoveUnit(vm) set vm=null if vH!=null then call RemoveUnit(vH) set vH=null endif loop exitwhen iP<0 if KD[iP]!=null then call DestroyEffect(KD[iP]) set KD[iP]=null endif set iP=iP-1 endloop endfunction function em takes real xm,real om returns integer if om<1.0 then return 0 elseif om<3.0 then set om=om*0.75 endif if C<3 then set om=om+1.0*fe elseif C<5 then set om=om+0.5*fe endif if xm<0.0 then set xm=0 endif return NC(xm*xm*0.12*(0.8+om*0.3)/(J*0.5+0.5-0.15*fe)) endfunction function rm takes nothing returns boolean return(GetUnitPointValue(GetTriggerUnit())<6)and(GetUnitState(GetTriggerUnit(),UNIT_STATE_MANA)>99)and(GetUnitAbilityLevel(GetTriggerUnit(),'BUsl')<1) endfunction function im takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit LC=GetTriggerUnit() local real x local real y local real n local real m local integer i=0 local integer am local string nm local boolean Vm=false local boolean Em=false call DisableTrigger(jD) set i=GetUnitUserData(LoadUnitHandle(qi,StringHash("reactor_reactor"),StringHash(XC(jD)))) if i<99 then set i=ModuloInteger(i,10) set m=GetUnitState(Ee[i],UNIT_STATE_MAX_MANA) set x=GetUnitX(Ee[i]) set y=GetUnitY(Ee[i]) set nm=XC(Ee[i]) loop exitwhen Vm or(LC==null) loop if GetUnitUserData(Ee[i])!=99 then call IssueTargetOrder(Ee[i],"drain",LC) set n=GetUnitState(Ee[i],UNIT_STATE_MANA) if n<1 then call FlushStoredMission(Ae,nm) call FlushStoredInteger(Ae,"reactor_explosions",nm) endif call StoreInteger(Ae,nm,XC(LC),1+GetStoredInteger(Ae,nm,XC(LC))) call lD(I2S(NC(n)),Ee[i],0,NC((n/m)*255.0),NC((n/m)*255.0),true,10,0.75) set am=GetStoredInteger(Ae,"reactor_explosions",nm) if GetRandomInt(0,99)GetRandomInt(1000,2400)then call qL(Ee[i],LC) endif endif if n>1000 then call wL(GetUnitLoc(Ee[i])) endif call RC(2.5) exitwhen LC==null exitwhen GetUnitStateSwap(UNIT_STATE_MANA,Ee[i])<1.0 exitwhen GetUnitStateSwap(UNIT_STATE_LIFE,LC)<1.0 exitwhen GetUnitStateSwap(UNIT_STATE_MANA,LC)<100.0 exitwhen HC(GetUnitX(LC),GetUnitY(LC),GetUnitX(Ee[i]),GetUnitY(Ee[i]),300) exitwhen GetUnitAbilityLevel(LC,'BUsl')>0 if(GetUnitUserData(Ee[i])!=99)and not Em then set n=GetUnitState(Ee[i],UNIT_STATE_MANA) call lD(I2S(NC(n)),Ee[i],0,NC((n/m)*255.0),NC((n/m)*255.0),true,10,0.75) endif set Em=false call RC(2.5) exitwhen LC==null exitwhen GetUnitStateSwap(UNIT_STATE_MANA,Ee[i])<1.0 exitwhen GetUnitStateSwap(UNIT_STATE_LIFE,LC)<1.0 exitwhen GetUnitStateSwap(UNIT_STATE_MANA,LC)<100.0 exitwhen HC(GetUnitX(LC),GetUnitY(LC),GetUnitX(Ee[i]),GetUnitY(Ee[i]),300) else set Vm=true exitwhen true endif endloop if not Vm then set LC=yL(x,y) endif endloop else set Vm=true endif set LC=null if not Vm then call EnableTrigger(jD) else call RemoveSavedHandle(qi,StringHash("reactor_reactor"),StringHash(XC(jD))) call DestroyTrigger(jD) endif set jD=null endfunction function Xm takes integer ck returns nothing local string Om local boolean Rm=false local integer iP=0 set S=S+ck if(fe>0)and(S>31)then call TriggerRegisterTimerEvent(yE,0,false) endif if(J>1)and(not Ii)and(S>0)then set Ii=true call aC("|r|cff00ff00HINT|r |cffffcc00Rescued civs increase your hazard pay and recognition.") endif if te<1 then if S=T)then call QuestItemSetDescriptionBJ(Ov,"Rescue 0 more civilians") call CreateQuestItemBJ(N[1],"Rescuing additional civs increases Ion Strike frequency") call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_COMPLETED,"|cffffcc00Civilians rescued:|r "+Om+I2S(S)+"|r") call QuestSetCompletedBJ(N[1],true) set Rm=true elseif not vv then call aC("Civilians rescued:|r "+Om+I2S(S)) endif call PostTriggerExecuteBJ(zE,true) call vd((175+25*J-10*Mx)*ck,true) if ci>0 then set ci=ci-1 call Rd((300-75*Mx)*ck) endif set ck=ck*IMaxBJ(10-ix*ix,1) loop exitwhen iP>8 set Wo[iP+10]=Wo[iP+10]+ck set iP=iP+1 endloop if Rm and not vv then if not vv then call aC("Civs have successfully lobbied for the government to help clean up the radiation.") endif call RC(2) if(J>2)and not vv then call aC("Watch out for Ion Strikes targeted at radiation fragments!") call RC(5) endif call TriggerRegisterTimerEvent(tR,0.1,false) endif else call aC("Civilians rescued:|r |cffff8000"+I2S(S)) call vd(300*ck,true) call Rd(400*ck) endif endfunction function Im takes nothing returns boolean local unit LC=GetTriggerUnit() return(GetUnitPointValue(LC)<3)and(GetUnitUserData(LC)<1) endfunction function Am takes nothing returns nothing local unit Nm=Lr[GetStoredInteger(Ae,"televac",XC(GetTriggeringTrigger()))] local unit bm=GetTriggerUnit() local real Bm=GetUnitState(Nm,UNIT_STATE_MANA) local integer iP local effect KD=null local integer ck if Bm<250 then return endif call SetUnitUserData(bm,1) call SetUnitState(Nm,UNIT_STATE_MANA,Bm-250) if GetUnitAbilityLevel(Nm,'B02E')<1 then if GetUnitState(Nm,UNIT_STATE_MANA)>250 then call SetUnitVertexColor(Nm,32,128,255,255) else call SetUnitVertexColor(Nm,0,255,0,255) endif endif set mr=mr+1 set KD=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(bm),GetUnitY(bm)) if(Nv[11]==1)and(bm==bv[1])then set Nv[11]=2 set bv[1]=null call DestroyEffect(Bv[2]) call Il(1) endif set iP=GetPlayerId(GetOwningPlayer(bm)) if bm==Yv[iP]then call DestroyTrigger(se[iP]) set se[iP]=null set Yv[iP]=null set ee[iP]=qf('n00H',Player(iP),GetUnitLoc(X[iP]),0) endif call RemoveUnit(bm) call TriggerSleepAction(0.1) call DestroyEffect(KD) call RC(5) if(mr<1)or vv then return endif set ck=mr set mr=0 if not vv then call Xm(ck) endif endfunction function cm takes unit Nm,integer Tc returns nothing local trigger jD=CreateTrigger() call TriggerRegisterUnitInRangeSimple(jD,128,Nm) call TriggerAddCondition(jD,Condition(function Im)) call TriggerAddAction(jD,function Am) call StoreInteger(Ae,"televac",XC(jD),Tc) call TriggerRegisterUnitManaEvent(hb,Nm,GREATER_THAN,250.00) call SetUnitUserData(Nm,Tc) set Lr[Tc]=Nm endfunction function Cm takes nothing returns nothing local integer i local integer Vk local location tF local unit LC local unit dm local trigger jD local integer Dm=0 local integer array fm local integer Fm=(C+sv-1)/3 call SetAltMinimapIcon("war3mapImported\\dotg.tga") call TriggerSleepAction(0.1) if(J>2)and(te<1)then call CreateFogModifierRadiusLocBJ(true,U,FOG_OF_WAR_VISIBLE,GetRectCenter(qv),5500.00) call DestroyFogModifier(GetLastCreatedFogModifier()) endif if te<1 then call cm(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'z002',-11774,11257,270.00),0) call cm(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'z002',-10627,769,270.00),1) call cm(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'z002',-8193,-11901,270.00),2) call cm(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'z002',2433,-12158,270.00),3) call cm(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'z002',12798,4865,270.00),4) call cm(CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'z002',12798,12669,270.00),5) endif if J>2 then set fm[0]=0 set fm[1]=0 set fm[2]=0 set fm[3]=1 set fm[4]=1 set fm[5]=2 elseif J>1 then set fm[0]=0 set fm[1]=0 set fm[2]=1 set fm[3]=1 set fm[4]=1 set fm[5]=2 else set fm[0]=0 set fm[1]=1 set fm[2]=1 set fm[3]=1 set fm[4]=2 set fm[5]=2 endif set i=83 set Vk=i-5 if te<1 then loop exitwhen i1)or(ModuloInteger(Dm,2)==1)then call lL(D[i]) else call mL(D[i],2,dm,-1) endif set Ee[Dm]=dm set Ee[Dm+6]=qf('o006',to,GetRectCenter(D[i]),0) call SetUnitUserData(dm,Dm+10*(1+fm[Dm])) call UnitAddAbility(dm,'A060'+fm[Dm]) if fe>1 then call UnitAddAbility(dm,'A0FL') endif set jD=CreateTrigger() call SaveUnitHandle(qi,StringHash("reactor_reactor"),StringHash(XC(jD)),dm) call TriggerRegisterUnitInRangeSimple(jD,450.00,dm) call TriggerAddAction(jD,function uL) set Dm=Dm+1 call pL(dm) set jD=CreateTrigger() call TriggerRegisterUnitManaEvent(jD,dm,GREATER_THAN,2999.00) call TriggerRegisterUnitManaEvent(jD,dm,GREATER_THAN,3999.00) call TriggerAddAction(jD,function QL) set jD=CreateTrigger() call SaveUnitHandle(qi,StringHash("reactor_reactor"),StringHash(XC(jD)),dm) call TriggerRegisterUnitInRangeSimple(jD,190.00,dm) call TriggerAddCondition(jD,Condition(function rm)) call TriggerAddAction(jD,function im) call TriggerRegisterEnterRectSimple(Bb,D[i]) call TriggerRegisterLeaveRectSimple(cb,D[i]) set i=i-1 endloop endif set Vk=GetRandomInt(i-2-J,i-3) set ne[i-Vk+1]=null loop exitwhen i3 then call CL('h005',2-Fm,1,D[i]) call CL('h005',3-Fm,2,D[i]) call CL('h005',89-40*Fm,10,D[i]) call CL('h005',89-40*Fm,10,D[i]) call CL('h006',89-40*Fm,10,D[i]) endif call CL('h006',1,1,D[i]) call CL('h006',3-Fm,1,D[i]) call FL(D[i],true) call uD(i) call TriggerSleepAction(0.01) set i=i-1 endloop set Vk=GetRandomInt(i-2,i-(Fm+1)/2) loop exitwhen i3 then call CL('h006',2-Fm,1,D[i]) endif call FL(D[i],true) call uD(i) call TriggerSleepAction(0.01) set i=i-1 endloop set Vk=GetRandomInt(i-J,i-te) loop exitwhen i(J*24)) call uD(i) set i=i-1 endloop call RemoveAllGuardPositions(Nr) call RemoveAllGuardPositions(to) set i=0 call TriggerSleepAction(1.0) call GL() if((J<3)and(GetRandomInt(1,J)==1))or(te>0)then set tF=Td(GetRectCenter(ln),1000,1000) call SetItemInvulnerable(CreateItemLoc('I03A',tF),true) set Nv[5]=Nv[5]+1 if(J<2)or(te>0)then if(GetRandomInt(0,1)==0)and((C+sv)>1)then call SetItemInvulnerable(CreateItemLoc('I03A',tF),true) set Nv[5]=Nv[5]+1 endif if(GetRandomInt(0,1)==0)and((C+sv)>3)then call SetItemInvulnerable(CreateItemLoc('I03A',tF),true) set Nv[5]=Nv[5]+1 endif endif call RemoveLocation(tF) call Ph() endif call CreateFogModifierRectBJ(true,Player(11),FOG_OF_WAR_VISIBLE,GetPlayableMapRect()) call CreateFogModifierRectBJ(true,Player(10),FOG_OF_WAR_VISIBLE,GetPlayableMapRect()) if te>0 then call TriggerRegisterTimerEvent(Db,1,false) endif endfunction function gm takes nothing returns nothing set WE=CreateTrigger() call TriggerAddAction(WE,function Cm) endfunction function Gm takes nothing returns nothing local integer ck=S-32 local integer hm=10 loop exitwhen ck<1 set hm=hm*4 set hm=hm/ 3 if hm>950 then set hm=950 exitwhen true endif set ck=ck-1 endloop set Si=hm endfunction function Hm takes nothing returns nothing set yE=CreateTrigger() call TriggerAddAction(yE,function Gm) endfunction function jm takes integer Lc,integer i returns nothing local location tF=yd(D[i]) call CreateItemLoc(Lc,tF) call RemoveLocation(tF) endfunction function Jm takes nothing returns nothing if(te>0)or(GetRandomInt(0,99)<((3-J)*50))then call jm('I01M',GetRandomInt(0,H)) endif if(te>0)or(GetRandomInt(0,4-J)==0)then call jm('I01X',GetRandomInt(0,H)) call jm('I01V',GetRandomInt(0,H)) call jm('I01T',GetRandomInt(0,H)) call jm('I01T',GetRandomInt(0,H)) call jm('I01W',GetRandomInt(0,H)) call jm('I01W',GetRandomInt(0,H)) endif call TriggerRegisterEnterRectSimple(fb,zV) call TriggerRegisterEnterRectSimple(fb,ZV) call TriggerRegisterEnterRectSimple(fb,rE) call TriggerRegisterEnterRectSimple(fb,eE) call TriggerRegisterEnterRectSimple(fb,xE) call TriggerRegisterEnterRectSimple(fb,oE) call SetPlayerTechResearchedSwap('R006',4,Player(PLAYER_NEUTRAL_PASSIVE)) call TriggerRegisterPlayerUnitEventSimple(wI,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_SPELL_EFFECT) call SetPlayerTechResearchedSwap('R012',4-J,Player(10)) call SetPlayerTechResearchedSwap('R012',4-J,Player(11)) call nf(Player(10),-100) call nf(Player(11),100) endfunction function km takes nothing returns nothing set YE=CreateTrigger() call TriggerAddAction(YE,function Jm) endfunction function Km takes nothing returns boolean local integer i=0 if Nv[5]>0 then return false endif if kv<1 then set i=i+1 endif if Ve>5 then set i=i+1 endif if S>31 then set i=i+1 endif return i>1 endfunction function lm takes nothing returns boolean if te>0 then return false endif if fe>0 then if(kv>0)and(mo<100)then return false endif if S<32 then return false endif if Ve<6 then return false endif if(fe>1)and(Nv[5]>0)then return false endif if mo<1 then set mo=1 set hr=1 call TriggerRegisterTimerEvent(yO,0,false) endif if mo<100 then return false endif else if kv>mv then return false endif if not IsQuestCompleted(N[1])then return false endif if not IsQuestCompleted(N[2])then return false endif if(Cx[9]>9)and(ze>0)and not Km()then return false endif endif return IsTriggerEnabled(zE) endfunction function Lm takes nothing returns nothing local integer i local integer mm local integer Mm local integer pm local integer Pm=J local integer qm=kv-Zo local boolean Qm=(J<3)and(GetStoredInteger(Ae,"herocount","totalplayers")==1) set vv=true call TD() call QuestSetCompletedBJ(N[3],true) call TriggerSleepAction(1) set i=0 loop exitwhen i>8 if Q[i]>0 then set Q[i]=-1 endif set i=i+1 endloop call ClearTextMessagesBJ(GetPlayersAll()) if yK()then if(J==1)and(ze>0)and(Nv[5]<1)and(((qm<1)and(Ve>5))or((qm<1)and(S>31))or((S>31)and(Ve>5)))then set Pm=0 endif if fe>0 then set fe=fe+2 endif set mm=(Ve+w)*(Ve-w)*(29-4*J) set Mm=IMinBJ(19,IMaxBJ(0,(S-T)))*29+(NC(SquareRoot(IMaxBJ(0,S-T-19))*29)-15)*2 set pm=IMaxBJ(0,mv-qm)*NC(650.0/ mv) set be=be+mm+IMaxBJ(Mm,0)+pm set i=0 loop exitwhen i>8 if(Q[i]==-1)and IC(Player(i))and not Xe[i]then set Xe[i]=true if Qm and(uv[i]==0)and((Pv[i*3]-Pv[i*3+1])=='O00T')then set Lo[i*15+2]=7 set Lo[i*15+6]=0 call Jl(i,14) else set Zv[i]=IMinBJ(Zv[i],Pm) call Jl(i,TK(i,1.00)) endif endif set i=i+1 endloop call DisplayTimedTextToForce(Fx,600,"|cffffcc00Official Time: "+WD()+"|r") if Nv[14]>0 then call TriggerRegisterTimerEvent(nR,1,false) endif if J>1 then call aC("|r|cff00ff00HINT|r |cffffcc00Take a screenshot (|r|cffffff00printscreen|r|cffffcc00) of your rank code in case a dimensional rift occurs!") endif call SetAllyColorFilterState(no[GetPlayerId(U)]) call RC(10) call TriggerExecute(bX) else call TriggerExecute(IX) endif endfunction function sm takes nothing returns nothing set zE=CreateTrigger() call TriggerAddCondition(zE,Condition(function lm)) call TriggerAddAction(zE,function Lm) endfunction function Sm takes nothing returns nothing local integer i call RC(10) if vv then return endif set i=0 loop exitwhen i>8 if AC(Player(i))and A[i]then return endif set i=i+1 endloop if vv then return endif set vv=true call TD() set i=0 loop exitwhen i>8 if Q[i]>0 then set Q[i]=-1 endif set i=i+1 endloop call ClearTextMessagesBJ(GetPlayersAll()) if Ue then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00Congratulations!|r") call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00You survived until "+WD()+"|cffffcc00.|r") else call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00Your team failed.|r") if te>0 then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00You didn't survive long enough.|r") call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00"+WD()) elseif fe>1 then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00Extinction appears to be your evolutionary destiny.|r") elseif fe>0 then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00You aren't good enough to overcome the nightmare.|r") elseif(J<3)then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00You don't seem to be ready for this difficulty level.|r") else if C<2 then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00You should find someone to play with and try again.|r") elseif C<9 then call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00It just takes practice. Never give up, never surrender!|r") else call DisplayTimedTextToForce(GetPlayersAll(),20,"|cffffcc00Your team is hopeless. Try again with better allies.|r") endif endif endif call TriggerSleepAction(5.0*Xx) if yK()then set i=0 loop exitwhen i>8 if(Q[i]==-1)and IC(Player(i))and not Xe[i]then set Xe[i]=true if te>3 then call Jl(i,TK(i,1.00)) else call Jl(i,TK(i,0.50)) endif endif set i=i+1 endloop endif call SetAllyColorFilterState(no[GetPlayerId(U)]) call TriggerSleepAction(20.0*Xx) set i=0 loop exitwhen i>8 if Q[i]==-1 then if te>3 then call CustomVictoryBJ(Player(i),true,true) else call CustomDefeatBJ(Player(i),"Defeat.") endif endif set i=i+1 endloop endfunction function tm takes nothing returns nothing set ZE=CreateTrigger() call TriggerAddAction(ZE,function Sm) endfunction function Tm takes nothing returns nothing local integer iP=GetPlayerId(GetTriggerPlayer()) if Xv==11 then set Xv=iP call iC(GetTriggerPlayer(),"Now listening to spawn messages.") elseif(iP==Xv)then set Xv=11 call iC(GetTriggerPlayer(),"No longer listening to spawn messages.") else call iC(GetTriggerPlayer(),"Player "+I2S(Xv+1)+" is already listening to spawn messages.") endif endfunction function um takes nothing returns nothing set vX=CreateTrigger() call TriggerAddAction(vX,function Tm) endfunction function Um takes nothing returns nothing call DisableTrigger(eX) call ik(GetTriggerPlayer()) set re=true call UnitAddAbilityBJ('A03Z',X[GetPlayerId(GetTriggerPlayer())]) call iC(GetTriggerPlayer(),"Advanced nanites activated.") endfunction function wm takes nothing returns nothing set eX=CreateTrigger() call TriggerAddAction(eX,function Um) endfunction function Wm takes nothing returns nothing local location ud=GetUnitLoc(X[GetPlayerId(GetTriggerPlayer())]) call DisableTrigger(xX) set re=true call CreateItemLoc('I01O',ud) call CreateItemLoc('I02Z',ud) call CreateItemLoc('I02Y',ud) call CreateItemLoc('I018',ud) call CreateItemLoc('I01R',ud) call CreateItemLoc('I01Q',ud) call CreateItemLoc('I01A',ud) call CreateItemLoc('I019',ud) call RemoveLocation(ud) endfunction function ym takes nothing returns nothing set xX=CreateTrigger() call TriggerAddAction(xX,function Wm) endfunction function Ym takes nothing returns nothing local unit LC=GetEnumUnit() if IsUnitType(LC,UNIT_TYPE_HERO)and IsUnitAliveBJ(LC)then call SetHeroLevelBJ(LC,IMinBJ(55,GetHeroLevel(LC)+1),true) endif endfunction function zm takes nothing returns nothing local integer i local string s=SubStringBJ(GetEventPlayerChatString(),7,8) set re=true set i=IMaxBJ(S2I(s),1) loop call ForGroupBJ(Gc(GetTriggerPlayer()),function Ym) set i=i-1 exitwhen i<1 call ac(1.2) endloop endfunction function Zm takes nothing returns nothing set oX=CreateTrigger() call TriggerAddAction(oX,function zm) endfunction function vM takes nothing returns nothing local string s=GetEventPlayerChatString() local integer i=S2I(SubStringBJ(s,9,StringLength(s))) set re=true call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,i) endfunction function eM takes nothing returns nothing set rX=CreateTrigger() call TriggerAddAction(rX,function vM) endfunction function oM takes nothing returns nothing local string s=GetEventPlayerChatString() local integer i=S2I(SubStringBJ(s,7,StringLength(s))) set re=true call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_LUMBER,i) endfunction function rM takes nothing returns nothing set aX=CreateTrigger() call TriggerAddAction(aX,function oM) endfunction function iM takes nothing returns nothing if JD()then set ke=true endif endfunction function aM takes nothing returns nothing set VX=CreateTrigger() call TriggerRegisterGameLoadedEventBJ(VX) call TriggerRegisterTimerEventSingle(VX,0.01) call TriggerAddAction(VX,function iM) endfunction function VM takes nothing returns nothing local integer i call DisplayTimedTextToForce(GetPlayersAll(),600,"|cffff8000WARNING|r |cffffcc00You are not allowed to load saved games.|r") call TriggerSleepAction(4.0) loop set i=0 loop exitwhen Ed(i) set i=i+1 exitwhen i>8 endloop exitwhen i>8 call KillUnit(X[i]) call TriggerSleepAction(0.5) endloop endfunction function EM takes nothing returns nothing set EX=CreateTrigger() call TriggerRegisterGameLoadedEventBJ(EX) call TriggerAddAction(EX,function VM) endfunction function XM takes nothing returns nothing call aC("|r|cffff8000WARNING|r |cffffcc00You will not be allowed to load because engine bugs can be exploited for easier victory.") endfunction function OM takes nothing returns nothing set XX=CreateTrigger() call TriggerRegisterGameSavedEventBJ(XX) call TriggerAddAction(XX,function XM) endfunction function RM takes nothing returns nothing set Ox=0 call TriggerRegisterTimerEvent(RX,30,false) loop exitwhen Ox<0 call TriggerSleepAction(1) set Ox=Ox+1 endloop call TriggerRegisterTimerEvent(OX,330,false) endfunction function IM takes nothing returns nothing set OX=CreateTrigger() call TriggerRegisterTimerEventSingle(OX,10.00) call TriggerAddAction(OX,function RM) endfunction function AM takes nothing returns nothing set Xx=I2R(Ox)/ 36.0 set Ox=-1000 endfunction function NM takes nothing returns nothing set RX=CreateTrigger() call TriggerAddAction(RX,function AM) endfunction function bM takes nothing returns nothing local integer i=0 loop exitwhen i>8 if Q[i]==-1 then call CustomVictoryBJ(Player(i),true,true) endif set i=i+1 endloop endfunction function BM takes nothing returns nothing set IX=CreateTrigger() call TriggerAddAction(IX,function bM) endfunction function cM takes nothing returns nothing local unit LC local effect KD local location tF local integer i=GetRandomInt(6,8) local integer nD=0 loop exitwhen i<1 set tF=GetRandomLocInRect(iE) set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",tF) set LC=Tf('z00A'+GetRandomInt(0,2),Player(10),tF,GetRandomInt(0,359)) call SetUnitInvulnerable(LC,(fe==0)or(nD==0)) call RemoveGuardPosition(LC) set He[nD]=LC set nD=nD+1 call ac(0.33) call DestroyEffect(KD) call ac(GetRandomReal(0.5,1.0)) set i=i-1 endloop call ac(2) set i=1 loop exitwhen i==nD call IssuePointOrderLocBJ(He[i],"attack",GetRandomLocInRect(GetPlayableMapRect())) set i=i+1 endloop call ac(5) call IssuePointOrderLocBJ(He[0],"attack",GetRandomLocInRect(GetPlayableMapRect())) endfunction function CM takes nothing returns nothing set AX=CreateTrigger() call TriggerAddAction(AX,function cM) endfunction function dM takes nothing returns nothing local unit LC local integer nD=GetRandomInt(0,8) local integer i=nD local location ud local unit vH loop exitwhen Ed(i) set i=i+1 if i>8 then set i=0 endif exitwhen i==nD endloop if Ed(i)then set LC=X[i] call IssueImmediateOrderBJ(LC,"holdposition") set ud=GetUnitLoc(LC) set vH=qf('o00J',Player(PLAYER_NEUTRAL_PASSIVE),GetRectCenter(vE),0.00) call UnitAddAbilityBJ('A05N',vH) call IssuePointOrderLocBJ(vH,"farsight",ud) if je<3 then call PanCameraToTimedLocForPlayer(U,GetUnitLoc(LC),2.00) endif call ac(1.0) call RemoveUnit(vH) call RemoveLocation(ud) call ac(0.5) if je<3 then call Xh(LC,1) endif call ac(2.0) if je<3 then call ResetToGameCameraForPlayer(U,1) endif call ac(1.5) set je=je+1 call PostTriggerExecuteBJ(NX,false) else loop exitwhen je>2 call ac(5.0) set je=je+1 endloop endif endfunction function DM takes nothing returns nothing set NX=CreateTrigger() call TriggerAddAction(NX,function dM) endfunction function fM takes nothing returns nothing call xh(true,GetPlayersAll()) call FogMaskEnableOff() call FogEnableOff() call CameraClearNoiseForPlayer(U) call ResetToGameCameraForPlayer(U,2) call TransmissionFromUnitTypeWithNameBJ(GetPlayersAll(),Player(9),'n00K',"Chief of National Security",GetRectCenter(GetPlayableMapRect()),AE,"Excellent work Bravo team. Your efforts have...",bj_TIMETYPE_SET,5.00,true) call TransmissionFromUnitTypeWithNameBJ(GetPlayersAll(),Player(9),'o00I',"",GetRectCenter(GetPlayableMapRect()),null,". . .",bj_TIMETYPE_SET,4.00,true) call TransmissionFromUnitTypeWithNameBJ(GetPlayersAll(),Player(11),'nmed',"Umbrella Corp. Executive",GetRectCenter(GetPlayableMapRect()),AE,"Well, well. You've done a fine job cleaning up our mess. But your interference ends here!",bj_TIMETYPE_SET,10.00,false) call ac(2) call TriggerExecute(NX) call OC(16) set je=3 call OC(2) call PanCameraToTimedLocForPlayer(U,GetRectCenter(iE),1.50) call ac(3) call TriggerExecute(AX) call ac(4) call Xh(He[0],1) call ac(0.75) call TransmissionFromUnitTypeWithNameBJ(GetPlayersAll(),Player(10),'z00A',"Umbrella Officer",GetRectCenter(iE),AE,"Alright men, move out and make haste. Get the samples, destroy the evidence, and then recall to H.Q.",bj_TIMETYPE_SET,8.00,false) call kD(He[0],"Alright men, move out and make haste. Get the samples, destroy the evidence, and then recall to H.Q.",30) call ResetToGameCameraForPlayer(U,1) call ac(6) call SetCameraFieldForPlayer(U,CAMERA_FIELD_TARGET_DISTANCE,3300.00,5) call SetCameraFieldForPlayer(U,CAMERA_FIELD_ANGLE_OF_ATTACK,285.00,5) call xh(false,GetPlayersAll()) call RC(60) call TriggerExecute(IX) endfunction function FM takes nothing returns nothing set bX=CreateTrigger() call TriggerAddAction(bX,function fM) endfunction function gM takes integer i returns string local string Vd if i==0 then set Vd="Afraid of Kittens (normal)" elseif i==1 then set Vd="Scared of the Dark (normal)" elseif i==2 then set Vd="Weak by Choice (normal)" elseif i==3 then set Vd="Little Girl (normal)" elseif i==4 then set Vd="Hopeless Noob (normal)" else set Vd="Fairy Princess (normal)" endif return("|cff00ff00"+Vd+"|r") endfunction function GM takes integer i returns string local string Vd if i==0 then set Vd="Joe Schmoe (hard)" elseif i==1 then set Vd="Average Guy (hard)" elseif i==2 then set Vd="Fairly Normal (hard)" elseif i==3 then set Vd="Burly Man (hard)" else set Vd="Tough Kid (hard)" endif return("|cffffffff"+Vd+"|r") endfunction function hM takes integer i returns string local string Vd if i<4 then set Vd="Hardcore (insane)" elseif i<8 then set Vd="Zombie Slayer (insane)" elseif i<12 then set Vd="Bane of the Wicked (insane)" elseif i<16 then set Vd="Pain-Bringer (insane)" elseif i<20 then set Vd="Carnage Incarnate (insane)" else set Vd="BikeHelmet Clone (insane)" endif return("|cffff8000"+Vd+"|r") endfunction function HM takes integer i returns string local string Vd if i==0 then set Vd="Dawn of the Dead (survival)" elseif i==1 then set Vd="28 Days Later... (survival)" elseif i==2 then set Vd="Resident Evil (survival)" elseif i==3 then set Vd="Army of Darkness (survival)" elseif i==4 then set Vd="Land of the Dead (survival)" else set Vd="Night of Living Dead (survival)" endif return("|cffffff00"+Vd+"|r") endfunction function jM takes nothing returns nothing local integer i local player oP call DisableTrigger(BX) call Qh() call DialogSetMessageBJ(K,"What best describes you?") set M=DialogAddButton(K,hM(GetRandomInt(0,20)),1) set Te=DialogAddButton(K,GM(GetRandomInt(0,4)),2) set L=DialogAddButton(K,gM(GetRandomInt(0,5)),3) call DialogAddButton(K,HM(GetRandomInt(0,5)),4) set i=0 loop exitwhen i>8 set oP=Player(i) if AC(oP)then if not IC(oP)then if GetAIDifficulty(oP)==AI_DIFFICULTY_INSANE then set q[i]=1 set uv[i]=wv*2 elseif GetAIDifficulty(oP)==AI_DIFFICULTY_NORMAL then set q[i]=2 set uv[i]=wv elseif GetAIDifficulty(oP)==AI_DIFFICULTY_NEWBIE then set q[i]=3 endif else set Je[i]=ID(i) set q[i]=0 call DialogDisplayBJ(true,K,oP) endif endif set i=i+1 endloop call StartTimerBJ(P,false,10.00) endfunction function JM takes nothing returns nothing set BX=CreateTrigger() call TriggerAddAction(BX,function jM) endfunction function kM takes nothing returns nothing call DisableTrigger(cX) call Pf() call DestroyTrigger(cX) endfunction function KM takes nothing returns nothing set cX=CreateTrigger() call TriggerRegisterTimerEventSingle(cX,0.01) call TriggerAddAction(cX,function kM) endfunction function lM takes integer aD returns integer local integer array LM if aD==0 then set LM[0]=1 set LM[1]=2 set LM[2]=5 elseif aD==1 then set LM[0]=1 set LM[1]=4 set LM[2]=6 elseif aD==2 then set LM[0]=1 set LM[1]=2 set LM[2]=6 elseif aD==3 then set LM[0]=1 set LM[1]=3 set LM[2]=6 elseif(aD>9)and(aD<15)then set LM[0]=2 set LM[1]=4 set LM[2]=5 elseif aD==4 then set LM[0]=6 set LM[1]=4 set LM[2]=5 elseif aD==5 then set LM[0]=2 set LM[1]=4 set LM[2]=3 elseif aD==6 then set LM[0]=3 set LM[1]=2 set LM[2]=6 elseif aD==7 then set LM[0]=3 set LM[1]=5 set LM[2]=1 elseif(aD>7)and(aD<10)then set LM[0]=4 set LM[1]=5 set LM[2]=3 else return 0 endif return LM[GetRandomInt(0,2)] endfunction function mM takes unit o,integer MM returns nothing local integer NH=GetUnitAbilityLevel(o,MM) local integer iP=GetPlayerId(GetOwningPlayer(o)) local integer c=GetUnitUserData(o) if(MM=='A0H4')then call wj(o,NH,true) if NH==4 then set NH=3 elseif NH==5 then set NH=4 endif call wj(o,NH-1,false) return endif if(MM>='A0FM')and(MM<='A0FW')then call SetUnitUserData(o,MM-'A0FM') call wj(o,0,true) call wj(o,1,false) return endif if(MM>='A0GT')and(MM<='A0GZ')then if(c==4)or(c==9)then set Pv[iP*3+1]=eJ(MM-'A0GT') else set Pv[iP*3+1]=0 endif call wj(o,1,true) call wj(o,2,false) return endif if(MM>='A0H0')and(MM<='A0H3')then set Pv[iP*3+2]=MM-'A0H0' call wj(o,2,true) call wj(o,3,false) return endif if(MM=='A0GS')then if NH==1 then call wj(o,3,true) call wj(o,4,false) else call wj(o,4,true) call wj(o,3,false) endif return endif if(MM>='A0GA')and(MM<=('A0GA'+Nx/2-1))then set Eo[iP]=MM-'A0GA' call wj(o,3,true) call wj(o,5,false) return endif if(MM>=('A0GA'+Nx/2))and(MM<=('A0GA'+Nx-1))then set Eo[iP]=MM-'A0GA' call wj(o,4,true) call wj(o,5,false) return endif if(MM>='A0G0')and(MM<='A0G9')then set do[iP]=MM-'A0G0' call DisableTrigger(co[iP]) if Pv[iP*3]==0 then set Pv[iP*3]=XJ(c) endif set Lo[iP*15+2]=kK(Pv[iP*3],Pv[iP*3+1]) set Lo[iP*15+3]=Pv[iP*3+2] set Lo[iP*15+4]=Eo[iP] set Lo[iP*15+5]=do[iP] set Lo[iP*15+6]=lM(Lo[iP*15+2]) set Lo[iP*15+7]=0 set Lo[iP*15+8]=0 set Lo[iP*15+9]=0 set Lo[iP*15+10]=0 set Lo[iP*15+11]=0 set Lo[iP*15+12]=0 set Lo[iP*15+13]=0 set Lo[iP*15+14]=0 set Lo[iP*15+15]=0 call kj(Eo[iP],iP,false) call Qj(do[iP],iP,false) call Zj(iP) call DestroyTrigger(co[iP]) return endif if(MM>='A0FX')and(MM<='A0FZ')then set qe[iP]=MM-'A0FX'+1 call Zj(iP) return endif endfunction function pM takes nothing returns nothing call mM(GetSpellAbilityUnit(),GetSpellAbilityId()) endfunction function PM takes unit o returns nothing local trigger jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,o,EVENT_UNIT_SPELL_EFFECT) call TriggerAddAction(jD,function pM) call UnitAddAbility(o,'A0H4') call wj(o,0,false) call SelectUnitForPlayerSingle(o,GetOwningPlayer(o)) set jD=null endfunction function qM takes nothing returns nothing local integer iP=GetPlayerId(GetTriggerPlayer()) local string s=GetEventPlayerChatString() local integer l=StringLength(s) local integer i=0 local string c local string QM="" if l<16 then return endif loop exitwhen i>=l set c=SubString(s,i,i+1) if(c=="0")or(S2I(c)!=0)then set QM=QM+c elseif(c!=" ")and(c!="-")and(c!="(")and(c!=")")then return endif set i=i+1 endloop if StringLength(QM)!=16 then return endif call DisableTrigger(co[iP]) if QM==El(GetPlayerName(Player(iP)),0)then set Pv[iP*3]=0 call iC(Player(iP),"Watchman class unlocked.") call Yj(I[iP],0) call SetPlayerTechResearched(Player(iP),'R00A',1) call EnableTrigger(co[iP]) return endif if not gl(Player(iP),QM)then set Pv[iP*3]=0 call iC(Player(iP),"|r|cffff0000|r |cffffcc00") call EnableTrigger(co[iP]) return endif if(Pv[iP*3]=='O018')and(uv[iP]==0)and(Zv[iP]>3)and(Lo[iP*15+6]==0)then set Pv[iP*3]=0 call iC(Player(iP),"Pyrotechnician class unlocked.") call Yj(I[iP],0) call SetPlayerTechResearched(Player(iP),'R017',1) call EnableTrigger(co[iP]) return endif call kj(Eo[iP],iP,false) call Qj(do[iP],iP,false) call Zj(iP) call DestroyTrigger(co[iP]) endfunction function sM takes player oP returns nothing local trigger jD=CreateTrigger() call TriggerAddAction(jD,function qM) call TriggerRegisterPlayerChatEvent(jD,oP,"",false) set co[GetPlayerId(oP)]=jD set jD=null endfunction function SM takes nothing returns nothing local boolean tM=false local player oP=GetTriggerPlayer() local integer iP=GetPlayerId(oP) local integer TM if(GetClickedButtonBJ()==L)then set q[iP]=3 set tM=true elseif(GetClickedButtonBJ()==Te)then set q[iP]=2 elseif(GetClickedButtonBJ()==M)then set q[iP]=1 else set q[iP]=4 endif set q[9]=q[9]+1 if tM then call iC(oP,"|cffff8000NOTE|r |cffffcc00Others cannot hear your default chat until you select a hero.") endif call PM(I[iP]) call sM(oP) if q[9]>=C then if IsTriggerEnabled(DX)then call TriggerRegisterTimerEvent(DX,0,false) endif endif call TriggerSleepAction(0.1) if U==oP then call EnableUserControl(true) endif if tM then call OC(35.0) loop exitwhen X[iP]!=null exitwhen not AC(oP) call TriggerSleepAction(10) endloop if C==1 then if JD()then call iC(oP,"|r|cffff8000NOTE|r |cffffcc00Rank may be gained only in LAN and Battle.net games.") call RC(8.0) endif endif if uv[iP]==0 then call RC(10) set TM=Uo call iC(oP,"|r|cff00ff00HINT|r |cffffcc00Read the objectives (|r|cffffff00F9|r|cffffcc00) so that you know what you're supposed to do.") call RC(10) loop exitwhen Uo>(TM+2) call RC(3) endloop call iC(oP,"|r|cff00ff00HINT|r |cffffcc00Most monsters can kill you |r|cffff8000very quickly|r|cffffcc00, so don't let them up close.") call RC(12) call iC(oP,"|r|cff00ff00HINT|r |cffffcc00Zombies can reanimate. Standing near corpses is not recommended.") call RC(12) call iC(oP,"|r|cff00ff00HINT|r |cffffcc00Always try to stay with the group. Designate a leader.") call RC(12) call iC(oP,"|r|cff00ff00HINT|r |cffffcc00Search buildings for items to use and radiation fragments to destroy.") call RC(12) call iC(oP,"|r|cff00ff00HINT|r |cffffcc00Nanites (|r|cffffff00F|r|cffffcc00) are necessary to stay alive. Use that skill and level it up.") call RC(12) call iC(oP,"|r|cff00ff00HINT|r |cffffcc00See |r|cffffff00http://redscull.com/swat|r|cffffcc00 for forums and detailed game info.") endif endif endfunction function uM takes nothing returns nothing set CX=CreateTrigger() call TriggerRegisterDialogEventBJ(CX,K) call TriggerAddAction(CX,function SM) endfunction function UM takes integer i returns nothing local player oP=Player(i) if Pv[i*3]==0 then if AC(oP)then if not IC(oP)then call mM(I[i],OJ(-2,i)+'A0G0') call ShareEverythingWithTeam(oP) call TriggerSleepAction(0.1) endif else set I[i]=null endif endif set oP=null endfunction function wM takes integer i returns nothing local player oP=Player(i) if Pv[i*3]==0 then if AC(oP)then if IC(oP)then call DisableTrigger(co[i]) call mM(I[i],OJ(-1,i)+'A0G0') call DestroyTrigger(co[i]) endif else set I[i]=null endif endif set oP=null endfunction function WM takes integer YM returns nothing local integer i loop exitwhen YM<1 set i=0 loop exitwhen i>8 if(Pv[i*3]==0)and AC(Player(i))then exitwhen true endif set i=i+1 endloop if i>8 then return endif call RC(5) set YM=YM-5 endloop endfunction function zM takes nothing returns nothing local integer i call DisableTrigger(dX) call UM(0) call UM(1) call UM(3) call UM(5) call UM(6) call UM(8) call UM(2) call UM(7) call UM(4) call WM(40) if(J>2)or((J>1)and(C==1))then call WM(120) endif set i=0 loop exitwhen i>8 if(Pv[i*3]==0)and AC(Player(i))then call iC(Player(i),"|cffff8000NOTE|r |cffffcc00You have 30 seconds to load a rank code or create a hero.") endif set i=i+1 endloop call WM(20) set i=0 loop exitwhen i>8 if(Pv[i*3]==0)and AC(Player(i))then call iC(Player(i),"|cffff8000NOTE|r |cffffcc00A hero will be chosen for you in 10 seconds.") endif set i=i+1 endloop call WM(10) call wM(0) call wM(1) call wM(2) call wM(3) call wM(4) call wM(5) call wM(6) call wM(7) call wM(8) call MultiboardDisplayBJ(true,pe) call DestroyTrigger(dX) endfunction function ZM takes nothing returns nothing set dX=CreateTrigger() call TriggerRegisterTimerExpireEventBJ(dX,Qv) call TriggerAddAction(dX,function zM) endfunction function vp takes integer ep returns string if ep==0 then return"" elseif ep==1 then return"Insane" elseif ep==2 then return"Hard" elseif ep==3 then return"Normal" else return"Survival" endif endfunction function xp takes real n returns integer if n>250.0 then return 3 elseif n>150.0 then return 2 endif return 1 endfunction function op takes nothing returns nothing local integer i=0 local integer WC=0 local integer dl=0 local integer rp=0 local string Vd local boolean ip=false call DisableTrigger(DX) call DisableTrigger(CX) set ro=CreateQuestBJ(bj_QUESTTYPE_OPT_DISCOVERED,"Difficulty Level","Difficulty level scales many aspects of the game. Some examples include hero experience rate, credits awarded, spawn rate of undead, movement speed of undead, and upgrade rate of undead. Quest requirements are also scaled, and easier modes help map visibility.","ReplaceableTextures\\CommandButtons\\BTNManual3.blp") loop exitwhen i>8 if q[i]>-1 then call DialogDisplayBJ(false,K,Player(i)) if q[i]==0 then call PM(I[i]) call sM(Player(i)) set ip=true elseif q[i]>0 then set WC=WC+1 if q[i]>3 then set rp=rp+1 set dl=dl+200 else set dl=dl+q[i]*100 endif endif call CreateQuestItemBJ(ro,ID(i)+" - "+vp(q[i])) endif set i=i+1 endloop if ip then call TriggerSleepAction(0.1) call EnableUserControl(true) endif if rp>=NC(I2R(C)/2.0)then set J=3 set te=1 set Mx=1 call QuestSetTitleBJ(ro,"Difficulty: Survival") else if WC>0 then set J=xp(I2R(dl)/ I2R(WC)) endif set te=0 call QuestSetTitleBJ(ro,"Difficulty: "+vp(J)) endif call StartTimerBJ(Qv,false,20) if J<3 then call SetPlayerTechResearched(to,'R001',1) call SetPlayerTechResearched(Nr,'R001',1) call SetPlayerTechResearched(to,'R004',1) call SetPlayerTechResearched(Nr,'R004',1) set xv=1 else set Gv=(C>1)and(te<1) endif call SetPlayerTechResearchedSwap('Rhgb',1,Player(10)) if te<1 then set mv=GetFoodMade('o00V'+J-1) else set mv=GetFoodMade('o00D') endif call yh() if te>0 then set Vd="|cffffff00Survival|r" set T=0 set rv=1.7 set he=1.0 set Y=1.10 set Mv=115 set w=0 set ye=-60 elseif J==1 then set Vd="|cffff8000Insane|r" set T=20 set rv=1.0 set he=0.9 set Y=0.92 set Mv=115 set w=3 set ye=-23 set Fe=1 set hi=hi+1 set sr=36 set xi=sr set hr=2 elseif J==2 then set Vd="Hard" set T=12 set rv=1.5 set he=0.6 set Y=1.50 set Mv=105 set w=3 set ye=-40 set sr=22 set xi=sr else set Vd="|cff00ff00Normal|r" set T=6 set rv=2.0 set he=0.4 set Y=2.90 set Mv=100 set w=2 set ye=-65 set sr=18 set xi=sr call EnableTrigger(LR) endif call Dd() call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_UPDATED,"|cffffcc00Difficulty Level:|r "+Vd) if te<1 then set Ov=CreateQuestItemBJ(N[1],"Rescue "+I2S(T)+" civilians") set Rv=CreateQuestItemBJ(N[2],"Restore "+I2S(w)+" reactors") call CreateQuestItemBJ(N[3],"Safe level is "+I2S(mv)) call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_REQUIREMENT,"|cffffcc00Inoculate and rescue "+I2S(T)+" civilians|r") call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_REQUIREMENT,"|cffffcc00Restore "+I2S(w)+" power plant reactors|r") call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_REQUIREMENT,"|cffffcc00Reduce radiation to safe level|r") call DestroyQuestBJ(N[4]) else call DestroyQuestBJ(N[1]) call DestroyQuestBJ(N[2]) call DestroyQuestBJ(N[3]) call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_REQUIREMENT,"|cffffcc00Survive for at least 44 minutes|r") set Ov=CreateQuestItemBJ(N[4],"Day 1") call TriggerRegisterTimerEvent(ZN,20,false) endif call TriggerRegisterTimerEvent(Jb,0,false) call TriggerRegisterTimerEvent(YE,30,false) call TriggerRegisterTimerEvent(wE,30,false) call TriggerExecute(WE) call PostTriggerExecuteBJ(jX,true) set i=0 loop call fJ() exitwhen(Z!=null)or(i>20) call TriggerSleepAction(3.0*Xx) set i=i+1 endloop if te>0 then call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_UPDATED,"|cffffcc00Day 1|r") call TriggerExecute(KR) endif call TriggerRegisterTimerEvent(qX,30,false) call OC(240) call DisableTrigger(yX) call DestroyTrigger(yX) endfunction function ap takes nothing returns nothing set DX=CreateTrigger() call TriggerRegisterTimerExpireEventBJ(DX,P) call TriggerAddAction(DX,function op) endfunction function np takes location Vp returns integer local location Ep local location Xp local unit Op local integer Rp=GetRandomInt(0,H) local effect array KD local integer Ip=0 local integer i=Jx[0] loop exitwhen i<1 if Jx[i]==1 then set Ep=GetUnitLoc(Qi[i+Jx[0]]) if not FC(Ep,Vp,1700)then set i=-99 endif call RemoveLocation(Ep) endif set i=i-1 endloop if i<-99 then set i=Jx[0] loop exitwhen i<1 if Jx[i]==1 then set Op=Qi[i+Jx[0]] set Ep=GetUnitLoc(Op) set Xp=zd(D[Rp]) set KD[Ip]=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",Ep) set KD[Ip+1]=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",Xp) call SetUnitPositionLoc(Op,Xp) call RemoveLocation(Ep) call RemoveLocation(Xp) set Ip=Ip+2 endif set i=i-1 endloop call RC(1) loop set Ip=Ip-1 exitwhen Ip<0 call DestroyEffect(KD[Ip]) endloop return 1 endif return 0 endfunction function Ap takes nothing returns nothing local unit Np=dJ() local unit bp local location ud if Np!=null then set ud=GetUnitLoc(Np) call PlaySoundBJ(gE) call aC("|r|cffff8000WARNING|r |cffffcc00Nuclear launch detected from Umbrella Corp!") set bp=Tf('ewsp',Player(PLAYER_NEUTRAL_PASSIVE),ud,bj_UNIT_FACING) call SetUnitColor(bp,PLAYER_COLOR_RED) call RC(7-np(ud)) call RemoveUnit(bp) call wk(ud,11,0) call RemoveLocation(ud) endif endfunction function Bp takes nothing returns nothing local trigger jD=GetTriggeringTrigger() call OC(GetRandomInt(180,480)) call Ap() if not vv then call TriggerRegisterTimerEvent(jD,1.0,false) else call DestroyTrigger(jD) endif endfunction function cp takes nothing returns nothing local trigger jD set te=te+1 call TriggerExecute(YX) if te==2 then set rv=RMaxBJ(0.5,rv-0.1) call TriggerRegisterGameStateEventTimeOfDay(fX,EQUAL,18.0) call OC(GetRandomInt(330,630)) call Ap() elseif te==3 then call OC(GetRandomInt(570,780)) call Ap() elseif te==4 then set jD=CreateTrigger() call TriggerAddAction(jD,function Bp) call PostTriggerExecuteBJ(jD,false) elseif te==5 then set Iv=Iv+1.8 elseif te==6 then set Iv=Iv+3.6 elseif te==7 then set Iv=Iv+7.2 endif endfunction function Cp takes nothing returns nothing set fX=CreateTrigger() call DisableTrigger(fX) call TriggerRegisterGameStateEventTimeOfDay(fX,EQUAL,6.00) call TriggerAddAction(fX,function cp) endfunction function dp takes nothing returns nothing local integer iDay=bC(te,2)+1 if GetTimeOfDay()<1.00 then call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_UPDATED,"|cffffcc00Day "+I2S(ix)+"|r") call QuestItemSetDescriptionBJ(Ov,"Day "+I2S(ix)) endif if(te==4)and(GetTimeOfDay()>1.00)and not vv then set Ue=true call CreateQuestItemBJ(N[4],"You will receive full rank exp when game ends") call QuestMessageBJ(GetPlayersAll(),bj_QUESTMESSAGE_COMPLETED,"|cffffcc00You survived long enough to earn full rank exp!|r") call QuestSetCompletedBJ(N[4],true) endif endfunction function Dp takes nothing returns nothing set FX=CreateTrigger() call DisableTrigger(FX) call TriggerRegisterGameStateEventTimeOfDay(FX,EQUAL,0.06) call TriggerRegisterGameStateEventTimeOfDay(FX,EQUAL,7.92) call TriggerAddAction(FX,function dp) endfunction function fp takes nothing returns nothing local real Wh local integer i if vr==null then return endif if er<0 then set er=er+1 else set i=IMinBJ(er/4+4,10) loop exitwhen i<1 if sh()then set er=er+1 endif set i=i-1 endloop call Ph() set Wh=1.15+0.05*er call SetUnitScale(vr,Wh,Wh,Wh) endif if GetRandomInt(0,2)0 then set rv=RMaxBJ(0.8,rv-0.1) call Qd() endif call fp() call MultiboardDisplayBJ(true,pe) endfunction function gp takes nothing returns nothing set gX=CreateTrigger() call DisableTrigger(gX) call TriggerRegisterGameStateEventTimeOfDay(gX,EQUAL,8.00) call TriggerRegisterGameStateEventTimeOfDay(gX,EQUAL,17.00) call TriggerAddAction(gX,function Fp) endfunction function Gp takes nothing returns nothing if(be<=0)or vv then call DisableTrigger(GX) call DestroyTrigger(GX) return endif if J>2 then set be=IMaxBJ(be-125,0) elseif J>1 then set be=IMaxBJ(be-83,0) else set be=IMaxBJ(be-62,0) endif endfunction function hp takes nothing returns nothing set GX=CreateTrigger() call TriggerRegisterTimerEventPeriodic(GX,60.00) call TriggerAddAction(GX,function Gp) endfunction function Hp takes nothing returns nothing if(ze<=0)or vv then call DisableTrigger(hX) if Cx[9]>9 then call ConditionalTriggerExecute(zE) endif call DestroyTrigger(hX) return endif set ze=ze-1 endfunction function jp takes nothing returns nothing set hX=CreateTrigger() call TriggerRegisterTimerEventPeriodic(hX,60.00) call TriggerAddAction(hX,function Hp) endfunction function Jp takes nothing returns nothing if De>5 then call uk(bC(De,3)*2) else call uk(IMaxBJ(De-1,0)) endif call TriggerRegisterTimerEvent(HX,ph(90.0),false) endfunction function kp takes nothing returns nothing set HX=CreateTrigger() call TriggerAddAction(HX,function Jp) call TriggerRegisterTimerEventSingle(HX,90.00) endfunction function Kp takes nothing returns boolean local integer i=0 local integer lp=0 local integer Lp=10 local boolean mp=true if not IsTriggerEnabled(jX)then return false endif if(J>1)or(sv>0)then return false endif if C<2 then set Lp=10 set mp=false endif loop exitwhen i>8 if(X[i]!=null)and(uv[i]>=Lp*wv)then set lp=lp+1 if uv[i]<11*wv then set mp=false endif endif set i=i+1 endloop if(lp==C)and(lp>0)then if mp then set fe=1 endif return true endif return false endfunction function Mp takes nothing returns nothing local integer i=GetRandomInt(6,8) local integer j=0 local integer pp=720 local location tF call DisableTrigger(jX) set Iv=Iv+3.6+2.4*fe call TriggerRegisterGameStateEventTimeOfDay(gX,EQUAL,0.01) call TriggerRegisterGameStateEventTimeOfDay(gX,EQUAL,11.99) call EnableTrigger(gX) if fe<1 then call aC("|r|cffff8000WARNING|r |cffffcc00Nightmare difficulty activated!") call QuestSetTitleBJ(ro,"Difficulty: Nightmare") else call aC("|r|cffff8000WARNING|r |cffffcc00Extinction difficulty activated. Prepare to die!") call QuestSetTitleBJ(ro,"Difficulty: Extinction") loop exitwhen j>5 if Ee[j]!=null then call UnitAddAbility(Ee[j],'A0FL') endif set j=j+1 endloop call SetPlayerTechResearched(to,'Rhme',1) call SetPlayerTechResearched(Nr,'Rhme',1) call TriggerRegisterTimerEvent(JX,0,false) endif set fe=fe+1 set hi=hi+1 call PlaySoundBJ(kE) set Mx=1 set Cx[9]=0 set Y=Y*(0.80-0.15*I2R(fe)) if C==1 then set Y=Y*1.15 endif call Dd() call DisableTrigger(mR) call DestroyTrigger(mR) call DisableTrigger(kR) call TriggerRegisterTimerEvent(Lb,0,false) set sr=sr+12 set xi=sr if(sx!=null)and(fe>1)then call RemoveItem(sx) endif set Yi=5*C if C>6 then set hr=7 elseif C>3 then set hr=6 elseif C>2 then set hr=5 elseif C>1 then set hr=4 else set hr=2 endif call SetPlayerTechResearched(Nr,'R012',4) call SetPlayerTechResearched(to,'R012',4) call SetPlayerTechResearched(Nr,'Rume',fe) call SetPlayerTechResearched(to,'Rume',fe) call TriggerExecute(YX) set he=0.95+0.15*fe if C<2 then set i=bC(i,2)+1 endif loop exitwhen i<1 call Th() set i=i-1 endloop if fe>1 then call TriggerRegisterTimerEvent(Hb,0,false) endif loop exitwhen Nv[5]>0 call TriggerSleepAction(3) endloop set j=GetRandomInt(0,H) set i=4-Nv[5]+(C-1)/3 loop exitwhen i<1 set tF=yd(D[j]) call SetItemInvulnerable(CreateItemLoc('I03A',tF),true) set Nv[5]=Nv[5]+1 call RemoveLocation(tF) set i=i-1 endloop if fe>1 then set i=C/5+1 loop exitwhen i<1 set tF=yd(D[GetRandomInt(0,H)]) call SetItemInvulnerable(CreateItemLoc('I03A',tF),true) set Nv[5]=Nv[5]+1 call RemoveLocation(tF) set i=i-1 endloop endif call Ph() call OC(60) set i=3+C loop exitwhen i<1 set j=GetRandomInt(45/fe+(fe-1)*(9-C)*2,75) set pp=pp-j call OC(j) if Th()then call Ph() endif set i=i-1 endloop if pp>0 then call OC(pp) endif set Fe=Fe+1 set hi=hi+1 if fe>1 then set Hi=Hi+1 set rv=rv-0.15 endif endfunction function Pp takes nothing returns nothing set jX=CreateTrigger() call TriggerAddCondition(jX,Condition(function Kp)) call TriggerAddAction(jX,function Mp) endfunction function qp takes nothing returns nothing local integer Qp local integer iP=0 local integer i loop exitwhen iP>8 if AC(Player(iP))then set Qp=0 if Lo[iP*15+11]>0 then set ai[iP]=ai[iP]+1 call SetPlayerTechResearched(Player(iP),'Rhde',IMaxBJ(ai[iP],1)) call SetPlayerTechResearched(Player(iP),'R00N',IMaxBJ(ai[iP],1)) set Qp=Qp+1 endif if(Lo[iP*15+12]>0)and Ed(iP)then call SetPlayerTechResearched(Player(iP),'R008',GetPlayerTechCount(Player(iP),'R008',true)+1) set Qp=Qp+1 endif if(Lo[iP*15+13]>0)and Ed(iP)then set i=GetUnitAbilityLevel(X[iP],'A00A')+mx[iP] if i>0 then call UnitRemoveAbility(X[iP],V[IMaxBJ(i-1,0)]) endif set mx[iP]=mx[iP]+1 call UnitAddAbility(X[iP],V[i]) set Qp=Qp+1 endif if Lo[iP*15+14]>0 then set Wo[iP+10]=Wo[iP+10]+333 set Qp=Qp+1 endif if Lo[iP*15+15]>0 then set Oi[iP]=Oi[iP]+20+20*Lo[iP*15+15] set Qp=Qp+1 endif if Qp>1 then call iC(Player(iP),"Medal bonuses activated.") elseif Qp>0 then call iC(Player(iP),"Medal bonus activated.") endif endif set iP=iP+1 endloop endfunction function sp takes nothing returns nothing set JX=CreateTrigger() call TriggerAddAction(JX,function qp) endfunction function Sp takes nothing returns nothing call DisableTrigger(jX) call DestroyTrigger(kX) endfunction function tp takes nothing returns nothing set kX=CreateTrigger() call TriggerRegisterTimerEventSingle(kX,90.00) call TriggerAddAction(kX,function Sp) endfunction function Tp takes nothing returns nothing if xi>0 then if ix<2 then set sr=sr-8+IMinBJ(xi-sr,14)/2 else set sr=sr-20+IMinBJ(xi-sr,38)/2 endif if sr<0 then set sr=0 endif endif set xi=sr set Ai[0]=(Ai[0]+1)/2 set Ai[1]=(Ai[1]+1)/2 set Ai[2]=(Ai[2]+1)/2 set Ai[3]=(Ai[3]+1)/((C+4)/2) set Ai[4]=Ai[4]+C/2 set Ai[5]=Ai[5]+1 set Yi=Yi+9+GetRandomInt(1,C) set ix=ix+1 endfunction function up takes nothing returns nothing set KX=CreateTrigger() call TriggerRegisterGameStateEventTimeOfDay(KX,EQUAL,0.00) call TriggerAddAction(KX,function Tp) endfunction function Up takes integer NH returns nothing local integer i=0 loop exitwhen i>11 call SetPlayerTechResearched(Player(i),'R01J',NH) set i=i+1 endloop endfunction function wp takes nothing returns nothing local integer gF=C call DisableTrigger(lX) if fe>1 then if C<3 then call OC(8*60) endif set Y=Y*0.89 call Dd() if gF>7 then call SetPlayerTechResearched(Nr,'R01V',2) call SetPlayerTechResearched(to,'R01I',3) call SetPlayerTechResearched(Nr,'R01I',3) call Up(3) elseif gF>4 then call SetPlayerTechResearched(Nr,'R01V',2) call SetPlayerTechResearched(to,'R01I',3) call SetPlayerTechResearched(Nr,'R01I',3) call Up(3) elseif gF>2 then call SetPlayerTechResearched(Nr,'R01V',1) call SetPlayerTechResearched(to,'R01I',2) call SetPlayerTechResearched(Nr,'R01I',2) call Up(3) else call SetPlayerTechResearched(Nr,'R01V',1) call SetPlayerTechResearched(to,'R01I',1) call SetPlayerTechResearched(Nr,'R01I',1) call Up(2) endif if C<3 then call OC(24*60) else call OC(24*60) endif set Y=Y*0.843 call Dd() if gF>7 then call SetPlayerTechResearched(Nr,'R01V',3) call SetPlayerTechResearched(to,'R01I',6) call SetPlayerTechResearched(Nr,'R01I',6) call Up(5) elseif gF>4 then call SetPlayerTechResearched(Nr,'R01V',3) call SetPlayerTechResearched(to,'R01I',5) call SetPlayerTechResearched(Nr,'R01I',5) call Up(4) elseif gF>2 then call SetPlayerTechResearched(Nr,'R01V',2) call SetPlayerTechResearched(to,'R01I',4) call SetPlayerTechResearched(Nr,'R01I',4) else call SetPlayerTechResearched(Nr,'R01V',2) call SetPlayerTechResearched(to,'R01I',2) call SetPlayerTechResearched(Nr,'R01I',2) call Up(3) endif if C<3 then call OC(16*60) else call OC(17*60) endif set Y=Y*0.80 elseif fe>0 then if C<3 then call OC(8*60) endif set Y=Y*0.90 call Dd() if gF>2 then call SetPlayerTechResearched(to,'R01I',2) call SetPlayerTechResearched(Nr,'R01I',2) call Up(3) else call SetPlayerTechResearched(to,'R01I',1) call SetPlayerTechResearched(Nr,'R01I',1) call Up(2) endif if C<3 then call OC(16*60) else call OC(17*60) endif set Y=Y*0.90 call Dd() call SetPlayerTechResearched(Nr,'R01V',1) if gF>8 then call Up(5) elseif gF>5 then call Up(4) elseif gF==2 then call Up(3) endif if C<3 then call OC(8*60) else call OC(7*60) endif set Y=Y*0.888 elseif J<2 then if C<3 then call OC(12*60) else call OC(8*60) endif set Y=Y*0.90 call Dd() call SetPlayerTechResearched(to,'R01I',1) call SetPlayerTechResearched(Nr,'R01I',1) call Up(1) endif call DestroyTrigger(lX) endfunction function Wp takes nothing returns nothing set lX=CreateTrigger() call TriggerRegisterGameStateEventTimeOfDay(lX,EQUAL,0.01) call TriggerAddAction(lX,function wp) endfunction function yp takes nothing returns nothing local unit ek=null local integer Lc local integer x local real x1 local real y1 local boolean bJ if yx>0 then set Lc=Yx[Wx] if zx[Wx]<0 then set x1=GetRandomInt(300,4600) set y1=GetRandomInt(7600,13400) else set x1=GetRectCenterX(D[zx[Wx]])+GetRandomInt(-480,480) set y1=GetRectCenterY(D[zx[Wx]])+GetRandomInt(-480,480) endif set x=vo[Wx] set bJ=Zx[Wx] set Wx=Wx+1 if Wx>=yx then set Wx=0 set yx=0 else call TriggerRegisterTimerEvent(LX,0,false) endif if iv<(fv/ 2)then set iv=iv+1 set ek=CreateUnit(to,Lc,x1,y1,270) elseif nv<(fv/ 2)then set nv=nv+1 set ek=CreateUnit(Nr,Lc,x1,y1,270) call SetUnitColor(ek,PLAYER_COLOR_BROWN) elseif bJ then set av=av+1 endif if ek!=null then set av=av-1 if av<0 then set av=0 endif call SetUnitState(ek,UNIT_STATE_LIFE,RMaxBJ(1,GetUnitState(ek,UNIT_STATE_LIFE)-GetRandomInt(0,99))) call uf(ek,mo) call CJ(ek,null) if Lc=='n008' then set bJ=true if x==0 then call mJ(ek) if GetRandomInt(0,10)==0 then set bJ=lJ(ek,1) elseif GetRandomInt(-1,398)1)and(mo<1)then call UnitAddAbility(ek,'Apsh') call UnitAddAbility(ek,'Agho') call UnitAddAbility(ek,'A0PC') call UnitAddAbility(ek,'A0PD') call TriggerRegisterUnitEvent(AO,ek,EVENT_UNIT_DEATH) call SetUnitVertexColor(ek,45,75,255,26) call SetUnitUserData(ek,999) set bJ=false endif endif if bJ and(No>0)then set No=No-1 call SetUnitUserData(ek,Ao[No]) endif elseif Lc=='n009' then if x<8 then call lJ(ek,IMaxBJ(5-x,0)) elseif(ix>1)and(not Vr)and(GetRandomInt(1,48-2*C+Ai[3])<(fe*4))then set Vr=true set Ai[3]=Ai[3]+41-C*7/3 call TriggerRegisterUnitEvent(CO,ek,EVENT_UNIT_DEATH) call UnitAddAbility(ek,'Arel') call UnitAddAbility(ek,'A0F4') call UnitAddAbility(ek,'AIlz') if(fe>1)and(ix>1)then call UnitAddAbility(ek,'A0I0'+IMinBJ(ix-2,3)) endif call UnitAddAbility(ek,'A0I4') call UnitAddAbility(ek,'A0I7') call UnitAddAbility(ek,'A0PE') call SetUnitScale(ek,0.60,0.60,0.58) call SetUnitVertexColor(ek,45,75,255,255) endif elseif Lc=='u001' then call TriggerRegisterUnitEvent(VO,ek,EVENT_UNIT_DEATH) if x<9 then call lJ(ek,IMaxBJ(6-x,0)) elseif GetRandomInt(-1,398)1)and(GetRandomInt(1,26+2*fe)>27)then call UnitRemoveAbility(ek,'ANbl') call UnitAddAbility(ek,'A03Z') call UnitAddAbility(ek,'AId7') call UnitAddAbility(ek,'AIsx') call UnitAddAbility(ek,'A0CV') call TriggerRegisterUnitEvent(gO,ek,EVENT_UNIT_DAMAGED) endif elseif Lc=='u002' then if x<3 then call lJ(ek,0) elseif(ix>1)and(fe>0)and(not nr)and(GetRandomInt(0,41-2*C)<1)then if GJ(ek,false)then set nr=true call TriggerRegisterUnitEvent(cO,ek,EVENT_UNIT_DEATH) call UnitRemoveAbility(ek,'Ahea') call UnitAddAbility(ek,'Arel') call UnitAddAbility(ek,'A0F4') call UnitAddAbility(ek,'AIlz') if(fe>1)and(ix>1)then call UnitAddAbility(ek,'A0I0'+IMinBJ(ix-2,3)) endif call UnitAddAbility(ek,'AUau') call UnitAddAbility(ek,'A04V') call SetUnitAbilityLevel(ek,'A02V',1+fe) call SetUnitScale(ek,1.5,1.5,1.4) call SetUnitUserData(ek,20) endif elseif GetRandomInt(-1,398)1)and(GetRandomInt(0,14-C)(499+fe*200)then if fe>0 then set Gr=1 else set Gr=10 endif else set Gr=Gr+1 endif if GetRandomInt(1,Gr)
39 set t=t+1 if i>598 then set i=0 else set i=i+1 endif endloop if i>598 then set Tx=0 else set Tx=i+1 endif if t>0 then call TriggerSleepAction(t*0.13*Xx) endif if tx[i]!=null then set t=GetUnitUserData(tx[i]) if t>19 then call Bd(GetUnitPointValue(tx[i])) call UnitSuspendDecay(tx[i],false) elseif not zp(i)then call UnitSuspendDecay(tx[i],false) set av=av+1 set Ao[No]=t+2*J-1 set No=No+1 endif set tx[i]=null endif call TriggerRegisterTimerEvent(mX,0,false) endfunction function eP takes nothing returns nothing set mX=CreateTrigger() call TriggerAddAction(mX,function vP) endfunction function xP takes nothing returns nothing local integer i=0 loop set tx[i]=null set i=i+1 exitwhen i>599 endloop call TriggerRegisterTimerEvent(mX,0,false) endfunction function rP takes nothing returns nothing set MX=CreateTrigger() call TriggerRegisterTimerEventSingle(MX,1.00) call TriggerAddAction(MX,function xP) endfunction function aP takes nothing returns boolean return GetUnitPointValue(GetEnteringUnit())<6 endfunction function VP takes nothing returns unit local unit ek=NJ('n008',GetRandomLocInRect(ln),270,true) if ek!=null then call SetUnitAnimation(ek,"birth") endif return ek endfunction function EP takes unit hJ,unit mC returns nothing if hJ!=null then call CJ(hJ,mC) endif endfunction function XP takes nothing returns nothing local integer i local unit mC=GetEnteringUnit() local unit array OP call DisableTrigger(pX) if mo>0 then return endif call ac(7.00) set i=NC(I2R(GetRandomInt(20-2*J,41-5*J))/4.0+bC(Q[12],10)) loop exitwhen i<1 set OP[0]=VP() set OP[1]=VP() set OP[2]=VP() set OP[3]=VP() call ac(2.333) call EP(OP[0],mC) call EP(OP[1],mC) call EP(OP[2],mC) call EP(OP[3],mC) set i=i-1 endloop call OC(180.0) if mo>0 then return endif call EnableTrigger(pX) endfunction function RP takes nothing returns nothing set pX=CreateTrigger() call TriggerAddCondition(pX,Condition(function aP)) call TriggerAddAction(pX,function XP) endfunction function IP takes nothing returns nothing set iv=GetPlayerState(Player(11),PLAYER_STATE_RESOURCE_FOOD_USED)+ev set nv=GetPlayerState(Player(10),PLAYER_STATE_RESOURCE_FOOD_USED) endfunction function AP takes nothing returns nothing set PX=CreateTrigger() call TriggerRegisterTimerEventPeriodic(PX,60.00) call TriggerAddAction(PX,function IP) endfunction function NP takes nothing returns nothing local real BP set qx[0]=null set qx[1]=null set qx[2]=null set qx[3]=null set qx[4]=null call TriggerRegisterEnterRectSimple(pX,ln) call TriggerRegisterTimerEvent(WX,0,false) call TriggerRegisterTimerEventPeriodic(WX,75.00-15*(J-te)) call TriggerRegisterTimerEvent(TX,45,false) call OC(180.00) call TriggerRegisterTimerEvent(YO,0,false) if(J>2)and(te<1)then set BP=6.0 else set BP=5.0 endif call TriggerRegisterTimerEventPeriodic(SX,BP) if te<1 then call OC(480.0) else call TriggerSleepAction(1.0) call TriggerRegisterGameStateEventTimeOfDay(gX,EQUAL,0.01) call TriggerRegisterGameStateEventTimeOfDay(gX,EQUAL,12.0) call EnableTrigger(fX) call EnableTrigger(FX) endif call EnableTrigger(gX) endfunction function cP takes nothing returns nothing set qX=CreateTrigger() call TriggerAddAction(qX,function NP) endfunction function CP takes nothing returns nothing local real dP=0.0 if te>0 then set dP=2.0 set ye=-14.28*(rv+0.75)+Iv+C*(2.5-rv) else set ye=-14.28*(rv+0.75)+Iv/(18.0-C/3.0)+C*(2.5-rv) endif if av>29 then set We=We+1.9+dP elseif av>0 then set We=We+1.0+dP else set We=We-4.5-dP if We<0 then set We=0 endif endif endfunction function DP takes nothing returns nothing set QX=CreateTrigger() call TriggerRegisterTimerEventPeriodic(QX,30.00) call TriggerAddAction(QX,function CP) endfunction function fP takes nothing returns nothing if(iv+nv)>(fv/ 3)then set av=1 set No=0 call TriggerRegisterTimerEvent(WX,0,false) call OC(15.0) set We=We+0.5 call TriggerRegisterTimerEvent(sX,0,false) else set av=0 set No=0 set We=0.0 if ev>2 then call OC(135.00+10*(J-IMinBJ(te,4))) else call OC(75.00+10*(J-IMinBJ(te,4))+ev*20) endif set ov=51+C+3*fe*fe call EnableTrigger(SX) endif endfunction function FP takes nothing returns nothing set sX=CreateTrigger() call TriggerAddAction(sX,function fP) endfunction function gP takes nothing returns nothing local integer i if(fe>0)and(ix>1)then set i=18-C/4-fe*fe else set i=IMaxBJ(J*10,19-C/4) endif if GetRandomInt(1+te,100)>i then set ov=ov-1 if ov<0 then call DisableTrigger(SX) call TriggerRegisterTimerEvent(tX,0,false) else if Ne>0 then set i=Ne set Ne=-1*Ne call TriggerSleepAction(0.01) else set i=GetRandomInt(0,H) endif call pJ(i,true) endif endif endfunction function GP takes nothing returns nothing set SX=CreateTrigger() call TriggerAddAction(SX,function gP) endfunction function hP takes nothing returns nothing if av>0 then if(iv+nv)>=fv then call TriggerExecute(WX) call OC(48-2*C) else call TriggerSleepAction((1.0+J)*Xx) call pJ(GetRandomInt(0,H),false) endif call TriggerRegisterTimerEvent(tX,0,false) else call TriggerRegisterTimerEvent(sX,0,false) endif endfunction function HP takes nothing returns nothing set tX=CreateTrigger() call TriggerAddAction(tX,function hP) endfunction function jP takes nothing returns nothing local integer i=11-fe*fe if Ze>1 then set i=i+15-fe*fe endif if not ue and(ix>1)and(GetRandomInt(0,4)0 then call OC(RMaxBJ(40,(2+J)*60.0-GetRandomInt(-10*J,10)-NC(Iv*10.0))) call OC(RMaxBJ(20,(2+J)*60.0-GetRandomInt(-10*J,10)-NC(Iv*5.0))) set ue=false else call OC(RMaxBJ(90,(2+J)*60.0-GetRandomInt(-10*J,10)-NC(Iv*6.0))) call OC(RMaxBJ(30*rv,(2+J)*60.0-GetRandomInt(-10*J,10)-NC(Iv*2.0))) set ue=false endif loop exitwhen(iv+nv)<(fv/ 4*3) exitwhen(av-No/8*7)<(fv/ 8) exitwhen(av+fv/8*7)0)then return endif if i<1 then if Ze<2 then set Ze=3 endif else set Ze=0 set Bo=0 endif if Ze>0 then set Bo=av set bo=true call TriggerRegisterTimerEvent(uX,1.0,false) call OC(20) set bo=false set Ze=Ze-1 if vv or(mo>0)then return endif endif call TriggerRegisterTimerEvent(uX,1.0,false) call TriggerRegisterTimerEvent(TX,1.0,false) endfunction function JP takes nothing returns nothing set TX=CreateTrigger() call TriggerAddAction(TX,function jP) endfunction function kP takes real KP,real lP returns boolean local real LP if(lP<0.03)or(KP<999.5)then return false endif if GetUnitAbilityLevel(jx,'B01D')>0 then return false endif set LP=GetUnitState(jx,UNIT_STATE_LIFE) return(LP>499.0)and(LP<(lP*GetUnitState(jx,UNIT_STATE_MAX_LIFE))) endfunction function mP takes nothing returns boolean return kP(GetEventDamage(),0.25+0.08*fe) endfunction function MP takes nothing returns nothing local boolean pP=UnitHasBuffBJ(jx,'B01D') call UnitAddAbility(jx,'A0CW') if Fe<3 then call SetUnitAbilityLevel(jx,'A0CW',1+Fe) else call SetUnitAbilityLevel(jx,'A0CW',3) endif call IssueImmediateOrder(jx,"roar") loop call TriggerSleepAction(1) exitwhen jx==null exitwhen UnitHasBuffBJ(jx,'B01D') call IssueImmediateOrder(jx,"roar") endloop if jx==null then return else call UnitRemoveAbility(jx,'A0CW') endif if pP then return endif if GetUnitAbilityLevel(jx,'Avul')<1 then call SetUnitVertexColor(jx,180,90,68,255) endif call UnitAddAbility(jx,'A0CX') if((J>2)and(te<2))or(C<2)then call SetUnitAbilityLevel(jx,'A0CX',2) endif call RC(4.1) loop exitwhen jx==null exitwhen not UnitHasBuffBJ(jx,'B01D') call TriggerSleepAction(Xx) endloop if jx==null then return endif call UnitRemoveAbility(jx,'A0CX') if GetUnitAbilityLevel(jx,'Avul')<1 then call SetUnitVertexColor(jx,255,200,150,255) endif endfunction function PP takes nothing returns nothing local trigger jD=CreateTrigger() call SaveTriggerHandle(qi,StringHash("boss_supermutant"),StringHash("hit"),jD) call TriggerAddCondition(jD,Condition(function mP)) call TriggerAddAction(jD,function MP) call TriggerRegisterUnitEvent(jD,jx,EVENT_UNIT_DAMAGED) endfunction function qP takes nothing returns boolean return GetSpellAbilityId()=='A068' endfunction function QP takes nothing returns nothing local integer MJ=EC(jx) local integer NH=GetUnitAbilityLevel(jx,'A068') local unit SP=GetSpellTargetUnit() call PlaySoundOnUnitBJ(jE,100,SP) if IsUnitType(SP,UNIT_TYPE_MECHANICAL)and(C>1)then return endif call TriggerSleepAction(0.1) if C>1 then if((Fe>1)or(te>1))and(GetRandomInt(0,60-10*bC(C+2,3)-9*fe)4 endloop else loop if qx[i]==yP then set qx[i]=null exitwhen true endif set i=i+1 exitwhen i>4 endloop endif endfunction function YP takes rect Yd returns nothing local integer i local integer j local integer wP local unit ek set i=GetRandomInt(1,IMaxBJ(NC(Q[12]/10.0),1)) loop exitwhen i<1 set j=GetRandomInt(0,9) if j<1 then set ek=NJ('u001',zd(Yd),270,false) call TriggerRegisterUnitEvent(VO,ek,EVENT_UNIT_DEATH) else if j<2 then set wP='u002' elseif j<4 then set wP='n009' else set wP='n008' endif set ek=NJ(wP,zd(Yd),270,false) endif if ek!=null then call CJ(ek,null) endif set i=i-1 endloop endfunction function zP takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit ZP=GetDyingUnit() local location ud=GetUnitLoc(ZP) local unit vq local real MC=GetUnitFacing(ZP) local integer i if GetUnitAbilityLevel(ZP,'Atru')!=3 then set i=GetRandomInt(60,150) call StoreInteger(Ae,"boss_abom_duration",XC(ZP),i) call RC(1.2) set vq=qf('n010',Player(PLAYER_NEUTRAL_PASSIVE),Ec(ud,28,225),MC) call SetUnitVertexColor(vq,255,255,255,0) call SetUnitAnimation(vq,"decay flesh") call RC(1) call SetUnitVertexColor(vq,255,255,255,255) call SetUnitTimeScale(vq,2) call SetUnitVertexColor(ZP,255,255,255,0) call SetUnitScalePercent(ZP,0.01,0.01,0.01) call SetUnitTimeScale(ZP,10) call RC(4) call SetUnitTimeScale(vq,0.01) call OC(i+1) call SetUnitTimeScale(vq,1) call SetUnitAnimation(vq,"decay bone") else call SetUnitVertexColor(ZP,240,150,150,0) call SetUnitScalePercent(ZP,0.01,0.01,0.01) call SetUnitTimeScale(ZP,10) set vq=Tf('n00Z',Player(PLAYER_NEUTRAL_PASSIVE),ud,MC) call SetUnitTimeScale(vq,0.85) call PlaySoundOnUnitBJ(JE,100,vq) set i=GetPlayerTechCount(to,'R002',true) call PC(ZP,0,336,GetLocationX(ud),GetLocationY(ud),GetRandomInt(3000+i*100,6000+i*250),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) if fe>1 then call PC(ZP,0,240,GetLocationX(ud),GetLocationY(ud),GetRandomInt(1500+i*50,3000+i*125),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) endif endif call RC(5) call RemoveUnit(vq) call RemoveLocation(ud) call DestroyTrigger(jD) endfunction function eq takes rect Yd returns nothing local integer i=GetPlayerTechCount(Player(11),'R001',true) local unit ek set i=2+bC(IMaxBJ(0,i-9),4)+bC(IMinBJ(i,9),3) set i=GetRandomInt(bC(i,2),i) loop exitwhen i<1 set ek=NJ('u002',zd(Yd),270,false) if ek!=null then if not GJ(ek,false)then call lJ(ek,0) endif call IssueTargetOrder(ek,"smart",ce) endif set i=i-1 endloop endfunction function xq takes nothing returns nothing if GetUnitTypeId(GetEnumUnit())=='o00J' then call RemoveUnit(GetEnumUnit()) endif endfunction function oq takes unit LC,integer zh,integer mc,string Zh returns nothing local unit vH=qf('o00J',Player(9),GetUnitLoc(LC),0.00) call UnitAddAbility(vH,zh) call SetUnitAbilityLevel(vH,zh,mc) call IssueTargetOrder(vH,Zh,LC) endfunction function rq takes nothing returns nothing local unit LC=GetEnumUnit() local integer Aj=GetUnitPointValue(LC) if(Aj>0)and(Aj<6)then if IsUnitType(LC,UNIT_TYPE_MECHANICAL)then call oq(LC,'A0CY',2,"sleep") elseif IsUnitType(LC,UNIT_TYPE_ANCIENT)then call oq(LC,'A0CY',2,"sleep") else call oq(LC,'A0CY',1,"sleep") endif elseif Aj==6 then set Aj=GetUnitTypeId(LC) if Aj=='n01C' then call oq(LC,'A0CY',2,"sleep") elseif(Aj=='n01A')or(Aj=='n01B')or(Aj=='n01D')then call oq(LC,'A0CY',2,"sleep") endif endif set LC=null endfunction function iq takes nothing returns nothing local group g local integer i=0 loop if(Q[i]>0)and IC(Player(i))then call Dh(Player(i),0.2,2.8,1.0,"ReplaceableTextures\\CameraMasks\\White_mask.blp",0,0,0,100,1) endif set i=i+1 exitwhen i>8 endloop set i=0 loop if Q[i]>0 then set g=fc(Player(i)) call ForGroup(g,function rq) call DestroyGroup(g) call TriggerSleepAction(0.01) endif set i=i+1 exitwhen i>8 endloop call TriggerSleepAction(Xx) set g=fc(Player(9)) call ForGroup(g,function xq) call DestroyGroup(g) set g=null endfunction function aq takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local real nq=GetUnitState(ce,UNIT_STATE_MAX_LIFE) call DisableTrigger(jD) if GetUnitState(ce,UNIT_STATE_LIFE)-1 then set Zr[i]=Zr[vi-1] endif if vi>0 then set vi=vi-1 endif set ce=null call DestroyTrigger(GetTriggeringTrigger()) endfunction function Rq takes unit LC returns nothing local integer i set i=0 loop exitwhen i>8 if Q[i]>0 then call UnitShareVisionBJ(true,LC,Player(i)) endif set i=i+1 endloop endfunction function Iq takes nothing returns nothing local integer i local integer Lc='U000' local unit Aq=null local location tF local trigger jD local integer Nq=fe if Nq>1 then set Nq=1 endif if bo and((te<1)or(GetRandomInt(0,3)==0))then set Lc='U007' elseif(ix>1)then if(Nv[1]<1)and(Ve>2)and(Q[12]>(100+Nq*85+Nq*15*C))and(GetRandomInt(0,39)<=te)then set Lc='U006' set Nv[1]=1 elseif(Zo==0)and(GetRandomInt(0-kx,10-2*IMaxBJ(0,Kv)+Ai[0])<1)then set Lc='U003' set Ai[0]=Ai[0]+4 elseif(jx==null)and(GetRandomInt(0-kx,IMaxBJ(0,7-Kv)+3*J-Nq+Ai[1])<1)then set Lc='U008' set Ai[1]=Ai[1]+4 elseif(Jx[0]==0)and(GetRandomInt(0-kx,5+J*J+Ai[2])<1)then set Lc='U009' set Ai[2]=Ai[2]+4 endif endif set i=GetRandomInt(0,H) set ev=ev+1 if Lc=='U009' then call StoreInteger(Ae,"CommandoSpawnInfo","Building",i) call TriggerRegisterTimerEvent(UX,0,false) else set Aq=qf(Lc,to,GetRectCenter(D[i]),bj_UNIT_FACING) if Lc=='U007' then set px=px+1 call SetUnitColor(Aq,ConvertPlayerColor(12)) if px>1 then call SetPlayerTechResearched(to,'R016',IMinBJ(bC(px,2),7)) call SetPlayerTechResearched(to,'R00I',IMinBJ(px-1,16)) call UnitAddAbility(Aq,V[IMinBJ(bC(px-2,2),30)]) call UnitAddAbility(Aq,a[IMinBJ(bC(px,3),14)]) if px==3 then call SetPlayerTechResearched(to,'R00E',3) call SetPlayerTechResearched(to,'R008',1) elseif px==5 then call SetPlayerTechResearched(to,'Rhac',1) endif if px>7 then call UnitAddAbility(Aq,'AId7') elseif px>5 then call UnitAddAbility(Aq,'AId8') elseif px>3 then call UnitAddAbility(Aq,'AId5') else call UnitAddAbility(Aq,'AId2') endif if px>(5-2*Mx)then call WP(Aq,true) endif endif call SetUnitAbilityLevel(Aq,'A08P',IMinBJ(5+px,16)) call SetUnitAbilityLevel(Aq,'A0D3',IMinBJ(5+2*(px-1),25)) call IssueImmediateOrder(Aq,"manashieldon") call ModifyHeroStat(bj_HEROSTAT_STR,Aq,bj_MODIFYMETHOD_ADD,25*bC(px,2)) call ModifyHeroStat(bj_HEROSTAT_AGI,Aq,bj_MODIFYMETHOD_ADD,2*px) set jD=CreateTrigger() call TriggerAddAction(jD,function UP) call TriggerRegisterTimerEvent(jD,RMaxBJ(30.0,360.0-60.0*te),false) call SaveUnitHandle(qi,StringHash("tyrantmonitor"),StringHash(XC(jD)),Aq) call SaveTriggerHandle(qi,StringHash("tyrantdroid"),StringHash(XC(Aq)),jD) call EnableTrigger(aO) else if fe>0 then call UnitAddAbility(Aq,'A0I0'+IMinBJ(ix-1,3)) endif if Lc=='U006' then set Le=Aq set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,Le,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function uP) call EnableTrigger(rO) if(J<3)or(te>0)then call UnitAddAbility(Aq,'A0CZ') call SetUnitAbilityLevel(Aq,'A0CZ',IMinBJ(Fe,2)+1) call UnitAddAbility(Aq,'A048') call SetUnitAbilityLevel(Aq,'A048',IMinBJ(Fe,2)+1) endif if C<4 then call UnitRemoveAbility(Aq,'A0N5') call UnitRemoveAbility(Aq,'A0N6') elseif C<5 then call UnitRemoveAbility(Aq,'A0N6') elseif C<8 then call UnitRemoveAbility(Aq,'A0N5') endif elseif Lc=='U003' then set ce=Aq call SetUnitState(ce,UNIT_STATE_MANA,RMaxBJ(0,kv/ 2.0)*(1+Mx)) set Zr[vi]=ce set vi=vi+1 set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,Aq,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function Oq) call EnableTrigger(eO) call SetUnitAbilityLevel(Aq,'A06O',1+Mx) elseif Lc=='U008' then set jx=Aq set Jo=0.09+0.02*fe set ko=7 call PP() call tP() call SetUnitAbilityLevel(Aq,'A068',IMaxBJ(1,C+sv+2-2*J+Mx*(1+bC(C+sv,2)))) set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,Aq,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function TP) call EnableTrigger(xO) if Mx>0 then call EnableTrigger(oO) call TriggerRegisterTimerEvent(oO,GetRandomInt(6,30),false) endif elseif Lc=='U000' then set kx=kx+1 if GetRandomInt(0,J*4)==0 then call SetUnitAbilityLevel(Aq,'Atru',2) elseif(Mx>0)and(GetRandomInt(0,2)==0)then call UnitAddAbility(Aq,'A0DF') call SetUnitVertexColor(Aq,240,150,150,255) call SetUnitAbilityLevel(Aq,'Atru',3) call TriggerRegisterUnitEvent(vO,Aq,EVENT_UNIT_DAMAGED) endif if Mx>0 then set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,Aq,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function zP) endif endif call uf(Aq,0) call UnitAddAbility(Aq,'A097'+J-1) endif call CJ(Aq,null) set iv=iv+1 endif if Lc!='U007' then if tD()and(te<1)and(Aq!=null)and(fe<2)then call Rq(Aq) endif set tF=GetRectCenter(D[i]) if Lc=='U009' then call aC("Intelligence located a covert Umbrella strike force!") else call aC("Satellite recon just spotted a freakishly large creature!") endif call SetCameraQuickPositionLocForPlayer(U,tF) call PingMinimapLocForForceEx(GetPlayersAll(),tF,6,bj_MINIMAPPINGSTYLE_FLASHY,100,31.64,0) call PlaySoundBJ(BE) if Lc=='U000' then call YP(D[i]) elseif Lc=='U003' then if fe>1 then set Zo=42+2*C-kv elseif fe>0 then set Zo=40-kv endif if Zo<20 then set Zo=20 endif set kv=kv+Zo call Ph() if Mx>0 then call eq(D[i]) if GetRandomInt(0-fe*fe,5)350)then set Hq=dC(GetUnitLoc(Qi[i+Jx[0]]),GetUnitLoc(Qi[Gq+2*Jx[0]])) if Hq0 exitwhen jq>15 endloop if Dq>0 then call Fq(Qi[Dq+Jx[0]],Dq,Gq) endif call FlushStoredInteger(Ae,"boss_commando_corpse",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function kq takes integer Gq returns nothing local trigger jD=CreateTrigger() call StoreInteger(Ae,"boss_commando_corpse",XC(jD),Gq) call TriggerAddAction(jD,function hq) call TriggerRegisterTimerEvent(jD,0,false) endfunction function Kq takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"boss_commando_revenge",XC(jD)) local real x local real y local unit lq local integer i=Jx[0] local unit Lq=null if iP>8 then if(Yv[iP-9]!=null)and(not zv[iP-9])then set Lq=Yv[iP-9] endif elseif Ed(iP)then set Lq=X[iP] endif if Lq!=null then if GetUnitAbilityLevel(Lq,'Avul')<1 then set x=GetUnitX(Lq) set y=GetUnitY(Lq) loop exitwhen i<1 if Jx[i]==1 then set lq=Qi[i+Jx[0]] if not HC(x,y,GetUnitX(lq),GetUnitY(lq),1700+500*IMinBJ(2,Fe))then call IssueTargetOrder(lq,"attack",Lq) endif endif set i=i-1 endloop endif endif call FlushStoredInteger(Ae,"boss_commando_revenge",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function mq takes integer iP returns nothing local trigger jD if iP>8 then if(Yv[iP-9]==null)or(zv[iP-9])then return endif elseif not Ed(iP)then return endif set jD=CreateTrigger() call StoreInteger(Ae,"boss_commando_revenge",XC(jD),iP) call TriggerAddAction(jD,function Kq) call TriggerRegisterTimerEvent(jD,0,false) endfunction function Mq takes nothing returns nothing local unit Op=GetRevivableUnit() local trigger jD=GetTriggeringTrigger() local integer Gq=GetStoredInteger(Ae,"boss_commando_index",XC(Op)) local location ud=GetUnitLoc(Op) local integer i=Jx[0] set Qi[Gq+2*Jx[0]]=CreateCorpse(GetOwningPlayer(Op),'n00X',GetLocationX(ud),GetLocationY(ud),GetUnitFacing(Op)) call SetUnitColor(Qi[Gq+2*Jx[0]],GetPlayerColor(Player(10))) call SetUnitAnimation(Qi[Gq+2*Jx[0]],"decay bone") call RemoveLocation(ud) loop exitwhen Jx[i]>0 set i=i-1 endloop if(i<1)and not Lx then set Lx=true set ev=ev-1 if not ar then call nd(1,"You have earned one valor point!",Jx[0]*(40-20*Mx)) if lx>0 then set ud=GetUnitLoc(Op) call CreateItemLoc('I001',ud) call RemoveLocation(ud) set lx=lx-1 elseif Se>0 then set ud=GetUnitLoc(Op) call CreateItemLoc('I03B',ud) call RemoveLocation(ud) set Se=Se-5 endif endif set Jx[Gq]=-1 call OC(30) call RemoveUnit(Qi[Gq+2*Jx[0]]) set Jx[0]=0 set Lx=false else if Jx[Gq+4*Jx[0]]>-3 then if Jx[Gq+4*Jx[0]]>-1 then call mq(Jx[Gq+4*Jx[0]]) endif call kq(Gq) endif set i=20 loop exitwhen i<1 set i=i-1 call TriggerSleepAction(Xx) if Jx[Gq]!=0 then return endif endloop call RemoveUnit(Qi[Gq+2*Jx[0]]) endif set Jx[Gq]=-1 call DestroyTrigger(LoadTriggerHandle(qi,StringHash("boss_commando_muderer"),StringHash(XC(Op)))) call RemoveSavedHandle(qi,StringHash("boss_commando_muderer"),StringHash(XC(Op))) call FlushStoredInteger(Ae,"boss_commando_index",XC(Op)) call RemoveUnit(Op) call DestroyTrigger(jD) endfunction function pq takes unit Op,integer Gq returns nothing local trigger jD=CreateTrigger() call TriggerAddAction(jD,function Mq) call TriggerRegisterUnitEvent(jD,Op,EVENT_UNIT_HERO_REVIVABLE) call StoreInteger(Ae,"boss_commando_index",XC(Op),Gq) endfunction function Pq takes nothing returns nothing local unit Lq=GetKillingUnit() local integer ZH local integer iP local integer Gq=GetStoredInteger(Ae,"boss_commando_index",XC(GetDyingUnit())) set Jx[Gq]=0 if Jx[Gq+4*Jx[0]]<=-3 then return endif if Lq==null then set Jx[Gq+4*Jx[0]]=-1 return endif set ZH=GetUnitTypeId(Lq) if(Jx[Gq+4*Jx[0]]==-2)and(ZH=='O002')then return endif set Jx[Gq+4*Jx[0]]=-1 if ZH=='o00R' then return endif set iP=GetPlayerId(GetOwningPlayer(Lq)) if iP>8 then return endif if(ZH=='O01F')or(ZH=='O001')then set Jx[Gq+4*Jx[0]]=iP+9 elseif not IsUnitType(Lq,UNIT_TYPE_MECHANICAL)then set Jx[Gq+4*Jx[0]]=iP endif endfunction function qq takes unit Op returns nothing local trigger jD=CreateTrigger() call TriggerAddAction(jD,function Pq) call TriggerRegisterUnitEvent(jD,Op,EVENT_UNIT_DEATH) call SaveTriggerHandle(qi,StringHash("boss_commando_muderer"),StringHash(XC(Op)),jD) endfunction function Qq takes integer WC returns integer if WC>7 then if fe>1 then return 2 else return 1 endif elseif WC>6 then return 3 elseif WC>5 then return 4 elseif WC>4 then return 6 elseif WC>3 then return 8 else return 9 endif endfunction function sq takes integer Sq returns integer local integer Ud=0 set Sq=bC(IMaxBJ(0,Sq-12),6)+bC(IMinBJ(Sq,12),4) if(C+sv)>7 then set Ud=3 elseif(C+sv)>4 then set Ud=2 elseif(C+sv)>2 then set Ud=1 endif return IMaxBJ(Ud,Sq) endfunction function tq takes nothing returns nothing local unit Op local effect KD local location ud local rect Yd=D[GetStoredInteger(Ae,"CommandoSpawnInfo","Building")] local integer Tq=GetStoredInteger(Ae,"CommandoSpawnInfo","LVAU") local integer VK=GetStoredInteger(Ae,"CommandoSpawnInfo","Crit") local integer uq=GetStoredInteger(Ae,"CommandoSpawnInfo","Weak") local integer Uq=GetStoredInteger(Ae,"CommandoSpawnInfo","Nani") local integer wq=GetStoredInteger(Ae,"CommandoSpawnInfo","Evad") local integer Wq=GetStoredInteger(Ae,"CommandoSpawnInfo","AdvG") local integer pF=GetStoredInteger(Ae,"CommandoSpawnInfo","Cell") local integer i=GetStoredInteger(Ae,"CommandoSpawnInfo","CurI") call StoreInteger(Ae,"CommandoSpawnInfo","CurI",i-1) set ud=zd(Yd) set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) set Op=qf('U009',Player(11),ud,bj_UNIT_FACING) set iv=iv+1 set Jx[i]=1 set Qi[i+Jx[0]]=Op call pq(Op,i) call qq(Op) call SetUnitColor(Op,GetPlayerColor(Player(10))) call SetUnitVertexColor(Op,255,255,255,95) if i==1 then call UnitAddAbility(Op,'AId7') set Jx[i+3*Jx[0]]=1 if Mx>0 then call UnitAddAbility(Op,'A0DE') call SetUnitAbilityLevel(Op,'A0DE',IMinBJ(bC(Tq*3,4)+1,16)) endif else if Mx>0 then call UnitAddAbility(Op,'AId7') if(i==2)and(fe>1)then call UnitAddAbility(Op,'A0F7') call SetUnitAbilityLevel(Op,'A0F7',3) endif else call UnitAddAbility(Op,'AId8') endif set Jx[i+3*Jx[0]]=IMinBJ(3-J,1) endif set Jx[i+4*Jx[0]]=-1 call UnitAddAbility(Op,'A04J') call SetHeroAgi(Op,12+Tq,true) call SetUnitAbilityLevel(Op,'A0D2',VK) call SetUnitAbilityLevel(Op,'A0D4',uq) call SetUnitAbilityLevel(Op,'A0D3',Uq) call SetUnitAbilityLevel(Op,'A0D5',wq) call UnitAddAbility(Op,V[GetRandomInt(Wq/3,Wq)]) if pF>0 then call UnitAddAbility(Op,a[pF]) endif call IssueImmediateOrder(Op,"manashieldon") call CJ(Op,null) call DestroyEffect(KD) endfunction function yq takes nothing returns nothing local integer Sq=GetPlayerTechCount(to,'R001',true) local integer Tq=GetPlayerTechCount(to,'R002',true) local integer i=1+sq(Sq) if C>1 then set i=i+IMaxBJ(0,GetRandomInt(0,Mx+1)-1) endif if ar then if fe>1 then set i=i/ 3+1 else set i=i/ 3 endif if i<1 then set i=1 endif endif set Jx[0]=i call StoreInteger(Ae,"CommandoSpawnInfo","CurI",i) call StoreInteger(Ae,"CommandoSpawnInfo","LVAU",Tq) call StoreInteger(Ae,"CommandoSpawnInfo","Crit",IMinBJ(bC(Tq,4)+1,Qq(Jx[0]))) call StoreInteger(Ae,"CommandoSpawnInfo","Weak",IMinBJ(bC(Tq*2,3)+1,8)) call StoreInteger(Ae,"CommandoSpawnInfo","Nani",IMinBJ(1+IMinBJ(Fe,2)+IMinBJ(7,Sq)+bC(IMaxBJ(Sq-7,0),2),25)) call StoreInteger(Ae,"CommandoSpawnInfo","Evad",IMinBJ(Sq,31)) if ar then call StoreInteger(Ae,"CommandoSpawnInfo","AdvG",0) else call StoreInteger(Ae,"CommandoSpawnInfo","AdvG",IMinBJ(IMaxBJ(bC(Sq-1,4+bC(Sq,18)),0)+IMinBJ(Fe,2)+fe,30)) endif if Sq>29 then call StoreInteger(Ae,"CommandoSpawnInfo","Cell",IMinBJ(bC(Sq-5,6),9)) elseif Sq>16 then call StoreInteger(Ae,"CommandoSpawnInfo","Cell",bC(Sq-5,5)) elseif Sq>4 then call StoreInteger(Ae,"CommandoSpawnInfo","Cell",bC(Sq-5,4)) else call StoreInteger(Ae,"CommandoSpawnInfo","Cell",0) endif loop call TriggerRegisterTimerEvent(Yo,0,false) exitwhen i<2 set i=i-1 endloop endfunction function Yq takes nothing returns nothing set UX=CreateTrigger() call TriggerAddAction(UX,function yq) set Yo=CreateTrigger() call TriggerAddAction(Yo,function tq) endfunction function zq takes nothing returns boolean return ev>0 endfunction function Zq takes nothing returns nothing local unit ZP=GetEnumUnit() if FJ(ZP)then call CJ(ZP,dJ()) endif endfunction function vQ takes unit Od returns nothing local integer i=Jx[0] local unit lq loop exitwhen i<1 set lq=Qi[i+Jx[0]] if(Jx[i]==1)and FJ(lq)and not UnitHasBuffBJ(lq,'BOwk')then call CJ(lq,Od) endif set i=i-1 endloop endfunction function eQ takes nothing returns nothing local group g=dc('U000') call ForGroupBJ(g,function Zq) call DestroyGroup(g) if ce!=null then call CJ(ce,dJ()) endif if jx!=null then call CJ(jx,dJ()) endif if Le!=null then call CJ(Le,dJ()) endif call vQ(dJ()) endfunction function xQ takes nothing returns nothing set wX=CreateTrigger() call TriggerRegisterTimerEventPeriodic(wX,15.00) call TriggerAddCondition(wX,Condition(function zq)) call TriggerAddAction(wX,function eQ) endfunction function oQ takes unit LC returns real if GetUnitTypeId(LC)=='n008' then return(GetUnitUserData(LC)/ wx)*(9.00/rv) else return 0.0 endif endfunction function rQ takes nothing returns boolean local unit LC=GetFilterUnit() local integer i=GetPlayerId(GetOwningPlayer(LC)) if(i<10)or(i>11)then return false endif if av>0 then call uf(LC,oQ(LC)) endif return FJ(LC) endfunction function iQ takes nothing returns boolean local unit LC=GetFilterUnit() local integer i=GetPlayerId(GetOwningPlayer(LC)) if(i<10)or(i>11)then return false endif call uf(LC,oQ(LC)) if not Wi then return true elseif not RectContainsCoords(ln,GetUnitX(LC),GetUnitY(LC))then return true endif return FJ(LC) endfunction function aQ takes nothing returns nothing call CJ(GetEnumUnit(),null) endfunction function nQ takes nothing returns nothing local group g local boolexpr Nc if mo<1 then set Nc=Condition(function rQ) set g=Ac(zi,Nc) else set Nc=Condition(function iQ) set g=Ac(zi,Nc) endif call RemoveAllGuardPositions(Nr) call RemoveAllGuardPositions(to) call fJ() set wx=IMaxBJ(1,2*J-te) call ForGroup(g,function aQ) call DestroyGroup(g) call DestroyBoolExpr(Nc) set Nc=null set g=null endfunction function VQ takes nothing returns nothing set WX=CreateTrigger() call TriggerAddAction(WX,function nQ) endfunction function EQ takes nothing returns boolean return FJ(GetTriggerUnit()) endfunction function XQ takes nothing returns nothing call IssueTargetOrder(GetTriggerUnit(),"attack",GetAttacker()) endfunction function OQ takes nothing returns nothing set yX=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(yX,Player(10),EVENT_PLAYER_UNIT_ATTACKED) call TriggerRegisterPlayerUnitEventSimple(yX,Player(11),EVENT_PLAYER_UNIT_ATTACKED) call TriggerAddCondition(yX,Condition(function EQ)) call TriggerAddAction(yX,function XQ) endfunction function RQ takes nothing returns nothing local integer IQ local integer AQ local integer i=0 if te<1 then set IQ=bC(Q[11],20) set AQ=bC(Q[12],48) elseif te<5 then set IQ=bC(Q[11],IMaxBJ(20-bC(te,2),12)) set AQ=bC(Q[12],IMaxBJ(50-2*te,15)) else set IQ=bC(Q[11],IMaxBJ(21-te,12)) set AQ=bC(Q[12],IMaxBJ(58-4*te,15)) endif set IQ=IQ+xv+Fe call SetPlayerTechResearched(to,'R001',IQ) call SetPlayerTechResearched(Nr,'R001',IQ) call SetPlayerTechResearched(to,'R002',bC(Q[11],40)+Fe) call SetPlayerTechResearched(Nr,'R002',bC(Q[11],40)+Fe) call SetPlayerTechResearched(to,'R004',bC(Q[12],30)+xv+Fe) call SetPlayerTechResearched(Nr,'R004',bC(Q[12],30)+xv+Fe) call SetPlayerTechResearched(to,'R00T',NC(IQ*1.75)) if IQ>3 then call SetPlayerTechResearched(to,'R014',bC(IQ,3)) endif loop exitwhen i>11 call SetPlayerTechResearched(Player(i),'R003',AQ+Hi) if J<2 then call SetPlayerTechResearched(Player(i),'R015',AQ+Fe) if fe>0 then call SetPlayerTechResearched(Player(i),'R00Q',AQ+hi) endif elseif J<3 then call SetPlayerTechResearched(Player(i),'R00Q',AQ+Fe) endif set i=i+1 endloop endfunction function NQ takes nothing returns nothing set YX=CreateTrigger() call TriggerAddAction(YX,function RQ) endfunction function bQ takes nothing returns nothing local unit BQ=GetDyingUnit() local unit SJ=GetKillingUnit() local integer Aj=GetUnitPointValue(BQ) if Aj>100 then if GetOwningPlayer(BQ)==to then if iv>0 then set iv=iv-1 endif else if nv>0 then set nv=nv-1 endif endif set Uo=Uo+1 if GetUnitUserData(BQ)<1000 then call Bd(Aj) if GetRandomInt(0,99)<5*GetUnitAbilityLevel(SJ,'A0BC')then call AK(BQ,SJ) endif endif elseif GetUnitUserData(BQ)<1000 then if GetRandomInt(0,99)<5*GetUnitAbilityLevel(SJ,'A0BC')then call AK(BQ,SJ) endif endif set BQ=null set SJ=null endfunction function cQ takes nothing returns nothing set zX=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(zX,Player(10),EVENT_PLAYER_UNIT_DEATH) call TriggerRegisterPlayerUnitEventSimple(zX,Player(11),EVENT_PLAYER_UNIT_DEATH) call TriggerAddAction(zX,function bQ) endfunction function CQ takes nothing returns boolean return GetUnitTypeId(GetRevivableUnit())=='U000' endfunction function dQ takes location QJ returns nothing local location ud local integer i=GetRandomInt(3-J,5+te) local unit Jg loop exitwhen i<1 set ud=Ec(QJ,GetRandomInt(20,160),GetRandomInt(0,359)) set Jg=qf('nrat',to,ud,GetRandomInt(0,359)) call SetUnitState(Jg,UNIT_STATE_LIFE,GetUnitState(Jg,UNIT_STATE_LIFE)-IMaxBJ(0,GetRandomInt(-10,30))) call SetUnitUserData(Jg,1000) set i=i-1 endloop endfunction function DQ takes nothing returns nothing local unit ZP=GetRevivableUnit() local location tF=GetUnitLoc(ZP) local location ud=Ec(tF,410,BC(GetUnitFacing(ZP)+180)) local integer fQ=GetUnitAbilityLevel(ZP,'Atru') local unit FQ=null local effect KD local integer Jq set ev=ev-1 set kx=kx-1 if(Mx>0)and(fQ!=3)then set Jq=GetStoredInteger(Ae,"boss_abom_duration",XC(ZP)) call FlushStoredInteger(Ae,"boss_abom_duration",XC(ZP)) set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\PlagueCloud\\PlagueCloudCaster.mdl",ud) set FQ=Tf('nrat',to,ud,0) call SetUnitVertexColor(FQ,255,255,255,0) call UnitRemoveAbility(FQ,'A059') call UnitRemoveAbility(FQ,'A03D') call UnitRemoveAbility(FQ,'Awan') call UnitAddAbility(FQ,'A0DG') call SetUnitUserData(FQ,1000) endif call RemoveUnit(ZP) call dQ(ud) if fQ==2 then call qJ(ud,20,160,GetRandomInt(10-2*J,20-4*J)) endif call RemoveLocation(tF) call RemoveLocation(ud) call nd(1,"You have earned one valor point!",120-90*Mx) if FQ!=null then call OC(Jq) call RemoveUnit(FQ) call DestroyEffect(KD) endif set FQ=null set ZP=null set tF=null set ud=null endfunction function gQ takes nothing returns nothing set ZX=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(ZX,Player(11),EVENT_PLAYER_HERO_REVIVABLE) call TriggerAddCondition(ZX,Condition(function CQ)) call TriggerAddAction(ZX,function DQ) endfunction function GQ takes nothing returns nothing local unit ZP=GetTriggerUnit() local real nq=GetUnitState(ZP,UNIT_STATE_MAX_LIFE) call DisableTrigger(vO) if GetUnitState(ZP,UNIT_STATE_LIFE)<(0.15*nq+RMinBJ(111.1*C*ix,0.18*nq))then call RC(GetRandomInt(1,21-fe*fe*fe)) if ZP==null then return endif if GetUnitState(ZP,UNIT_STATE_LIFE)<1 then return endif call KillUnit(ZP) else call RC(2) endif call EnableTrigger(vO) endfunction function hQ takes nothing returns nothing set vO=CreateTrigger() call TriggerAddAction(vO,function GQ) endfunction function HQ takes nothing returns boolean return GetUnitTypeId(GetRevivableUnit())=='U003' endfunction function jQ takes nothing returns nothing set ev=ev-1 call RemoveUnit(GetRevivableUnit()) if ce==null then call DisableTrigger(eO) endif set kv=kv-Zo set Zo=0 call Ph() if te<1 then call PostTriggerExecuteBJ(zE,true) endif call nd(3,"You have earned three valor points!",240-120*Mx) endfunction function JQ takes nothing returns nothing set eO=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(eO,Player(11),EVENT_PLAYER_HERO_REVIVABLE) call TriggerAddCondition(eO,Condition(function HQ)) call TriggerAddAction(eO,function jQ) call DisableTrigger(eO) endfunction function kQ takes nothing returns boolean return GetUnitTypeId(GetRevivableUnit())=='U008' endfunction function KQ takes nothing returns nothing set ev=ev-1 call RemoveUnit(GetRevivableUnit()) if jx==null then call DisableTrigger(xO) endif call nd(3,"You have earned three valor points!",240-120*Mx) endfunction function lQ takes nothing returns nothing set xO=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(xO,Player(11),EVENT_PLAYER_HERO_REVIVABLE) call TriggerAddCondition(xO,Condition(function kQ)) call TriggerAddAction(xO,function KQ) call DisableTrigger(xO) endfunction function LQ takes nothing returns boolean return IsTriggerEnabled(oO) endfunction function mQ takes nothing returns nothing if(jx==null)or not(GetUnitState(jx,UNIT_STATE_LIFE)>0)then return endif call UnitAddAbility(jx,'Avul') call UnitAddAbility(jx,'Aeth') call SetUnitVertexColor(jx,0,0,0,176) if kP(1000,Jo)then set Jo=Jo-0.02 call TriggerRegisterTimerEvent(LoadTriggerHandle(qi,StringHash("boss_supermutant"),StringHash("hit")),0,false) endif call RC(GetRandomInt(2,6)) if(jx==null)or not(GetUnitState(jx,UNIT_STATE_LIFE)>0)or not IsTriggerEnabled(oO)then return endif if UnitHasBuffBJ(jx,'B01D')then call SetUnitVertexColor(jx,180,90,68,255) else call SetUnitVertexColor(jx,255,200,150,255) endif call UnitRemoveAbility(jx,'Aeth') call UnitRemoveAbility(jx,'Avul') call TriggerRegisterTimerEvent(oO,GetRandomInt(4,16),false) endfunction function MQ takes nothing returns nothing set oO=CreateTrigger() call TriggerAddCondition(oO,Condition(function LQ)) call TriggerAddAction(oO,function mQ) endfunction function pQ takes nothing returns boolean return GetUnitTypeId(GetRevivableUnit())=='U006' endfunction function PQ takes nothing returns nothing set ev=ev-1 call RemoveUnit(GetRevivableUnit()) call aC("You used great skill to overcome Godzilla!") call Cd(1) call DisableTrigger(rO) call DestroyTrigger(rO) endfunction function qQ takes nothing returns nothing set rO=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(rO,Player(11),EVENT_PLAYER_HERO_REVIVABLE) call TriggerAddCondition(rO,Condition(function pQ)) call TriggerAddAction(rO,function PQ) call DisableTrigger(rO) endfunction function QQ takes nothing returns boolean return GetUnitTypeId(GetRevivableUnit())=='U007' endfunction function sQ takes nothing returns nothing local integer i=0 local unit LC=GetRevivableUnit() local trigger SQ=LoadTriggerHandle(qi,StringHash("tyrantdroid"),StringHash(XC(LC))) if SQ!=null then call RemoveSavedHandle(qi,StringHash("tyrantmonitor"),StringHash(XC(SQ))) endif call RemoveSavedHandle(qi,StringHash("tyrantdroid"),StringHash(XC(LC))) set ev=ev-1 call WP(LC,false) call RemoveUnit(LC) endfunction function tQ takes nothing returns nothing set aO=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(aO,Player(11),EVENT_PLAYER_HERO_REVIVABLE) call TriggerAddCondition(aO,Condition(function QQ)) call TriggerAddAction(aO,function sQ) call DisableTrigger(aO) endfunction function TQ takes unit uQ,integer UQ returns boolean local effect KD local integer i=0 local real x local real y if(UQ+GetRandomInt(2,4)*J)=GetRandomInt(0,9) set UQ=UQ+2*J set i=i+1 endloop set KD=AddSpecialEffect(zD(),x,y) call TriggerSleepAction(2.5*Xx) if i>0 then call Bd((GetUnitPointValue(uQ)-100)*i+100) if GetRandomInt(1,Gr)<(hr+i)then set Gr=Gr+1 call TriggerRegisterUnitEvent(NO,CreateUnit(GetOwningPlayer(uQ),'n016',GetUnitX(uQ),GetUnitY(uQ),GetUnitFacing(uQ)),EVENT_UNIT_DEATH) endif endif call DestroyEffect(KD) set KD=null return true endfunction function wQ takes unit uQ,unit Lq,boolean WQ,integer i returns nothing set i=i+Tx if i>599 then set i=i-600 endif loop exitwhen tx[i]==null if i>598 then set i=0 else set i=i+1 endif endloop set Ux[i]=Lq set ux[i]=WQ set tx[i]=uQ endfunction function yQ takes nothing returns boolean return GetUnitTypeId(GetDyingUnit())=='n008' endfunction function YQ takes nothing returns nothing local unit SJ=GetKillingUnit() local unit uQ=GetDyingUnit() local integer UQ=GetUnitUserData(uQ) if UQ<999 then if GetUnitTypeId(SJ)=='o00R' then call UnitSuspendDecay(uQ,true) call wQ(uQ,SJ,true,GetRandomInt(230,299)) elseif UQ9 then set SJ=null set BQ=null set es=null set oP=null return endif if i>0 then set vs=GetUnitAbilityLevel(BQ,'A0F5'+Mx)>0 set x=GetUnitX(BQ) set y=GetUnitY(BQ) set f=GetUnitFacing(BQ) loop exitwhen i<1 call TriggerSleepAction(GetRandomReal(0,3)*Xx) set es=CreateUnit(oP,'u004',x,y,f) if oP==to then set iv=iv+1 else set nv=nv+1 call SetUnitColor(es,PLAYER_COLOR_BROWN) endif call uf(es,24.00/rv) if vs then call UnitAddAbility(es,'A0F5'+Mx) call SetUnitVertexColor(es,255,150,81,255) endif call TriggerSleepAction(0.01) call CJ(es,SJ) set i=i-1 endloop endif set SJ=null set BQ=null set es=null set oP=null endfunction function xs takes nothing returns nothing set VO=CreateTrigger() call TriggerAddAction(VO,function ZQ) endfunction function os takes nothing returns boolean local integer Lc=GetUnitTypeId(GetDyingUnit()) if(Lc=='n004')or(Lc=='n005')then return(GetUnitPointValue(GetKillingUnit())>100)and not IsUnitType(GetKillingUnit(),UNIT_TYPE_ANCIENT) endif return false endfunction function rs takes nothing returns nothing local unit SJ=GetDyingUnit() local integer Lc=GetUnitTypeId(SJ) local location ud if GetRandomInt(0,99)>(GetUnitPointValue(GetKillingUnit())-85.0)*(4.0+Iv/4.0)/(2.0*rv-0.7*fe)then return endif call OC(GetRandomInt(40,60)) if(SJ==null)or(GetUnitState(SJ,UNIT_STATE_LIFE)>0)then return endif set ud=GetUnitLoc(SJ) call RemoveUnit(SJ) set SJ=qf(Lc,Nr,ud,GetRandomInt(0,359)) call SetUnitState(SJ,UNIT_STATE_LIFE,RMaxBJ(1,GetUnitState(SJ,UNIT_STATE_LIFE)-GetRandomInt(0,99))) call SetUnitUserData(SJ,2) call UnitRemoveAbility(SJ,'Awan') call uf(SJ,0.0) call SetUnitColor(SJ,PLAYER_COLOR_BROWN) call SetUnitVertexColorBJ(SJ,100,50.00,50.00,0) call UnitAddAbility(SJ,'A02W') call SetUnitAbilityLevel(SJ,'A02W',2) call TriggerSleepAction(0.1) call CJ(SJ,null) set ud=null endfunction function is takes nothing returns nothing set EO=CreateTrigger() call TriggerAddCondition(EO,Condition(function os)) call TriggerAddAction(EO,function rs) endfunction function as takes nothing returns nothing local unit BQ=GetDyingUnit() local real x=GetUnitX(BQ) local real y=GetUnitY(BQ) local integer i=vi-1 loop exitwhen i<0 exitwhen Zr[i]==BQ set i=i-1 endloop if i>-1 then set Zr[i]=Zr[vi-1] endif if vi>0 then set vi=vi-1 endif set i=GetUnitTypeId(BQ) if(i!='u002')and(i!='u00A')then if GetUnitUserData(BQ)<1000 then call RC(4.0) endif set BQ=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'hfoo',x,y,270) call SetUnitUserData(BQ,998) call SetUnitState(BQ,UNIT_STATE_LIFE,GetUnitState(BQ,UNIT_STATE_LIFE)*(1.0-0.1*jo)) return endif set kv=kv-1 if GetUnitUserData(BQ)==20 then call uh(x,y,true) call uh(x,y,true) set i=1+fe*fe+GetRandomInt(0,(C+5)/2) loop exitwhen i<1 set iv=iv+1 set BQ=CreateUnit(to,'u00A',x+GetRandomInt(-45,45),y+GetRandomInt(-45,45),GetRandomInt(0,359)) call RemoveGuardPosition(BQ) if sh()then set Zr[vi]=BQ set vi=vi+1 call TriggerRegisterUnitEvent(XO,BQ,EVENT_UNIT_DEATH) call UnitAddAbility(BQ,'AId0') call UnitAddAbility(BQ,'A0AA') call SetUnitAbilityLevel(BQ,'A0AA',2) call SetUnitVertexColor(BQ,80,199,0,255) call CJ(BQ,null) endif set i=i-1 if i==5 then call TriggerSleepAction(0.1) endif endloop endif call Ph() if te<1 then call ConditionalTriggerExecute(zE) endif endfunction function ns takes nothing returns nothing set XO=CreateTrigger() call TriggerAddAction(XO,function as) endfunction function Vs takes nothing returns nothing if Br>0 then set Br=Br-1 endif endfunction function Es takes nothing returns nothing set OO=CreateTrigger() call TriggerAddAction(OO,function Vs) endfunction function Xs takes nothing returns nothing local unit Os=GetTriggerUnit() local integer Ud=4-J local integer wd=12-3*J call UnitAddAbility(Os,'Aloc') if J<2 then set Ud=4+2*fe set wd=7+(C-1)/3+2*fe endif call SetUnitState(Os,UNIT_STATE_LIFE,(GetRandomInt(Ud,wd)*3)/2) endfunction function Rs takes nothing returns nothing set RO=CreateTrigger() call TriggerAddAction(RO,function Xs) endfunction function Is takes unit LC,unit BQ,real x,real y,integer tK returns nothing local integer iP=-1 local integer i=0 local integer As local integer WC=0 local integer Gq local unit array DJ local integer array Ns loop exitwhen i>8 if Ed(i)and not HC(x,y,GetUnitX(X[i]),GetUnitY(X[i]),1800)then set DJ[WC]=X[i] set Ns[WC]=Pv[i*3+2] set WC=WC+1 endif set i=i+1 endloop if WC<2 then if LC!=null then set iP=GetPlayerId(GetOwningPlayer(LC)) endif if(iP>-1)and(iP<9)and Ed(iP)then set DJ[WC]=X[iP] set Ns[WC]=Pv[iP*3+2] set WC=WC+1 endif set i=0 loop exitwhen i>8 if Ed(i)then set DJ[WC]=X[i] set Ns[WC]=Pv[i*3+2] set WC=WC+1 endif set i=i+1 endloop endif set i=WC loop exitwhen i<1 set i=i-1 if Ns[i]>1 then set DJ[WC]=DJ[i] set DJ[WC+1]=DJ[i] set DJ[WC+2]=DJ[i] set WC=WC+3 elseif Ns[i]>0 then set DJ[WC]=DJ[i] set WC=WC+1 endif endloop if J>2 then set i=1 else set i=1+GetRandomInt(C/4,C/2+((C+1)/3)*fe+ix/(4-(C+2)/3))+tK if J>1 then set i=i/3 endif set As=C+2*fe-Br if As<0 then set As=0 endif if As0 then if Gq<1 then set Gq=WC endif set iP=GetRandomInt(0,Gq-1) set LC=DJ[iP] call IssueTargetOrder(BQ,"attack",LC) set DJ[iP]=DJ[Gq-1] set DJ[Gq-1]=LC set Gq=Gq-1 endif set i=i-1 endloop endfunction function bs takes nothing returns nothing local unit hJ=GetDyingUnit() call Is(GetKillingUnit(),hJ,GetUnitX(hJ),GetUnitY(hJ),0) set hJ=null endfunction function Bs takes nothing returns nothing set IO=CreateTrigger() call TriggerAddAction(IO,function bs) endfunction function cs takes nothing returns nothing local unit hJ=GetDyingUnit() local real x=GetUnitX(hJ) local real y=GetUnitY(hJ) local unit LC local group g=CreateGroup() call GroupEnumUnitsInRange(g,x,y,144,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if IsUnitType(LC,UNIT_TYPE_HERO)and(GetUnitAbilityLevel(LC,'Avul')<1)then if GetPlayerId(GetOwningPlayer(LC))<9 then call Yh(Nr,LC,'A04Y',"chainlightning") exitwhen true endif endif call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set g=null set LC=null set hJ=null endfunction function Cs takes nothing returns nothing set AO=CreateTrigger() call TriggerAddAction(AO,function cs) endfunction function ds takes nothing returns nothing local unit Ds=GetDyingUnit() local player oP=GetOwningPlayer(Ds) local real x=GetUnitX(Ds) local real y=GetUnitY(Ds) local real f=GetUnitFacing(Ds) call RemoveUnit(Ds) call UnitApplyTimedLife(CreateUnit(oP,'n015',x,y,f),'BTLF',6+14*Mx) if(C>2)and(fe>0)then call UnitApplyTimedLife(CreateUnit(oP,'n015',x,y,f),'BTLF',20) if GetRandomInt(C-12,fe)>1 then call UnitApplyTimedLife(CreateUnit(oP,'n015',x,y,f),'BTLF',20) endif endif set oP=null set Ds=null endfunction function fs takes nothing returns nothing set NO=CreateTrigger() call TriggerAddAction(NO,function ds) endfunction function Fs takes nothing returns boolean return GetUnitTypeId(GetRevivableUnit())=='U00C' endfunction function gs takes nothing returns nothing local unit Aq=GetRevivableUnit() local location Gs=GetUnitLoc(Aq) local location hs=Ec(Gs,300,BC(GetUnitFacing(Aq)+180)) call Is(null,Aq,GetLocationX(hs),GetLocationY(hs),C/2) call RemoveLocation(Gs) call RemoveLocation(hs) call RemoveUnit(Aq) set Aq=null set Gs=null set hs=null set Pr=Pr-1 if((fe==1)and(mo>70))or Wi then if Di>0 then set Di=Di/ 2 endif else set Di=0 endif endfunction function Hs takes nothing returns nothing set BO=CreateTrigger() call TriggerAddCondition(BO,Condition(function Fs)) call TriggerAddAction(BO,function gs) endfunction function js takes nothing returns nothing set nr=false endfunction function Js takes nothing returns nothing set cO=CreateTrigger() call TriggerAddAction(cO,function js) endfunction function ks takes nothing returns nothing set Vr=false endfunction function Ks takes nothing returns nothing set CO=CreateTrigger() call TriggerAddAction(CO,function ks) endfunction function ls takes nothing returns nothing local unit SJ=GetKillingUnit() local unit BQ=GetDyingUnit() local real x=GetUnitX(BQ) local real y=GetUnitY(BQ) local real n=GetUnitFacing(BQ) local integer Ls=GetUnitUserData(BQ) local integer ms=GetUnitAbilityLevel(BQ,'S001') local integer IH set cr=cr-1 if Ls>998 then return endif call RemoveUnit(BQ) if fe>1 then if C>6 then set IH=(C+1)/3+2 elseif C>3 then set IH=(C+1)/3+1 else set IH=(C+1)/3 endif if ix>2 then set IH=IH+1 endif else set IH=(C+1)/3 endif set iv=iv+1 set BQ=CreateUnit(to,'n00S',x,y,n) call RemoveGuardPosition(BQ) call kJ(BQ,GetRandomInt(-1,Ls)0 then return endif endif endif set ud=GetUnitLoc(hJ) call UnitRemoveAbility(hJ,'A0P8') call UnitRemoveAbility(hJ,'A0PB') call UnitRemoveAbility(hJ,'A0P7') call UnitRemoveAbility(hJ,'A0P9') if SJ!=null then if IsUnitType(SJ,UNIT_TYPE_ANCIENT)then set LF=LF/ 8 endif call UnitDamageTarget(hJ,SJ,LF,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) endif call wk(ud,11,-2) call RemoveLocation(ud) endfunction function Ps takes nothing returns nothing local unit hJ=GetDyingUnit() if GetUnitAbilityLevel(hJ,'A0P8')<1 then return endif call ps(hJ,null) endfunction function qs takes nothing returns nothing set DO=CreateTrigger() call TriggerAddAction(DO,function Ps) endfunction function Qs takes nothing returns boolean return GetSpellAbilityId()=='A0P9' endfunction function ss takes nothing returns nothing call ps(GetSpellAbilityUnit(),GetSpellTargetUnit()) endfunction function Ss takes nothing returns nothing set fO=CreateTrigger() call TriggerAddCondition(fO,Condition(function Qs)) call TriggerAddAction(fO,function ss) endfunction function ts takes player Fc,real Ts returns nothing local real us=Ts if(us>9.0)then set us=9.0 endif if(GetLocalPlayer()==Fc)then call CameraSetTargetNoiseEx(Ts*10.0,Ts*Pow(5,us),true) endif endfunction function Us takes nothing returns nothing local integer i local location array sk local real array Sk local location ud loop call TriggerSleepAction(1.75) exitwhen Le==null set ud=GetUnitLoc(Le) set sk[GetPlayerId(U)]=GetCameraTargetPositionLoc() set Sk[GetPlayerId(U)]=DistanceBetweenPoints(sk[GetPlayerId(U)],ud) call RemoveLocation(sk[GetPlayerId(U)]) set i=0 loop exitwhen i>8 call ts(Player(i),RMaxBJ(1.0,10.0-Sk[GetPlayerId(U)]/500.0)) set i=i+1 endloop call TriggerSleepAction(0.25) set i=0 loop exitwhen i>8 call xG(Player(i)) set i=i+1 endloop call RemoveLocation(ud) endloop call DestroyTrigger(FO) endfunction function ws takes nothing returns nothing set FO=CreateTrigger() call TriggerAddAction(FO,function Us) endfunction function Ws takes nothing returns nothing local unit ek=GetTriggerUnit() local integer iP=GetPlayerId(GetOwningPlayer(GetEventDamageSource())) local real x=GetUnitX(X[iP]) local real y=GetUnitY(X[iP]) local effect KD local integer ms=GetUnitAbilityLevel(ek,'S001') call DisableTrigger(gO) if ms>0 then if ms==1 then call SetUnitAbilityLevel(ek,'S001',2) call SetUnitAbilityLevel(ek,'A0MN',2) endif call TriggerSleepAction(1.5*Xx) elseif Ed(iP)and jC(GetUnitX(ek),GetUnitY(ek),x,y,232,1250)then set KD=AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl",ek,"origin") call SetUnitPosition(ek,x,y) call IssueTargetOrder(ek,"attack",X[iP]) call TriggerSleepAction(0.1) call DestroyEffect(KD) call RC(2) else call TriggerSleepAction(1.5*Xx) endif call EnableTrigger(gO) set KD=null endfunction function ys takes nothing returns nothing set gO=CreateTrigger() call TriggerAddAction(gO,function Ws) endfunction function Ys takes nothing returns boolean return GetSpellAbilityId()=='A0OC' endfunction function zs takes nothing returns nothing local unit LC=GetSpellTargetUnit() local effect KD=null local real LP local real Zs call TriggerSleepAction(2*Xx) if(GetUnitAbilityLevel(LC,'Avul')>0)or(GetUnitAbilityLevel(LC,'A09D')==2)then return endif set LP=GetUnitState(LC,UNIT_STATE_LIFE) if(LC!=null)and(LP>1)then set Zs=GetUnitState(LC,UNIT_STATE_MANA) if IsUnitType(LC,UNIT_TYPE_MECHANICAL)then set LP=LP-LP*0.05*(1.0+fe) if LP>2 then call SetUnitState(LC,UNIT_STATE_LIFE,LP) else call SetUnitState(LC,UNIT_STATE_LIFE,2) endif set Zs=Zs-Zs*0.10*(1.0+fe) else set Zs=Zs-Zs*0.05*(2.0+fe) endif if Zs>0 then call SetUnitState(LC,UNIT_STATE_MANA,Zs) else call SetUnitState(LC,UNIT_STATE_MANA,0) endif set KD=AddSpecialEffectTarget("Abilities\\Spells\\Orc\\Purge\\PurgeBuffTarget.mdl",LC,"chest") call TriggerSleepAction(2*Xx) call DestroyEffect(KD) endif set LC=null set KD=null endfunction function vS takes nothing returns nothing set GO=CreateTrigger() call TriggerAddCondition(GO,Condition(function Ys)) call TriggerAddAction(GO,function zs) endfunction function eS takes nothing returns boolean return GetSpellAbilityId()=='A0P0' endfunction function oS takes nothing returns nothing call IssueImmediateOrder(GetSpellAbilityUnit(),"voodoo") endfunction function rS takes nothing returns nothing set hO=CreateTrigger() call TriggerAddCondition(hO,Condition(function eS)) call TriggerAddAction(hO,function oS) endfunction function iS takes nothing returns nothing if po!=null then call SetUnitState(po,UNIT_STATE_MANA,GetUnitState(po,UNIT_STATE_MANA)+500.0) call IssueTargetOrder(po,"holybolt",po) call Cg(po) endif endfunction function aS takes nothing returns nothing set HO=CreateTrigger() call TriggerAddAction(HO,function iS) endfunction function nS takes integer i returns nothing local texttag qD=CreateTextTag() local string s local integer SD if i<4 then if i<1 then set s="Swwwaaaaat" elseif i<2 then set s="Doooooooom" elseif i<3 then set s="Grrrrrrrrr" else set s="Paaaaiiiin" endif elseif i<8 then if i<5 then set s="Feel the pain!" elseif i<6 then set s="Die, weakling!" elseif i<7 then set s="You're mine now!" else set s="Domination!" endif elseif i<13 then if i<9 then set s="Reinforcements..." elseif i<10 then set s="Send them in..." elseif i<11 then set s="Backup coming..." elseif i<12 then set s="Need assistance..." else set s="Requesting aid..." endif elseif i<16 then if i<14 then set s="What now, bitches?" elseif i<15 then set s="You like me now?" else set s="You afraid yet?" endif elseif i<19 then if i<17 then set s="No juice for you." elseif i<18 then set s="Energy's for wimps." else set s="Suffer cell depletion." endif elseif i<22 then if i<20 then set s="Round two, fight!!" elseif i<21 then set s="Let's try again!!" else set s="It's not over yet!!" endif else set s="Redscull jewish crap in your face!" endif set SD=StringLength(s) call SetTextTagText(qD,s,0.0185) call SetTextTagPos(qD,GetUnitX(po)-6*SD-14,GetUnitY(po),140) call SetTextTagColor(qD,255,255,255,255) call SetTextTagVelocity(qD,0,0.007) call SetTextTagPermanent(qD,false) call SetTextTagLifespan(qD,1.87+0.12*SD) set qD=null endfunction function VS takes unit Od,integer i returns nothing local texttag qD=CreateTextTag() local string s local integer SD set i=i+GetRandomInt(0,4) if i<1 then set s="Let's dance, " elseif i<2 then set s="You and me, " elseif i<3 then set s="Your turn, " elseif i<4 then set s="Game over, " elseif i<5 then set s="Make your time, " elseif i<6 then set s="Not so fast, " elseif i<7 then set s="Not just yet, " elseif i<8 then set s="Not this time, " elseif i<9 then set s="Not today, " else set s="Not having it, " endif set s=s+GetHeroProperName(Od)+"." set SD=StringLength(s) call SetTextTagText(qD,s,0.0185) call SetTextTagPos(qD,GetUnitX(po)-6*SD-14,GetUnitY(po),140) call SetTextTagColor(qD,255,255,255,255) call SetTextTagVelocity(qD,0,0.007) call SetTextTagPermanent(qD,false) call SetTextTagLifespan(qD,1.87+0.12*SD) set qD=null endfunction function ES takes nothing returns nothing set po=null set ev=ev-1 set oi=true call DisableTrigger(QO) call DisableTrigger(sO) set kv=kv-er set er=0 call RC(6) set mo=100 call ConditionalTriggerExecute(zE) call Ph() endfunction function XS takes nothing returns nothing set jO=CreateTrigger() call TriggerAddAction(jO,function ES) endfunction function OS takes real RS returns nothing if Mo<0.003 then set Mo=0.001 elseif Mo<0.02 then set Mo=Mo-0.002*RS elseif Mo<0.11 then set Mo=Mo-0.01*RS else set Mo=0.10 endif endfunction function IS takes nothing returns boolean return GetSpellAbilityId()=='A0I9' endfunction function AS takes nothing returns nothing local unit LC=GetSpellTargetUnit() local real kC=GetUnitState(LC,UNIT_STATE_MAX_LIFE) local real EH=GetUnitState(LC,UNIT_STATE_LIFE) local real NS if((kC-EH-500)>(Mo*kC))or(Mo>0.10)then set NS=Mo*kC call SetUnitState(LC,UNIT_STATE_LIFE,EH+NS) call OS(1.0) else set NS=0.001*kC call SetUnitState(LC,UNIT_STATE_LIFE,EH+NS) endif if NC(NS+500)>9999 then call lD("+"+I2S(NC(NS/1000.0+0.5))+"k",LC,255,204,0,true,11,1.9) else call lD("+"+I2S(NC(NS+500)),LC,255,204,0,true,11,1.9) endif call RC(1.5) if FJ(LC)then call CJ(LC,null) endif endfunction function bS takes nothing returns nothing set JO=CreateTrigger() call TriggerAddCondition(JO,Condition(function IS)) call TriggerAddAction(JO,function AS) endfunction function BS takes nothing returns boolean return GetSpellAbilityId()=='A0IC' endfunction function cS takes nothing returns nothing local unit LC=GetSpellTargetUnit() local unit CS local unit array dS local integer DS=0 local integer wd=IMinBJ((C+1)/3,NC(GetUnitState(po,UNIT_STATE_MANA))/200) local real x=GetUnitX(po) local real y=GetUnitY(po) local group g=CreateGroup() call GroupEnumUnitsInRange(g,GetUnitX(LC),GetUnitY(LC),264,null) loop set CS=FirstOfGroup(g) exitwhen CS==null exitwhen DS==wd if GetUnitPointValue(CS)<6 then if CS!=LC then if HC(GetUnitX(CS),GetUnitY(CS),x,y,336)then set dS[DS]=CreateUnit(to,'o00J',x,y,0) call UnitAddAbility(dS[DS],'A0J8') call IssueTargetOrder(dS[DS],"thunderbolt",CS) set DS=DS+1 endif endif endif call GroupRemoveUnit(g,CS) endloop call DestroyGroup(g) set g=null call SetUnitState(po,UNIT_STATE_MANA,RMaxBJ(0,GetUnitState(po,UNIT_STATE_MANA)-DS*200)) call TriggerSleepAction(1) loop exitwhen DS<1 set DS=DS-1 call RemoveUnit(dS[DS]) endloop endfunction function fS takes nothing returns nothing set kO=CreateTrigger() call TriggerAddCondition(kO,Condition(function BS)) call TriggerAddAction(kO,function cS) endfunction function FS takes nothing returns boolean return GetSpellAbilityId()=='A0JD' endfunction function gS takes nothing returns nothing local real x=GetUnitX(po) local real y=GetUnitY(po) local real h local real v local item Jd local integer j local integer i=0 loop exitwhen i>8 if Ed(i)then set h=GetUnitX(X[i]) set v=GetUnitY(X[i]) if not HC(x,y,h,v,625)then set j=0 loop if GetRandomInt(0,1+fe)>1 then set Jd=UnitItemInSlot(X[i],j) if Jd!=null then if(GetItemTypeId(Jd)!='I02A')and not wF(Jd,i,0)then call SetItemPosition(Jd,h,v) endif endif endif set j=j+1 exitwhen j>5 endloop endif endif set i=i+1 endloop endfunction function GS takes nothing returns nothing set KO=CreateTrigger() call TriggerAddCondition(KO,Condition(function FS)) call TriggerAddAction(KO,function gS) endfunction function hS takes nothing returns boolean return GetSpellAbilityId()=='A0ID' endfunction function HS takes nothing returns nothing call Yk(po,GetSpellTargetUnit(),210+30*fe*C) endfunction function jS takes nothing returns nothing set lO=CreateTrigger() call TriggerAddCondition(lO,Condition(function hS)) call TriggerAddAction(lO,function HS) endfunction function JS takes nothing returns nothing local unit LC=GetDyingUnit() local real x=GetUnitX(LC) local real y=GetUnitY(LC) local real f=GetUnitFacing(LC) local unit kS local integer fQ=GetRandomInt(fe*fe*fe-7,fe*(C/2)) local effect KD=AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",x,y) call RemoveUnit(LC) loop exitwhen fQ<1 set kS=CreateUnit(Nr,'u00D',x,y,f) call SetUnitTimeScale(kS,3) call SetUnitExploded(kS,true) call RemoveGuardPosition(kS) set fQ=fQ-1 endloop call TriggerSleepAction(Xx) call DestroyEffect(KD) set KD=null set LC=null set kS=null endfunction function KS takes nothing returns nothing set LO=CreateTrigger() call TriggerAddAction(LO,function JS) endfunction function lS takes nothing returns boolean return GetUnitTypeId(GetSummonedUnit())=='O011' endfunction function LS takes nothing returns nothing local unit VF=GetSummonedUnit() local unit Od=dJ() local real x local real y local effect fx if Od!=null then set x=GetUnitX(Od) set y=GetUnitY(Od) call SetUnitPosition(VF,x,y) else set x=GetUnitX(VF) set y=GetUnitY(VF) endif set fx=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x,y) call TriggerRegisterUnitEvent(LO,VF,EVENT_UNIT_DEATH) call SetUnitAbilityLevel(VF,'A0H7',7*fe+C/3-1) call SetUnitAbilityLevel(VF,'A0BD',fe) call SetHeroStr(VF,225+75*C,true) call SetHeroAgi(VF,9+2*fe*C,true) call SetUnitColor(VF,ConvertPlayerColor(12)) call TriggerSleepAction(Xx) call DestroyEffect(fx) set fx=null endfunction function mS takes nothing returns nothing set mO=CreateTrigger() call TriggerAddCondition(mO,Condition(function lS)) call TriggerAddAction(mO,function LS) endfunction function MS takes unit Od returns integer if UnitHasItemOfTypeBJ(Od,'I02A')then return 1 endif return 0 endfunction function pS takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"borgforcefieldkeyplayer",XC(jD)) local string aF=GetStoredString(Ae,"borgforcefieldkeythekey",XC(jD)) if aF=="+" then call SetPlayerAbilityAvailable(Player(iP),'A05G'+MS(X[iP])+Xi[iP],false) call SetPlayerAbilityAvailable(Player(iP),'A053',true) call SetUnitAbilityLevel(X[iP],'A05C',10) elseif aF=="-" then call SetPlayerAbilityAvailable(Player(iP),'A053',false) call SetPlayerAbilityAvailable(Player(iP),'A05G'+MS(X[iP])+Xi[iP],true) call SetUnitAbilityLevel(X[iP],'A05C',9) elseif aF=="." then if Player(iP)==U then call ForceUICancel() endif elseif aF=="w" then call TriggerSleepAction(0.1) call IssueImmediateOrder(X[iP],"manashieldon") call IssueImmediateOrder(X[iP],"stop") elseif aF=="*" then call TriggerSleepAction(2*Xx) call SetUnitAbilityLevel(X[iP],'A05C',Pv[iP*3+2]+1+Do[iP*Co+1]) call SetUnitAbilityLevel(X[iP],'A09D',1) else call TriggerSleepAction(0.1) if Player(iP)==U then call ForceUIKey(aF) endif endif call FlushStoredInteger(Ae,"borgforcefieldkeyplayer",XC(jD)) call FlushStoredString(Ae,"borgforcefieldkeythekey",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function PS takes integer iP,string aF returns nothing local trigger jD=CreateTrigger() call StoreInteger(Ae,"borgforcefieldkeyplayer",XC(jD),iP) call StoreString(Ae,"borgforcefieldkeythekey",XC(jD),aF) call TriggerAddAction(jD,function pS) call TriggerRegisterTimerEvent(jD,0.1,false) endfunction function qS takes integer iP,boolean QS,boolean sS returns nothing call StoreInteger(Ae,"borgforcefieldturnoffdone",I2S(iP),0) call DestroyEffect(LoadEffectHandle(qi,StringHash("borgforcefieldfx"),iP)) call RemoveSavedHandle(qi,StringHash("borgforcefieldfx"),iP) call PS(iP,"-") if sS and QS then endif call PS(iP,"*") endfunction function SS takes nothing returns nothing local real x=GetUnitX(po) local real y=GetUnitY(po) local real h local real v local real tS=0.95+0.15*C local unit array TS local lightning array fx local integer c=0 local integer i=0 loop exitwhen i>8 set TS[i]=null if Ed(i)and(GetStoredInteger(Ae,"borgforcefieldturnoffdone",I2S(i))==1)then set h=GetUnitX(X[i]) set v=GetUnitY(X[i]) if not HC(h,v,x,y,625)then set fx[c]=AddLightning("FORK",true,x,y,h,v) set c=c+1 set TS[i]=X[i] call StoreInteger(Ae,"borgforcefieldturnoffdone",I2S(i),2) call iC(Player(i),"Force field generator malfunctioning...") endif endif set i=i+1 endloop call TriggerSleepAction(Xx) loop exitwhen c<1 set c=c-1 call DestroyLightning(fx[c]) endloop call RC(4.5) set i=0 loop exitwhen i>8 if(TS[i]!=null)and Ed(i)and(GetStoredInteger(Ae,"borgforcefieldturnoffdone",I2S(i))>1)then call iC(Player(i),"Force field generator turned off.") call qS(i,GetStoredBoolean(Ae,"borgforcefieldturnoffnanites",I2S(i)),true) endif set i=i+1 endloop endfunction function uS takes nothing returns nothing set MO=CreateTrigger() call TriggerAddAction(MO,function SS) endfunction function US takes nothing returns unit local integer i=0 local integer WC=0 local integer wS local unit array DJ local boolean WS loop exitwhen i>8 if Ed(i)then if B[i]==12 then if(GetUnitAbilityLevel(X[i],'A0NP')==2)or(Pv[i*3+2]==0)then if not zv[i]then set DJ[WC]=Yv[i] set WC=WC+1 endif else set DJ[WC]=X[i] set WC=WC+1 if Pv[i*3+2]>1 then set DJ[WC]=X[i] set WC=WC+1 endif endif elseif Pv[i*3+2]>0 then set DJ[WC]=X[i] set WC=WC+1 if Pv[i*3+2]>1 then set DJ[WC]=X[i] set WC=WC+1 endif endif endif if B[i]==9 then if(not zv[i])and(GetUnitAbilityLevel(Yv[i],'Avul')<1)then if Ed(i)then set WS=HC(GetUnitX(X[i]),GetUnitY(X[i]),GetUnitX(Yv[i]),GetUnitY(Yv[i]),900) else set WS=true endif set WS=WS and HC(GetUnitX(po),GetUnitY(po),GetUnitX(Yv[i]),GetUnitY(Yv[i]),1200) if WS then if(qe[i]!=1)or(GetStoredInteger(Ae,"dogstealth",XC(Yv[i]))==0)then if not Wi or not RectContainsUnit(ln,Yv[i])then set wS=0 loop exitwhen wS>C set DJ[WC]=Yv[i] set WC=WC+1 set wS=wS+1 endloop endif endif endif endif endif set i=i+1 endloop if WC==0 then return null endif return DJ[GetRandomInt(0,WC-1)] endfunction function YS takes nothing returns nothing local real x1 local real y1 local real x2 local real y2 local effect xf=null local effect fx=null local integer i=8 local unit Od=US() if Od==null then return endif call fJ() set x2=GetUnitX(Od) set y2=GetUnitY(Od) if not HC(GetUnitX(po),GetUnitY(po),x2,y2,900+40*GetUnitAbilityLevel(Od,'A0BC'))then call IssueTargetOrder(po,"attack",Od) call RC(3) elseif GetUnitState(po,UNIT_STATE_MANA)>250 then set x1=GetRandomReal(x2-325,x2+325) set y1=GetRandomReal(y2-325,y2+325) loop exitwhen not IsTerrainPathable(x1,y1,PATHING_TYPE_WALKABILITY) set i=i-1 exitwhen i<1 set x1=GetRandomReal(x2-325,x2+325) set y1=GetRandomReal(y2-325,y2+325) endloop if i>0 then call SetUnitState(po,UNIT_STATE_MANA,GetUnitState(po,UNIT_STATE_MANA)-250) set xf=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(po),GetUnitY(po)) set fx=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x1,y1) call SetUnitPosition(po,x1,y1) call TriggerSleepAction(Xx) call DestroyEffect(fx) call DestroyEffect(xf) set fx=null set xf=null endif endif call IssuePointOrder(po,"attack",x2,y2) endfunction function zS takes nothing returns nothing set pO=CreateTrigger() call TriggerAddAction(pO,function YS) endfunction function ZS takes integer dL returns boolean local real x=GetUnitX(po) local real y=GetUnitY(po) local integer i=0 loop exitwhen i>8 if Ed(i)and not HC(x,y,GetUnitX(X[i]),GetUnitY(X[i]),dL)then return true endif set i=i+1 endloop return false endfunction function vt takes nothing returns real if C<6 then return 2.333+0.667*C endif return 6.0 endfunction function et takes nothing returns nothing local location xt local location ud local unit bp local unit ot local unit rt local effect xf local effect fx if po==null then return endif if not ZS(1200)then set so=18 return endif set fx=AddSpecialEffect("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",GetUnitX(po),GetUnitY(po)) call SetUnitAbilityLevel(po,'A0IB',GetUnitAbilityLevel(po,'A0IB')+2) call nS(GetRandomInt(0,3)) call RC(4.5) call DestroyEffect(fx) if po==null then return endif if GetUnitState(po,UNIT_STATE_MANA)<350 then set so=so-NC(324.0/vt()) else call SetUnitState(po,UNIT_STATE_MANA,GetUnitState(po,UNIT_STATE_MANA)-350) endif set xt=GetUnitLoc(po) set ud=Location(GetUnitX(po)+GetRandomInt(-100,100),GetUnitY(po)+GetRandomInt(-100,100)) set bp=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'ewsp',ud,0) call SetUnitColor(bp,PLAYER_COLOR_RED) set rt=qf('o00B',Player(PLAYER_NEUTRAL_PASSIVE),Ec(xt,RMaxBJ(200,RMinBJ(4000,DistanceBetweenPoints(ud,xt)*0.5)),AngleBetweenPoints(xt,ud)),0) call SetUnitFlyHeightBJ(rt,6000.00,9000.00) call RC(0.25) set ot=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'o00B',xt,0) call IssueTargetOrder(ot,"attack",rt) call RC(2.75-np(ud)) call RemoveUnit(rt) call RemoveUnit(ot) call RemoveLocation(xt) if po!=null then set xf=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(po),GetUnitY(po)) set xt=GetRectCenter(D[GetRandomInt(0,H)]) set fx=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",xt) if GetUnitState(po,UNIT_STATE_MANA)>250 then call SetUnitState(po,UNIT_STATE_MANA,GetUnitState(po,UNIT_STATE_MANA)-250) else set so=so-36 endif call SetUnitPositionLoc(po,xt) call RC(0.5) call DestroyEffect(fx) call DestroyEffect(xf) call RemoveLocation(xt) if po!=null then call SetUnitAbilityLevel(po,'A0IB',GetUnitAbilityLevel(po,'A0IB')-2) call CJ(po,null) endif else call RC(0.5) endif call RemoveUnit(bp) call wk(ud,11,-1) call RemoveLocation(ud) if po!=null then call IssueTargetOrder(po,"holybolt",po) call RC(2) if po!=null then call CJ(po,null) endif endif endfunction function it takes nothing returns nothing set PO=CreateTrigger() call TriggerAddAction(PO,function et) endfunction function at takes nothing returns nothing local unit Od=dJ() local boolean nt local location ud local effect Vt=null local effect Et=null local integer Xt local integer i call VS(Od,0) call RC(6) if not Xd(Od)then call TriggerRegisterTimerEvent(qO,14,false) return endif set Mi=Od set nt=RectContainsUnit(vE,Od)or RectContainsUnit(zV,Od)or RectContainsUnit(ZV,Od)or RectContainsUnit(rE,Od)or RectContainsUnit(eE,Od)or RectContainsUnit(xE,Od)or RectContainsUnit(oE,Od) if not nt then set Xt=GetRandomInt(0,H) set ud=zd(D[Xt]) set Vt=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(Od),GetUnitY(Od)) set Et=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) call SetUnitPositionLoc(Od,ud) call PanCameraToTimedLocForPlayer(GetOwningPlayer(Od),ud,0.15) call TriggerSleepAction(Xx) call RemoveLocation(ud) call DestroyEffect(Vt) call DestroyEffect(Et) set Vt=null set Et=null if not Xd(Od)then return endif set ud=GetRectCenter(D[Xt]) else set ud=GetUnitLoc(Od) endif if HC(GetUnitX(po),GetUnitY(po),GetLocationX(ud),GetLocationY(ud),700)then set Vt=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(po),GetUnitY(po)) set Et=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) call SetUnitPositionLoc(po,ud) endif call IssueTargetOrder(po,"attack",Od) if Zi<1.0 then call Yh(to,po,'A0CM',"unholyfrenzy") endif if Vt!=null then call DestroyEffect(Vt) call DestroyEffect(Et) endif call RemoveLocation(ud) call RC(20) if Xd(Od)then call IssuePointOrder(po,"attack",GetUnitX(Od),GetUnitY(Od)) endif set Mi=null endfunction function Ot takes nothing returns nothing set qO=CreateTrigger() call TriggerAddAction(qO,function at) endfunction function Rt takes nothing returns boolean return GetEnteringUnit()==po endfunction function It takes nothing returns nothing local lightning fx if GetUnitAbilityLevel(po,'Avul')>0 then set fx=AddLightning("FORK",true,GetUnitX(ir),GetUnitY(ir),GetUnitX(po),GetUnitY(po)) call SetLightningColor(fx,1,0,1,1) call UnitRemoveAbility(po,'Avul') call SetUnitVertexColor(po,225,225,225,255) call TriggerSleepAction(Xx*0.5) call DestroyLightning(fx) endif set fx=null endfunction function At takes nothing returns nothing set QO=CreateTrigger() call DisableTrigger(QO) call TriggerRegisterEnterRectSimple(QO,ln) call TriggerAddCondition(QO,Condition(function Rt)) call TriggerAddAction(QO,function It) endfunction function Nt takes nothing returns boolean return GetLeavingUnit()==po endfunction function bt takes nothing returns nothing call RC(GetRandomReal(0.1,6.0)) if po==null then return endif if Wi and not RectContainsCoords(XE,GetUnitX(po),GetUnitY(po))then if GetUnitAbilityLevel(po,'Avul')<1 then call UnitAddAbility(po,'Avul') call SetUnitVertexColor(po,0,0,0,176) endif endif endfunction function Bt takes nothing returns nothing set sO=CreateTrigger() call DisableTrigger(sO) call TriggerRegisterLeaveRectSimple(sO,XE) call TriggerAddCondition(sO,Condition(function Nt)) call TriggerAddAction(sO,function bt) endfunction function ct takes nothing returns nothing local integer VG if po==null then return endif set VG=GetHeroStr(po,false) call SetHeroStr(po,VG+1500*C,true) call UnitAddAbility(po,'A0F7') call SetUnitAbilityLevel(po,'A0F7',4) call OC(60) if po==null then return endif call UnitAddAbility(po,'A0HB') call SetHeroStr(po,VG,true) if fe<2 then call OC(60) call UnitRemoveAbility(po,'A0F7') endif endfunction function Ct takes nothing returns nothing set SO=CreateTrigger() call TriggerAddAction(SO,function ct) endfunction function dt takes nothing returns nothing local location xt local location ud local unit bp local unit ot local unit rt local effect fx if po==null then return endif set fx=AddSpecialEffect("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",GetUnitX(po),GetUnitY(po)) call SetUnitAbilityLevel(po,'A0IB',GetUnitAbilityLevel(po,'A0IB')+2) call nS(GetRandomInt(0,3)) call RC(4.5) call DestroyEffect(fx) if po==null then return endif call SetUnitState(po,UNIT_STATE_MANA,RMaxBJ(0,GetUnitState(po,UNIT_STATE_MANA)-350)) set xt=GetUnitLoc(po) set ud=Location(GetUnitX(po)+GetRandomInt(-100,100),GetUnitY(po)+GetRandomInt(-100,100)) set bp=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'ewsp',ud,0) call SetUnitColor(bp,PLAYER_COLOR_RED) set rt=qf('o00B',Player(PLAYER_NEUTRAL_PASSIVE),Ec(xt,RMaxBJ(200,RMinBJ(4000,DistanceBetweenPoints(ud,xt)*0.5)),AngleBetweenPoints(xt,ud)),0) call SetUnitFlyHeightBJ(rt,6000.00,9000.00) call RC(0.25) set ot=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'o00B',xt,0) call IssueTargetOrder(ot,"attack",rt) call RC(2.75-np(ud)) call RemoveUnit(rt) call RemoveUnit(ot) call RemoveLocation(xt) if po!=null then if GetUnitAbilityLevel(po,'A09D')!=2 then call SaveEffectHandle(qi,StringHash("Nemesis"),StringHash("ForceFieldFX"),AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaShield\\ManaShieldCaster.mdl",po,"origin")) call UnitAddAbility(po,'A05C') call UnitAddAbility(po,'A09D') call SetUnitAbilityLevel(po,'A05C',9) call SetUnitAbilityLevel(po,'A09D',2) endif endif call RC(0.5) if po!=null then call SetUnitAbilityLevel(po,'A0IB',GetUnitAbilityLevel(po,'A0IB')-2) endif call RemoveUnit(bp) call wk(ud,11,-1) call RemoveLocation(ud) endfunction function Dt takes nothing returns nothing set tO=CreateTrigger() call TriggerAddAction(tO,function dt) endfunction function ft takes nothing returns nothing local unit Aq if Di>0 then set Di=Di-5 return endif if Pr>=((C+2)/3)then return endif if C>8 then set Di=60 elseif C>5 then set Di=80 else set Di=120 endif set Pr=Pr+1 set Aq=CreateUnit(to,'U00C',GetRandomInt(300,4600),GetRandomInt(7600,13400),GetRandomInt(0,359)) if C<2 then call UnitAddAbility(Aq,'A0I0'+IMaxBJ(IMinBJ(ix-4,3),0)) elseif C<4 then call UnitAddAbility(Aq,'A0I0'+IMaxBJ(IMinBJ(ix-3,3),0)) else call UnitAddAbility(Aq,'A0I0'+IMaxBJ(IMinBJ(ix-2,3),0)) endif call RemoveGuardPosition(Aq) call uf(Aq,0) call UnitAddAbility(Aq,'A097'+J-1) call CJ(Aq,null) set iv=iv+1 endfunction function Ft takes nothing returns nothing call DisableTrigger(UO) call DestroyTrigger(UO) set ei=2 if fe>1 then set Mo=Mo+0.14+0.04*C else set Mo=Mo+0.07+0.02*C endif call TriggerRegisterTimerEvent(SO,0,false) if GetUnitAbilityLevel(po,'A0I9')<3 then call SetUnitAbilityLevel(po,'A0I9',3) endif call UnitResetCooldown(po) call nS(GetRandomInt(19,21)) call TriggerRegisterTimerEvent(HO,0,false) if fe>1 then call SaveEffectHandle(qi,StringHash("Nemesis"),StringHash("ForceFieldFX"),AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaShield\\ManaShieldCaster.mdl",po,"origin")) call UnitAddAbility(po,'A05C') call UnitAddAbility(po,'A09D') call SetUnitAbilityLevel(po,'A05C',9) call SetUnitAbilityLevel(po,'A09D',2) if GetUnitAbilityLevel(po,'A0IB')<3 then call TriggerRegisterTimerEvent(tO,2,false) else call TriggerRegisterTimerEvent(tO,10,false) endif elseif GetUnitAbilityLevel(po,'A0IB')<3 then call TriggerRegisterTimerEvent(PO,1,false) else call TriggerRegisterTimerEvent(PO,10,false) endif endfunction function gt takes nothing returns nothing call DisableTrigger(uO) call DestroyTrigger(uO) set ei=1 call UnitResetCooldown(po) if fe>1 then call UnitAddAbility(po,'Avul') call SetUnitVertexColor(po,0,0,0,176) call nS(GetRandomInt(13,15)) endif call TriggerRegisterUnitEvent(UO,po,EVENT_UNIT_DAMAGED) call TriggerRegisterTimerEvent(UO,0,false) endfunction function Gt takes nothing returns nothing local integer Vk=GetRandomInt(0,999) local real ht local real Ht local real jt=vt() local boolean Jt=false if po==null then return endif if mo>50 then set di[1]=di[1]-1 if(di[1]<1)and(di[0]>-1)then set di[1]=NC(20.0-1.666*vt()) call UnitRemoveAbility(po,V[di[0]]) set di[0]=di[0]-1 if di[0]>-1 then call UnitAddAbility(po,V[di[0]]) endif endif endif if Mo<0.09 then if ZS(1800)then call OS(jt/20.0) endif endif if Zi>0.999 then set Zi=Zi-jt endif if yi>0 then set yi=yi-1 endif set Di=Di-1 if Vk>(839-Qo-10*C)then set Qo=0 call TriggerRegisterTimerEvent(MO,0,false) else set Qo=Qo+5*C endif set ht=GetUnitState(po,UNIT_STATE_LIFE) set Ht=GetUnitState(po,UNIT_STATE_MAX_LIFE) if mo==51 then if((ht/Ht)<0.666)or(ei>0)then set mo=53 set er=100-kv if er>0 then set Jt=true set kv=kv+er call Ph() call Eq(true) call RC(4.5) set kv=kv-er set er=IMinBJ(40,er) set kv=kv+er call Ph() else set er=0 endif endif elseif mo==52 then if((ht/Ht)<0.5)or(ei>0)then if GetUnitAbilityLevel(po,'A0I9')<3 then call SetUnitAbilityLevel(po,'A0I9',3) endif set mo=53 set er=60-kv if er>0 then set Jt=true set kv=kv+er call Ph() call Eq(true) call RC(4.5) set kv=kv-er set er=IMinBJ(40,er) set kv=kv+er call Ph() else set er=0 endif endif elseif mo==53 then if((ht/Ht)<(0.16+0.17*fe))or(ei>0)then if fe>1 then if GetUnitAbilityLevel(po,'A0I9')<3 then call SetUnitAbilityLevel(po,'A0I9',3) endif set mo=54 else set mo=70 endif if C>(3-fe)then call IssueTargetOrder(po,"rejuvination",dJ()) set Jt=true endif endif elseif mo==54 then if ei>0 then set mo=55 call nS(GetRandomInt(16,18)) call UnitAddAbility(po,'A0JB') call UnitAddAbility(po,'A0JC') call RC(1) call UnitRemoveAbility(po,'A0JB') call UnitRemoveAbility(po,'A0JC') set Jt=true elseif(ht/Ht)<0.333 then if ZS(1200)then set mo=55 call nS(GetRandomInt(16,18)) call UnitAddAbility(po,'A0JB') call UnitAddAbility(po,'A0JC') call RC(1) call UnitRemoveAbility(po,'A0JB') call UnitRemoveAbility(po,'A0JC') set Jt=true endif endif elseif mo==55 then if ei>0 then set mo=59 elseif(ht/Ht)<0.25 then call gt() set mo=59 set Jt=true endif elseif mo==59 then call TriggerRegisterTimerEvent(qO,0,false) set mo=60 call TriggerRegisterUnitEvent(wO,po,EVENT_UNIT_DAMAGED) call TriggerRegisterTimerEvent(wO,0,false) set Jt=true elseif(mo>59)and(mo<67)then set mo=mo+1 if GetRandomInt(mo,67)>66 then call aC("ChronoTech Corp. sent your squad an advanced device from the future!") call aC("(scanners detected its presence in the graveyard)") set ir=qf('o013',Player(9),GetRectCenter(ln),120) call SetUnitVertexColor(ir,0,0,0,176) call EnableTrigger(sO) call EnableTrigger(QO) if RectContainsCoords(ln,GetUnitX(po),GetUnitY(po))then call TriggerRegisterTimerEvent(QO,0,false) endif set jt=jt+(jt/2)*(67-mo) set mo=67 set Jt=true endif elseif(mo>66)and(mo<70)then set jt=1 set mo=mo+1 call TriggerRegisterTimerEvent(vR,0,false) set Jt=true elseif mo==70 then if ei>1 then if fe>1 then set mo=71 else set mo=80 endif elseif ht<(8125.0+1875.0*C)then call Ft() if fe>1 then set mo=71 else set mo=80 endif set Jt=true endif elseif mo==71 then if(Zi<1.0)and ZS(700)then set mo=80 call Yh(to,po,'A0CM',"unholyfrenzy") set Jt=true endif endif if not Jt then if(mo>70)and(mo<81)then if ht<(8125.0+1875.0*C)then if fe<2 then if(Zi<1.0)and ZS(1200)then set mo=81 call Yh(to,po,'A0CM',"unholyfrenzy") endif elseif(Zi<1.0)and(yi<90)and(GetUnitAbilityLevel(po,'Avul')<1)then if ZS(700)then set yi=yi+15 endif call Yh(to,po,'A0CM',"unholyfrenzy") endif endif endif if ht1 then set Po=0.750*Po else set Po=0.666*Po endif if Po<(800+200*C)then set Po=0 endif elseif Vk<250 then if(so>-37)and(GetUnitAbilityLevel(po,'A0IB')<3)then if(mo<80)or ZS(1200)then call TriggerRegisterTimerEvent(pO,0,false) endif endif elseif Vk<350 then if ZS(625)then call IssueImmediateOrder(po,"stomp") endif elseif Vk<(354+3*C)then if(fe>1)and(C>1)and(GetRandomInt(0,99)(0.33*kC)then set Wi=false endif call TriggerSleepAction(3*Xx) call EnableTrigger(wO) endfunction function pt takes nothing returns nothing set wO=CreateTrigger() call TriggerAddAction(wO,function Mt) endfunction function Pt takes nothing returns integer local integer i=0 local integer c=1 local integer Lc local integer mc local integer dd local integer qt=0 local boolean Qt=false local integer St=0 local integer Tt=0 loop exitwhen i>8 if AC(Player(i))then set Lc=GetUnitTypeId(X[i]) if Lc=='O005' then set mc=GetUnitAbilityLevel(X[i],'A01V') set dd=IMinBJ(GetHeroSkillPoints(X[i]),16-mc) if(mc+dd)<7 then set c=c+1 elseif(mc+dd)<12 then set c=c+2 else set c=c+3 endif elseif B[i]==12 then if not Qt then set Qt=true set c=c+2 set St=St+3 else set c=c+3 set St=St+5 endif set mc=GetUnitAbilityLevel(X[i],'A0NY') set dd=IMinBJ(GetHeroSkillPoints(X[i]),16-mc) set Tt=Tt+mc+dd elseif B[i]==9 then set St=St+1 if Lc=='O00O' then set c=c+1 endif if qe[i]==3 then set c=c+1 endif elseif B[i]==11 then set c=c+1 set mc=GetUnitAbilityLevel(X[i],'A0KV') set dd=IMinBJ(GetHeroSkillPoints(X[i]),8-mc) set qt=qt+mc+dd elseif B[i]==2 then set St=St+1 elseif B[i]==7 then set St=St+2 endif endif set i=i+1 endloop if GetRandomInt(ModuloInteger(qt,8),8)>7 then set c=c+qt/8+1 else set c=c+qt/8 endif if Qt then call SetUnitAbilityLevel(po,'A0I9',GetUnitAbilityLevel(po,'A0I9')+1) endif call SetUnitAbilityLevel(po,'A0PQ',IMinBJ((Tt+2)/4+1,9)) if St>0 then call UnitAddAbility(po,'A026') call SetUnitAbilityLevel(po,'A026',IMinBJ(St,18)) endif return IMaxBJ(c,1) endfunction function ut takes nothing returns nothing local integer i=0 local integer c=0 call SetUnitAbilityLevel(po,'A0I8',Pt()) if C>1 then loop exitwhen i>8 set i=i+1 if(Pv[i*3+2]>1)or(B[i]==12)then set c=c+1 elseif Pv[i*3+2]==0 then set c=c-1 endif endloop if c>15 then set c=6 elseif c>12 then set c=5 elseif c>9 then set c=4 elseif c>6 then set c=3 elseif c>3 then set c=2 elseif c>0 then set c=1 else set c=0 endif if fe>1 then call SetPlayerTechResearched(to,'R01G',(C-2)/2+1+c) else call SetPlayerTechResearched(to,'R01G',c) endif endif if C<3 then call UnitRemoveAbility(po,'AId7') if C<2 then call UnitAddAbility(po,'AId5') else call UnitAddAbility(po,'AId8') endif endif if C<7 then call UnitRemoveAbility(po,'A0N7') endif if C<4 then call UnitRemoveAbility(po,'A0N6') endif if C<2 then call UnitRemoveAbility(po,'A0N5') endif call TriggerRegisterPlayerUnitEventSimple(BO,to,EVENT_PLAYER_HERO_REVIVABLE) set fv=(fv*2)/3 call OC(GetRandomInt(30+90*(fe-1),60+180*(fe-1))) if po!=null then call ft() endif endfunction function Ut takes nothing returns nothing set WO=CreateTrigger() call TriggerAddAction(WO,function ut) endfunction function wt takes nothing returns integer set di[0]=7+C set di[1]=NC(20.0-1.666*vt()) return di[0] endfunction function Wt takes nothing returns nothing local integer i=5*ev if i>12 then set i=12 endif loop exitwhen ev<1 exitwhen i<1 call OC(24) set i=i-1 endloop endfunction function yt takes nothing returns nothing local real x=GetRandomInt(300,4600) local real y=GetRandomInt(7600,13400) local effect fx local integer i=15 call DisableTrigger(SR) loop exitwhen not IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) set x=GetRandomInt(300,4600) set y=GetRandomInt(7600,13400) exitwhen i<1 set i=i-1 call TriggerSleepAction(0.01) endloop if i<1 then set x=2600 set y=10570 endif call OC(GetRandomInt(11-fe*fe*fe,21-fe*fe*fe*fe)) call Ap() call uk(De+44+C*(C-5)) call OC(GetRandomInt(20,61-fe*fe*fe*fe)) call Wt() call DisplayTimedTextToForce(Fx,12,"|cffffcc00Swwwaaaaat...|r") call SetPlayerTechResearched(to,'R01K',GetPlayerTechCount(to,'R00T',true)) call CreateUnit(to,'n00O',x,y,0) set Mo=0.091+0.001*C call TriggerRegisterPlayerUnitEvent(mO,to,EVENT_PLAYER_UNIT_SUMMON,null) set fx=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x,y) set po=CreateUnit(to,'O010',x,y,0) set ev=ev+1 set iv=iv+1 call AddSpecialEffectTarget("war3mapImported\\WeaponChain.mdx",po,"weapon") call SetUnitColor(po,ConvertPlayerColor(12)) if fe>1 then set Po=0.750*GetUnitState(po,UNIT_STATE_MAX_LIFE) call SaveEffectHandle(qi,StringHash("Nemesis"),StringHash("ForceFieldFX"),AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaShield\\ManaShieldCaster.mdl",po,"origin")) call UnitAddAbility(po,'A05C') call UnitAddAbility(po,'A09D') call SetUnitAbilityLevel(po,'A05C',9) call SetUnitAbilityLevel(po,'A09D',2) else set Po=0.666*GetUnitState(po,UNIT_STATE_MAX_LIFE) set mo=52 endif call TriggerRegisterUnitEvent(uO,po,EVENT_UNIT_DAMAGED) call TriggerRegisterUnitEvent(jO,po,EVENT_UNIT_DEATH) call TriggerSleepAction(0.1) call TriggerRegisterUnitEvent(JO,po,EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(KO,po,EVENT_UNIT_SPELL_EFFECT) if fe>1 then call TriggerRegisterUnitEvent(kO,po,EVENT_UNIT_SPELL_EFFECT) endif call TriggerRegisterUnitEvent(lO,po,EVENT_UNIT_SPELL_EFFECT) call TriggerRegisterUnitEvent(eA,po,EVENT_UNIT_SPELL_EFFECT) call SetUnitAbilityLevel(po,'A0IB',fe) call SetUnitAbilityLevel(po,'A0IE',fe) call SetUnitAbilityLevel(po,'A0IC',C) if fe>1 then if C<5 then call SetUnitAbilityLevel(po,'A0I9',2) endif else if C>4 then call SetUnitAbilityLevel(po,'A0I9',2) else call SetUnitAbilityLevel(po,'A0I9',3) endif endif call UnitAddAbility(po,V[wt()]) call SetHeroStr(po,75+25*C,true) call SetHeroAgi(po,25+C,true) call TriggerRegisterTimerEvent(TO,vt(),false) call TriggerRegisterTimerEvent(WO,0,false) call CJ(po,null) call TriggerSleepAction(Xx) call DestroyEffect(fx) if fe>1 then call TriggerRegisterTimerEvent(VR,GetRandomInt(2,1+C),false) endif endfunction function Yt takes nothing returns nothing set yO=CreateTrigger() call TriggerAddAction(yO,function yt) endfunction function zt takes nothing returns nothing call OC(GetRandomInt(250,450)) if mo<1 then if(fe>1)and(Nv[9]<10)then if GetRandomInt(0,3-Nv[9])<1 then set Nv[9]=10 call TriggerRegisterTimerEvent(ZN,0,false) else set Nv[9]=Nv[9]+1 endif endif if(Nv[0]<1)and(Q[12]>210)and(GetRandomInt(0,2)==0)then call TriggerRegisterTimerEvent(eR,0,false) elseif(GetRandomInt(0-fe/2,3+te)<=te)and(Q[12]>20)then call TriggerRegisterTimerEvent(vR,0,false) endif call TriggerRegisterTimerEvent(YO,0,false) endif endfunction function Zt takes nothing returns nothing set YO=CreateTrigger() call TriggerAddAction(YO,function zt) endfunction function vT takes nothing returns boolean return IsTriggerEnabled(zO) endfunction function eT takes nothing returns string local integer i=GetRandomInt(0,25) if i==0 then return"Hmmm..." elseif i==1 then return"Interesting." elseif i==2 then return"Eureka!" elseif i==3 then return"I wonder..." elseif i==4 then return"Bah!" elseif i==5 then return"Oh..." elseif i==6 then return"I see." endif return"" endfunction function xT takes nothing returns nothing local string s local location tF=GetRandomLocInRect(vE) call IssuePointOrderLoc(bv[0],"move",tF) call RemoveLocation(tF) set tF=null call ac(GetRandomReal(1.6,4.7)) if not IsTriggerEnabled(zO)then return endif call IssueImmediateOrder(bv[0],"stop") set s=eT() if s!="" then call lD(s,bv[0],255,244,0,false,8,1.5) call ac(2.0) else call ac(1.0) endif if IsTriggerEnabled(zO)then call ConditionalTriggerExecute(zO) endif endfunction function oT takes nothing returns nothing set zO=CreateTrigger() call TriggerAddCondition(zO,Condition(function vT)) call TriggerAddAction(zO,function xT) endfunction function rT takes nothing returns nothing local location tF=GetRectCenter(vE) call DisableTrigger(zO) call IssueImmediateOrderBJ(bv[0],"stop") call RemoveGuardPosition(bv[0]) call StoreString(Ae,"scientist","Greeting","You can use this antidote I developed to cure zombies of the virus!") call TriggerSleepAction(1) call IssuePointOrderLocBJ(bv[0],"move",tF) call TriggerRegisterUnitEvent(XR,bv[0],EVENT_UNIT_SELL_ITEM) call TriggerSleepAction(1) call RemoveLocation(tF) call DestroyTrigger(ZO) endfunction function aT takes nothing returns nothing set ZO=CreateTrigger() call TriggerRegisterTimerEventSingle(ZO,360.00) call TriggerAddAction(ZO,function rT) endfunction function VT takes nothing returns nothing local unit Op=GetDyingUnit() if(mo<1)and(GetRandomInt(0,99)<(14+3*J-fe*fe))then call CreateItem('I001',GetUnitX(Op),GetUnitY(Op)) endif if mi then if GetUnitTypeId(Op)=='z004' then set mi=false endif endif endfunction function ET takes real x,real y returns unit local effect fx=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x,y) local unit SJ=CreateUnit(Nr,'z00B',x,y,GetRandomInt(0,359)) set nv=nv+1 call SetUnitAbilityLevel(SJ,'A03I',19) call SetUnitAbilityLevel(SJ,'A018',5) call UnitAddAbility(SJ,'A09B') call UnitAddAbility(SJ,'A0DA') call IssueImmediateOrder(SJ,"manashieldon") call CJ(SJ,null) call TriggerSleepAction(0.1) call DestroyEffect(fx) set fx=null return SJ endfunction function XT takes nothing returns nothing local unit SJ local real OT=Q[12]+20*fe local boolean RT=(fe>0)and(C>1)and(GetRandomInt(0,4-C/3)<(1+Ai[5]))and not mi local integer i local integer j local real x1 local real y1 local real x local real y local integer mc=1 local integer fk=GetRandomInt(0,3) local location ud=null local boolean IT=(fe>0)and(Z!=null)and(GetRandomInt(0,4)<=IMinBJ(1,mo)) local effect fx=null local integer Lc local integer Ef local integer AT=0 if po!=null then if IMaxBJ(GetRandomInt(1,100),11)>(GetUnitState(po,UNIT_STATE_LIFE)/GetUnitState(po,UNIT_STATE_MAX_LIFE)*100)then set IT=true endif endif if IT then set x1=GetUnitX(Z) set y1=GetUnitY(Z) else if fk==0 then set ud=GetRectCenter(Tn) elseif fk==1 then set ud=GetRectCenter(Un) elseif fk==2 then set ud=GetRectCenter(un) else set ud=GetRectCenter(wn) endif endif if OT>520 then set mc=5 set OT=OT-120.0 elseif OT>390 then set mc=4 set OT=OT-90.0 elseif OT>260 then set mc=3 set OT=OT-60.0 elseif OT>130 then set mc=2 set OT=OT-30.0 endif if mo>0 then set i=GetRandomInt(IMinBJ(IMaxBJ(1,NC(OT/75.0)),C),IMinBJ(IMaxBJ(1,NC(OT/30.0)),C+sv))*2/3-1 if i<1 then set i=1 endif set RT=false else set i=GetRandomInt(IMinBJ(IMaxBJ(1,NC(OT/75.0)),C),IMinBJ(IMaxBJ(1,NC(OT/30.0)),C+sv+fe)) endif loop exitwhen i<1 if(i==1)and RT then set mi=true set Lc='z004' set RT=false set Ai[5]=0 set i=2 else set Lc='z00A'+GetRandomInt(0,2) endif if IT then set j=10 loop set x=x1+GetRandomInt(-550,550) set y=y1+GetRandomInt(-550,550) exitwhen not IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY) set j=j-1 if j<1 then set x=x1 set y=y1 exitwhen true endif endloop set fx=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x,y) set SJ=CreateUnit(Nr,Lc,x,y,GetRandomInt(0,359)) else set SJ=Tf(Lc,Nr,ud,bj_UNIT_FACING) endif set nv=nv+1 call SetUnitAbilityLevel(SJ,'A03I',4+3*mc) call SetUnitAbilityLevel(SJ,'A019',mc) call SetUnitAbilityLevel(SJ,'A018',mc) if Lc=='z00C' then call TriggerRegisterUnitEvent(GO,SJ,EVENT_UNIT_SPELL_EFFECT) elseif(Lc=='z00B')and(fe>0)then call UnitAddAbility(SJ,'A04J') call SetUnitVertexColor(SJ,255,255,255,95) endif set Ef=GetRandomInt(0,5-J+fe) if Ef==6 then if GetRandomInt(0,4-(C+2)/3)==0 then set Ef='A0KF' set AT=1 else set Ef='A04E' set AT=1 endif elseif Ef>4 then set Ef='A0KD' if fe>1 then set AT=3 else set AT=2 endif elseif Ef>3 then set Ef='A0KD' if fe>0 then set AT=1+GetRandomInt(1,fe) else set AT=1 endif elseif Ef==3 then set Ef='A0DD' set AT=4-J+fe elseif(Ef==2)and(fe>0)then set Ef='AIsx' set AT=1 elseif Ef==1 then set Ef='A04A' set AT=4-J+fe endif if AT>0 then call UnitAddAbility(SJ,Ef) call SetUnitAbilityLevel(SJ,Ef,AT) endif set AT=GetRandomInt(0,fe*2) if Lc=='z004' then call SetUnitVertexColor(SJ,255,255,255,26) if fe>1 then call TriggerRegisterUnitEvent(hO,SJ,EVENT_UNIT_SPELL_EFFECT) call UnitAddAbility(SJ,'A0FC') call UnitAddAbility(SJ,V[mc*3+8]) call UnitAddAbility(SJ,'Agho') else call UnitAddAbility(SJ,'A09B') call UnitAddAbility(SJ,V[mc*3+2]) call UnitAddAbility(SJ,'A04L') endif elseif AT==4 then call UnitAddAbility(SJ,'A09B') elseif AT>1 then call UnitAddAbility(SJ,'A06Z') elseif AT==1 then call UnitAddAbility(SJ,'A0KE') endif call IssueImmediateOrder(SJ,"manashieldon") call TriggerRegisterUnitEvent(rr,SJ,EVENT_UNIT_DEATH) call CJ(SJ,null) call TriggerSleepAction(0.1) if IT then call DestroyEffect(fx) set fx=null endif set i=i-1 endloop if not IT then call RemoveLocation(ud) set ud=null endif endfunction function NT takes nothing returns nothing set vR=CreateTrigger() call TriggerAddAction(vR,function XT) set rr=CreateTrigger() call TriggerAddAction(rr,function VT) endfunction function bT takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit LC=GetDyingUnit() local effect KD local location tF=GetUnitLoc(LC) set KD=AddSpecialEffectLoc("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",tF) call RemoveUnit(LC) call RC(1.0) call CreateItemLoc('I01M',tF) call RemoveLocation(tF) call DestroyEffect(KD) call DestroyTrigger(jD) endfunction function BT takes nothing returns nothing local unit SJ local real OT=Q[12]+20*fe local integer i=2 local integer mc=2 local integer fk=GetRandomInt(0,3) local location ud local trigger jD set Nv[0]=1 if fk==0 then set ud=GetRectCenter(Tn) elseif fk==1 then set ud=GetRectCenter(Un) elseif fk==2 then set ud=GetRectCenter(un) else set ud=GetRectCenter(wn) endif if OT>520 then set mc=5 elseif OT>390 then set mc=4 elseif OT>260 then set mc=3 endif loop exitwhen i<1 set SJ=CreateUnitAtLoc(Player(10),'z00A'+GetRandomInt(0,2),ud,0) set nv=nv+1 call SetUnitAbilityLevel(SJ,'A03I',4+3*mc) call SetUnitAbilityLevel(SJ,'A04A',mc) call SetUnitAbilityLevel(SJ,'A019',mc) call SetUnitAbilityLevel(SJ,'A018',mc) call IssueImmediateOrder(SJ,"manashieldon") call SetUnitMoveSpeed(SJ,291) call CJ(SJ,null) set i=i-1 endloop set SJ=CreateUnitAtLoc(Player(10),'z007',ud,0) set nv=nv+1 set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,SJ,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function bT) call SetUnitColor(SJ,ConvertPlayerColor(11)) call SetUnitAbilityLevel(SJ,'A08P',2+2*mc) call SetUnitAbilityLevel(SJ,'A0AC',4*mc-1) call IssueImmediateOrder(SJ,"manashieldon") call CJ(SJ,null) call RemoveLocation(ud) endfunction function cT takes nothing returns nothing set eR=CreateTrigger() call TriggerAddAction(eR,function BT) endfunction function CT takes nothing returns nothing local real x local real y local string Vd="pregnant.. televac..soon.." call QD(Vd,bv[1],StringLength(Vd)) call RC(6) if bv[1]!=null then set x=GetUnitX(bv[1]) set y=GetUnitY(bv[1]) if C>5 then call ET(x,y) endif if C>1 then call ET(x,y) endif set Vd="Terminate her!" call QD(Vd,ET(x,y),StringLength(Vd)) endif call RC(13) if bv[1]!=null then call SetUnitUserData(bv[1],0) if GetUnitState(bv[1],UNIT_STATE_LIFE)>1 then set Vd="ok.. ready.. now.." call QD(Vd,bv[1],StringLength(Vd)) endif endif call OC(160) if Nv[11]>1 then return endif set Nv[11]=3 call DestroyEffect(Bv[2]) if(bv[1]!=null)and(GetUnitState(bv[1],UNIT_STATE_LIFE)>1)then set Vd="too..late.. baby..lost.." call QD(Vd,bv[1],StringLength(Vd)) endif set bv[1]=null endfunction function dT takes nothing returns nothing set xR=CreateTrigger() call TriggerAddAction(xR,function CT) endfunction function DT takes integer Bl returns string local integer i=GetRandomInt(1,26-2*Bl) if i==1 then return"Halt!" endif if i==2 then return"Denied!" endif if i==3 then return"Intercepted!" endif if i==4 then return"Got you!" endif if i==5 then return"Cease!" endif if i==6 then return"Desist!" endif if i==7 then return"No way!" endif if i==8 then return"Game over!" endif if i==9 then return"You lose!" endif if i==10 then return"Bad idea!" endif return" " endfunction function fT takes nothing returns nothing set Nv[12]=Nv[12]+1 if(Nv[12]>8)and(Nv[15]<1)then call RC(2) call Il(2) endif endfunction function FT takes nothing returns nothing local unit Op local string Vd local integer i=8 loop exitwhen i<1 set Op=ET(GetRandomInt(-1787,0),GetRandomInt(-5500,-4400)) call TriggerRegisterUnitEvent(Ci,Op,EVENT_UNIT_DEATH) set Vd=DT(i) call QD(Vd,Op,StringLength(Vd)) call RC(GetRandomReal(0.1,2.0)) set i=i-1 endloop endfunction function gT takes nothing returns nothing set oR=CreateTrigger() call TriggerAddAction(oR,function FT) set Ci=CreateTrigger() call TriggerAddAction(Ci,function fT) endfunction function GT takes nothing returns nothing local integer iP=GetPlayerId(GetTriggerPlayer()) if(Nv[13]==1)and Ed(iP)then if not HC(GetUnitX(X[iP]),GetUnitY(X[iP]),GetUnitX(bv[2]),GetUnitY(bv[2]),500)then set Nv[13]=2 call QD("A hidden note!",X[iP],16) call RC(2) call Il(3) call DisableTrigger(rR) call DestroyTrigger(rR) endif endif endfunction function hT takes nothing returns nothing set rR=CreateTrigger() call TriggerAddAction(rR,function GT) endfunction function HT takes nothing returns nothing local player oP=GetTriggerPlayer() local integer iP=GetPlayerId(oP) local boolean jT=false if(mo>0)or(te>0)or vv then call DisableTrigger(aR) call DestroyTrigger(aR) return endif if(X[iP]==null)or not gd(iP)then return endif set iP=0 loop exitwhen iP>8 if AC(Player(iP))then if X[iP]==null then call iC(oP,"Please wait until all players have selected a hero.") return endif if Fd(iP)<10 then set jT=true endif endif set iP=iP+1 endloop if not jT then if C==1 then call iC(oP,"You need to seek out and |r|cffc2c2c2-train|r|cffffcc00 other officers.") else call iC(oP,"You need to seek out and |r|cffc2c2c2-train|r|cffffcc00 officers with less experience.") endif call DisableTrigger(aR) call DestroyTrigger(aR) return endif set iP=0 loop exitwhen iP>8 if AC(Player(iP))then if gd(iP)then set Nv[14]=Nv[14]+1 call iC(Player(iP),"You must help your fellow officers succeed.") elseif Fd(iP)<10 then call iC(Player(iP),"Your training is necessary to ensure humanity's survival. You must succeed.") endif endif set iP=iP+1 endloop call DisableTrigger(aR) call DestroyTrigger(aR) endfunction function JT takes nothing returns nothing set aR=CreateTrigger() call TriggerAddAction(aR,function HT) endfunction function kT takes nothing returns nothing local integer KT=0 local integer iP=0 loop exitwhen iP>8 if AC(Player(iP))then if Fd(iP)<10 then set KT=KT+1 endif endif set iP=iP+1 endloop if GetRandomInt(-25,KT*100/(Nv[14]+1))>10 then call Il(4) else call Il(5) endif endfunction function lT takes nothing returns nothing set nR=CreateTrigger() call TriggerAddAction(nR,function kT) endfunction function LT takes nothing returns boolean return(Nv[10]<1)or(GetUnitPointValue(GetEnteringUnit())==3) endfunction function mT takes nothing returns nothing local real x local real y local integer i=0 if Nv[10]<1 then call Rh(null,bv[0],"I finally finished developing my new device, a force field neutralizer! You'll need it to defeat Nemesis.") set Nv[10]=1 loop exitwhen Ed(i)and RectContainsCoords(vE,GetUnitX(X[i]),GetUnitY(X[i])) set i=i+1 exitwhen i>8 endloop if i>8 then call TriggerRegisterEnterRectSimple(VR,vE) return endif endif call DisableTrigger(VR) set x=GetUnitX(gB) set y=GetUnitY(gB) call KillUnit(gB) call SetItemInvulnerable(CreateItem('I03Z',x,y),true) call DestroyTrigger(VR) endfunction function MT takes nothing returns nothing set VR=CreateTrigger() call TriggerAddCondition(VR,Condition(function LT)) call TriggerAddAction(VR,function mT) endfunction function pT takes nothing returns boolean return GetUnitPointValue(GetEnteringUnit())==3 endfunction function PT takes nothing returns nothing call DisableTrigger(ER) call DestroyEffect(Bv[GetUnitUserData(bv[0])]) call SetUnitUserData(bv[0],0) if te<1 then call Rh(GetEnteringUnit(),bv[0],GetStoredString(Ae,"scientist","Greeting")) endif call If(1,GetRectCenter(vE)) call DestroyTrigger(ER) endfunction function qT takes nothing returns nothing set ER=CreateTrigger() call TriggerRegisterEnterRectSimple(ER,vE) call TriggerAddCondition(ER,Condition(function pT)) call TriggerAddAction(ER,function PT) endfunction function QT takes nothing returns nothing call SetUnitFacingToFaceUnitTimed(GetSellingUnit(),GetBuyingUnit(),0.50) endfunction function sT takes nothing returns nothing set XR=CreateTrigger() call TriggerRegisterUnitEvent(XR,XB,EVENT_UNIT_SELL_ITEM) call TriggerAddAction(XR,function QT) endfunction function ST takes nothing returns boolean return GetItemTypeId(GetSoldItem())=='I03A' endfunction function tT takes nothing returns nothing set Nv[5]=Nv[5]-1 call Ph() if Nv[5]<1 then call aC("All hazardous materials containers have been rid from the city.") set Ai[0]=Ai[0]+2 if te<1 then call PostTriggerExecuteBJ(zE,true) endif endif endfunction function TT takes nothing returns nothing set OR=CreateTrigger() call TriggerAddCondition(OR,Condition(function ST)) call TriggerAddAction(OR,function tT) endfunction function uT takes nothing returns nothing local unit LC=GetRevivableUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer i local location tF if GetUnitTypeId(LC)=='O001' then if not Ed(iP)then set ee[iP]=CreateUnit(GetOwningPlayer(Yv[iP]),'n00G',GetUnitX(Yv[iP]),GetUnitY(Yv[iP]),0) else set ee[iP]=CreateUnit(GetOwningPlayer(Yv[iP]),'n00G',GetUnitX(X[iP]),GetUnitY(X[iP]),0) if HC(GetUnitX(Yv[iP]),GetUnitY(Yv[iP]),GetUnitX(ee[iP]),GetUnitY(ee[iP]),2900)then call iC(Player(iP),"Your robodog died far from you.") else call Yh(Player(iP),X[iP],'A0CO',"innerfire") endif endif return endif if GetUnitPointValue(LC)!=3 then return endif if Mi==LC then set Mi=null endif set tF=GetUnitLoc(LC) if AC(Player(iP))then call Oj(LC,tF,0) endif set Wv[iP]=1.0 if ex[iP]>0 then call SetHeroInt(LC,GetHeroInt(LC,false)+ex[iP],true) set ex[iP]=0 endif set qr[iP]=false if ModuloInteger(cx,10)==iP then if cx>9 then call SetHeroInt(LC,GetHeroInt(LC,false)-20,true) set yv[iP]=yv[iP]-0.10 endif set cx=-1 call CreateItemLoc('I018',tF) endif set i=0 loop exitwhen i>5 call SetItemPositionLoc(UnitItemInSlot(LC,i),tF) set i=i+1 endloop if Mr[iP]>0 then set i=Mr[iP] loop exitwhen i<1 call CreateItemLoc('I00N',tF) set i=i-1 endloop call UnitRemoveAbility(LC,V[mx[iP]-1]) endif call Tg(LC) call RemoveLocation(tF) if Gv and AC(Player(iP))and(not vv)then set Gv=false call TriggerSleepAction(2.0) call aC("|r|cff00ff00HINT|r |cffffcc00Hero corpses do not decay. Medics can Revive, and any hero can use the Revive item.") endif endfunction function UT takes nothing returns nothing set RR=CreateTrigger() call TriggerAddAction(RR,function uT) endfunction function wT takes integer iP returns nothing local integer sH=GetStoredInteger(Ae,I2S(iP),"riotshield_equipped") if(sH>-1)and(sH!=iP)then call UnitRemoveAbility(X[iP],'AId4') call StoreInteger(Ae,I2S(sH),"riotshield_protecting",-1) call iC(Player(sH),"|r|cffff8000NOTE|r |cffffcc00Riot Shield is no longer protecting ally.") call StoreInteger(Ae,I2S(iP),"riotshield_equipped",-1) endif endfunction function WT takes nothing returns nothing local unit Od=GetDyingUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) set Ce[iP]=true set Ex[iP]=0 call UnitRemoveAbility(Od,'Blsh') set Nv[15]=Nv[15]+1 if mo<1 then set io[iP]=io[iP]+1 if io[iP]>0 then if J<2 then if pv[iP*Nx+2]>0 then if io[iP]<3 then call UnitRemoveAbility(Od,'A0FE'+io[iP]-1) endif elseif io[iP]<7 then call UnitRemoveAbility(Od,'A0FE'+io[iP]-1) endif elseif(J<3)and(io[iP]<3)then call UnitRemoveAbility(Od,'A0FE'+io[iP]-1) endif endif endif if ti[iP]>0 then call UnitRemoveAbility(Od,'A0PG'+ti[iP]) set ti[iP]=0 endif call nG(iP) call FK(Od) call wT(iP) if pv[iP*Nx+13]>0 then if IsUnitSelected(bx[iP],Player(iP))then call SelectUnitRemoveForPlayer(bx[iP],Player(iP)) endif call SetUnitPosition(bx[iP],GetUnitX(Od),GetUnitY(Od)) endif if IsUnitType(Od,UNIT_TYPE_ANCIENT)and not uH(Od,iP)then call UnitRemoveType(Od,UNIT_TYPE_ANCIENT) endif if IsUnitType(Od,UNIT_TYPE_PEON)then call UnitRemoveType(Od,UNIT_TYPE_PEON) endif if Do[iP*Co+8]>4 then set Do[iP*Co+8]=5 call SetUnitMoveSpeed(Od,Ld(iP,false)) elseif Do[iP*Co+8]>1 then set Do[iP*Co+8]=1 endif if B[iP]==4 then call SetUnitAbilityLevel(Od,'A02Z',1) elseif B[iP]==5 then set Go[iP*2]=0 set Go[iP*2+1]=1 if Cr[iP]!=null then call DestroyEffect(Cr[iP]) set Cr[iP]=null endif elseif B[iP]==11 then call SetPlayerAbilityAvailable(Player(iP),'A0CN',false) endif if B[iP]==2 then if(Yv[iP]!=null)and(GetUnitTypeId(Yv[iP])=='n005')and(GetUnitAbilityLevel(Yv[iP],'Aloc')>0)then call UnitAddAbility(Yv[iP],'Awan') call IssuePointOrder(Yv[iP],"move",GetUnitX(Od),GetUnitY(Od)) endif endif call TriggerSleepAction(Xx) if ge[iP]!=null then call DestroyEffect(ge[iP]) set ge[iP]=null if pv[iP*Nx+2]>0 then call UnitRemoveAbility(Od,'A0CT') call UnitRemoveAbility(Od,'A0CU') call UnitRemoveAbility(Od,'A0CV') endif if Do[iP*Co+3]>0 then call UnitRemoveAbility(Od,'A0HB') endif endif if Z==Od then call fJ() endif set Od=null endfunction function yT takes nothing returns nothing set IR=CreateTrigger() call TriggerAddAction(IR,function WT) endfunction function YT takes nothing returns nothing call cK(GetDyingUnit()) endfunction function zT takes nothing returns nothing set AR=CreateTrigger() call TriggerAddAction(AR,function YT) endfunction function ZT takes nothing returns nothing call Cj(GetTriggerPlayer(),GetPlayerName(GetTriggerPlayer())+" left the game.") endfunction function vu takes nothing returns nothing set NR=CreateTrigger() call TriggerAddAction(NR,function ZT) endfunction function eu takes integer iP returns nothing local integer xu=GetUnitAbilityLevel(Yv[iP],'A0MT') local integer ou=IMinBJ(8,GetUnitAbilityLevel(X[iP],'A036')) if zv[iP]then return endif if Er[iP]>0 then call UnitRemoveAbility(Yv[iP],V[Er[iP]-1]) endif if xu>15 then set xu=24 elseif xu>14 then set xu=21 elseif xu>10 then set xu=10+2*(xu-10) endif set Er[iP]=xu+ou if Er[iP]>0 then call UnitAddAbility(Yv[iP],V[Er[iP]-1]) endif endfunction function ru takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"hocad_player",XC(jD)) local integer iu=GetStoredInteger(Ae,"hocad_selector",XC(jD)) local unit au=Yv[iP] if au==null then set au=Tr[iP*3+iu] endif if(GetHeroSkillPoints(X[iP])<1)and IsUnitSelected(X[iP],Player(iP))then call SelectUnitForPlayerSingle(au,Player(iP)) call SelectUnitRemoveForPlayer(X[iP],Player(iP)) endif call FlushStoredInteger(Ae,"hocad_selector",XC(jD)) call FlushStoredInteger(Ae,"hocad_player",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function nu takes integer iP,integer iu returns nothing local trigger jD=CreateTrigger() call StoreInteger(Ae,"hocad_player",XC(jD),iP) call StoreInteger(Ae,"hocad_selector",XC(jD),iu) call TriggerAddAction(jD,function ru) call TriggerRegisterTimerEvent(jD,0,false) endfunction function Vu takes unit Od,unit LC returns nothing local integer iT=GetPlayerId(GetOwningPlayer(LC)) local integer i=0 loop exitwhen i>2 exitwhen Ix[iT*3+i]==Od set i=i+1 endloop if i<3 then call hK(Od,LC,i) endif endfunction function Eu takes nothing returns nothing local unit Od=GetLearningUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer Xu=GetLearnedSkill() local integer NH=GetUnitAbilityLevel(Od,Xu) if(Xu=='A000')then set ai[iP]=ai[iP]+1 call SetPlayerTechResearched(Player(iP),'Rhde',IMaxBJ(ai[iP],1)) call SetPlayerTechResearched(Player(iP),'R00N',IMaxBJ(ai[iP],1)) if(B[iP]==12)and(Yv[iP]!=null)then call SetUnitMoveSpeed(Yv[iP],qd(iP)) call iC(Player(iP),"Robot movement speed upgraded.") endif elseif(Xu=='A00A')then if B[iP]==6 then if GetUnitAbilityLevel(Od,'A02C')<18 then call SetUnitAbilityLevel(Od,'A02C',1+NH) endif endif set NH=NH+mx[iP] call UnitRemoveAbility(Od,V[IMaxBJ(NH-2,0)]) call UnitAddAbility(Od,V[IMaxBJ(NH-1,0)]) elseif(Xu=='A008')then if NH==1 then call SetPlayerAbilityAvailableBJ(true,'A0C0',Player(iP)) endif if GetPlayerController(Player(iP))!=MAP_CONTROL_COMPUTER then set Gx[iP*5]=Gx[iP*5]+1 call Gj(iP) call nu(iP,-1) else if Gx[iP*5+1]<8 then set Gx[iP*5+1]=Gx[iP*5+1]+1 elseif Gx[iP*5+2]<3 then set Gx[iP*5+2]=Gx[iP*5+2]+1 elseif Gx[iP*5+3]<3 then set Gx[iP*5+3]=Gx[iP*5+3]+1 else set Gx[iP*5+4]=Gx[iP*5+4]+1 endif call Gj(iP) endif elseif(Xu=='A0O0')then call SetPlayerTechResearched(Player(iP),'Rotr',NH) call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,1) elseif(Xu=='A0NZ')then if zv[iP]then if NH>1 then call SetUnitAbilityLevel(Od,'A0NZ',NH-1) else call UnitRemoveAbility(Od,'A0NZ') endif call ModifyHeroSkillPoints(Od,bj_MODIFYMETHOD_ADD,1) call iC(Player(iP),"Robot's flamethrower cannot be upgraded while it's inactive.") else if NH>1 then call UnitRemoveAbility(Yv[iP],'A0DG'+NH) endif call UnitAddAbility(Yv[iP],'A0DH'+NH) call SetHeroAgi(Yv[iP],GetHeroAgi(Yv[iP],false)+1,true) call SetUnitAbilityLevel(Yv[iP],'A0OA',1+bC(NH+2,3)) endif elseif(Xu=='A0NY')then call SetPlayerTechResearched(Player(iP),'R01Z',NH) elseif(Xu=='A04B')then call SetPlayerTechResearchedSwap('R00F',NH,Player(iP)) elseif(Xu=='A04C')then call SetPlayerTechResearchedSwap('R00G',NH,Player(iP)) elseif(Xu=='A04M')then call SetPlayerTechResearchedSwap('R00H',NH,Player(iP)) if NH>9 then call SetPlayerAbilityAvailableBJ(false,'A09E'+NH-10,Player(iP)) call ac(1.0) endif call SetUnitAbilityLevelSwapped('A09E'+IMaxBJ(0,NH-9),Od,IMaxBJ(1,NH-8)) elseif(Xu=='A0A7')then call SetPlayerTechResearchedSwap('R00L',NH,Player(iP)) call SetPlayerTechResearchedSwap('R00U',NH,Player(iP)) call SetUnitAcquireRangeBJ(Od,1200.00+40*NH) if NH==1 then call UnitAddAbility(Od,'A0BC') endif call SetUnitAbilityLevel(Od,'A0BC',NH+2) elseif(Xu=='A01V')then call SetPlayerTechResearched(Player(iP),'Rhse',IMaxBJ(1,NH-7)) elseif(Xu=='A00K')then call SetPlayerTechResearched(Player(iP),'Rhar',IMinBJ(IMaxBJ(NH-4,0),8)) if NH==1 then call SetPlayerTechResearched(Player(iP),'Rhcd',1) endif elseif(Xu=='A01K')then call SetPlayerTechResearchedSwap('Rhpt',NH,Player(iP)) elseif(Xu=='A00C')then call SetPlayerTechResearched(Player(iP),'Rhar',NH/2) if NH==1 then call UnitAddAbility(Od,'A06L') endif call SetUnitAbilityLevel(Od,'A06L',NH) elseif(Xu=='A046')then call SetPlayerTechResearchedSwap('R00C',NH,Player(iP)) elseif(Xu=='A051')then if NH==1 then call UnitAddAbility(Od,'A0K4') endif if pv[iP*Nx+4]>0 then call SetUnitAbilityLevel(Od,'A0K4',NH+8) else call SetUnitAbilityLevel(Od,'A0K4',NH) endif elseif(Xu=='A0EM')then if NH==1 then call UnitAddAbility(Od,'A0K5') endif call SetUnitAbilityLevel(Od,'A0K5',NH) elseif(Xu=='A0B0')or(Xu=='A0B1')or(Xu=='A0B2')then if Yv[iP]!=null then call Vu(Od,Yv[iP]) endif if Xu=='A0B0' then if NH>12 then call SetHeroInt(Od,GetHeroInt(Od,false)+2,true) else call SetHeroInt(Od,GetHeroInt(Od,false)+1,true) endif call Sg(Od) endif elseif(Xu=='A036')then call SuspendHeroXPBJ(true,Yv[iP]) call SetHeroLevelBJ(Yv[iP],NH+1,false) call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_SUB,1) call SuspendHeroXPBJ(false,Yv[iP]) call SetUnitAbilityLevel(Yv[iP],'A037',NH+1) call SetPlayerTechResearched(Player(iP),'R009',NH) if NH<9 then call eu(iP) endif if NH<17 then if NH>1 then call UnitRemoveAbility(Yv[iP],'A0HI'+NH) endif call UnitAddAbility(Yv[iP],'A0HJ'+NH) if not zv[iP]then call Dj(Yv[iP],25) endif endif call SetUnitAbilityLevel(Yv[iP],'A03S',IMinBJ(1+NH/2,9)) if(Vo[iP]>0)then set Vo[iP]=Vo[iP]+GetHeroAgi(Yv[iP],false)-1 call SetHeroAgi(Yv[iP],1,true) endif call SetHeroStr(Yv[iP],75+25*GetUnitAbilityLevel(Yv[iP],'A03S')+15*Vo[iP],true) if qe[iP]==1 then call SetUnitAbilityLevel(Yv[iP],'Aihn',IMinBJ(2+NH/2,6)) call SetPlayerTechResearched(Player(iP),'R01U',IMinBJ(NH,8)) elseif qe[iP]==2 then call SetPlayerTechResearched(Player(iP),'R00S',IMinBJ(1+NH/4,5)) endif elseif(Xu=='A02Y')then if NH==1 then call UnitAddAbility(Od,'A0K7') endif if kd(Od,'I023',null)or kd(bx[iP],'I024',null)then call SetUnitAbilityLevel(Od,'A0K7',NH+8) else call SetUnitAbilityLevel(Od,'A0K7',NH) endif elseif(Xu=='A0L0')or(Xu=='A0L1')or(Xu=='A0L2')then set tr[iP*19+5*(Xu-'A0L0')]=tr[iP*19+5*(Xu-'A0L0')]+1 call Hj(iP) call nu(iP,Xu-'A0L0') endif if B[iP]==7 then set R[iP]=R[iP]+1 set O[iP*F+R[iP]-1]=Xu endif set Od=null endfunction function Ou takes nothing returns nothing set bR=CreateTrigger() call TriggerAddAction(bR,function Eu) endfunction function Ru takes unit Od,integer Xu returns nothing local integer NH local player oP=null if(Xu=='A0MW')or(Xu=='A00F')then set oP=GetOwningPlayer(Od) set NH=GetUnitAbilityLevel(Od,Xu)+Do[GetPlayerId(oP)*Co] set Ar[GetPlayerId(oP)]=NH call SetPlayerTechResearched(oP,'R00K',IMinBJ(NH,10)) if(Xu=='A0MW')then call SetPlayerTechResearched(oP,'Rhri',NH) elseif(Xu=='A00F')then if NH==1 then call UnitAddAbility(Od,'A0H6') else call SetUnitAbilityLevel(Od,'A0H6',NH) call SetUnitAbilityLevel(Od,'A0CK',NH) endif endif elseif(Xu=='A003')then set oP=GetOwningPlayer(Od) set NH=GetUnitAbilityLevel(Od,Xu)+Do[GetPlayerId(oP)*Co] set Ar[GetPlayerId(oP)]=NH call SetPlayerTechResearched(oP,'R00V',IMinBJ(NH,18)) if do[GetPlayerId(oP)]==1 then if NH==1 then if B[GetPlayerId(oP)]==10 then call UnitAddAbility(Od,'A0KL') else call UnitAddAbility(Od,'A0HF') endif else if B[GetPlayerId(oP)]==10 then call SetUnitAbilityLevel(Od,'A0KL',NH) else call SetUnitAbilityLevel(Od,'A0HF',NH) endif endif else if NH==1 then if B[GetPlayerId(oP)]==10 then call UnitAddAbility(Od,'A0KK') else call UnitAddAbility(Od,'A0H7') endif else if B[GetPlayerId(oP)]==10 then call SetUnitAbilityLevel(Od,'A0KK',NH) else call SetUnitAbilityLevel(Od,'A0H7',NH) endif endif endif call SetPlayerTechResearched(oP,'Rhfl',1) elseif(Xu=='A004')or(Xu=='A04W')then set oP=GetOwningPlayer(Od) set NH=GetUnitAbilityLevel(Od,Xu)+Do[GetPlayerId(oP)*Co] set Ar[GetPlayerId(oP)]=NH call SetPlayerTechResearched(oP,'R00J',IMinBJ(NH,18)) if(Xu=='A004')then call SetUnitAbilityLevel(Od,'A0H5',NH) call SetUnitAbilityLevel(Od,'A0H9',NH) call SetPlayerTechResearched(oP,'R010',NH) elseif(Xu=='A04W')then if NH==1 then call UnitAddAbility(Od,'A0DH') else call SetUnitAbilityLevel(Od,'A0DH',NH) call UnitRemoveAbility(Od,'A0DG'+NH) endif call UnitAddAbility(Od,'A0DH'+NH) endif elseif(Xu=='A0KV')then set oP=GetOwningPlayer(Od) set NH=GetUnitAbilityLevel(Od,Xu)+Do[GetPlayerId(oP)*Co] set Ar[GetPlayerId(oP)]=NH call SetPlayerTechResearched(oP,'R01P',IMinBJ(NH,10)) if NH==1 then call UnitAddAbility(Od,'A0KW'+GetUnitTypeId(Od)-'O01B') else call SetUnitAbilityLevel(Od,'A0KW'+GetUnitTypeId(Od)-'O01B',NH) endif call SetPlayerTechResearched(oP,'R01N'+GetUnitTypeId(Od)-'O01B',IMinBJ(NH,10)) call hj(GetPlayerId(oP)) set ji=ji+1 endif endfunction function Iu takes nothing returns boolean return GetUnitPointValue(GetLearningUnit())==3 endfunction function Au takes nothing returns nothing call Ru(GetLearningUnit(),GetLearnedSkill()) endfunction function Nu takes nothing returns nothing set BR=CreateTrigger() call TriggerAddCondition(BR,Condition(function Iu)) call TriggerAddAction(BR,function Au) endfunction function bu takes unit LC,integer iP returns nothing local string Vd="" if B[iP]==4 then if GetUnitAbilityLevel(LC,'B01C')<1 then call UnitRemoveAbility(LC,'A04F'+Fv[iP]) call UnitAddAbility(LC,'A04G'+Fv[iP]) endif set pv[iP*Nx+1]=pv[iP*Nx+1]+6 call SetUnitMoveSpeed(LC,Ld(iP,false)) set Vd="Movement speed increased. Cloak delay reduced." elseif B[iP]==1 then call SetPlayerTechResearchedSwap('Rhfc',Fv[iP]+1,Player(iP)) set Vd="Adrenaline cooldown reduced." elseif B[iP]==9 then call ModifyHeroSkillPoints(LC,bj_MODIFYMETHOD_ADD,1) set Vd="Extra skill point available." elseif B[iP]==6 then call SetPlayerTechResearched(Player(iP),'R008',GetPlayerTechCount(Player(iP),'R008',true)+1) set Vd="Rockets upgraded to deliver more damage." elseif B[iP]==5 then call SetPlayerTechResearched(Player(iP),'Remg',Fv[iP]) set Vd="Flamethrower enhanced with more advanced catalyst." elseif B[iP]==2 then call SetPlayerTechResearched(Player(iP),'Rhan',5+Fv[iP]) set Vd="Pep-Talk improved." elseif B[iP]==7 then call SetPlayerTechResearched(Player(iP),'R01D',Fv[iP]) set Vd="Droids are tougher." call gj(iP,'A041') elseif B[iP]==10 then call UnitAddItemByIdSwapped('I014',LC) call UnitAddItemByIdSwapped('I015',LC) call UnitAddItemByIdSwapped('I016',LC) call UnitAddItemByIdSwapped('I021',LC) set Vd="Additional implants installed." elseif B[iP]==8 then call SetUnitAbilityLevelSwapped('A0AX',LC,Fv[iP]+3) set Vd="Mind Rot radius increased." elseif B[iP]==11 then set tr[iP*19+10]=tr[iP*19+10]+1 call Hj(iP) set Vd="Custom Loadout received an additional point for allocation." elseif B[iP]==12 then call SetUnitAbilityLevel(LC,'A0NR',1+Fv[iP]) set Vd="Broadcasting the signal drains less energy." endif call iC(Player(iP),Vd) endfunction function Bu takes unit LC,integer iP,integer mc returns nothing local player oP=Player(iP) local integer rd=0 if GetRandomInt(0,999+io[iP]*500)0 then if GetRandomInt(0,999)0 then call SetPlayerState(oP,PLAYER_STATE_RESOURCE_LUMBER,GetPlayerState(oP,PLAYER_STATE_RESOURCE_LUMBER)+rd) if vv then return endif if rd==1 then call iC(oP,"You have earned a valor point!") elseif rd==2 then call iC(oP,"You have earned a couple valor points!") else call iC(oP,"You have earned a few valor points!") endif endif endfunction function cu takes nothing returns boolean return GetUnitPointValue(GetLevelingUnit())==3 endfunction function Cu takes nothing returns nothing local unit LC=GetLevelingUnit() local integer mc=GetHeroLevel(LC) local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer i if(mc>49)and not(gv[iP]<1)then if pv[iP*Nx+5]>0 then set gv[iP]=0.3846 else set gv[iP]=0.20 endif set i=GetHeroXP(LC)-256000 call SetHeroXP(LC,256000,false) call AddHeroXPSwapped(NC(i*gv[iP]),LC,true) endif if mc>50 then if pv[iP*Nx+5]>0 then set gv[iP]=gv[iP]-0.0577 else set gv[iP]=gv[iP]-0.03 endif else set Pi[iP]=Pi[iP]+1 endif if not vv then set Q[iP]=Q[iP]+IMaxBJ(1,bC(mc,12+Ko[iP])) set Q[iP+13]=Q[iP+13]+IMaxBJ(1,bC(mc,17+Ko[iP])) endif call RC(1.0) if Ed(iP)then call Sg(LC) endif if mc>50 then set Fv[iP]=mc-50 call bu(LC,iP) endif call TriggerRegisterTimerEvent(aI,3,false) call Bu(LC,iP,mc) if(zo[iP]==0)and(mc>=(27+3*zo[9]))then set zo[iP]=1 set zo[9]=zo[9]+1 call SetPlayerTechResearched(to,'R01F',zo[9]) call SetPlayerTechResearched(Nr,'R01F',zo[9]) endif endfunction function du takes nothing returns nothing set cR=CreateTrigger() call TriggerAddCondition(cR,Condition(function cu)) call TriggerAddAction(cR,function Cu) endfunction function Du takes nothing returns nothing local unit LC=GetLevelingUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) local integer NH=GetHeroLevel(LC) local real n=1.05+0.05*((NH+9)/10) if n>Rr then set Rr=n endif if NH<50 then if NH>=GetPlayerTechCount(oP,'Rhan',true)*10 then call SetPlayerTechResearched(oP,'Rhan',bC(NH,10)+1) call iC(oP,"Pep-Talk improved.") endif endif if Yv[iP]!=null then if GetUnitState(Yv[iP],UNIT_STATE_LIFE)>1 then if GetUnitTypeId(Yv[iP])=='O00E' then if NH>50 then set NH=30 elseif NH>10 then set NH=10+(NH-10)/2 endif if GetHeroLevel(Yv[iP])3)and(Yv[iP]!=null)and(GetUnitTypeId(Yv[iP])=='n005')then set Pi[iP]=Pi[iP]-4 set NH=GetUnitAbilityLevel(Yv[iP],'A094') if NH<5 then call SetUnitAbilityLevel(Yv[iP],'A094',NH+1) call iC(oP,"You are adored even more!") else set NH=GetUnitAbilityLevel(Yv[iP],'ACrn') if NH<5 then call SetUnitAbilityLevel(Yv[iP],'ACrn',GetUnitAbilityLevel(Yv[iP],'ACrn')+1) call iC(oP,"Adoring woman's defib upgraded!") else set Pi[iP]=-99 call iC(oP,"You are eternally loved!") call TriggerRegisterUnitEvent(vA,Yv[iP],EVENT_UNIT_DEATH) call DisableTrigger(se[iP]) call DestroyTrigger(se[iP]) endif endif endif endif endif set LC=null set oP=null endfunction function fu takes nothing returns nothing set CR=CreateTrigger() call TriggerAddAction(CR,function Du) endfunction function Fu takes nothing returns nothing local unit LC=GetLevelingUnit() local player oP=GetOwningPlayer(LC) local integer NH=GetHeroLevel(LC) if ModuloInteger(NH,10)==0 then call IncUnitAbilityLevel(LC,'A047') call iC(oP,"Backup battery recharge time reduced.") endif set LC=null set oP=null endfunction function gu takes nothing returns nothing set dR=CreateTrigger() call TriggerAddAction(dR,function Fu) endfunction function Gu takes nothing returns nothing local unit LC=GetLevelingUnit() local player oP=GetOwningPlayer(LC) local integer NH=GetHeroLevel(LC) if ModuloInteger(NH,10)==0 then call IncUnitAbilityLevel(LC,'A0E9') call iC(oP,"Combustion efficiency improved.") endif set LC=null set oP=null endfunction function hu takes nothing returns nothing set DR=CreateTrigger() call TriggerAddAction(DR,function Gu) endfunction function Hu takes unit LC,integer mc returns nothing local player oP=GetOwningPlayer(LC) if GetPlayerTechCount(oP,'R000',true)>=mc then return endif call SetPlayerTechResearched(oP,'R000',mc) call SetUnitAbilityLevel(LC,'A0KI',mc) call iC(oP,"Increased Revive's chance to require half energy and recharge instantly.") set oP=null endfunction function ju takes nothing returns nothing local unit LC=GetLevelingUnit() local integer Pj=GetHeroLevel(LC) if Pj>=35 then call Hu(LC,8) elseif Pj>=30 then call Hu(LC,7) elseif Pj>=25 then call Hu(LC,6) elseif Pj>=20 then call Hu(LC,5) elseif Pj>=15 then call Hu(LC,4) elseif Pj>=10 then call Hu(LC,3) elseif Pj>=5 then call Hu(LC,2) endif set LC=null endfunction function Ju takes nothing returns nothing set fR=CreateTrigger() call TriggerAddAction(fR,function ju) endfunction function ku takes nothing returns nothing local unit LC=GetLevelingUnit() local player oP=GetOwningPlayer(LC) local integer Pj=GetHeroLevel(LC) if(Pj>=20)then if GetUnitAbilityLevel(LC,'A0AX')<3 then call SetUnitAbilityLevel(LC,'A0AX',3) call iC(oP,"Mind Rot cooldown reduced.") endif elseif(Pj>=10)then if GetUnitAbilityLevel(LC,'A0AX')<2 then call SetUnitAbilityLevel(LC,'A0AX',2) call iC(oP,"Mind Rot cooldown reduced.") endif endif set LC=null set oP=null endfunction function Ku takes nothing returns nothing set FR=CreateTrigger() call TriggerAddAction(FR,function ku) endfunction function lu takes nothing returns boolean local integer Pj=GetHeroLevel(GetLevelingUnit()) return(Pj==10)or(Pj==20)or(Pj==30)or(Pj==40) endfunction function Lu takes nothing returns nothing local unit LC=GetLevelingUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) call SetUnitAbilityLevel(LC,'A0KS',GetUnitAbilityLevel(LC,'A0KS')+1) if mx[iP]>0 then call UnitRemoveAbility(LC,V[mx[iP]-1]) endif set mx[iP]=mx[iP]+1 call UnitAddAbility(LC,V[mx[iP]-1]) call iC(oP,"Advanced generator improved.") set LC=null set oP=null endfunction function mu takes nothing returns nothing set gR=CreateTrigger() call TriggerAddCondition(gR,Condition(function lu)) call TriggerAddAction(gR,function Lu) endfunction function Mu takes player oP,integer iP,integer NH returns integer local integer el local integer nD if GetUnitAbilityLevel(X[iP],'A039')>1 then return 1 endif if not Ed(iP)then if ix>2 then return 2 else return 0 endif endif if NH<0 then set NH=GetHeroLevel(X[iP]) endif if(NH>50)or(IMinBJ(99,GetRandomInt(-1,150))<(bC(kv,10)*bC(kv,10)))then set el=Eo[iP]-1 set nD=GetRandomInt(1,13) if(nD!=el)and(nD!=5)then if(nD==7)or(nD==8)then call nG(iP) elseif nD==13 then set nD=14 if nD==el then return 400 endif endif call kj(nD,iP,true) call jj(nD,iP) call iC(oP,"You have mutated! ("+VD(nD,true)+")") if U==oP then call PlaySoundBJ(FE) endif if nD==2 then set NH=IMinBJ(io[iP],6) loop exitwhen NH<3 call UnitAddAbility(X[iP],'A0FE'+NH-1) set NH=NH-1 endloop endif if nD==9 then call Ph() endif return 1 else return 400 endif endif if ix>2 then return 2 else return 0 endif endfunction function pu takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"mavmutatetimer",XC(jD)) local integer i=GetStoredInteger(Ae,"mavmutatetimer_i",I2S(iP)) local integer NH call OC(IMaxBJ(GetRandomInt(200,400)-i,20)) set NH=Mu(Player(iP),iP,-1) if NH==1 then call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),1) call FlushStoredInteger(Ae,"mavmutatetimer",XC(jD)) call DestroyTrigger(jD) elseif NH>2 then call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),NH) call TriggerRegisterTimerEvent(jD,0,false) else call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),i*i) call TriggerRegisterTimerEvent(jD,0,false) endif endfunction function Pu takes nothing returns nothing local player oP=GetOwningPlayer(GetLevelingUnit()) local integer iP=GetPlayerId(oP) local integer NH=GetHeroLevel(X[iP]) local trigger jD if NH<3 then elseif NH<19 then call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,1) elseif NH<27 then if ModuloInteger(NH,2)==0 then call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,1) endif elseif NH<36 then if ModuloInteger(NH+1,3)==0 then call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,1) endif elseif NH==40 then call ModifyHeroSkillPoints(Yv[iP],bj_MODIFYMETHOD_ADD,1) endif if GetStoredInteger(Ae,"mavmutatetimer_i",I2S(iP))>0 then call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),GetStoredInteger(Ae,"mavmutatetimer_i",I2S(iP))*3/2) return endif set NH=Mu(oP,iP,NH) if NH<2 then if NH==1 then call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),1) endif return endif set jD=CreateTrigger() call TriggerAddAction(jD,function pu) call StoreInteger(Ae,"mavmutatetimer",XC(jD),iP) call StoreInteger(Ae,"mavmutatetimer_i",I2S(iP),NH) call TriggerRegisterTimerEvent(jD,0,false) endfunction function qu takes nothing returns nothing set GR=CreateTrigger() call TriggerAddAction(GR,function Pu) endfunction function Qu takes integer iP returns nothing local integer NH local integer dd if(Yv[iP]==null)or zv[iP]then return endif set NH=GetHeroLevel(X[iP]) if NH>50 then set NH=50 endif if GetHeroLevel(Yv[iP])29 then call SuspendHeroXPBJ(false,LC) endif if(Mh>0)and(GetRandomInt(0,29)1)and not vv then call RC(2.0) set YM=YM-2 call aC("|r|cff00ff00HINT|r |cffffcc00Enter the chat string |r|cffffffff-kick "+DD(ZH)+"|r|cffffcc00 to vote to kick this player out of the game.") endif endif call OC(YM) set Hv[ZH*9+ZH]=IMaxBJ(0,Hv[ZH*9+ZH]-1) set ax[zu]=-1 endif endif endif endif endfunction function Zu takes nothing returns nothing set kR=CreateTrigger() call TriggerAddAction(kR,function yu) endfunction function vU takes integer ed returns nothing local integer i if C<1 then return endif set ed=ed/C if ed<1 then return endif set i=0 loop exitwhen i>8 if(Q[i]>0)and IC(Player(i))then call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD)+ed+Oi[i]) call iC(Player(i),"+"+I2S(ed+Oi[i])+" credits") endif set i=i+1 endloop endfunction function eU takes nothing returns nothing local integer i=0 if not vv then call aC("Hazard Pay") if te>0 then call vd(180*C,true) else call vU(10*(J+7)*C+S*C) endif endif call TriggerSleepAction(1) if(fe>0)and(Fe>1)then if(fe>1)or yD()then set xr=xr+C if xr>5 then set xr=xr-9 set Fe=Fe+1 if ix>3 then set hi=hi+1 endif if ix>4 then set Fe=Fe+(ix-3)/2 if ix>6 then set Hi=Hi+(ix-5)/2 set hi=hi+(ix-5)/2 endif endif call TriggerRegisterTimerEvent(YX,0,false) endif endif endif loop exitwhen i>8 if pv[i*Nx+11]>0 then if yD()then set pv[i*Nx+11]=3210 call ModifyHeroStat(bj_HEROSTAT_AGI,X[i],bj_MODIFYMETHOD_ADD,bC(pv[i*Nx+11],100)) else set pv[i*Nx+11]=3200 call ModifyHeroStat(bj_HEROSTAT_AGI,X[i],bj_MODIFYMETHOD_SUB,bC(pv[i*Nx+11],100)) endif call SetUnitMoveSpeed(X[i],Ld(i,false)) endif set i=i+1 endloop endfunction function xU takes nothing returns nothing set KR=CreateTrigger() call TriggerRegisterGameStateEventTimeOfDay(KR,EQUAL,8.00) call TriggerRegisterGameStateEventTimeOfDay(KR,EQUAL,17.00) call TriggerAddAction(KR,function eU) endfunction function oU takes nothing returns nothing local real Nd=xx set xx=0.0 if Nd>0.0 then call Ad(Nd) endif endfunction function rU takes nothing returns nothing set lR=CreateTrigger() call TriggerRegisterTimerEventPeriodic(lR,3.0) call TriggerAddAction(lR,function oU) endfunction function iU takes nothing returns nothing local player oP=GetTriggerPlayer() local integer iP=GetPlayerId(oP) local integer yC=Fd(iP) if vv then return endif if yC<3 then call iC(oP,"You must be at least a Detective (Rank 4) to use this feature.") elseif(J<3)or(te!=0)then call iC(oP,"This feature only works in Normal difficulty games.") elseif Hv[iP*9+iP]>0 then call iC(oP,"You cannot use this feature so soon after killing an ally.") else if ej(4+2*yC)then call aC("All dead Officer I heroes less than level "+I2S(5+2*yC)+" have been revived by "+AD(iP)+".") else call iC(oP,"There are no dead Officer I heroes under level "+I2S(5+2*yC)+".") endif endif endfunction function aU takes nothing returns nothing set LR=CreateTrigger() call TriggerAddAction(LR,function iU) call DisableTrigger(LR) endfunction function nU takes nothing returns nothing local player oP=GetTriggerPlayer() local integer iP=GetPlayerId(oP) local integer yC=Fd(iP) if vv then return endif if(J>1)or(ze<1)or(Cx[9]>9)or(fe>0)then if Cx[9]>9 then call iC(oP,"Perfect victory conditions are already being enforced.") else call iC(oP,"This feature is only available on Insane difficulty within the first 60 minutes.") endif return endif if yC<6 then call iC(oP,"You must be at least a Captain (Rank 7) to use this feature.") return endif if Cx[iP]>0 then call iC(oP,"Vote recalculated.") else set Cx[iP]=1 call iC(oP,"You voted to enforce perfect victory conditions.") set Cx[9]=Cx[9]+1 endif if Cx[9]>bC(C,2)then set Cx[9]=10 call aC("Vote passed. Perfect victory conditions are now being enforced.") call DisableTrigger(mR) call DestroyTrigger(mR) endif endfunction function VU takes nothing returns nothing set mR=CreateTrigger() call TriggerAddAction(mR,function nU) endfunction function EU takes integer XU returns boolean local integer OU=-1 local integer i=0 loop if Ed(i)then if OU>-1 then return false else set OU=i endif endif set i=i+1 exitwhen i>8 endloop return OU==XU endfunction function RU takes integer IU returns integer if Hv[IU*9+IU]>0 then return 100 else return ve[IU] endif endfunction function AU takes integer XU returns boolean local integer i=0 loop exitwhen i>8 if(i!=XU)and(Hv[XU*9+i]>0)then return false endif set i=i+1 endloop return true endfunction function NU takes integer XU returns nothing local integer i=0 loop exitwhen i>8 if i!=XU then set Hv[XU*9+i]=0 endif set i=i+1 endloop endfunction function bU takes integer gF returns integer if gF<2 then return 1 elseif gF<4 then return 250 elseif gF==4 then return 300 elseif gF==5 then return 350 elseif gF==6 then return 425 elseif gF==7 then return 500 elseif gF==8 then return 550 elseif gF==9 then return 600 endif return 0 endfunction function BU takes integer WC returns integer local integer cU=0 loop exitwhen WC<1 if WC==1 then set cU=cU+150 else set cU=cU+25 endif set WC=WC-1 endloop return cU endfunction function CU takes integer XU returns boolean local integer dU=0 local integer i=0 loop exitwhen i>8 if i==XU then set dU=dU+BU(Hv[XU*9+i]) else set dU=dU+Hv[XU*9+i] endif set i=i+1 endloop if dU>=bU(C)then if IC(Player(XU))and not Xe[XU]and yK()then set Xe[XU]=true if(Hv[XU*9+XU]>0)or not EU(XU)then call Jl(XU,TK(XU,0.25)) call CustomDefeatBJ(Player(XU),"Voted out.") else call Jl(XU,TK(XU,0.50)) set i=0 loop if Hv[XU*9+i]>0 then set Xe[i]=true endif set i=i+1 exitwhen i>8 endloop call CustomDefeatBJ(Player(XU),"Mutiny!") endif endif call NU(XU) call Cj(Player(XU),ID(XU)+" has been voted out of the game.") return true endif return false endfunction function DU takes nothing returns nothing local string s=GetEventPlayerChatString() local player oP=GetTriggerPlayer() local integer IU local integer XU if vv then return endif set XU=FD(oP,s,"-kick","kick","vote to kick the corresponding player") if XU<0 then return endif set IU=GetPlayerId(oP) if IU==XU then call iC(oP,"You cannot vote to kick yourself out of the game.") return endif if GetPlayerSlotState(Player(XU))!=PLAYER_SLOT_STATE_PLAYING then call iC(oP,"That player is not in the current game.") return endif if not IC(Player(XU))then call iC(oP,"You cannot vote to kick computer players out of the game.") return endif if Hv[XU*9+IU]>0 then return endif if pr[IU]>29 then call iC(oP,"Because of your numerous kick attempts, you must wait before you can vote again.") return endif set pr[IU]=pr[IU]+1 if pr[IU]>29 then call iC(oP,"Because of your numerous kick attempts, you must wait before you can vote again.") call OC(30) set pr[IU]=pr[IU]-2 return endif if not AU(XU)then set Hv[XU*9+IU]=RU(IU) call CU(XU) return endif if(Hv[XU*9+XU]<1)and EU(XU)then call aC("|cffff8000WARNING|r |cffffcc00If the last surviving officer is kicked out of the game, mutinous officers will not earn a rank code.") endif call aC(ID(IU)+" initiated a vote to kick "+ID(XU)+" out of the game.") call aC("Enter the chat string |r|cffffffff-kick "+DD(XU)+"|r|cffffcc00 if you think "+AD(XU)+" should be kicked.") set Hv[XU*9+IU]=RU(IU) if not CU(XU)then call OC(30) if not vv and(GetPlayerSlotState(Player(XU))==PLAYER_SLOT_STATE_PLAYING)then call aC("The vote to kick "+ID(XU)+" failed.") endif call NU(XU) endif endfunction function fU takes nothing returns nothing set MR=CreateTrigger() call TriggerAddAction(MR,function DU) endfunction function FU takes nothing returns nothing local player oP=GetTriggerPlayer() local string s=GetEventPlayerChatString() local integer i=FD(oP,s,"-info","examine","examine the indicated player's character selections") if i<0 then return endif if not AC(Player(i))then call iC(oP,"That player is not in the current game.") return endif call bf(oP,i) endfunction function gU takes nothing returns nothing set pR=CreateTrigger() call TriggerAddAction(pR,function FU) endfunction function GU takes nothing returns nothing if vv then call iC(GetTriggerPlayer(),WD()) else call aC(WD()) endif endfunction function hU takes nothing returns nothing set PR=CreateTrigger() call TriggerAddAction(PR,function GU) endfunction function HU takes nothing returns nothing local string s=GetEventPlayerChatString() local player oP=GetTriggerPlayer() local integer i if StringLength(s)<7 then call iC(oP,"Enter any value from |r|cffffffff-view 1|r|cffffcc00 to |r|cffffffff-view 60|r|cffffcc00 to zoom.") return elseif SubString(s,0,5)!="-view" then return endif set i=S2I(SubString(s,6,StringLength(s))) call nf(oP,i) endfunction function jU takes nothing returns nothing set qR=CreateTrigger() call TriggerAddAction(qR,function HU) endfunction function JU takes nothing returns nothing local string s=GetEventPlayerChatString() local player oP=GetTriggerPlayer() local integer iP=GetPlayerId(oP) local integer i local integer kU local integer KU local integer c=0 if SubString(s,0,5)!="-pool" then set oP=null return endif if StringLength(s)<7 then set i=0 loop exitwhen i>8 if i!=iP then set kU=GetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD) if kU>ao[i]then set c=c+kU-ao[i] call SetPlayerState(Player(i),PLAYER_STATE_RESOURCE_GOLD,ao[i]) endif endif set i=i+1 endloop set c=c+GetPlayerState(Player(9),PLAYER_STATE_RESOURCE_GOLD) call SetPlayerState(Player(9),PLAYER_STATE_RESOURCE_GOLD,0) set KU=GetPlayerState(Player(9),PLAYER_STATE_RESOURCE_LUMBER) call SetPlayerState(Player(9),PLAYER_STATE_RESOURCE_LUMBER,0) if c>0 then call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD,c+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD)) call iC(oP,"You received "+I2S(c)+" credits from your allies.") else call iC(oP,"You did not receive any credits from your allies.") endif if KU>0 then call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER,KU+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER)) call iC(oP,"You received "+I2S(KU)+" valor from police reserves.") endif else set i=S2I(SubString(s,6,StringLength(s))) set ao[iP]=IMaxBJ(i,0) call iC(oP,"Allies may now automatically take your credits in excess of "+I2S(i)+".") endif set oP=null endfunction function lU takes nothing returns nothing set QR=CreateTrigger() call TriggerAddAction(QR,function JU) endfunction function LU takes nothing returns nothing local player oP=GetTriggerPlayer() if IsTriggerEnabled(JR)then call DisableTrigger(JR) call DisableTrigger(qR) call DisableTrigger(MR) call DisableTrigger(pR) call DisableTrigger(PR) call DisableTrigger(QR) call DisableTrigger(LR) call DisableTrigger(hI) call DisableTrigger(HI) call iC(oP,"Chat commands disabled for everyone.") else call EnableTrigger(JR) call EnableTrigger(qR) call EnableTrigger(MR) call EnableTrigger(pR) call EnableTrigger(PR) call EnableTrigger(QR) call EnableTrigger(hI) call EnableTrigger(HI) if(J>2)and(te<1)then call EnableTrigger(LR) endif call iC(oP,"Chat commands are now enabled.") endif endfunction function mU takes nothing returns nothing set sR=CreateTrigger() call TriggerAddAction(sR,function LU) endfunction function MU takes nothing returns nothing if IsTriggerEnabled(SR)then call Fk(60) call TriggerRegisterTimerEvent(SR,323.0-4*Ve*(Ve-1),false) endif endfunction function pU takes nothing returns nothing set SR=CreateTrigger() call TriggerAddAction(SR,function MU) endfunction function PU takes real qU,real QU returns nothing local real sU local real SU local integer i=0 loop exitwhen i>8 if Ed(i)then set sU=GetUnitX(X[i]) set SU=GetUnitY(X[i]) if not HC(qU,QU,sU,SU,600)then call iC(Player(i),"|cffff8000WARNING|r |cffffcc00Ion Strike targeted at nearby radiation fragment!") endif endif set i=i+1 endloop endfunction function tU takes unit Lk returns nothing local unit vH local real x=GetUnitX(Lk) local real y=GetUnitY(Lk) call PU(x,y) call RC(4.0) set vH=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'o00J',14000,10500,0.00) call UnitAddAbility(vH,'A05N') call IssuePointOrder(vH,"farsight",x,y) call TriggerSleepAction(1.0) call RemoveUnit(vH) set vH=null endfunction function TU takes nothing returns nothing local real jt local integer WC=0 local group g=Ac(bj_mapInitialPlayableArea,Condition(function hk)) local unit Lk=FirstOfGroup(g) call DestroyGroup(g) set g=null if(Lk==null)and(vi>0)then set Lk=Zr[vi-1] endif if Lk!=null then call tU(Lk) set Lk=null endif loop set jt=205.0-kv*0.8-RMinBJ(50,S)*1.4-WC*30.0 exitwhen jt<30 call OC(30) set WC=WC+1 endloop if jt>0 then call OC(jt) endif if IsTriggerEnabled(tR)then call TriggerRegisterTimerEvent(tR,0,false) endif endfunction function uU takes nothing returns nothing set tR=CreateTrigger() call TriggerAddAction(tR,function TU) endfunction function UU takes nothing returns nothing local unit LC=GetDyingUnit() local effect KD=AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(LC),GetUnitY(LC)) call RemoveUnit(LC) call TriggerSleepAction(Xx) call DestroyEffect(KD) endfunction function wU takes nothing returns nothing set TR=CreateTrigger() call TriggerAddAction(TR,function UU) endfunction function WU takes nothing returns nothing local integer id=GetSpellAbilityId() local unit yU=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(yU)) if id=='A0JZ' then if GetUnitAbilityLevel(yU,'A0MI')>0 then call Vf(yU,'A0JZ',1,true) return endif if not Ed(iP)or HC(GetUnitX(yU),GetUnitY(yU),GetUnitX(X[iP]),GetUnitY(X[iP]),900)then call iC(Player(iP),"Robot cannot be reset when not near your hero.") call Vf(yU,'A0JZ',1,true) return endif call UnitRemoveAbility(yU,'A0JY') call UnitRemoveAbility(yU,'S000') call UnitRemoveAbility(yU,'A0ML') call UnitAddAbility(yU,'A0MI') call UnitAddAbility(yU,'A0MJ') call UnitAddAbility(yU,'A0MK') return endif call TriggerSleepAction(0.1) call UnitRemoveAbility(yU,'A0MI') call UnitRemoveAbility(yU,'A0MJ') call UnitRemoveAbility(yU,'A0MK') if id=='A0MI' then call UnitAddAbility(yU,'A0JY') elseif id=='A0MJ' then call UnitAddAbility(yU,'S000') elseif id=='A0MK' then call UnitAddAbility(yU,'A0ML') endif endfunction function YU takes nothing returns nothing set uR=CreateTrigger() call TriggerAddAction(uR,function WU) endfunction function zU takes nothing returns boolean return GetUnitTypeId(GetDyingUnit())=='O00F' endfunction function ZU takes nothing returns nothing local unit LC=GetDyingUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer i=0 local integer vw=IMaxBJ(GetUnitAbilityLevel(X[iP],'A006')-1,1) local effect KD call SetUnitAbilityLevel(X[iP],'A006',vw) call SetUnitAbilityLevel(X[iP],'A0OB',vw) loop exitwhen i>4 if qo[iP*5+i]==LC then set qo[iP*5+i]=null elseif qo[iP*5+i]!=null then if GetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i)>5 then call SetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i,vw+4) else call SetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i,vw-1) endif call SetUnitAbilityLevel(qo[iP*5+i],'A0P2',vw-1) endif set i=i+1 endloop set KD=AddSpecialEffect("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",GetUnitX(LC),GetUnitY(LC)) call RemoveUnit(LC) call TriggerSleepAction(Xx) call DestroyEffect(KD) endfunction function ew takes nothing returns nothing set UR=CreateTrigger() call TriggerAddCondition(UR,Condition(function zU)) call TriggerAddAction(UR,function ZU) endfunction function xw takes nothing returns boolean return GetUnitTypeId(GetSummonedUnit())=='O00F' endfunction function ow takes nothing returns nothing local unit VF=GetSummonedUnit() local unit Od=GetSummoningUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer i local integer array rw local integer iw local integer vw local real aw set iw=IMaxBJ(GetHeroLevel(Od)/ 2,1) call SetHeroLevel(VF,iw,false) call SuspendHeroXP(VF,false) call SetUnitAcquireRangeBJ(VF,550+75*Gx[iP*5+2]) call SetUnitMoveSpeed(VF,Pd(iP)+Gx[iP*5+4]*30) if Gx[iP*5+3]>0 then call SetUnitAbilityLevel(VF,'A042',1+Gx[iP*5+3]*4) call SetHeroStr(VF,Gx[iP*5+3]*100,true) endif call ModifyHeroSkillPoints(VF,bj_MODIFYMETHOD_SET,0) set aw=0.5 set rw[0]=0 set rw[1]=0 set rw[2]=0 set rw[3]=0 set i=0 loop exitwhen i>=R[iP] set vw=O[iP*F+i] if vw=='A003' then set aw=aw+0.75 elseif vw=='A00B' then set aw=aw+0.50 elseif(vw=='A008')then elseif(vw=='A05B')then set rw[2]=rw[2]+1 else set rw[3]=rw[3]+1 endif set i=i+1 endloop if Do[iP*Co+8]>0 then call UnitAddAbility(VF,'A0MS') set rw[3]=rw[3]-1 endif set vw=GetHeroLevel(X[iP])+1 if fe>1 then set rw[3]=rw[3]+3 elseif fe>0 then set rw[3]=rw[3]+1 endif set i=IMinBJ(vw,rw[3]+Fv[iP])+1 call SetUnitAbilityLevel(VF,'A041',i) call IssueImmediateOrder(VF,"manashieldon") set rw[0]=NC(aw)-1 set rw[1]=bC(Gx[iP*5+1],2) set rw[2]=bC(rw[2],2) set rw[3]='A0AH' set rw[4]='A0C7' set rw[5]='A005' call ModifyHeroSkillPoints(VF,bj_MODIFYMETHOD_SET,rw[0]+rw[1]+rw[2]) set i=0 loop exitwhen i>2 set vw=rw[i] loop exitwhen vw<1 call SelectHeroSkill(VF,rw[i+3]) set vw=vw-1 endloop set i=i+1 endloop call SetUnitState(VF,UNIT_STATE_MANA,200+25*Gx[iP*5+1]) if go[iP]then call IssueImmediateOrder(VF,"coldarrows") endif call TriggerSleepAction(0.01) set i=0 loop exitwhen i>4 if qo[iP*5+i]==null then set qo[iP*5+i]=VF call UnitAddAbility(VF,'A0IG'+i) set i=4 endif set i=i+1 endloop set vw=GetUnitAbilityLevel(Od,'A006') set i=0 loop exitwhen i>4 if qo[iP*5+i]!=null then if GetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i)>5 then call SetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i,vw+5) else call SetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i,vw) endif call SetUnitAbilityLevel(qo[iP*5+i],'A0P2',vw) endif set i=i+1 endloop call IssueTargetOrder(VF,"smart",X[iP]) call SetUnitAbilityLevel(Od,'A006',vw+1) call SetUnitAbilityLevel(Od,'A0OB',vw+1) endfunction function nw takes nothing returns nothing set wR=CreateTrigger() call TriggerAddCondition(wR,Condition(function xw)) call TriggerAddAction(wR,function ow) endfunction function Vw takes unit mH,item gg returns nothing local integer Gg=GetItemCharges(gg) local integer Lc=GetItemTypeId(gg) if Gg==1 then if Lc=='I00B' then call RemoveItem(gg) elseif not sF('I000')then return endif else call SetItemCharges(gg,Gg-1) if(Gg==Cv)and(Lc=='I01S')then call SetUnitLifeBJ(mb,1.00) endif endif call SetUnitState(mH,UNIT_STATE_MANA,GetUnitState(mH,UNIT_STATE_MANA)+500.0) call Cg(mH) endfunction function Ew takes unit mH returns item local item Jd=UnitItemInSlot(mH,0) if(Jd!=null)and((GetItemTypeId(Jd)=='I01S')or(GetItemTypeId(Jd)=='I00B'))then return Jd endif return null endfunction function Xw takes nothing returns nothing local unit mH=GetTriggerUnit() local integer iP=GetPlayerId(GetOwningPlayer(mH)) local item Jd if not zv[iP]then set Jd=Ew(mH) if Jd!=null then call Vw(mH,Jd) endif endif set mH=null set Jd=null endfunction function Ow takes nothing returns nothing set WR=CreateTrigger() call TriggerAddAction(WR,function Xw) endfunction function Rw takes unit mH returns integer local integer NH=GetUnitAbilityLevel(X[GetPlayerId(GetOwningPlayer(mH))],'A036') if NH<2 then return'A04G' elseif NH<4 then return'A04H' elseif NH<6 then return'A04J' elseif NH<8 then return'A04L' else return'A0AI' endif endfunction function Iw takes unit mH returns real local integer NH=GetUnitAbilityLevel(X[GetPlayerId(GetOwningPlayer(mH))],'A036') if NH<2 then return 5.5 elseif NH<4 then return 4.9 elseif NH<6 then return 3.7 elseif NH<8 then return 2.5 else return 1.5 endif endfunction function Aw takes trigger jD,unit mH returns nothing call DisableTrigger(jD) if GetUnitTypeId(mH)=='O001' then call UnitRemoveType(mH,UNIT_TYPE_PEON) call UnitRemoveAbility(mH,'Aeth') endif call UnitRemoveAbility(mH,'A04G') call UnitRemoveAbility(mH,'A04H') call UnitRemoveAbility(mH,'A04J') call UnitRemoveAbility(mH,'A04L') call UnitRemoveAbility(mH,'A0AI') call RemoveSavedHandle(qi,StringHash("dogstealtht"),StringHash(XC(jD))) call RemoveSavedHandle(qi,StringHash("dogstealthu"),StringHash(XC(mH))) call StoreInteger(Ae,"dogstealth",XC(mH),0) call DestroyTrigger(jD) endfunction function Nw takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local unit mH=LoadUnitHandle(qi,StringHash("dogstealtht"),StringHash(XC(jD))) if HC(GetUnitX(mH),GetUnitY(mH),GetStoredReal(Ae,"dogstealthx",XC(mH)),GetStoredReal(Ae,"dogstealthy",XC(mH)),99)then call Aw(jD,mH) else if GetStoredInteger(Ae,"dogstealth",XC(mH))==1 then call StoreInteger(Ae,"dogstealth",XC(mH),2) call TriggerSleepAction(0.1) call IssuePointOrder(mH,"move",GetUnitX(mH),GetUnitY(mH)) endif call TriggerSleepAction(3.0*Xx) call TriggerRegisterTimerEvent(jD,0,false) endif set mH=null set jD=null endfunction function bw takes nothing returns boolean return GetIssuedOrderId()==lo[3] endfunction function Bw takes nothing returns nothing local unit mH=GetOrderedUnit() local trigger jD=null if GetStoredInteger(Ae,"dogstealth",XC(mH))>0 then return endif call StoreInteger(Ae,"dogstealth",XC(mH),1) call StoreReal(Ae,"dogstealthx",XC(mH),GetUnitX(mH)) call StoreReal(Ae,"dogstealthy",XC(mH),GetUnitY(mH)) set jD=CreateTrigger() call SaveUnitHandle(qi,StringHash("dogstealtht"),StringHash(XC(jD)),mH) call SaveTriggerHandle(qi,StringHash("dogstealthu"),StringHash(XC(mH)),jD) call TriggerAddAction(jD,function Nw) if GetUnitTypeId(mH)=='O001' then call UnitAddAbility(mH,Rw(mH)) call UnitAddAbility(mH,'Aeth') call UnitAddType(mH,UNIT_TYPE_PEON) call TriggerRegisterTimerEvent(jD,Iw(mH),false) else call UnitAddAbility(mH,'A0AI') call StoreInteger(Ae,"dogstealth",XC(mH),2) call TriggerRegisterTimerEvent(jD,2,false) endif set jD=null set mH=null endfunction function cw takes nothing returns nothing set yR=CreateTrigger() call TriggerAddCondition(yR,Condition(function bw)) call TriggerAddAction(yR,function Bw) endfunction function Cw takes unit mH,unit LC returns boolean local integer iP=GetPlayerId(GetOwningPlayer(mH)) if IsPlayerEnemy(Player(iP),GetOwningPlayer(LC))then if Xo[iP]<0 then call iC(Player(iP),"Hyper-thrash is not available yet.") elseif Xo[iP]==0 then if HC(GetUnitX(mH),GetUnitY(mH),GetUnitX(LC),GetUnitY(LC),1200)then call iC(Player(iP),"Target is too far to hyper-thrash.") else return true endif endif endif return false endfunction function dw takes nothing returns boolean local integer gJ=GetIssuedOrderId() if gJ==lo[5]then return Cw(GetOrderedUnit(),GetOrderTargetUnit()) endif if gJ==lo[3]then return Xo[GetPlayerId(GetOwningPlayer(GetOrderedUnit()))]>0 endif return false endfunction function Dw takes unit mH returns nothing local integer iP=GetPlayerId(GetOwningPlayer(mH)) local integer i local effect KD=AddSpecialEffect("Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl",Oo[iP*3+1],Oo[iP*3+2]) call SetUnitPosition(mH,Oo[iP*3+1],Oo[iP*3+2]) call SetUnitVertexColor(mH,43,44,45,255) call UnitAddAbility(mH,'A03K') call UnitRemoveAbility(mH,'Avul') set i=Xo[iP] loop exitwhen i<2 call RemoveUnit(si[iP*9+i-1]) set i=i-1 endloop set Xo[iP]=-1 call RC(1) call DestroyEffect(KD) set KD=null call RC((Oo[iP*3]/ 12.5)*(1.03-RMinBJ(GetHeroLevel(mH),17)*0.03)-1.0+Io[iP]) if Xo[iP]!=-1 then return endif set Xo[iP]=0 call SetUnitVertexColor(mH,63,64,65,255) call UnitRemoveAbility(mH,'A03K') call UnitRemoveAbility(mH,'Aeth') call iC(Player(iP),"Hyper-thrash is now available.") endfunction function fw takes unit mH,unit mC returns nothing local integer iP=GetPlayerId(GetOwningPlayer(mH)) local real n=GetUnitState(mH,UNIT_STATE_MANA)*0.5 local real nM local real nC local integer Fw local integer NH=GetHeroLevel(mH) local integer i=1 local integer gw=GetUnitAbilityLevel(mH,'A0F8') local real x local real y local real f local effect KD=null local unit Gw=null if Ed(iP)and HC(GetUnitX(mH),GetUnitY(mH),GetUnitX(X[iP]),GetUnitY(X[iP]),2900)then if HC(GetUnitX(mC),GetUnitY(mC),GetUnitX(X[iP]),GetUnitY(X[iP]),2900)then call iC(Player(iP),"Robodog cannot hyper-thrash when far from your hero.") return endif endif if n<76 then call iC(Player(iP),"Not enough energy to hyper-thrash.") return endif if n>250 then set n=250 endif if NH>9 then set nC=100 else set nC=190-10*NH endif set nM=GetUnitState(mH,UNIT_STATE_MANA) if NH>8 then set i=5 elseif NH>6 then set i=4 elseif NH>4 then set i=3 elseif NH>1 then set i=2 endif if i>1 then set i=IMinBJ(R2I((nM-n)/ nC),i-1)+1 endif set nC=nC*(i-1) if gw<1 then set gw=1 endif if Io[iP]<19.9 then set Io[iP]=Io[iP]+0.2 endif call SetUnitState(mH,UNIT_STATE_MANA,nM-n-nC) set Oo[iP*3]=n set Oo[iP*3+1]=GetUnitX(mH) set Oo[iP*3+2]=GetUnitY(mH) set KD=AddSpecialEffect("Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl",Oo[iP*3+1],Oo[iP*3+2]) call UnitAddAbility(mH,'Avul') call UnitAddAbility(mH,'Aeth') call UnitRemoveAbility(mH,'B02G') call SetUnitVertexColor(mH,0,0,0,170) set x=GetUnitX(mC) set y=GetUnitY(mC) call SetUnitPosition(mH,x,y) set f=GetUnitFacing(mH) set Xo[iP]=i loop exitwhen i<2 set Gw=CreateUnit(Player(iP),'z001',x+GetRandomInt(-144,144),y+GetRandomInt(-144,144),f) set si[iP*9+i-1]=Gw call SetUnitVertexColor(Gw,0,0,0,176) call SetUnitAbilityLevel(Gw,'A0F8',gw) call IssueTargetOrder(Gw,"smart",mH) set i=i-1 endloop set Gw=null set Fw=(150+NH*3+GetRandomInt(1,49)) if not IsUnitType(mC,UNIT_TYPE_MECHANICAL)then set Fw=Fw*IMaxBJ(2,gw-2) endif call UnitDamageTarget(mH,mC,Fw,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) call lD(I2S(Fw)+"!",mH,255,0,0,true,12,3) call RC(1) call DestroyEffect(KD) set KD=null call RC(n/ 12.5-5.0) if Xo[iP]<1 then return endif set KD=AddSpecialEffectTarget("Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl",mH,"overhead") call iC(Player(iP),"|r|cffff8000Robodog will unphase soon.") call RC(3) call DestroyEffect(KD) set KD=null call RC(1) if Xo[iP]<1 then return endif set x=GetUnitX(mH) set y=GetUnitY(mH) if IsTerrainPathable(x,y,PATHING_TYPE_WALKABILITY)then call Dw(mH) return endif if NH>17 then set NH=17 endif set KD=AddSpecialEffect("Abilities\\Spells\\Human\\Feedback\\ArcaneTowerAttack.mdl",GetUnitX(mH),GetUnitY(mH)) call SetUnitVertexColor(mH,43,44,45,255) call UnitAddAbility(mH,'A03K') call UnitRemoveAbility(mH,'Avul') set i=Xo[iP] loop exitwhen i<2 call RemoveUnit(si[iP*9+i-1]) set i=i-1 endloop set Xo[iP]=-1 call RC(1) call DestroyEffect(KD) set KD=null call RC((n/ 12.5)*(1.03-NH*0.03)-1.0+Io[iP]) if Xo[iP]!=-1 then return endif set Xo[iP]=0 call SetUnitVertexColor(mH,63,64,65,255) call UnitRemoveAbility(mH,'A03K') call UnitRemoveAbility(mH,'Aeth') call iC(Player(iP),"Hyper-thrash is now available.") endfunction function hw takes nothing returns nothing if GetIssuedOrderId()==lo[5]then call fw(GetOrderedUnit(),GetOrderTargetUnit()) else call Dw(GetOrderedUnit()) endif endfunction function Hw takes nothing returns nothing set YR=CreateTrigger() call TriggerAddCondition(YR,Condition(function dw)) call TriggerAddAction(YR,function hw) endfunction function jw takes nothing returns boolean return GetSpellAbilityId()=='A036' endfunction function Jw takes unit Od,integer iP returns nothing local force oF=hc(GetOwningPlayer(Od)) local location ud=GetUnitLoc(Yv[iP]) call PingMinimapLocForForceEx(oF,ud,4.0,bj_MINIMAPPINGSTYLE_SIMPLE,100,100,100) call RemoveLocation(ud) call DestroyForce(oF) set oF=null set ud=null endfunction function kw takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer NH=GetUnitAbilityLevel(Od,'A036') local integer Kw=24 local integer iP=GetPlayerId(GetOwningPlayer(Od)) local real lw=0 if zv[iP]then if HC(GetUnitX(Yv[iP]),GetUnitY(Yv[iP]),GetUnitX(ee[iP]),GetUnitY(ee[iP]),2900)then if HC(GetUnitX(Yv[iP]),GetUnitY(Yv[iP]),GetUnitX(X[iP]),GetUnitY(X[iP]),900)then call iC(Player(iP),"You must be near your robodog's death location to reconstruct it.") call Jw(Od,iP) if(GetUnitState(Od,UNIT_STATE_MAX_MANA)-GetUnitState(Od,UNIT_STATE_MANA))<350 then call TriggerSleepAction(0.1) endif call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+350) return endif endif loop exitwhen NH<1 set lw=lw+Kw set Kw=Kw-1 set NH=NH-1 endloop set zv[iP]=false call RemoveUnit(ee[iP]) call ReviveHero(Yv[iP],GetUnitX(Od),GetUnitY(Od),true) call SetUnitState(Yv[iP],UNIT_STATE_MANA,lw) call SetUnitVertexColor(Yv[iP],63,64,65,255) call UnitRemoveAbility(Yv[iP],'Avul') call eu(iP) if(qe[iP]==1)or(qe[iP]==2)then call IssueImmediateOrder(Yv[iP],"manashieldon") endif if GetHeroAgi(Yv[iP],false)>1 then call SetHeroAgi(Yv[iP],GetHeroAgi(Yv[iP],false)-1,true) elseif Vo[iP]>0 then set Vo[iP]=Vo[iP]-1 call SetHeroStr(Yv[iP],GetHeroStr(Yv[iP],false)-15,true) endif call UnitRemoveAbility(Od,'B01U') endif endfunction function Lw takes nothing returns nothing set zR=CreateTrigger() call TriggerAddCondition(zR,Condition(function jw)) call TriggerAddAction(zR,function kw) endfunction function mw takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetDyingUnit())) local integer i set zv[iP]=true if qe[iP]==1 then call Aw(LoadTriggerHandle(qi,StringHash("dogstealthu"),StringHash(XC(Yv[iP]))),Yv[iP]) elseif qe[iP]!=2 then call UnitRemoveAbility(Yv[iP],'A03K') call UnitRemoveAbility(Yv[iP],'Aeth') set i=Xo[iP] loop exitwhen i<2 call RemoveUnit(si[iP*9+i-1]) set i=i-1 endloop set Xo[iP]=0 endif endfunction function Mw takes nothing returns nothing set ZR=CreateTrigger() call TriggerAddAction(ZR,function mw) endfunction function pw takes nothing returns boolean return GetSpellAbilityId()=='A06K' endfunction function Pw takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) local unit mH=Yv[iP] local real x=GetUnitX(mH) local real y=GetUnitY(mH) local integer qw=GetHeroSkillPoints(mH) local boolean Qw=GetUnitAbilityLevel(mH,'BNms')<1 if zv[iP]then call iC(Player(iP),"Robodog must be reconstructed before it can be reprogrammed.") call Vf(X[iP],'A06K',1,true) return endif if Ed(iP)and HC(x,y,GetUnitX(X[iP]),GetUnitY(X[iP]),2900)then call iC(Player(iP),"Robodog cannot be reprogrammed when far from your hero.") call Vf(X[iP],'A06K',1,true) return endif if(GetUnitAbilityLevel(mH,'A0NH')>0)and Qw then call UnitRemoveAbility(mH,'A0NH') call CreateItem('I02M',x,y) call iC(Player(iP),"Custom health modification removed.") endif set qw=qw+GetUnitAbilityLevel(mH,'A035') set qw=qw+GetUnitAbilityLevel(mH,'A038') if Qw then set qw=qw+GetUnitAbilityLevel(mH,'A07Z') endif set qw=qw+GetUnitAbilityLevel(mH,'A0MT') call UnitRemoveAbility(mH,'A035') call UnitRemoveAbility(mH,'A038') call UnitRemoveAbility(mH,'A0F8') call SetPlayerAbilityAvailable(Player(iP),'A0CP',true) if Qw then call UnitRemoveAbility(mH,'A07Z') endif call UnitRemoveAbility(mH,'A0MT') call eu(iP) call ModifyHeroSkillPoints(mH,bj_MODIFYMETHOD_SET,qw) if Qw then call SelectHeroSkill(mH,'A07Z') endif set mH=null endfunction function sw takes nothing returns nothing set vI=CreateTrigger() call TriggerAddCondition(vI,Condition(function pw)) call TriggerAddAction(vI,function Pw) endfunction function Sw takes nothing returns boolean return GetSpellAbilityId()=='A03S' endfunction function tw takes nothing returns nothing local unit mH=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(mH)) if Ed(iP)and HC(GetUnitX(mH),GetUnitY(mH),GetUnitX(X[iP]),GetUnitY(X[iP]),2900)then call iC(Player(iP),"Robodog cannot reallocate attributes when far from your hero.") set mH=null return endif call SetUnitAnimation(mH,"spell slam") if Vo[iP]>0 then call SetHeroStr(mH,GetHeroStr(mH,false)-15*Vo[iP],true) call SetHeroAgi(mH,GetHeroAgi(mH,false)+Vo[iP],true) set Vo[iP]=0 else set Vo[iP]=GetHeroAgi(mH,false)-1 if Vo[iP]>0 then call SetHeroAgi(mH,1,true) call SetHeroStr(mH,GetHeroStr(mH,false)+15*Vo[iP],true) endif endif set mH=null endfunction function Tw takes nothing returns nothing set eI=CreateTrigger() call TriggerAddCondition(eI,Condition(function Sw)) call TriggerAddAction(eI,function tw) endfunction function uw takes nothing returns boolean return GetLearnedSkill()=='A038' endfunction function Uw takes nothing returns nothing local unit mH=GetLearningUnit() local integer NH=GetLearnedSkillLevel() if NH==1 then call SetPlayerAbilityAvailable(GetOwningPlayer(mH),'A0CP',false) call UnitAddAbility(mH,'A0F8') if qe[GetPlayerId(GetOwningPlayer(mH))]==1 then call SetUnitAbilityLevel(mH,'A0F8',3) elseif qe[GetPlayerId(GetOwningPlayer(mH))]!=2 then call SetUnitAbilityLevel(mH,'A0F8',5) endif else call SetUnitAbilityLevel(mH,'A0F8',GetUnitAbilityLevel(mH,'A0F8')+1) endif set mH=null endfunction function ww takes nothing returns nothing set xI=CreateTrigger() call TriggerAddCondition(xI,Condition(function uw)) call TriggerAddAction(xI,function Uw) endfunction function Ww takes nothing returns boolean return GetSpellAbilityId()=='A0CP' endfunction function yw takes nothing returns nothing local unit mH=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(mH)) local real Yw=GetUnitX(mH) local real zw=GetUnitY(mH) local real Zw=GetUnitX(X[iP]) local real vW=GetUnitY(X[iP]) local effect KD local effect array eW local item array tg local integer xW=0 local integer i=0 loop set tg[i]=UnitItemInSlot(mH,i) if tg[i]!=null then if vh(GetItemTypeId(tg[i]),null)then set tg[i]=null else set xW=xW+1 endif endif set i=i+1 exitwhen i>5 endloop if xW<1 then call Vf(mH,'A0CP',7,false) return endif if GetUnitState(mH,UNIT_STATE_MANA)<(50+50*xW)then call iC(Player(iP),"Not enough energy to teleport all items.") call Vf(mH,'A0CP',7,false) return endif set KD=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",Yw,zw) set i=0 loop if tg[i]!=null then set Yw=Zw+GetRandomReal(-50,50) set zw=vW+GetRandomReal(-50,50) call SetItemPosition(tg[i],Yw,zw) set eW[i]=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",Yw,zw) else set eW[i]=null endif set i=i+1 exitwhen i>5 endloop call Vf(mH,'A0CP',xW,false) call SetUnitAnimation(mH,"attack slam") call TriggerSleepAction(0.23) call DestroyEffect(KD) set i=0 loop if eW[i]!=null then call DestroyEffect(eW[i]) endif set i=i+1 exitwhen i>5 endloop endfunction function oW takes nothing returns nothing set oI=CreateTrigger() call TriggerAddCondition(oI,Condition(function Ww)) call TriggerAddAction(oI,function yw) endfunction function rW takes nothing returns boolean return GetUnitTypeId(GetSummonedUnit())=='o007' endfunction function iW takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetSummoningUnit())) local unit aW=GetSummonedUnit() local integer nW=Vi[iP]+1 set Vi[iP]=nW call SetUnitAnimation(aW,"stand") call SetUnitAbilityLevel(aW,'A0AJ',1+GetUnitAbilityLevel(X[iP],'A00C')) call SetUnitAbilityLevel(aW,'A0MG',1+GetUnitAbilityLevel(X[iP],'A00C')) call SetUnitAbilityLevel(aW,'A08R',1+GetUnitAbilityLevel(X[iP],'A00C')) call TriggerSleepAction(0.1) if X[iP]!=null then call SetUnitAbilityLevel(X[iP],'A06J',2) endif call OC(89) if(X[iP]!=null)and(Vi[iP]==nW)then call SetUnitAbilityLevel(X[iP],'A06J',1) endif set aW=null endfunction function VW takes nothing returns nothing set rI=CreateTrigger() call TriggerAddCondition(rI,Condition(function rW)) call TriggerAddAction(rI,function iW) endfunction function EW takes nothing returns nothing local unit LC=GetDyingUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local location tF=GetUnitLoc(LC) local effect KD=AddSpecialEffectLoc("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",tF) local real x=GetUnitX(LC) local real y=GetUnitY(LC) local string h=XC(LC) local integer Hd local item XW=null local integer i=GetStoredInteger(Ae,"ladfusion_item_count",h)-1 local string XF=GetStoredString(Ae,"droidremote_ladlink",h) local integer kF=0 local unit VF loop exitwhen Ji[kF]==LC set kF=kF+1 endloop if ki[kF]>0 then set Ke=IMaxBJ(0,Ke-9-GetHeroLevel(LC)) endif call RemoveUnit(LC) if(Qr!=null)and(ki[kF+6]>0)then call DestroyEffect(Qr) set Qr=null endif set Ji[kF]=null call TriggerSleepAction(1.0*Xx) call RemoveLocation(tF) call DestroyEffect(KD) call CreateItem('I01M',x,y) loop exitwhen i<0 set Hd=GetStoredInteger(Ae,"ladfusion_item_"+I2S(i),h) if Hd=='I01F' then set XW=CreateItem(Hd,x+GetRandomInt(-90,90),y+GetRandomInt(-90,90)) call SetItemCharges(XW,0) call SetItemInvulnerable(XW,true) else call CreateItem(Hd,x+GetRandomInt(-90,90),y+GetRandomInt(-90,90)) endif call FlushStoredInteger(Ae,"ladfusion_item_"+I2S(i),h) set i=i-1 endloop call FlushStoredInteger(Ae,"ladfusion_item_count",h) call FlushStoredString(Ae,"droidremote_ladlink",h) if XF!="" then set VF=EF(XF) if VF!=null then call KillUnit(VF) endif endif if XW!=null then call OC(120) if(XW!=null)and(GetItemLifeBJ(XW)>0.0)then call SetItemCharges(XW,1) call SetItemInvulnerable(XW,false) endif set XW=null endif endfunction function OW takes nothing returns nothing set iI=CreateTrigger() call TriggerAddAction(iI,function EW) endfunction function RW takes unit VF,boolean IW returns nothing local real AW local real Nd if IW then set Ke=IMaxBJ(0,Ke-9-GetHeroLevel(VF)) endif set AW=GetUnitUserData(VF) set Nd=le*(AW/225000.0) if Nd>AW then set Nd=AW+0.3*(Nd-AW) endif call SuspendHeroXPBJ(true,VF) call SetHeroXP(VF,IMaxBJ(GetHeroXP(VF),NC(Nd)),true) call SuspendHeroXPBJ(false,VF) if IW then set Ke=Ke+9+GetHeroLevel(VF) endif endfunction function NW takes nothing returns nothing local integer i=0 local real bW=0 local real BW=0 loop exitwhen i>8 if X[i]!=null then set BW=BW+GetHeroXP(X[i]) set bW=bW+1 endif set i=i+1 endloop set le=BW/ bW set i=0 loop exitwhen i>5 if Ji[i]!=null then call RW(Ji[i],ki[i]>0) endif set i=i+1 endloop call Qd() endfunction function cW takes nothing returns nothing set aI=CreateTrigger() call TriggerAddAction(aI,function NW) endfunction function CW takes nothing returns boolean return GetLearnedSkill()=='A07Z' endfunction function dW takes nothing returns nothing local unit VF=GetLearningUnit() local integer NH=GetUnitAbilityLevel(VF,GetLearnedSkill()) call SetUnitAbilityLevel(VF,'A0AC',NH) call SetUnitAbilityLevel(VF,'A0AD',NH) call SetUnitAbilityLevel(VF,'A03I',NH) call SetUnitAbilityLevel(VF,'A041',NH) endfunction function DW takes nothing returns nothing set nI=CreateTrigger() call TriggerAddCondition(nI,Condition(function CW)) call TriggerAddAction(nI,function dW) endfunction function fW takes nothing returns boolean return GetSpellAbilityId()=='A0CH' endfunction function FW takes nothing returns nothing local unit gW=GetSpellAbilityUnit() local unit Od=GetSpellTargetUnit() local string XF=GetStoredString(Ae,"droidremote_ladlink",XC(gW)) local unit i if(GetUnitPointValue(Od)!=3)or(GetOwningPlayer(Od)==GetOwningPlayer(gW))then call iC(GetOwningPlayer(gW),"You must select another player's officer.") return endif call SetUnitOwner(gW,GetOwningPlayer(Od),false) if XF!="" then set i=EF(XF) if i!=null then call SetUnitOwner(i,GetOwningPlayer(Od),false) endif endif endfunction function GW takes nothing returns nothing set VI=CreateTrigger() call TriggerAddCondition(VI,Condition(function fW)) call TriggerAddAction(VI,function FW) endfunction function hW takes nothing returns boolean return GetSpellAbilityId()=='A0JK' endfunction function HW takes nothing returns nothing local unit VF=GetSpellAbilityUnit() local item jW=GetSpellTargetItem() local integer Lc=GetItemTypeId(jW) local integer CF=GetStoredInteger(Ae,"droidremote_boards",XC(VF)) local integer i if(Lc=='I02M')or(Lc=='I02N')or(Lc=='I02O')then call RemoveItem(jW) call UnitModifySkillPoints(VF,1) if Lc=='I02M' then call SetHeroStr(VF,GetHeroStr(VF,false)+50,true) set CF=CF+1 elseif Lc=='I02N' then call SetHeroAgi(VF,GetHeroAgi(VF,false)+5,true) set CF=CF+10 else set i=GetStoredInteger(Ae,"droidremote_energyregen",XC(VF)) call StoreInteger(Ae,"droidremote_energyregen",XC(VF),i+1) if i>-1 then call UnitRemoveAbility(VF,V[i]) endif call UnitAddAbility(VF,V[i+1]) set CF=CF+100 endif call StoreInteger(Ae,"droidremote_boards",XC(VF),CF) set i=GetUnitAbilityLevel(VF,'A0JK') if i<6 then call SetUnitAbilityLevel(VF,'A0JK',i+1) else call UnitRemoveAbility(VF,'A0JK') call UnitAddAbility(VF,'A042') call SetUnitAbilityLevel(VF,'A042',GetHeroStr(VF,false)/25+1) endif else call iC(GetOwningPlayer(VF),"Must target a circuit board.") endif set VF=null set jW=null endfunction function JW takes nothing returns nothing set EI=CreateTrigger() call TriggerAddCondition(EI,Condition(function hW)) call TriggerAddAction(EI,function HW) endfunction function kW takes nothing returns nothing local unit VF=GetDyingUnit() local integer iP=GetPlayerId(GetOwningPlayer(VF)) local integer sH=GetStoredInteger(Ae,I2S(iP),"riotshield_cadet") local integer KW=fi[iP]+1 local real jt=(KW+5.0)*(1.0-0.05*GetUnitAbilityLevel(VF,'A0O5')) local real mf=0.002 local real Bm local boolean lW=GetUnitAbilityLevel(VF,'A0P6')<1 set fi[iP]=KW set zv[iP]=true set Fi[iP]=GetUnitState(Yv[iP],UNIT_STATE_MANA) if sH>-1 then call UnitRemoveAbility(VF,'AId4') call StoreInteger(Ae,I2S(sH),"riotshield_protecting",-1) call iC(Player(sH),"|r|cffff8000NOTE|r |cffffcc00Riot Shield is no longer protecting ally.") call StoreInteger(Ae,I2S(iP),"riotshield_cadet",-1) endif call UnitRemoveAbility(Yv[iP],'A0NL') if Ed(iP)and not vv then call iC(Player(iP),"Robot will be auto-reconstructed in "+I2S(NC(jt))+" seconds.") endif if jt<21 then call RC(jt) else call OC(jt-6) if fi[iP]!=KW then return endif if not AC(Player(iP))or(Yv[iP]==null)then return endif if Ed(iP)and not vv then call iC(Player(iP),"Robot will be auto-reconstructed in 6 seconds.") endif call RC(6) endif loop if fi[iP]!=KW then return endif if not AC(Player(iP))or(Yv[iP]==null)then return endif exitwhen Ed(iP) call TriggerSleepAction(Xx*20) set mf=mf+0.20 endloop set zv[iP]=false call ReviveHero(Yv[iP],GetUnitX(X[iP]),GetUnitY(X[iP]),false) call SetUnitAnimation(Yv[iP],"birth") call SetUnitState(Yv[iP],UNIT_STATE_MANA,Fi[iP]) if lW then set Bm=GetUnitState(X[iP],UNIT_STATE_MANA)/1250.0 if(mf+Bm)<1.0 then set mf=(mf+Bm)*GetUnitState(Yv[iP],UNIT_STATE_MAX_LIFE) call SetUnitState(X[iP],UNIT_STATE_MANA,0) elseif mf>=1.0 then set mf=GetUnitState(Yv[iP],UNIT_STATE_MAX_LIFE) else set Bm=Bm-(1.0-mf) call SetUnitState(X[iP],UNIT_STATE_MANA,Bm*1250.0) set mf=GetUnitState(Yv[iP],UNIT_STATE_MAX_LIFE) endif call SetUnitState(Yv[iP],UNIT_STATE_LIFE,mf) else call SetUnitState(Yv[iP],UNIT_STATE_LIFE,mf*GetUnitState(Yv[iP],UNIT_STATE_MAX_LIFE)) endif call Qu(iP) if GetUnitAbilityLevel(Yv[iP],'A0P6')<1 then call UnitAddAbility(Yv[iP],'Abun') call UnitAddAbility(Yv[iP],'Aeth') call UnitAddAbility(Yv[iP],'A0P6') endif endfunction function LW takes nothing returns nothing set XI=CreateTrigger() call TriggerAddAction(XI,function kW) endfunction function mW takes nothing returns boolean return GetUnitTypeId(GetSoldUnit())=='o00H' endfunction function MW takes nothing returns nothing local unit pW=GetSoldUnit() local unit Od=GetBuyingUnit() local integer iP=GetPlayerId(GetOwningPlayer(pW)) local integer yC=Fd(iP) call SetUnitAbilityLevelSwapped('A042',pW,5) call SetUnitAbilityLevelSwapped('A0AG',pW,IMaxBJ(1,yC)) call IssueTargetOrderBJ(pW,"move",Od) if yC<10 then call iC(Player(iP),"You should assign your new cargo bot to a hotkey group so you don't lose it.") endif endfunction function PW takes nothing returns nothing set OI=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(OI,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_SELL) call TriggerAddCondition(OI,Condition(function mW)) call TriggerAddAction(OI,function MW) endfunction function qW takes nothing returns boolean return(GetSpellAbilityId()=='A0AF')or(GetSpellAbilityId()=='A091') endfunction function QW takes nothing returns nothing local unit pW=GetSpellAbilityUnit() local integer NH if GetSpellAbilityId()=='A0AF' then set NH=GetUnitAbilityLevel(pW,'Aihn') if NH>4 then call UnitRemoveAbility(pW,'A0AF') endif call SetUnitAbilityLevelSwapped('Aihn',pW,NH+1) call SetUnitAbilityLevelSwapped('A0AS',pW,NH+1) else call UnitRemoveAbility(pW,'A091') call UnitAddAbility(pW,'Agho') endif endfunction function sW takes nothing returns nothing set RI=CreateTrigger() call TriggerAddCondition(RI,Condition(function qW)) call TriggerAddAction(RI,function QW) endfunction function SW takes nothing returns boolean return(GetItemTypeId(GetManipulatedItem())=='I00A')and(GetUnitTypeId(GetManipulatingUnit())=='o00H') endfunction function tW takes nothing returns nothing local unit pW=GetManipulatingUnit() local item TW=GetManipulatedItem() local integer Gg=GetItemCharges(TW) local integer uW=bC(GetUnitUserData(pW),100)+Gg local integer wd=16*GetUnitAbilityLevelSwapped('A0AS',pW) set Gg=uW-wd call SetUnitUserData(pW,ModuloInteger(GetUnitUserData(pW),100)+100*IMinBJ(uW,wd)) if Gg<1 then call RemoveItem(TW) else call SetItemCharges(TW,Gg) call UnitRemoveItemSwapped(TW,pW) call iC(GetOwningPlayer(pW),"Cargo bot cannot carry more bandages.") endif endfunction function UW takes nothing returns nothing set II=CreateTrigger() call TriggerAddCondition(II,Condition(function SW)) call TriggerAddAction(II,function tW) endfunction function wW takes nothing returns boolean return(GetSpellAbilityId()=='A0AS')or(GetSpellAbilityId()=='A0AT') endfunction function WW takes nothing returns nothing local integer Lc=GetSpellAbilityId() local unit pW=GetSpellAbilityUnit() local location ud local integer uW=bC(GetUnitUserData(pW),100) if Lc=='A0AS' then call iC(GetOwningPlayer(pW),"Cargo bot is carrying "+I2S(uW)+" bandages.") elseif uW==0 then call iC(GetOwningPlayer(pW),"Cargo bot is carrying no bandages.") else set ud=GetUnitLoc(pW) call SetItemCharges(CreateItem('I00A',GetLocationX(ud),GetLocationY(ud)),IMinBJ(uW,16)) call SetUnitUserData(pW,ModuloInteger(GetUnitUserData(pW),100)+100*IMaxBJ(0,uW-16)) call RemoveLocation(ud) endif endfunction function yW takes nothing returns nothing set AI=CreateTrigger() call TriggerAddCondition(AI,Condition(function wW)) call TriggerAddAction(AI,function WW) endfunction function YW takes nothing returns nothing endfunction function zW takes nothing returns nothing set NI=CreateTrigger() call TriggerAddAction(NI,function YW) endfunction function ZW takes nothing returns boolean return GetSpellAbilityId()=='A03M' endfunction function vy takes nothing returns nothing local item ey=GetSpellTargetItem() local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local integer ZF call SetUnitPosition(bx[iP],GetUnitX(Od),GetUnitY(Od)) if ey==null then if oP==U then call ForceUICancel() endif call SelectUnitForPlayerSingle(bx[iP],oP) call EnableTrigger(LoadTriggerHandle(qi,StringHash("backpacktrigger"),iP)) return endif set ZF=jd(Od,ey) if ZF<0 then call qG(oP,iP,ey) else call xg(X[iP],bx[iP],ZF) endif endfunction function xy takes nothing returns nothing set bI=CreateTrigger() call TriggerAddCondition(bI,Condition(function ZW)) call TriggerAddAction(bI,function vy) endfunction function oy takes nothing returns boolean local integer Lc=GetSpellAbilityId() return(Lc=='A0BA')or(Lc=='A0BB')or(Lc=='A0BF')or(Lc=='A0BG') endfunction function ry takes nothing returns nothing local integer Lc=GetSpellAbilityId() local item ey=GetSpellTargetItem() local player oP=GetOwningPlayer(GetSpellAbilityUnit()) local integer iP=GetPlayerId(oP) local integer ZF if Lc=='A0BG' then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],oP) endif call SelectUnitRemoveForPlayer(bx[iP],oP) return endif if Lc=='A0BF' then if Ed(iP)then if GetUnitState(X[iP],UNIT_STATE_MANA)<25.0 then call iC(oP,"Not enough energy.") else call SetUnitState(X[iP],UNIT_STATE_MANA,GetUnitState(X[iP],UNIT_STATE_MANA)-25.0) if kg(iP)then return endif endif else call iC(oP,"You are dead.") endif call Vf(bx[iP],'A0BF',2,false) return endif call SetUnitPosition(bx[iP],GetUnitX(X[iP]),GetUnitY(X[iP])) if ey==null then call iC(oP,"Invalid target.") return endif if Lc=='A0BA' then if Ed(iP)then set ZF=jd(bx[iP],ey) if ZF>-1 then call xg(bx[iP],X[iP],ZF) else if HC(GetItemX(ey),GetItemY(ey),GetUnitX(X[iP]),GetUnitY(X[iP]),150)then call iC(oP,"Out of range.") else call qG(oP,iP,ey) endif endif else call iC(oP,"You are dead.") endif return endif if Lc=='A0BB' then set ZF=jd(bx[iP],ey) if ZF>-1 then call SetItemPosition(UnitRemoveItemFromSlot(bx[iP],ZF),GetUnitX(X[iP]),GetUnitY(X[iP])) else call iC(oP,"Item not in backpack.") endif return endif endfunction function iy takes nothing returns nothing set BI=CreateTrigger() call TriggerAddCondition(BI,Condition(function oy)) call TriggerAddAction(BI,function ry) endfunction function ay takes nothing returns nothing local integer iP=GetPlayerId(GetTriggerPlayer()) if IsUnitSelected(bx[iP],Player(iP))then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],Player(iP)) endif call SelectUnitRemoveForPlayer(bx[iP],Player(iP)) endif endfunction function ny takes nothing returns nothing set cI=CreateTrigger() call TriggerAddAction(cI,function ay) endfunction function Vy takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetManipulatingUnit())) local real x=GetUnitX(X[iP]) local real y=GetUnitY(X[iP]) call SetUnitPosition(bx[iP],x,y) endfunction function Ey takes nothing returns nothing set CI=CreateTrigger() call TriggerAddAction(CI,function Vy) endfunction function Xy takes nothing returns boolean local integer Oy=GetSpellAbilityId() return(Oy>='A06A')and(Oy<'A06J') endfunction function Ry takes nothing returns nothing local integer Oy=GetSpellAbilityId() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) local item BG if GetUnitPointValue(LC)!=3 then call SetUnitPosition(bx[iP],GetUnitX(X[iP]),GetUnitY(X[iP])) endif if(Oy=='A06E')then call mG(Ie[GetPlayerId(oP)],GetSpellTargetItem(),oP,true) return endif if(Oy=='A06I')then call DG(Ie[GetPlayerId(oP)],LC) return endif if GetUnitPointValue(LC)==3 then set BG=Ie[GetPlayerId(oP)] else set BG=MG(bx[GetPlayerId(oP)]) endif if BG==null then call iC(oP,"Backpack contains no pouch.") return endif if not Ed(GetPlayerId(oP))then call iC(oP,"You are dead.") return endif if(Oy=='A06B')then call sG(BG,oP) else call wG(BG,Oy,LC,oP) endif endfunction function Iy takes nothing returns nothing set dI=CreateTrigger() call TriggerAddCondition(dI,Condition(function Xy)) call TriggerAddAction(dI,function Ry) endfunction function Ay takes nothing returns boolean local integer Oy=GetSpellAbilityId() return(Oy>'A0BT')and(Oy<'A0BX') endfunction function Ny takes nothing returns nothing local integer Oy=GetSpellAbilityId() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) if not OG(iP)then call CreateItem(Oy-'A0BU'+'I04D',GetUnitX(LC),GetUnitY(LC)) call iC(oP,"Cannot use until another drug wears off.") elseif Oy=='A0BW' then call RG(iP,1,"drugmentat") elseif Oy=='A0BU' then call RG(iP,2,"drugbuffout") elseif Oy=='A0BV' then call RG(iP,3,"drugspeed") endif set LC=null set oP=null endfunction function by takes nothing returns nothing set DI=CreateTrigger() call TriggerAddCondition(DI,Condition(function Ay)) call TriggerAddAction(DI,function Ny) endfunction function By takes nothing returns boolean return(GetSpellAbilityId()=='A08Z')or(GetSpellAbilityId()=='A00H') endfunction function cy takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local unit vH if GetStoredInteger(Ae,I2S(iP),"drugoverdose")==0 then call iC(GetOwningPlayer(Od),"Hero is not under the effect of any drugs.") return endif call nG(iP) call TriggerSleepAction(0.1) call Sg(Od) set vH=qf('o00J',GetOwningPlayer(Od),GetUnitLoc(Od),0) call UnitAddAbility(vH,'AUsl') call IssueTargetOrder(vH,"sleep",Od) call TriggerSleepAction(Xx) set Ge[iP]=0.0 call RemoveUnit(vH) loop call TriggerSleepAction(Xx) exitwhen not Ed(iP) exitwhen not UnitHasBuffBJ(Od,'BUsl') endloop if Ge[iP]<0.01 then set Ge[iP]=1.0 endif endfunction function Cy takes nothing returns nothing set fI=CreateTrigger() call TriggerAddCondition(fI,Condition(function By)) call TriggerAddAction(fI,function cy) endfunction function Dy takes nothing returns boolean return(GetSpellAbilityId()=='A001')or(GetSpellAbilityId()=='A09Z') endfunction function fy takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer Mk if GetSpellAbilityId()=='A001' then if pv[iP*Nx+9]>0 then call mk(LC,9,0,2,1) else call mk(LC,7,0,0,1) endif else set Mk=GetUnitAbilityLevel(LC,'A09Z') if Mk<8 then call mk(LC,Mk,0,0,2) else call mk(LC,7,0,1,2) endif endif endfunction function Fy takes nothing returns nothing set FI=CreateTrigger() call TriggerAddCondition(FI,Condition(function Dy)) call TriggerAddAction(FI,function fy) endfunction function gy takes nothing returns nothing if Ve>5 then call mk(XB,16,0,2,0) else call mk(XB,16,0,1,0) endif endfunction function Gy takes nothing returns nothing set gI=CreateTrigger() call TriggerAddAction(gI,function gy) endfunction function hy takes nothing returns boolean return GetSpellAbilityId()=='A01W' endfunction function Hy takes nothing returns nothing call ak(GetSpellAbilityUnit()) endfunction function jy takes nothing returns nothing set GI=CreateTrigger() call TriggerAddCondition(GI,Condition(function hy)) call TriggerAddAction(GI,function Hy) endfunction function Jy takes integer i returns string if i==0 then return"Do you actually think other players like chat spam?" elseif i==1 then return"Maybe if you typed help more often it would help more..." elseif i==2 then return"Calm down! No one is going to help a spammer." elseif i==3 then return"You should vote to kick yourself out of the game." elseif i==4 then return"Why do you need so much help? Try not sucking." else return"Please don't spam the chat channel." endif endfunction function ky takes nothing returns nothing local integer iP=GetPlayerId(GetTriggerPlayer()) if fe>0 then call ak(X[iP]) return endif set nx[iP]=nx[iP]+1 if nx[iP]>1 then if nx[iP]>3 then call iC(Player(iP),Jy(GetRandomInt(0,9))) endif return endif call ak(X[iP]) call TriggerSleepAction(20) set nx[iP]=0 endfunction function Ky takes nothing returns nothing set hI=CreateTrigger() call TriggerAddAction(hI,function ky) endfunction function ly takes nothing returns nothing local player oP=GetTriggerPlayer() local location ud local integer Ly=0 local integer i=0 loop exitwhen i>8 if not A[i]then set ud=GetUnitLoc(I[i]) call CD(oP,i,ud,4) call RemoveLocation(ud) set Ly=Ly+1 endif if(B[i]==2)and(X[i]!=null)then if hx[i]!=null then set ud=GetUnitLoc(hx[i]) call CD(oP,i,ud,4) call RemoveLocation(ud) set Ly=Ly+1 endif endif set i=i+1 endloop if Ly<1 then call iC(oP,"No one is dead.") endif set oP=null set ud=null endfunction function my takes nothing returns nothing set HI=CreateTrigger() call TriggerAddAction(HI,function ly) endfunction function My takes nothing returns boolean if GetIssuedOrderId()==lo[4]then return GetUnitTypeId(GetOrderTargetUnit())=='hfoo' endif return false endfunction function py takes nothing returns nothing call IssueTargetOrder(GetOrderedUnit(),"attack",GetOrderTargetUnit()) endfunction function Py takes nothing returns nothing set jI=CreateTrigger() call TriggerAddCondition(jI,Condition(function My)) call TriggerAddAction(jI,function py) endfunction function qy takes nothing returns boolean return GetSpellAbilityId()=='A08U' endfunction function Qy takes nothing returns nothing call Ej(GetSpellAbilityUnit()) endfunction function sy takes nothing returns nothing set JI=CreateTrigger() call TriggerAddCondition(JI,Condition(function qy)) call TriggerAddAction(JI,function Qy) endfunction function Sy takes integer Hd returns boolean if Hd=='I00G' then return true elseif Hd=='I00I' then return true elseif Hd=='I00W' then return true elseif Hd=='I00E' then return true elseif Hd=='I023' then return true elseif Hd=='I01V' then return true elseif Hd=='I01T' then return true elseif Hd=='I01W' then return true elseif Hd=='I00N' then return true elseif Hd=='I04G' then return true elseif Hd=='I02D' then return true elseif Hd=='I00K' then return true elseif Hd=='I00S' then return true elseif Hd=='I00Q' then return true elseif Hd=='I00U' then return true elseif Hd=='I03J' then return true elseif Hd=='I02H' then return true elseif Hd=='I03C' then return true elseif Hd=='I02A' then return true elseif Hd=='I04A' then return true endif return false endfunction function ty takes integer Hd returns boolean local integer i=0 if(Hd=='I04A')or(Hd=='I02A')or(Hd=='I03C')or(Hd=='I02H')then loop exitwhen i>3 if lr[i]==Hd then return false endif set i=i+1 endloop set i=0 loop exitwhen i>3 if lr[i]<0 then set lr[i]=Hd return true endif set i=i+1 endloop endif return true endfunction function Ty takes item Jd,integer iP returns nothing local integer i=0 loop exitwhen i>5 if Jr[iP*6+i]==null then set Jr[iP*6+i]=Jd return endif set i=i+1 endloop endfunction function uy takes nothing returns boolean return GetSpellAbilityId()=='A03M' endfunction function Uy takes nothing returns nothing local item Jd=GetSpellTargetItem() local integer Hd=GetItemTypeId(Jd) local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) if Jd==null then call Vf(Od,'A03M',1,true) return endif if not UnitHasItem(Od,Jd)then call iC(oP,"You must target an item in your inventory.") call Vf(Od,'A03M',1,true) return endif if(not IsItemPawnable(Jd))or(not Sy(Hd))then call iC(oP,"You cannot replicate that item.") call Vf(Od,'A03M',1,true) return endif if(GetHeroInt(Od,false)+ex[iP])9801 set i=i-1 endloop call RemoveUnit(Yy) set Yy=null set zr[iP]=false endfunction function zy takes nothing returns nothing set KI=CreateTrigger() call TriggerAddCondition(KI,Condition(function Wy)) call TriggerAddAction(KI,function yy) endfunction function Zy takes nothing returns boolean return GetIssuedOrderId()==lo[3] endfunction function vY takes nothing returns nothing local unit Od=GetOrderedUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) if Do[iP*Co+8]>2 then return elseif Do[iP*Co+8]==1 then set Do[iP*Co+8]=2 if ni[iP*2]<3 then set ni[iP*2]=ni[iP*2]+1 call iC(GetOwningPlayer(Od),"|r|cff00ff00HINT|r |cffffcc00Disable automatic target acquisition by quickly issuing another Hold Position command.") endif call TriggerSleepAction(2*Xx) if Do[iP*Co+8]==2 then set Do[iP*Co+8]=1 endif return endif set Do[iP*Co+8]=3 if ni[iP*2]<3 then set ni[iP*2]=3 endif call TriggerSleepAction(1.2) if not Xd(Od)then return endif set Do[iP*Co+8]=4 call UnitAddType(Od,UNIT_TYPE_PEON) call iC(GetOwningPlayer(Od),"Now attempting to remain hidden from enemies.") call TriggerSleepAction(0.1) if ni[iP*2+1]<3 then set ni[iP*2+1]=ni[iP*2+1]+1 call iC(GetOwningPlayer(Od),"|r|cff00ff00HINT|r |cffffcc00Automatically engage enemies by issuing an Attack command on the ground.") endif call IssuePointOrder(Od,"move",GetUnitX(Od),GetUnitY(Od)) endfunction function eY takes nothing returns nothing set lI=CreateTrigger() call TriggerAddCondition(lI,Condition(function Zy)) call TriggerAddAction(lI,function vY) endfunction function xY takes nothing returns boolean return GetIssuedOrderId()==lo[5] endfunction function oY takes nothing returns nothing local unit Od=GetOrderedUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) if Do[iP*Co+8]<4 then return endif set Do[iP*Co+8]=1 call UnitRemoveType(Od,UNIT_TYPE_PEON) call iC(GetOwningPlayer(Od),"No longer hiding from enemies.") call TriggerSleepAction(0.1) call IssuePointOrder(Od,"attack",GetUnitX(Od),GetUnitY(Od)) endfunction function rY takes nothing returns nothing set LI=CreateTrigger() call TriggerAddCondition(LI,Condition(function xY)) call TriggerAddAction(LI,function oY) endfunction function iY takes nothing returns boolean return GetSpellAbilityId()=='A01V' endfunction function aY takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) local integer iAimLvl=GetUnitAbilityLevel(LC,'A01V') call SetPlayerAbilityAvailable(oP,'A00G',true) loop exitwhen not Ed(iP) exitwhen GetUnitAbilityLevel(LC,'Basl')>0 call TriggerSleepAction(0.2) endloop call SetPlayerAbilityAvailable(oP,'A00J',false) call SetPlayerAbilityAvailable(oP,'A01U',true) call SetPlayerAbilityAvailable(oP,'A0KC',true) if Ed(iP)then call OC(20) endif call SetPlayerAbilityAvailable(oP,'A00G',false) loop exitwhen not Ed(iP) exitwhen GetUnitAbilityLevel(LC,'Basl')<1 call TriggerSleepAction(0.2) endloop call SetPlayerAbilityAvailable(oP,'A01U',false) call SetPlayerAbilityAvailable(oP,'A0KC',false) call SetPlayerAbilityAvailable(oP,'A00J',true) endfunction function nY takes nothing returns nothing set mI=CreateTrigger() call TriggerAddCondition(mI,Condition(function iY)) call TriggerAddAction(mI,function aY) endfunction function VY takes nothing returns boolean return GetSpellAbilityId()=='A0A8' endfunction function EY takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local integer tJ=GetUnitAbilityLevel(SJ,GetSpellAbilityId()) local location XY if GetSpellTargetUnit()==null then set XY=GetSpellTargetLoc() else set XY=GetUnitLoc(GetSpellTargetUnit()) endif call YJ(SJ,tJ,XY) endfunction function OY takes nothing returns nothing set MI=CreateTrigger() call TriggerAddCondition(MI,Condition(function VY)) call TriggerAddAction(MI,function EY) endfunction function RY takes integer Lc,integer Gg returns integer local integer ed=-1 if Lc=='I00G' then set ed=250 elseif Lc=='I00H' then set ed=250 elseif Lc=='I00I' then set ed=250 elseif Lc=='I00J' then set ed=250 elseif Lc=='I00W' then set ed=250 elseif Lc=='I00X' then set ed=250 elseif Lc=='I00E' then set ed=200 elseif Lc=='I00F' then set ed=200 elseif Lc=='I01X' then set ed=200 elseif Lc=='I001' then set ed=100 elseif Lc=='I01M' then set ed=2000 elseif Lc=='I01N' then set ed=2000 elseif Lc=='I00A' then set ed=4*Gg elseif Lc=='I00B' then set ed=60*Gg elseif Lc=='I00D' then set ed=6*Gg elseif Lc=='I00C' then set ed=6*Gg elseif Lc=='I01O' then set ed=2000 elseif Lc=='I01I' then set ed=3*Gg elseif Lc=='I024' then set ed=500 elseif Lc=='I023' then set ed=500 elseif Lc=='I008' then set ed=25*Gg elseif Lc=='I007' then set ed=25*Gg elseif Lc=='I01F' then set ed=2000 elseif Lc=='I006' then set ed=25*Gg elseif Lc=='I005' then set ed=25*Gg elseif Lc=='I03M' then set ed=25*Gg elseif Lc=='I03L' then set ed=25*Gg elseif Lc=='I01V' then set ed=200 elseif Lc=='I01U' then set ed=200 elseif Lc=='I01T' then set ed=200 elseif Lc=='I01W' then set ed=200 elseif Lc=='I018' then set ed=2000 elseif Lc=='I01R' then set ed=2000 elseif Lc=='I01Z' then set ed=1500 elseif Lc=='I01Y' then set ed=1500 elseif Lc=='I01Q' then set ed=2000 elseif Lc=='I00O' then set ed=250 elseif Lc=='I00N' then set ed=250 elseif Lc=='I04H' then set ed=250 elseif Lc=='I04G' then set ed=250 elseif Lc=='I02Q' then set ed=500 elseif Lc=='I02R' then set ed=500 elseif Lc=='I02T' then set ed=500 elseif Lc=='I02U' then set ed=500 elseif Lc=='I03Q' then set ed=500 elseif Lc=='I03R' then set ed=500 elseif Lc=='I00L' then set ed=250 elseif Lc=='I00K' then set ed=250 elseif Lc=='I01A' then set ed=2000 elseif Lc=='I00S' then set ed=250 elseif Lc=='I00T' then set ed=250 elseif Lc=='I019' then set ed=2000 elseif Lc=='I00R' then set ed=250 elseif Lc=='I00Q' then set ed=250 elseif Lc=='I00V' then set ed=250 elseif Lc=='I00U' then set ed=250 elseif Lc=='I03J' then set ed=250 elseif Lc=='I03K' then set ed=250 elseif Lc=='I02I' then set ed=750 elseif Lc=='I02H' then set ed=750 elseif Lc=='I02J' then set ed=750 elseif Lc=='I02E' then set ed=500 elseif Lc=='I02D' then set ed=500 elseif Lc=='I02A' then set ed=750 elseif Lc=='I02C' then set ed=750 elseif Lc=='I02B' then set ed=750 elseif Lc=='I03C' then set ed=750 elseif Lc=='I03D' then set ed=750 elseif Lc=='I03E' then set ed=750 elseif Lc=='I04A' then set ed=750 elseif Lc=='I04B' then set ed=750 elseif Lc=='I04C' then set ed=750 elseif Lc=='I02M' then set ed=60 elseif Lc=='I02N' then set ed=60 elseif Lc=='I02O' then set ed=60 elseif Lc=='I02W' then set ed=500 elseif Lc=='I02X' then set ed=500 elseif Lc=='I03T' then set ed=500 elseif Lc=='I03U' then set ed=500 elseif Lc=='I02Y' then set ed=2000 elseif Lc=='I02Z' then set ed=500*Gg elseif Lc=='I02P' then set ed=100 elseif Lc=='I02V' then set ed=100 elseif Lc=='I03S' then set ed=100 elseif Lc=='I02S' then set ed=100 elseif Lc=='I03P' then set ed=100 elseif(Lc>='I031')and(Lc<='I039')then set ed=750 endif return ed endfunction function IY takes integer Lc,integer Gg returns boolean local integer ed=RY(Lc,Gg) if ed<0 then return false endif call vd(ed,true) return true endfunction function AY takes integer iP returns nothing local integer mc if X[iP]==null then return endif loop set mc=GetUnitAbilityLevel(X[iP],'A03L') exitwhen(mc<12)and(mc>1) call TriggerSleepAction(0.1) endloop call SetUnitAbilityLevel(X[iP],'A03L',mc-1) if(mc-1)<=(4-bC(Fd(iP),3))then return endif call TriggerRegisterTimerEvent(gr[iP],93-3*GetPlayerTechCount(Player(iP),'R006',true),false) endfunction function NY takes nothing returns nothing call AY(0) endfunction function bY takes nothing returns nothing call AY(1) endfunction function BY takes nothing returns nothing call AY(2) endfunction function cY takes nothing returns nothing call AY(3) endfunction function CY takes nothing returns nothing call AY(4) endfunction function dY takes nothing returns nothing call AY(5) endfunction function DY takes nothing returns nothing call AY(6) endfunction function fY takes nothing returns nothing call AY(7) endfunction function FY takes nothing returns nothing call AY(8) endfunction function gY takes nothing returns nothing local unit mC=GetDyingUnit() local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"itdtrigs",XC(jD)) if mC!=null then call RemoveLocation(Ev[iP]) set Ev[iP]=GetUnitLoc(mC) endif set Qe[iP]=null call FlushStoredInteger(Ae,"itdtrigs",XC(jD)) set se[iP]=null call DestroyTrigger(jD) endfunction function GY takes unit LC returns boolean if IsUnitType(LC,UNIT_TYPE_HERO)then return true endif if GetUnitTypeId(LC)=='o00H' then return true endif if GetUnitTypeId(LC)=='z005' then return true endif if GetUnitTypeId(LC)=='n007' then return true endif return false endfunction function hY takes integer eh returns boolean return(eh=='I014')or(eh=='I015')or(eh=='I016')or(eh=='I020')or(eh=='I01K')or(eh=='I01L')or(eh=='I003')or(eh=='I04D')or(eh=='I04E')or(eh=='I04F')or(eh=='I01E') endfunction function HY takes nothing returns boolean if GetSpellAbilityId()=='A03L' then return GetUnitAbilityLevel(GetSpellAbilityUnit(),'A03L')<12 endif return false endfunction function jY takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local item Jd=GetSpellTargetItem() local location JY=GetSpellTargetLoc() local unit mC=GetSpellTargetUnit() local player oP=GetOwningPlayer(SJ) local integer iP=GetPlayerId(oP) local integer eh local integer kY local location tF local effect KD=null local effect Et=null local integer KY=0 if Jd==null then set Qe[iP]=null if se[iP]!=null then call FlushStoredInteger(Ae,"itdtrigs",XC(se[iP])) call DestroyTrigger(se[iP]) set se[iP]=null endif if mC==null then call RemoveLocation(Ev[iP]) set Ev[iP]=JY call iC(oP,"New item destination location marked.") elseif not GY(mC)then call RemoveLocation(Ev[iP]) if GetUnitTypeId(mC)=='z000' then set Ev[iP]=Td(GetUnitLoc(mC),70,200) else set Ev[iP]=GetUnitLoc(mC) endif call iC(oP,"New item destination location marked.") else set Qe[iP]=mC set se[iP]=CreateTrigger() call TriggerRegisterUnitEvent(se[iP],mC,EVENT_UNIT_DEATH) call TriggerAddAction(se[iP],function gY) call StoreInteger(Ae,"itdtrigs",XC(se[iP]),iP) call RemoveLocation(Ev[iP]) set Ev[iP]=GetUnitLoc(mC) if GetUnitTypeId(mC)=='z005' then call iC(oP,"Items targeted for teleportation will be pawned.") if(C>1)and not gd(iP)then call iC(oP,"|cffff8000NOTE |r|cffffcc00Credits are divided evenly to all players.") endif else call iC(oP,"New item destination unit marked.") endif endif call Vf(SJ,'A03L',12,false) return endif if wF(Jd,iP,0)then call iC(oP,"You cannot teleport a replicated item.") call Vf(SJ,'A03L',12,false) return endif set eh=GetItemTypeId(Jd) if vh(eh,oP)then call Vf(SJ,'A03L',12,false) return endif if not UnitHasItem(SJ,Jd)then set tF=GetItemLoc(Jd) set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",tF) else set tF=GetUnitLoc(SJ) endif if Qe[iP]!=null then set KY=GetUnitTypeId(Qe[iP]) if KY=='z005' then if CheckItemStatus(Jd,bj_ITEM_STATUS_PAWNABLE)and IY(eh,GetItemCharges(Jd))then call RemoveItem(Jd) set Et=AddSpecialEffectLoc("UI\\Feedback\\GoldCredit\\GoldCredit.mdl",tF) else call iC(oP,"Item could not be pawned.") call Vf(SJ,'A03L',12,false) call TriggerSleepAction(0.33) call RemoveLocation(tF) if KD!=null then call DestroyEffect(KD) endif if Et!=null then call DestroyEffect(Et) endif return endif else call RemoveLocation(Ev[iP]) if KY=='n007' then set Ev[iP]=Td(GetUnitLoc(Qe[iP]),70,200) else set Ev[iP]=GetUnitLoc(Qe[iP]) endif endif endif if KY!='z005' then call SetItemPositionLoc(Jd,Ev[iP]) set Et=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",Ev[iP]) if Qe[iP]!=null then set kY=GetPlayerId(GetOwningPlayer(Qe[iP])) if(Qe[iP]==X[kY])and((eh=='I003')or(eh=='I01K')or(eh=='I01L'))then if QG(eh,Qe[iP],kY)then call RemoveItem(Jd) endif else call cg(Qe[iP],Jd) endif endif endif if hY(eh)then call Vf(SJ,'A03L',1,false) call TriggerSleepAction(0.23) else call TriggerSleepAction(0.33) set eh=GetUnitAbilityLevel(SJ,'A03L') if eh<11 then call SetUnitAbilityLevel(SJ,'A03L',eh+1) endif if eh<=(4-bC(Fd(iP),3))then if gr[iP]==null then set gr[iP]=CreateTrigger() if iP==0 then call TriggerAddAction(gr[iP],function NY) elseif iP==1 then call TriggerAddAction(gr[iP],function bY) elseif iP==2 then call TriggerAddAction(gr[iP],function BY) elseif iP==3 then call TriggerAddAction(gr[iP],function cY) elseif iP==4 then call TriggerAddAction(gr[iP],function CY) elseif iP==5 then call TriggerAddAction(gr[iP],function dY) elseif iP==6 then call TriggerAddAction(gr[iP],function DY) elseif iP==7 then call TriggerAddAction(gr[iP],function fY) else call TriggerAddAction(gr[iP],function FY) endif endif call TriggerRegisterTimerEvent(gr[iP],31-GetPlayerTechCount(oP,'R006',true),false) endif endif call RemoveLocation(tF) if KD!=null then call DestroyEffect(KD) endif if Et!=null then call DestroyEffect(Et) endif endfunction function lY takes nothing returns nothing set pI=CreateTrigger() call TriggerAddCondition(pI,Condition(function HY)) call TriggerAddAction(pI,function jY) endfunction function LY takes nothing returns boolean if GetIssuedOrderId()==lo[4]then return GetUnitPointValue(GetOrderTargetUnit())>10000 endif return false endfunction function mY takes nothing returns nothing local unit SJ=GetOrderedUnit() local unit MY=GetOrderTargetUnit() local integer iP=GetPlayerId(GetOwningPlayer(SJ)) local effect KD=null if B[iP]==4 then if GetUnitTypeId(SJ)=='O005' then if not HC(GetUnitX(SJ),GetUnitY(SJ),GetUnitX(MY),GetUnitY(MY),200)and(GetUnitPointValue(MY)!=10009)then if not hv[iP]then set hv[iP]=true set KD=AddSpecialEffectTarget("Abilities\\Spells\\Human\\ControlMagic\\ControlMagicTarget.mdl",SJ,"overhead") call RC(1.0) set hv[iP]=false call DestroyEffect(KD) if IsUnitAliveBJ(MY)then call KillUnit(MY) endif else call iC(GetOwningPlayer(SJ),"Cannot covertly open another crate yet.") endif set KD=null return endif endif endif call IssueTargetOrder(SJ,"attack",MY) endfunction function pY takes nothing returns nothing set PI=CreateTrigger() call TriggerAddCondition(PI,Condition(function LY)) call TriggerAddAction(PI,function mY) endfunction function PY takes nothing returns boolean return OrderId2String(GetIssuedOrderId())=="ambush" endfunction function qY takes nothing returns nothing local unit LC=GetOrderedUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) if IsUnitType(LC,UNIT_TYPE_PEON)then call UnitRemoveType(LC,UNIT_TYPE_PEON) if Do[iP*Co+8]>4 then set Do[iP*Co+8]=5 call SetUnitMoveSpeed(LC,Ld(iP,false)) endif call iC(GetOwningPlayer(LC),"No longer hiding from enemies.") call TriggerSleepAction(0.1) call SetUnitAbilityLevel(LC,'A02Z',1) call IssuePointOrder(LC,"attack",GetUnitX(LC),GetUnitY(LC)) else call TriggerSleepAction(1.2) if Xd(LC)then call UnitAddType(LC,UNIT_TYPE_PEON) if Do[iP*Co+8]>4 then set Do[iP*Co+8]=30 call SetUnitMoveSpeed(LC,Ld(iP,false)) endif call iC(GetOwningPlayer(LC),"Now attempting to remain hidden from enemies.") call TriggerSleepAction(0.1) call SetUnitAbilityLevel(LC,'A02Z',2) call IssuePointOrder(LC,"move",GetUnitX(LC),GetUnitY(LC)) endif endif endfunction function QY takes nothing returns nothing set qI=CreateTrigger() call TriggerAddAction(qI,function qY) call TriggerAddCondition(qI,Condition(function PY)) endfunction function sY takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetManipulatingUnit())) local integer Hd=GetItemTypeId(GetManipulatedItem()) if Hd=='I019' then set Ir[iP]=Ir[iP]+0.10 endif if Hd=='I03X' then set Ir[iP]=Ir[iP]+0.85 return endif if Hd=='I044' then set Ir[iP]=Ir[iP]+0.40 return endif endfunction function SY takes nothing returns nothing set QI=CreateTrigger() call TriggerAddAction(QI,function sY) endfunction function tY takes nothing returns nothing local unit LC=GetManipulatingUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer Hd=GetItemTypeId(GetManipulatedItem()) if Hd=='I019' then set Ir[iP]=Ir[iP]-0.10 return endif if Hd=='I03X' then if GetStoredInteger(Ae,"validatingitem",XC(LC))==0 then set Ir[iP]=Ir[iP]-0.85 endif return endif if Hd=='I044' then if GetStoredInteger(Ae,"validatingitem",XC(LC))==0 then set Ir[iP]=Ir[iP]-0.40 endif return endif endfunction function TY takes nothing returns nothing set sI=CreateTrigger() call TriggerAddAction(sI,function tY) endfunction function uY takes nothing returns boolean return GetSpellAbilityId()=='A0KI' endfunction function UY takes nothing returns nothing local unit wY=GetSpellAbilityUnit() local integer mc=GetUnitAbilityLevel(wY,'A0KI') local integer IH if mc==8 then set IH=1000 elseif mc==7 then set IH=750 elseif mc==6 then set IH=500 elseif mc==5 then set IH=333 elseif mc==4 then set IH=250 elseif mc==3 then set IH=167 elseif mc==2 then set IH=100 elseif mc==1 then set IH=50 else set IH=0 endif if GetRandomInt(0,999)15 then set b=true elseif i<70 then if NH==15 then set b=true elseif i<40 then if NH==14 then set b=true elseif i<20 then if NH==13 then set b=true elseif i<10 then if NH==12 then set b=true endif endif endif endif endif if b and UnitHasBuffBJ(LC,'Bprg')then call UnitRemoveBuffBJ('Bprg',LC) set Dv[iP]=1.00-RMinBJ(0.04*RMaxBJ(io[iP],0),0.25) call pf(LC) else set b=false endif if i<(10+15*(NH-5))then if b then call wg(LC,4) else call wg(LC,3) endif else call RC(1.0) endif if h<1.0 then return endif if zY then set uo[iP]=uo[iP]+1 endif set i=6 loop exitwhen LC==null set n=GetUnitState(LC,UNIT_STATE_LIFE) exitwhen n<1.0 set KD=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Heal\\HealTarget.mdl",LC,"origin") call SetUnitState(LC,UNIT_STATE_LIFE,n+h) call RC(1.0) call DestroyEffect(KD) set i=i-1 exitwhen i<1 endloop if zY then set uo[iP]=uo[iP]-1 endif set KD=null endfunction function ZY takes nothing returns nothing set tI=CreateTrigger() call TriggerAddCondition(tI,Condition(function yY)) call TriggerAddAction(tI,function YY) endfunction function vz takes nothing returns boolean return GetSpellAbilityId()=='A00E' endfunction function ez takes nothing returns nothing local unit LC=GetSpellTargetUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local boolean zY=GetUnitPointValue(LC)==3 local integer Jq=GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00E') if zY then set uo[iP]=uo[iP]+1 endif call wg(GetSpellTargetUnit(),5) if zY then call RC(Jq) set uo[iP]=uo[iP]-1 endif endfunction function xz takes nothing returns nothing set TI=CreateTrigger() call TriggerAddCondition(TI,Condition(function vz)) call TriggerAddAction(TI,function ez) endfunction function oz takes unit LC,integer Jq,integer tK returns nothing local player oP=GetOwningPlayer(LC) local integer rz=12-GetUnitAbilityLevel(LC,'A002') local integer iz if Jq>0 then call OC(Jq) endif set iz=Uo-tK loop call RC(5) exitwhen(Uo-iz)0 if Jq>0 then set Jq=0 if GetUnitPointValue(LC)==3 then call iC(oP,"You're on an adrenaline rush!") endif endif set rz=rz+rz/3 set iz=Uo call Yh(oP,LC,'A0CM',"unholyfrenzy") endloop set oP=null endfunction function az takes nothing returns boolean return GetSpellAbilityId()=='A00D' endfunction function nz takes nothing returns nothing local unit wY=GetSpellAbilityUnit() local unit LC=GetSpellTargetUnit() local unit vH local integer Vz=GetUnitAbilityLevel(wY,'A002') if(wY!=LC)and(Vz>0)then if GetRandomInt(0,99)<(60+5*Vz)then set vH=CreateUnit(GetOwningPlayer(wY),'o00J',GetUnitX(wY),GetUnitY(wY),0.00) call TriggerRegisterUnitEvent(UI,vH,EVENT_UNIT_SPELL_EFFECT) call UnitAddAbility(vH,'A0CM') call IssueTargetOrder(vH,"unholyfrenzy",wY) endif endif if GetUnitAbilityLevel(LC,'Buhf')<1 then if wY==LC then call oz(LC,14,GetRandomInt(0,2*Vz)) else call oz(LC,14,0) endif endif set wY=null set LC=null set vH=null endfunction function Ez takes nothing returns nothing set uI=CreateTrigger() call TriggerAddCondition(uI,Condition(function az)) call TriggerAddAction(uI,function nz) endfunction function Xz takes nothing returns boolean return GetSpellAbilityId()=='A0CM' endfunction function Oz takes nothing returns nothing local unit vH=GetSpellAbilityUnit() local unit wY=GetSpellTargetUnit() local boolean Rz=GetUnitAbilityLevel(wY,'Buhf')<1 call TriggerSleepAction(0.01) call RemoveUnit(vH) if Rz then call oz(wY,0,GetRandomInt(1,12)) endif set vH=null set wY=null endfunction function Iz takes nothing returns nothing set UI=CreateTrigger() call TriggerAddCondition(UI,Condition(function Xz)) call TriggerAddAction(UI,function Oz) endfunction function Az takes location Nz returns nothing local location Ep local location Xp local integer i=Jx[0] loop exitwhen i<1 if Jx[i]==1 then set Ep=GetUnitLoc(Qi[i+Jx[0]]) if DistanceBetweenPoints(Ep,Nz)<350 then set Xp=Ec(Nz,GetRandomInt(450,650),BC(AngleBetweenPoints(Nz,Ep))) call IssuePointOrderLoc(Qi[i+Jx[0]],"move",Xp) call RemoveLocation(Xp) endif call RemoveLocation(Ep) endif set i=i-1 endloop set Ep=null set Xp=null endfunction function bz takes location Nz returns nothing local location Ep local location Xp local integer i=0 loop if(qx[i]!=null)and(GetUnitState(qx[i],UNIT_STATE_LIFE)>0)then set Ep=GetUnitLoc(qx[i]) if DistanceBetweenPoints(Ep,Nz)<350 then set Xp=zd(D[GetRandomInt(0,H)]) call IssuePointOrderLoc(qx[i],"blink",Xp) call RemoveLocation(Xp) endif call RemoveLocation(Ep) endif set i=i+1 exitwhen i>4 endloop set Ep=null set Xp=null endfunction function Bz takes location ud returns nothing local integer i=0 local location array sk local real array Sk local fogmodifier tk set sk[GetPlayerId(U)]=GetCameraTargetPositionLoc() set Sk[GetPlayerId(U)]=DistanceBetweenPoints(sk[GetPlayerId(U)],ud) call RemoveLocation(sk[GetPlayerId(U)]) loop exitwhen i>8 call Dh(Player(i),0.40,0.50,0.10,"ReplaceableTextures\\CameraMasks\\White_mask.blp",95,98,100,100.0,RMinBJ(99.0,RMaxBJ(1.0,Sk[GetPlayerId(U)]*7.0/100.0-30.0))) set i=i+1 endloop endfunction function cz takes unit LC,unit Od returns nothing local integer Cz=0 local integer iP=GetPlayerId(GetOwningPlayer(LC)) local boolean dz=GetUnitAbilityLevel(LC,'Avul')<1 local boolean Dz=false if GetUnitTypeId(LC)=='hfoo' then if Od!=XB then call SetUnitUserData(LC,999) endif elseif(iP==10)or(iP==11)then if not IsUnitType(LC,UNIT_TYPE_HERO)then set Cz=2 call PauseUnit(LC,true) set Dz=GetUnitAbilityLevel(LC,'AIlz')>0 if dz and not Dz then call SetUnitUserData(LC,999) call SetUnitVertexColor(LC,12,12,12,255) endif elseif GetUnitTypeId(LC)=='U009' then set Jx[GetStoredInteger(Ae,"boss_commando_index",XC(LC))+4*Jx[0]]=-2 elseif(not IsUnitType(LC,UNIT_TYPE_ANCIENT))or(GetUnitTypeId(LC)=='O010')then set Cz=1 endif elseif iP==14 then call SetUnitUserData(LC,999) endif if dz then if vv then call KillUnit(LC) elseif(Cz==1)or Dz then if GetUnitAbilityLevel(LC,'A09D')!=2 then if GetUnitState(LC,UNIT_STATE_LIFE)<5001 then call SetUnitState(LC,UNIT_STATE_LIFE,1) else call SetUnitState(LC,UNIT_STATE_LIFE,GetUnitState(LC,UNIT_STATE_LIFE)-5000) endif call UnitDamageTarget(Od,LC,2500,true,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) endif else call UnitDamageTarget(Od,LC,7500,true,true,ATTACK_TYPE_MAGIC,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) endif endif if Cz==2 then call PauseUnit(LC,false) endif endfunction function fz takes nothing returns boolean return GetSpellAbilityId()=='A05N' endfunction function Fz takes nothing returns nothing local location ud=GetSpellTargetLoc() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) local unit ek local unit gz local unit Gz local group g if GetUnitTypeId(LC)!='O002' then set LC=XB else call PingMinimapForForceEx(Fx,GetLocationX(ud),GetLocationY(ud),2.4,0,99.9,99.9,99.9) endif call RC(0.50) set gz=Tf('n00D',oP,ud,0) call SetUnitTimeScalePercent(gz,2.5) set Gz=Tf('n00E',oP,ud,0) call SetUnitTimeScalePercent(Gz,12.8) call bz(ud) call RC(1.00) call Az(ud) call RC(1.00) call Bz(ud) call RC(0.50) set g=CreateGroup() call GroupEnumUnitsInRangeOfLoc(g,ud,264,null) loop set ek=FirstOfGroup(g) exitwhen ek==null call cz(ek,LC) call GroupRemoveUnit(g,ek) endloop call DestroyGroup(g) set g=null call RemoveUnit(Gz) call RemoveUnit(gz) call RemoveLocation(ud) set Gz=null set gz=null set ud=null set LC=null set oP=null endfunction function hz takes nothing returns nothing set wI=CreateTrigger() call TriggerAddCondition(wI,Condition(function fz)) call TriggerAddAction(wI,function Fz) endfunction function Hz takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetPlayerId(GetOwningPlayer(GetDyingUnit())) call UnitRemoveAbility(Yv[iP],'A094') call UnitRemoveAbility(Yv[iP],'ACrn') set Yv[iP]=null set se[iP]=null call RC(3) set ee[iP]=CreateUnit(Player(iP),'n00H',GetUnitX(X[iP]),GetUnitY(X[iP]),0) call DestroyTrigger(jD) endfunction function jz takes nothing returns boolean return GetSpellAbilityId()=='A095' endfunction function Jz takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local unit kz=GetSpellTargetUnit() local player oP=GetOwningPlayer(SJ) local integer iP=GetPlayerId(oP) local integer Lc=GetUnitTypeId(kz) local location ud local real f local real n if(Lc!='n004')and(Lc!='n005')then call iC(oP,"That unit cannot be recruited.") return endif if kz==Yv[GetPlayerId(GetOwningPlayer(kz))]then call iC(oP,"You cannot poach another officer's recruit!") return endif if ee[iP]==null then return endif call RemoveUnit(ee[iP]) set ee[iP]=null if hx[iP]!=null then call RemoveUnit(Yv[iP]) call RemoveUnit(hx[iP]) set hx[iP]=null call DestroyFogModifier(bi[iP]) endif set Yv[iP]=kz call SetUnitOwner(kz,oP,false) set se[iP]=CreateTrigger() call TriggerRegisterUnitEvent(se[iP],kz,EVENT_UNIT_DEATH) call TriggerAddAction(se[iP],function Hz) call UnitRemoveAbility(kz,'Awan') call SetUnitMoveSpeed(kz,268.0+220.0*(1.0-Pow(0.9,ho))) call IssueTargetOrder(kz,"smart",SJ) if Lc=='n005' then set Pi[iP]=0 call iC(oP,"You cannot recruit women, but she will follow you adoringly!") call UnitAddAbility(kz,'A094') call UnitAddAbility(kz,'ACrn') if GetUnitAbilityLevel(kz,'A09P')<1 then call TriggerRegisterUnitEvent(zI,kz,EVENT_UNIT_SPELL_EFFECT) call UnitAddAbility(kz,'A09P') call UnitAddAbility(kz,'A0I6') call UnitAddType(kz,UNIT_TYPE_ANCIENT) endif else call iC(oP,"This man agrees to follow you. Eventually he'll be ready for action!") set Lc=GetHeroLevel(SJ) if Lc>50 then set Lc=30 elseif Lc>10 then set Lc=10+(Lc-10)/2 endif call OC(30+GetRandomInt(3,5)*Lc) if(Yv[iP]!=null)and(Yv[iP]==kz)and(GetOwningPlayer(Yv[iP])==oP)then call DestroyTrigger(se[iP]) set se[iP]=null set Yv[iP]=null set ud=GetUnitLoc(kz) call iC(oP,"Your recruit is now ready for the field!") set f=GetUnitFacing(kz) set n=GetUnitStateSwap(UNIT_STATE_LIFE,kz) call RemoveUnit(kz) call tH(oP,iP,ud,f,n,-1*Lc) endif endif endfunction function Kz takes nothing returns nothing set WI=CreateTrigger() call TriggerAddCondition(WI,Condition(function jz)) call TriggerAddAction(WI,function Jz) endfunction function lz takes nothing returns boolean return GetSpellAbilityId()=='A0AE' endfunction function Lz takes nothing returns nothing local unit QH=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(QH)) local item mz=GetSpellTargetItem() local integer Lc=GetItemTypeId(mz) if(Lc=='I01K')or(Lc=='I04D')then call UnitAddAbility(QH,'A07Q') elseif(Lc=='I01L')or(Lc=='I04E')then call UnitAddAbility(QH,'A07A') else if(Lc=='I003')or(Lc=='I04F')then call iC(Player(iP),"Cadets have no use for mentats.") endif return endif call RemoveItem(mz) call RemoveUnit(ee[iP+9]) set ee[iP+9]=null call OC(120.0+3.16*(GetHeroInt(QH,true)-100.0)) if(QH==null)or(QH!=Yv[iP])then return endif call UnitRemoveAbility(QH,'A07Q') call UnitRemoveAbility(QH,'A07A') call UnitRemoveAbility(QH,'A06R') call TriggerSleepAction(0.01) set ee[iP+9]=qf('n00M',GetOwningPlayer(QH),GetUnitLoc(QH),0) endfunction function Mz takes nothing returns nothing set yI=CreateTrigger() call TriggerAddCondition(yI,Condition(function lz)) call TriggerAddAction(yI,function Lz) endfunction function pz takes nothing returns boolean return GetSpellAbilityId()=='A0F3' endfunction function Pz takes nothing returns nothing local unit Od=GetSpellTargetUnit() local unit QH=GetSpellAbilityUnit() local real qz=(GetUnitState(Od,UNIT_STATE_MANA)+GetUnitState(QH,UNIT_STATE_MANA))/(GetUnitState(Od,UNIT_STATE_MAX_MANA)+GetUnitState(QH,UNIT_STATE_MAX_MANA)) call SetUnitState(Od,UNIT_STATE_MANA,qz*GetUnitState(Od,UNIT_STATE_MAX_MANA)) call SetUnitState(QH,UNIT_STATE_MANA,qz*GetUnitState(QH,UNIT_STATE_MAX_MANA)) endfunction function Qz takes nothing returns nothing set YI=CreateTrigger() call TriggerAddCondition(YI,Condition(function pz)) call TriggerAddAction(YI,function Pz) endfunction function sz takes nothing returns boolean local integer id=GetSpellAbilityId() return(id=='A0I6')or(id=='A0MP') endfunction function Sz takes unit QH returns nothing local integer NH=GetUnitAbilityLevel(QH,'A07Z') local boolean QS=(GetUnitAbilityLevel(QH,'BNms')>0) if QS then call UnitRemoveAbility(QH,'BNms') endif call UnitRemoveAbility(QH,'A03I') if fe>1 then if GetHeroInt(QH,false)>109.9 then call SetUnitMoveSpeed(QH,228) else call SetUnitMoveSpeed(QH,204) endif call UnitAddAbility(QH,'A0AC') call SetUnitAbilityLevel(QH,'A0AC',NH) else if GetHeroInt(QH,false)>109.9 then call SetUnitMoveSpeed(QH,259) else call SetUnitMoveSpeed(QH,231) endif call UnitAddAbility(QH,'A041') call SetUnitAbilityLevel(QH,'A041',NH) endif call UnitAddAbility(QH,a[0]) call Dj(QH,250.0) if QS then call IssueImmediateOrder(QH,"manashieldon") call IssueImmediateOrder(QH,"stop") endif endfunction function tz takes nothing returns nothing local unit QH=GetSpellAbilityUnit() local item Tz=null local integer Lc if GetSpellAbilityId()=='A0MP' then call UnitRemoveAbility(QH,'A0MP') call Sz(QH) return endif set Tz=GetSpellTargetItem() set Lc=GetItemTypeId(Tz) if(Lc=='I00F')or(Lc=='I00E')then call RemoveItem(Tz) call UnitRemoveAbility(QH,'A0I6') call UnitAddAbility(QH,'AId2') if GetUnitTypeId(QH)=='O00E' then call UnitAddAbility(QH,'A0MP') endif else call iC(GetOwningPlayer(QH),"Recruit can only use the basic Kevlar Vest.") endif set QH=null set Tz=null endfunction function uz takes nothing returns nothing set zI=CreateTrigger() call TriggerAddCondition(zI,Condition(function sz)) call TriggerAddAction(zI,function tz) endfunction function Uz takes nothing returns boolean return GetSpellAbilityId()=='A0P3' endfunction function wz takes nothing returns nothing local unit LC=GetSpellTargetUnit() if(kv>0)and(GetUnitPointValue(LC)==3)and(pv[GetPlayerId(GetOwningPlayer(LC))*Nx+9]>0)then call SetUnitState(LC,UNIT_STATE_LIFE,GetUnitState(LC,UNIT_STATE_LIFE)+kv*5) call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","head") call Vf(GetSpellAbilityUnit(),'A0P3',1,true) call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","hand,right") call TriggerSleepAction(0.1) call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","foot,right") call TriggerSleepAction(0.1) call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","foot,left") call TriggerSleepAction(0.1) call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","hand,left") call TriggerSleepAction(0.1) call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","head") else call Yf(LC,"Abilities\\Spells\\Items\\OrbVenom\\OrbVenomSpecialArt.mdl","chest") call JK(LC,60) endif endfunction function Wz takes nothing returns nothing set ZI=CreateTrigger() call TriggerAddCondition(ZI,Condition(function Uz)) call TriggerAddAction(ZI,function wz) endfunction function yz takes nothing returns nothing local unit Yz=GetDyingUnit() local player oP=GetOwningPlayer(Yz) local integer iP=GetPlayerId(oP) local real f=GetUnitFacing(Yz) local real x=GetUnitX(Yz) local real y=GetUnitY(Yz) call RemoveUnit(Yz) set Yz=CreateUnit(oP,'n005',x,y,f) call SetUnitUserData(Yz,2) call UnitAddAbility(Yz,'Aloc') set Yv[iP]=Yz call SetUnitVertexColor(Yz,255,220,210,90) call UnitAddAbility(Yz,'A094') call SetUnitAbilityLevel(Yz,'A094',5) call SetUnitMoveSpeed(Yz,290) if Ed(iP)then call IssueTargetOrder(Yz,"smart",X[iP]) else call IssuePointOrder(Yz,"move",GetUnitX(X[iP]),GetUnitY(X[iP])) endif endfunction function zz takes nothing returns nothing set vA=CreateTrigger() call TriggerAddAction(vA,function yz) endfunction function Zz takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local effect KD=LoadEffectHandle(qi,StringHash("mindslaygore"),StringHash(XC(jD))) call RemoveSavedHandle(qi,StringHash("mindslaygore"),StringHash(XC(jD))) call TriggerSleepAction(3.00*Xx) call DestroyEffect(KD) call DestroyTrigger(jD) endfunction function vZ takes unit LC,unit Od returns real local terraindeformation eZ local location DC=GetUnitLoc(LC) local location fC=GetUnitLoc(Od) local real Sk=DistanceBetweenPoints(DC,fC) local real xZ local real oZ local trigger jD=CreateTrigger() call TriggerAddAction(jD,function Zz) if(C==1)and(Sk>0)then set xZ=(GetLocationX(DC)-GetLocationX(fC))/ Sk set oZ=(GetLocationY(DC)-GetLocationY(fC))/ Sk set eZ=TerrainDeformWave(GetLocationX(fC),GetLocationY(fC),xZ,oZ,Sk,6000,128,100,250,1) endif call OC(Sk/ 6000.0) if IsUnitType(LC,UNIT_TYPE_HERO)then call SaveEffectHandle(qi,StringHash("mindslaygore"),StringHash(XC(jD)),ZD(LC,DC,"head")) else call SaveEffectHandle(qi,StringHash("mindslaygore"),StringHash(XC(jD)),AddSpecialEffectLoc(zD(),DC)) endif call TriggerRegisterTimerEvent(jD,0.1,false) call RemoveLocation(DC) call RemoveLocation(fC) if(C==1)and(Sk>0)then call TerrainDeformStop(eZ,0) endif return Sk endfunction function rZ takes real BD,real Sk returns real local real n=1.05263 local integer i=0 loop exitwhen i>8 if Ed(i)then set n=n*0.95 endif set i=i+1 endloop if Sk<1200 then set Sk=0.9 elseif Sk>4200 then set Sk=1.5 else set Sk=(Sk+3300)*0.0002 endif return n*BD*Sk endfunction function iZ takes nothing returns boolean return GetSpellAbilityId()=='A0AW' endfunction function aZ takes nothing returns nothing local unit LC=GetSpellTargetUnit() local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local integer sg=GetHeroInt(Od,true) local integer i=GetHeroInt(Od,false) local real Hq=0 local real d=1.2 local real n=0.0 local real x=0.0 local real p local integer nZ=0 set sg=i+bC(sg-i,3)-100 if iP<9 then call RemoveUnit(ee[iP]) else call nS(GetRandomInt(4,7)) endif if LC==Od then call iC(oP,"You cannot slay yourself.") set p=0.001 elseif(GetUnitAbilityLevel(LC,'Avul')>0)and(not IsUnitType(LC,UNIT_TYPE_ANCIENT)or not IsPlayerEnemy(oP,GetOwningPlayer(LC)))then call iC(oP,"You cannot slay that target.") set p=0.001 else if GetUnitTypeId(LC)=='U009' then call PauseUnit(LC,true) set nZ=GetStoredInteger(Ae,"boss_commando_index",XC(LC)) set Hq=vZ(LC,Od) call PauseUnit(LC,false) set p=GetUnitState(LC,UNIT_STATE_LIFE) set x=IMaxBJ(2*Jx[0],3) if p>0 then call KillUnit(LC) set p=RMaxBJ(p/600.0,0.1) else set p=0.001 endif elseif(GetUnitPointValue(LC)==3)or(GetUnitTypeId(LC)=='O00E')then set Hq=vZ(LC,Od) set p=GetUnitState(LC,UNIT_STATE_LIFE) if p>0 then call SetUnitState(LC,UNIT_STATE_LIFE,1.0) set x=3 set p=RMinBJ(RMaxBJ(p/500.0,0.1),1.2) else set p=0.001 endif elseif IsUnitType(LC,UNIT_TYPE_HERO)then set Hq=vZ(LC,Od) set p=GetUnitState(LC,UNIT_STATE_LIFE) if p>0 then if LC==po then call SetUnitState(LC,UNIT_STATE_LIFE,p*0.67) elseif GetUnitTypeId(LC)=='U006' then call SetUnitState(LC,UNIT_STATE_LIFE,p*0.67) else call SetUnitState(LC,UNIT_STATE_LIFE,p*0.5) endif set p=p*0.5 if p>48000 then set x=30+(p-48000.0)/3200.0 elseif p>24000 then set x=20+(p-24000.0)/2400.0 elseif p>12000 then set x=12+(p-12000.0)/1500.0 else set x=p/1000.0 endif set p=RMinBJ(RMaxBJ(0.75*p/800.0+0.25*RMaxBJ(p-800,0)/1200.0,1.0),3.0+Mx) else set p=0.001 endif elseif GetUnitAbilityLevel(LC,'AIlz')>0 then call PauseUnit(LC,true) set Hq=vZ(LC,Od) call PauseUnit(LC,false) set p=GetUnitState(LC,UNIT_STATE_LIFE) if p>0 then call SetUnitState(LC,UNIT_STATE_LIFE,p*0.20) if p>12000 then set x=12+(p-12000.0)/1500.0+0.25*(C-1) else set x=p/1000.0+1.0*(C-1) endif set p=RMinBJ(RMaxBJ(0.75*p/800.0+0.25*RMaxBJ(p-800,0)/1200.0,0.1),0.45+1.2*fe) else set p=0.001 endif else call PauseUnit(LC,true) if(GetUnitTypeId(LC)=='n008')or(GetUnitTypeId(LC)=='u001')or(GetUnitTypeId(LC)=='n00S')then call SetUnitUserData(LC,999) endif set Hq=vZ(LC,Od) call PauseUnit(LC,false) set p=GetUnitState(LC,UNIT_STATE_LIFE) if p>0 then call KillUnit(LC) if GetUnitTypeId(LC)=='u00B' then set p=0.001 else set p=RMinBJ(RMaxBJ(0.75*p/800.0+0.25*RMaxBJ(p-800,0)/1200.0,0.1),1.0) endif else set p=0.001 endif endif endif set n=133.2-RMinBJ(sg,50)*d loop exitwhen sg<51 set sg=sg-50 set d=d*0.594 set n=n-RMinBJ(sg,50)*d endloop call RC(1.0) if nZ>0 then set Jx[nZ+4*Jx[0]]=-3 endif if iP<9 then if(po!=null)and(LC==po)then call IssueTargetOrder(LC,"rejuvination",dJ()) endif call OC(RMaxBJ(1.0,rZ(n*p+x,Hq)-1.0)) set ee[iP]=qf('n00O',oP,GetUnitLoc(Od),0) if Ed(iP)then call iC(oP,"Your mind is rested.") endif else call CJ(Od,null) endif endfunction function VZ takes nothing returns nothing set eA=CreateTrigger() call TriggerAddCondition(eA,Condition(function iZ)) call TriggerAddAction(eA,function aZ) endfunction function EZ takes unit hJ returns nothing local integer iP=GetPlayerId(GetOwningPlayer(hJ)) if(iP!=10)and(iP!=11)then return endif if GetUnitState(hJ,UNIT_STATE_LIFE)<1.0 then return endif call UnitRemoveAbility(hJ,'A0JP') call CJ(hJ,null) endfunction function XZ takes unit hJ,boolean OZ,integer mc returns unit local integer iP=GetPlayerId(GetOwningPlayer(hJ)) local real x local real y local real z local integer r if(iP!=10)and(iP!=11)then return null endif if GetUnitState(hJ,UNIT_STATE_LIFE)<1.0 then return null endif if OZ then call SetUnitState(hJ,UNIT_STATE_MANA,0) if GetUnitAbilityLevel(hJ,'A0P7')>0 then call SetUnitAbilityLevel(hJ,'A0P7',IMinBJ(GetUnitAbilityLevel(hJ,'A0P7')+1,5)) endif if GetUnitAbilityLevel(hJ,'A0JP')>0 then return null endif call UnitRemoveAbility(hJ,'A0AA') call UnitRemoveAbility(hJ,'Afzy') call UnitRemoveAbility(hJ,'Ahea') call UnitRemoveAbility(hJ,'Apsh') endif call UnitRemoveAbility(hJ,'A0AY') call UnitRemoveAbility(hJ,'A0EO') call UnitRemoveAbility(hJ,'A0EP') call UnitRemoveAbility(hJ,'A0EQ') call UnitAddAbility(hJ,'A0AY') call UnitAddAbility(hJ,'A0EO'+mc) call UnitAddAbility(hJ,'A0JP') return hJ endfunction function RZ takes nothing returns boolean return GetSpellAbilityId()=='A0AX' endfunction function IZ takes nothing returns nothing local real x=GetLocationX(GetSpellTargetLoc()) local real y=GetLocationY(GetSpellTargetLoc()) local unit Od=GetSpellAbilityUnit() local integer NH=GetUnitAbilityLevel(Od,'A0AX') local integer sg=GetHeroInt(Od,true) local integer i=GetHeroInt(Od,false) local real AZ local real EH local real d local group g local group g2 local unit LC local unit array NZ local unit array OP local unit array bZ local integer id local integer WC=0 local integer BZ=0 set sg=i+bC(sg-i,3)-100 if sg>100 then set AZ=0.40-0.001*(sg-100) if AZ<0.05 then set AZ=0.05 endif elseif sg>50 then set AZ=0.55-0.003*(sg-50) else set AZ=0.80-0.005*sg endif set d=288+12*IMaxBJ(1,NH-2) if NH>3 then set NH=2 else set NH=NH-1 endif set EH=(0.86-AZ)*50.0+0.75 set NZ[0]=CreateUnit(ii,'o01A',-15557,15296,0) set NZ[1]=CreateUnit(ii,'o01A',15535,15299,0) set NZ[2]=CreateUnit(ii,'o01A',15535,-15817,0) set NZ[3]=CreateUnit(ii,'o01A',-15545,-14912,0) set NZ[4]=CreateUnit(ii,'o01A',-179,15304,0) set NZ[5]=CreateUnit(ii,'o01A',15583,591,0) set NZ[6]=CreateUnit(ii,'o01A',-100,-15835,0) set NZ[7]=CreateUnit(ii,'o01A',-15573,0,0) call SetUnitState(NZ[0],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[1],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[2],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[3],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[4],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[5],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[6],UNIT_STATE_LIFE,EH) call SetUnitState(NZ[7],UNIT_STATE_LIFE,EH) set i=1 set g=CreateGroup() call GroupEnumUnitsInRange(g,x,y,d,null) loop set LC=FirstOfGroup(g) exitwhen LC==null call GroupRemoveUnit(g,LC) set id=GetUnitTypeId(LC) if(id=='n008')or(id=='n00S')or(id=='n009')or(id=='u005')then set LC=XZ(LC,id=='n008',NH) if LC!=null then call IssueTargetOrder(LC,"attack",NZ[GetRandomInt(0,7)]) if GetUnitAbilityLevel(LC,'AIlz')>0 then set bZ[BZ]=LC set BZ=BZ+1 else set OP[WC]=LC set WC=WC+1 endif endif set i=i+1 endif if i>8 then set i=1 set EH=EH-0.1 call TriggerSleepAction(0.1) endif endloop call DestroyGroup(g) call RC(EH*0.25) loop exitwhen BZ<1 call EZ(bZ[BZ]) set BZ=BZ-1 endloop call RC(EH*0.75) loop exitwhen WC<1 call EZ(OP[WC]) set WC=WC-1 endloop set g=null set Od=null endfunction function cZ takes nothing returns nothing set rA=CreateTrigger() call TriggerAddCondition(rA,Condition(function RZ)) call TriggerAddAction(rA,function IZ) endfunction function CZ takes nothing returns boolean return GetSpellAbilityId()=='A0AV' endfunction function dZ takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local integer sg=GetUnitAbilityLevel(Od,'A0B0') local integer Xu set Xu=sg+GetUnitAbilityLevel(Od,'A0B1')+GetUnitAbilityLevel(Od,'A0B2') if pv[iP*Nx]>0 then call SetUnitAbilityLevel(Od,'A0B0',1) call SetUnitAbilityLevel(Od,'A0B1',1) call SetUnitAbilityLevel(Od,'A0B2',1) set Xu=Xu-3 if sg>12 then call SetHeroInt(Od,GetHeroInt(Od,false)-2*sg+13,true) call Sg(Od) elseif sg>1 then call SetHeroInt(Od,GetHeroInt(Od,false)-sg+1,true) call Sg(Od) endif else call UnitRemoveAbility(Od,'A0B0') call UnitRemoveAbility(Od,'A0B1') call UnitRemoveAbility(Od,'A0B2') if sg>12 then call SetHeroInt(Od,GetHeroInt(Od,false)-2*sg+12,true) call Sg(Od) elseif sg>0 then call SetHeroInt(Od,GetHeroInt(Od,false)-sg,true) call Sg(Od) endif endif if Xu<1 then return endif call cK(Od) call RemoveUnit(ee[iP+9]) call OC(2.564+I2R(Xu)/2.2941) set ee[iP+9]=qf('n00P',oP,GetUnitLoc(Od),0) call ModifyHeroSkillPoints(Od,bj_MODIFYMETHOD_ADD,Xu) if Ed(iP)then call iC(oP,"Your mind is cleared.") endif endfunction function DZ takes nothing returns nothing set aA=CreateTrigger() call TriggerAddCondition(aA,Condition(function CZ)) call TriggerAddAction(aA,function dZ) endfunction function fZ takes nothing returns boolean local integer i=GetSpellAbilityId() return(i=='A0B0')or(i=='A0B1')or(i=='A0B2') endfunction function FZ takes nothing returns nothing local integer Lc=GetSpellAbilityId()-'A0B0' local unit LC=GetSpellTargetUnit() local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iT=GetPlayerId(GetOwningPlayer(LC)) if GetUnitPointValue(LC)!=3 then call iC(oP,"Invalid target.") return endif if(Ax[iT*9+Lc*3+Lc]>0)and(Ix[iT*3+Lc]!=Od)then call iC(oP,"Target already receiving that focus from another psychologist.") return endif call hK(Od,LC,Lc) endfunction function gZ takes nothing returns nothing set nA=CreateTrigger() call TriggerAddCondition(nA,Condition(function fZ)) call TriggerAddAction(nA,function FZ) endfunction function GZ takes nothing returns boolean return GetLearnedSkill()=='A0MT' endfunction function hZ takes nothing returns nothing call eu(GetPlayerId(GetOwningPlayer(GetLearningUnit()))) endfunction function HZ takes nothing returns nothing set VA=CreateTrigger() call TriggerAddCondition(VA,Condition(function GZ)) call TriggerAddAction(VA,function hZ) endfunction function jZ takes nothing returns boolean return GetSpellAbilityId()=='A0K7' endfunction function JZ takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local integer tJ=GetUnitAbilityLevel(SJ,'A0K7')-1 local location XY if tJ>7 then set tJ=tJ-7 endif if GetSpellTargetUnit()==null then set XY=GetSpellTargetLoc() else set XY=GetUnitLoc(GetSpellTargetUnit()) endif call sJ(SJ,tJ+1,XY) set XY=null set SJ=null endfunction function kZ takes nothing returns nothing set EA=CreateTrigger() call TriggerAddCondition(EA,Condition(function jZ)) call TriggerAddAction(EA,function JZ) endfunction function KZ takes nothing returns nothing local item Jd=GetManipulatedItem() local integer Hd=GetItemTypeId(Jd) local unit LC local integer iP if Hd!='I024' then return endif set LC=GetManipulatingUnit() set iP=GetPlayerId(GetOwningPlayer(LC)) set Hd=GetUnitAbilityLevel(X[iP],'A0K7') if(Hd==0)or(Hd>8)then return endif call SetUnitAbilityLevel(X[iP],'A0K7',Hd+8) endfunction function lZ takes nothing returns nothing set XA=CreateTrigger() call TriggerAddAction(XA,function KZ) endfunction function LZ takes nothing returns nothing local item Jd=GetManipulatedItem() local integer Hd=GetItemTypeId(Jd) local unit LC local integer iP if Hd!='I024' then return endif set LC=GetManipulatingUnit() set iP=GetPlayerId(GetOwningPlayer(LC)) set Hd=GetUnitAbilityLevel(X[iP],'A0K7') if Hd<9 then return endif if not kd(X[iP],'I023',null)and not kd(LC,'I024',Jd)then call SetUnitAbilityLevel(X[iP],'A0K7',Hd-8) endif endfunction function mZ takes nothing returns nothing set OA=CreateTrigger() call TriggerAddAction(OA,function LZ) endfunction function MZ takes nothing returns boolean return GetSpellAbilityId()=='A0C6' endfunction function pZ takes nothing returns nothing local player oP=GetOwningPlayer(GetSpellAbilityUnit()) call SelectUnitForPlayerSingle(Yv[GetPlayerId(oP)],oP) endfunction function PZ takes nothing returns nothing set RA=CreateTrigger() call TriggerAddCondition(RA,Condition(function MZ)) call TriggerAddAction(RA,function pZ) endfunction function qZ takes nothing returns boolean local integer Lc=GetSpellAbilityId() return(Lc>='A0CA')and(Lc<'A0CF') endfunction function QZ takes nothing returns nothing local integer Lc=GetSpellAbilityId() local player oP=GetOwningPlayer(GetSpellAbilityUnit()) local integer iP=GetPlayerId(oP) if Lc=='A0CA' then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],oP) endif call SelectUnitRemoveForPlayer(Yv[iP],oP) return endif if Gx[iP*5]<1 then call iC(oP,"You have no points allocated.") return endif if not Ed(iP)then call iC(oP,"You cannot select upgrades at this time.") return endif set Gx[iP*5]=Gx[iP*5]-1 set Lc=Lc-'A0CA' set Gx[iP*5+Lc]=Gx[iP*5+Lc]+1 call Gj(iP) if Gx[iP*5]<1 then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],oP) endif call SelectUnitRemoveForPlayer(Yv[iP],oP) endif if Lc==2 then call gj(iP,'A0CC') elseif Lc==3 then call gj(iP,'A0CD') elseif Lc==4 then call gj(iP,'A0CE') endif endfunction function sZ takes nothing returns nothing set IA=CreateTrigger() call TriggerAddCondition(IA,Condition(function qZ)) call TriggerAddAction(IA,function QZ) endfunction function SZ takes nothing returns nothing local integer iP=GetPlayerId(GetTriggerPlayer()) local trigger jD=GetTriggeringTrigger() call DisableTrigger(jD) if IsUnitSelected(Yv[iP],Player(iP))then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],Player(iP)) endif call SelectUnitRemoveForPlayer(Yv[iP],Player(iP)) endif call RC(0.5) call EnableTrigger(jD) endfunction function tZ takes nothing returns nothing set AA=CreateTrigger() call TriggerAddAction(AA,function SZ) endfunction function TZ takes nothing returns nothing local unit LC=GetTriggerUnit() local integer iP if not Xd(LC)then set LC=null return endif set iP=GetPlayerId(GetOwningPlayer(LC)) if GetUnitState(LC,UNIT_STATE_MANA)<997.99 then if pi[iP]>='A0OS' then call UnitRemoveAbility(LC,pi[iP]) endif if Gx[iP*5+1]<1 then set pi[iP]=1 else set pi[iP]='A0OS'+Gx[iP*5+1]-1 call UnitAddAbility(LC,pi[iP]) endif else if pi[iP]>='A0OS' then call UnitRemoveAbility(LC,pi[iP]) endif set pi[iP]=0 endif set LC=null endfunction function uZ takes nothing returns nothing set NA=CreateTrigger() call TriggerAddAction(NA,function TZ) endfunction function UZ takes nothing returns boolean return GetSpellAbilityId()=='A049' endfunction function wZ takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local real WZ local real yZ local real x local real y local integer i=40 local integer h=0 local integer r local effect Vt=null local effect Et=null call SetUnitAbilityLevel(LC,'A049',5) call RemoveUnit(ee[iP]) call UnitAddAbility(LC,'A0A0') call UnitAddAbility(LC,'A0N0') call UnitAddAbility(LC,'A0OF') call RC(0.5) call IssueImmediateOrder(LC,"holdposition") set WZ=GetUnitX(LC) set yZ=GetUnitY(LC) loop call RC(3.0) set h=h+3+3*bC(123-i*3,20) set i=i-1 exitwhen i<1 exitwhen not Ed(iP) set x=GetUnitX(LC) set y=GetUnitY(LC) exitwhen HC(x,y,WZ,yZ,99) set WZ=x set yZ=y if i==38 then set Vt=AddSpecialEffectTarget("Doodads\\LordaeronSummer\\Props\\SmokeSmudge\\SmokeSmudge2.mdl",LC,"hand right") elseif i==34 then set Et=AddSpecialEffectTarget("Doodads\\LordaeronSummer\\Props\\SmokeSmudge\\SmokeSmudge1.mdl",LC,"hand right") endif endloop if(i<1)and Ed(iP)then call iC(Player(iP),"Chaingun overheating...") endif set r=IMinBJ(4,Gd(iP)) call SetUnitAbilityLevel(LC,'A049',r) set i=0 loop exitwhen i>4 call UnitRemoveAbility(LC,'A0A0'+i) call UnitRemoveAbility(LC,'A0N0'+i) call UnitRemoveAbility(LC,'A0OF'+i) set i=i+1 endloop if Vt!=null then call DestroyEffect(Vt) endif if Et!=null then call DestroyEffect(Et) endif if r==1 then set h=NC(I2R(h)/1.5356) elseif r==2 then set h=NC(I2R(h)/2.1070) elseif r==3 then set h=NC(I2R(h)/2.9226) else set h=NC(I2R(h)/3.9391) endif call OC(h+5) if Ed(iP)and not vv then call iC(Player(iP),"Chaingun finished cooling down.") endif set ee[iP]=qf('n00N',Player(iP),GetUnitLoc(LC),0) endfunction function YZ takes nothing returns nothing set bA=CreateTrigger() call TriggerAddCondition(bA,Condition(function UZ)) call TriggerAddAction(bA,function wZ) endfunction function zZ takes nothing returns boolean return GetSpellAbilityId()=='A049' endfunction function ZZ takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer mc=0 local real Oh=7.5 call RC(2.6) loop exitwhen not Ed(iP) exitwhen GetUnitAbilityLevel(LC,'A049')<5 set mc=mc+1 call UnitRemoveAbility(LC,'A0A0'+mc-1) call UnitRemoveAbility(LC,'A0N0'+mc-1) call UnitRemoveAbility(LC,'A0OF'+mc-1) call RC(2.4) exitwhen not Ed(iP) exitwhen GetUnitAbilityLevel(LC,'A049')<5 call UnitAddAbility(LC,'A0A0'+mc) call UnitAddAbility(LC,'A0N0'+mc) call UnitAddAbility(LC,'A0OF'+mc) exitwhen mc>3 call RC(Oh-2.4) endloop endfunction function v0 takes nothing returns nothing set BA=CreateTrigger() call TriggerAddCondition(BA,Condition(function zZ)) call TriggerAddAction(BA,function ZZ) endfunction function e0 takes nothing returns boolean return GetSpellAbilityId()=='A0OB' endfunction function x0 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local real x=GetUnitX(LC) local real y=GetUnitY(LC) local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer i=0 local integer NH set Ti[iP]=1 loop exitwhen i>4 if qo[iP*5+i]!=null then if not HC(x,y,GetUnitX(qo[iP*5+i]),GetUnitY(qo[iP*5+i]),900)then set NH=GetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i) if NH<6 then call UnitAddAbility(qo[iP*5+i],'Avul') call UnitAddAbility(qo[iP*5+i],'Aeth') call SetUnitVertexColor(qo[iP*5+i],0,0,0,170) call SetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i,NH+5) endif endif endif set i=i+1 endloop endfunction function o0 takes nothing returns nothing set cA=CreateTrigger() call TriggerAddCondition(cA,Condition(function e0)) call TriggerAddAction(cA,function x0) endfunction function r0 takes nothing returns boolean return GetSpellAbilityId()=='A0OB' endfunction function i0 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) local integer i=0 local integer NH set Ti[iP]=0 loop exitwhen i>4 if qo[iP*5+i]!=null then set NH=GetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i) if NH>5 then call UnitRemoveAbility(qo[iP*5+i],'Avul') call UnitRemoveAbility(qo[iP*5+i],'Aeth') call SetUnitVertexColor(qo[iP*5+i],100,100,100,255) call SetUnitAbilityLevel(qo[iP*5+i],'A0IG'+i,NH-5) endif endif set i=i+1 endloop endfunction function a0 takes nothing returns nothing set CA=CreateTrigger() call TriggerAddCondition(CA,Condition(function r0)) call TriggerAddAction(CA,function i0) endfunction function n0 takes nothing returns boolean return GetSpellAbilityId()=='A05B' endfunction function V0 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) set Ti[iP]=1 if Ui[iP]!=null then call RemoveUnit(Ui[iP]) endif set Ui[iP]=CreateUnit(oP,'o00J',GetUnitX(LC),GetUnitY(LC),0) if Ve>1 then call UnitAddAbility(Ui[iP],'A0PP') call SetUnitAbilityLevel(Ui[iP],'A0PP',GetUnitAbilityLevel(LC,'A05B')) else call UnitAddAbility(Ui[iP],'A0PO') call SetUnitAbilityLevel(Ui[iP],'A0PO',GetUnitAbilityLevel(LC,'A05B')) endif endfunction function E0 takes nothing returns nothing set dA=CreateTrigger() call TriggerAddCondition(dA,Condition(function n0)) call TriggerAddAction(dA,function V0) endfunction function X0 takes nothing returns boolean return GetSpellAbilityId()=='A05B' endfunction function O0 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) set Ti[iP]=0 if Ui[iP]!=null then call RemoveUnit(Ui[iP]) endif endfunction function R0 takes nothing returns nothing set DA=CreateTrigger() call TriggerAddCondition(DA,Condition(function X0)) call TriggerAddAction(DA,function O0) endfunction function I0 takes nothing returns boolean return GetSpellAbilityId()=='A06N' endfunction function A0 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local item gg=ng(Od,'I00B',bg(Od,'I00B'),null) if gg!=null then set dr[iP]=dr[iP]+1 call StoreInteger(Ae,"unitmakingbattery",XC(Od),1) call TriggerSleepAction(0.25*Xx) if dr[iP]==20 then call SetUnitAbilityLevel(Od,'A06N',2) call iC(GetOwningPlayer(Od),"Battery recharger has corroded.") endif call SetItemCharges(gg,GetItemCharges(gg)+1) call SetItemPawnable(gg,false) call StoreInteger(Ae,"unitmakingbattery",XC(Od),0) else call iC(GetOwningPlayer(Od),"No batteries in inventory to recharge.") call Vf(Od,'A06N',3,false) endif endfunction function N0 takes nothing returns nothing set fA=CreateTrigger() call TriggerAddCondition(fA,Condition(function I0)) call TriggerAddAction(fA,function A0) endfunction function b0 takes nothing returns boolean return GetSpellAbilityId()=='A005' endfunction function B0 takes nothing returns nothing local unit VF=GetSpellAbilityUnit() local unit LC=GetSpellTargetUnit() call Yk(VF,LC,80+40*GetUnitAbilityLevel(VF,'A005')) if LC==X[GetPlayerId(GetOwningPlayer(VF))]then call IssueTargetOrder(VF,"smart",LC) endif endfunction function c0 takes nothing returns nothing set FA=CreateTrigger() call TriggerAddCondition(FA,Condition(function b0)) call TriggerAddAction(FA,function B0) endfunction function C0 takes nothing returns boolean return GetIssuedOrderId()==OrderId("immolation") endfunction function d0 takes nothing returns nothing local unit Od=GetOrderedUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local boolean D0=pv[iP*Nx+4]>0 if qr[iP]then return endif set qr[iP]=true if D0 then call SetUnitAbilityLevel(Od,'A03F',GetUnitAbilityLevel(Od,'A00B')) call SetPlayerAbilityAvailable(oP,'A03F',true) else call SetUnitAbilityLevel(Od,'A08A',GetUnitAbilityLevel(Od,'A00B')) call SetPlayerAbilityAvailable(oP,'A08A',true) endif loop call RC(5.0) exitwhen not Ed(iP) exitwhen not UnitHasBuffBJ(Od,'BEim') endloop set qr[iP]=false if D0 then call SetPlayerAbilityAvailable(oP,'A03F',false) else call SetPlayerAbilityAvailable(oP,'A08A',false) endif endfunction function f0 takes nothing returns nothing set gA=CreateTrigger() call TriggerAddCondition(gA,Condition(function C0)) call TriggerAddAction(gA,function d0) endfunction function F0 takes nothing returns boolean return GetIssuedOrderId()==OrderId("unimmolation") endfunction function g0 takes nothing returns nothing local unit Od=GetOrderedUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) if not qr[iP]then return endif set qr[iP]=false if pv[iP*Nx+4]>0 then call SetPlayerAbilityAvailable(Player(iP),'A03F',false) else call SetPlayerAbilityAvailable(Player(iP),'A08A',false) endif endfunction function G0 takes nothing returns nothing set GA=CreateTrigger() call TriggerAddCondition(GA,Condition(function F0)) call TriggerAddAction(GA,function g0) endfunction function h0 takes nothing returns boolean return GetUnitTypeId(GetOrderedUnit())=='O00F' endfunction function H0 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetOrderedUnit())) local integer gJ=GetIssuedOrderId() if gJ==OrderId("coldarrows")then set go[iP]=true elseif gJ==OrderId("uncoldarrows")then set go[iP]=false endif endfunction function j0 takes nothing returns nothing set hA=CreateTrigger() call TriggerAddCondition(hA,Condition(function h0)) call TriggerAddAction(hA,function H0) endfunction function J0 takes nothing returns boolean return GetSpellAbilityId()=='A00K' endfunction function k0 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local unit K0=qf('n001',GetOwningPlayer(LC),OffsetLocation(GetSpellTargetLoc(),1,13),0) local integer l0=GetUnitAbilityLevel(LC,'A0A9') call SetUnitUserData(K0,5+GetUnitAbilityLevel(LC,'A00K')) call SetUnitState(K0,UNIT_STATE_MANA,40+5*IMinBJ(12,GetUnitAbilityLevel(LC,'A00K'))) call UnitApplyTimedLife(K0,'BOwd',720) call TriggerSleepAction(0.01) if K0!=null then if l0==2 then call IssueImmediateOrder(K0,"townbellon") elseif l0==3 then call IssueImmediateOrder(K0,"townbelloff") endif endif endfunction function L0 takes nothing returns nothing set HA=CreateTrigger() call TriggerAddCondition(HA,Condition(function J0)) call TriggerAddAction(HA,function k0) endfunction function m0 takes nothing returns nothing local unit LC=GetEnumUnit() if GetUnitTypeId(LC)=='n001' then if bC(GetUnitUserData(LC),100)==1 then call SetUnitUserData(LC,1000+GetUnitUserData(LC)) call IssueImmediateOrder(LC,"windwalk") endif endif endfunction function M0 takes nothing returns boolean return GetSpellAbilityId()=='A01N' endfunction function p0 takes nothing returns nothing local unit P0=GetSpellAbilityUnit() local integer mc=ModuloInteger(GetUnitUserData(P0),100)-6 local boolean q0=bC(ModuloInteger(GetUnitUserData(P0),1000),100)==1 local group g local effect KD local location ud local unit LC=null call UnitAddAbility(P0,'A01O'+IMinBJ(3,mc)) if q0 then call SetUnitUserData(P0,1000) set ud=GetUnitLoc(P0) set g=Cc(bK(mc),ud) call ForGroup(g,function m0) call DestroyGroup(g) call RemoveLocation(ud) endif call TriggerSleepAction(Xx) set KD=AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\FragmentationShards\\FragBoomSpawn.mdl",P0,"origin") call PlaySoundOnUnitBJ(OE,85.00,P0) call ExplodeUnitBJ(P0) call DestroyEffect(KD) set g=null set KD=null endfunction function Q0 takes nothing returns nothing set jA=CreateTrigger() call TriggerAddCondition(jA,Condition(function M0)) call TriggerAddAction(jA,function p0) endfunction function s0 takes nothing returns boolean return(GetIssuedOrderId()==OrderId("immolation"))and(GetUnitTypeId(GetOrderedUnit())=='n001') endfunction function S0 takes nothing returns nothing local unit P0=GetOrderedUnit() call UnitAddAbility(P0,'A04L') call StoreInteger(Ae,"c4sma_rangecount",XC(P0),0) loop call RC(5.0) exitwhen IsUnitDeadBJ(P0) exitwhen not UnitHasBuffBJ(P0,'B017') endloop if not IsUnitDeadBJ(P0)then call UnitRemoveAbility(P0,'A04L') endif endfunction function t0 takes nothing returns nothing set JA=CreateTrigger() call TriggerAddCondition(JA,Condition(function s0)) call TriggerAddAction(JA,function S0) endfunction function T0 takes nothing returns boolean return(GetIssuedOrderId()==OrderId("unimmolation"))and(GetUnitTypeId(GetOrderedUnit())=='n001') endfunction function u0 takes nothing returns nothing call UnitRemoveAbility(GetOrderedUnit(),'A04L') endfunction function U0 takes nothing returns nothing set kA=CreateTrigger() call TriggerAddCondition(kA,Condition(function T0)) call TriggerAddAction(kA,function u0) endfunction function w0 takes trigger jD,unit LC returns nothing local unit P0=LoadUnitHandle(qi,StringHash("c4sma_irangemine"),StringHash(XC(jD))) call DisableTrigger(jD) if GetUnitUserData(P0)>199 then return endif if IsUnitType(LC,UNIT_TYPE_HERO)and IsUnitType(LC,UNIT_TYPE_ANCIENT)then call SetUnitUserData(P0,100+GetUnitUserData(P0)) call IssueImmediateOrder(P0,"windwalk") return endif call EnableTrigger(jD) endfunction function W0 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetTriggerUnit())) if(iP==10)or(iP==11)then call w0(GetTriggeringTrigger(),GetTriggerUnit()) endif endfunction function y0 takes trigger jD,unit LC returns nothing local unit P0=LoadUnitHandle(qi,StringHash("c4sma_rangemine"),StringHash(XC(jD))) local player oP=GetOwningPlayer(P0) local real EH local boolean b local integer mc local integer WC call DisableTrigger(jD) if GetUnitUserData(P0)>199 then return endif set WC=GetStoredInteger(Ae,"c4sma_rangecount",XC(P0)) call StoreInteger(Ae,"c4sma_rangecount",XC(P0),WC+1) call EnableTrigger(jD) if WC>0 then return else set EH=GetUnitState(P0,UNIT_STATE_LIFE) call RC(4) if(GetOwningPlayer(P0)!=oP)or(GetUnitUserData(P0)>199)then return endif set mc=ModuloInteger(GetUnitUserData(P0),100)-5 if GetUnitAbilityLevel(P0,'A0AO')==1 then set b=(GetStoredInteger(Ae,"c4sma_rangecount",XC(P0))>(bC(mc+1,4)+IMaxBJ(1,bC(mc-7,3)))) else set b=(GetStoredInteger(Ae,"c4sma_rangecount",XC(P0))>bC(IMinBJ(mc+1,8),4)) endif if b then if GetUnitAbilityLevel(P0,'B017')>0 then call IssueImmediateOrder(P0,"unimmolation") endif if(mc>8)and(GetUnitAbilityLevel(P0,'A0AO')==1)then call OC(14) if(GetOwningPlayer(P0)!=oP)or(GetUnitUserData(P0)>199)then return endif if(EH-GetUnitState(P0,UNIT_STATE_LIFE))<50 then if GetUnitAbilityLevel(P0,'B017')<1 then call IssueImmediateOrder(P0,"immolation") endif call StoreInteger(Ae,"c4sma_rangecount",XC(P0),0) endif endif else call StoreInteger(Ae,"c4sma_rangecount",XC(P0),0) endif endif endfunction function Y0 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetTriggerUnit())) if(iP==10)or(iP==11)then call y0(GetTriggeringTrigger(),GetTriggerUnit()) endif endfunction function z0 takes nothing returns nothing local unit P0=GetTriggerUnit() if GetUnitUserData(P0)<200 then call SetUnitUserData(P0,1000+GetUnitUserData(P0)) call IssueImmediateOrder(P0,"windwalk") endif endfunction function Z0 takes nothing returns nothing local unit P0=GetDyingUnit() call RemoveSavedHandle(qi,StringHash("c4sma_rangemine"),StringHash(XC(LoadTriggerHandle(qi,StringHash("c4sma_range"),StringHash(XC(P0)))))) call DestroyTrigger(LoadTriggerHandle(qi,StringHash("c4sma_range"),StringHash(XC(P0)))) call RemoveSavedHandle(qi,StringHash("c4sma_range"),StringHash(XC(P0))) call FlushStoredInteger(Ae,"c4sma_rangecount",XC(P0)) call RemoveSavedHandle(qi,StringHash("c4sma_irangemine"),StringHash(XC(LoadTriggerHandle(qi,StringHash("c4sma_irange"),StringHash(XC(P0)))))) call DestroyTrigger(LoadTriggerHandle(qi,StringHash("c4sma_irange"),StringHash(XC(P0)))) call RemoveSavedHandle(qi,StringHash("c4sma_irange"),StringHash(XC(P0))) call DestroyTrigger(LoadTriggerHandle(qi,StringHash("c4sma_life"),StringHash(XC(P0)))) call RemoveSavedHandle(qi,StringHash("c4sma_life"),StringHash(XC(P0))) call RemoveSavedHandle(qi,StringHash("c4sma_death"),StringHash(XC(P0))) set P0=null call DestroyTrigger(GetTriggeringTrigger()) endfunction function v1 takes nothing returns boolean return(GetSpellAbilityId()=='A0AM')or(GetSpellAbilityId()=='A0AN') endfunction function e1 takes nothing returns nothing local unit P0=GetSpellAbilityUnit() local integer o1=GetSpellAbilityId() local integer mc=ModuloInteger(GetUnitUserData(P0),100)-6 local trigger jD call UnitRemoveAbility(P0,'A0AM') call UnitRemoveAbility(P0,'A0AN') call UnitAddAbility(P0,o1+2) call SetUnitUserData(P0,GetUnitUserData(P0)+100) if not UnitHasBuffBJ(P0,'B017')then call IssueImmediateOrder(P0,"immolation") endif set jD=CreateTrigger() call TriggerRegisterUnitInRangeSimple(jD,bK(mc)+73,P0) call TriggerAddAction(jD,function Y0) call SaveTriggerHandle(qi,StringHash("c4sma_range"),StringHash(XC(P0)),jD) call SaveUnitHandle(qi,StringHash("c4sma_rangemine"),StringHash(XC(jD)),P0) call StoreInteger(Ae,"c4sma_rangecount",XC(P0),0) set jD=CreateTrigger() if mc<2 then call TriggerRegisterUnitInRangeSimple(jD,bK(mc),P0) else call TriggerRegisterUnitInRangeSimple(jD,BK(mc),P0) endif call TriggerAddAction(jD,function W0) call SaveTriggerHandle(qi,StringHash("c4sma_irange"),StringHash(XC(P0)),jD) call SaveUnitHandle(qi,StringHash("c4sma_irangemine"),StringHash(XC(jD)),P0) set jD=CreateTrigger() set mc=IMinBJ(15,mc+4) if o1=='A0AM' then call TriggerRegisterUnitLifeEvent(jD,P0,LESS_THAN,140.0-RMaxBJ(0,mc-7)*RMaxBJ(0,mc-9)*(2.5-0.3*RMinBJ(1,fe))) else call TriggerRegisterUnitLifeEvent(jD,P0,LESS_THAN,150.0-RMaxBJ(0,mc-7)*RMaxBJ(0,mc-9)*(1.7-0.2*RMinBJ(1,fe))) endif call TriggerAddAction(jD,function z0) call SaveTriggerHandle(qi,StringHash("c4sma_life"),StringHash(XC(P0)),jD) set jD=CreateTrigger() call TriggerRegisterUnitEvent(jD,P0,EVENT_UNIT_DEATH) call TriggerAddAction(jD,function Z0) call SaveTriggerHandle(qi,StringHash("c4sma_death"),StringHash(XC(P0)),jD) endfunction function r1 takes nothing returns nothing set KA=CreateTrigger() call TriggerAddCondition(KA,Condition(function v1)) call TriggerAddAction(KA,function e1) endfunction function i1 takes nothing returns boolean return GetUnitTypeId(GetSummonedUnit())=='o00Z' endfunction function a1 takes nothing returns nothing local unit n1=GetSummonedUnit() local unit Od=GetSummoningUnit() local integer i=GetUnitAbilityLevel(Od,'A0A9') call RemoveUnit(n1) if i==3 then set i=1 else set i=i+1 endif call SetUnitAbilityLevel(Od,'A0A9',i) endfunction function V1 takes nothing returns nothing set lA=CreateTrigger() call TriggerAddCondition(lA,Condition(function i1)) call TriggerAddAction(lA,function a1) endfunction function E1 takes nothing returns boolean return GetSpellAbilityId()=='A06M' endfunction function X1 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer O1=GetPlayerId(GetOwningPlayer(Od)) local unit LC=GetSpellTargetUnit() local integer R1=GetPlayerId(GetOwningPlayer(LC)) local item I1=null local item A1=null local item N1=null local item Jd local integer i local unit Kd if GetUnitPointValue(LC)!=3 then call iC(Player(O1),"Invalid target.") call Vf(Od,'A06M',2,false) return endif if To[R1*3]and To[R1*3+1]and To[R1*3+2]then if Od==LC then call iC(Player(O1),"Your gear cannot be further modified.") else call iC(Player(O1),"Target's gear cannot be further modified.") endif call Vf(Od,'A06M',2,false) return endif set Kd=Od loop exitwhen Kd==null set i=0 loop set Jd=UnitItemInSlot(Kd,i) if Jd!=null then if GetItemTypeId(Jd)=='I02M' then if I1==null then set I1=Jd endif elseif GetItemTypeId(Jd)=='I02N' then if A1==null then set A1=Jd endif elseif GetItemTypeId(Jd)=='I02O' then if N1==null then set N1=Jd endif endif endif set i=i+1 exitwhen i>5 endloop exitwhen Kd!=Od set Kd=bx[O1] endloop set Kd=LC loop exitwhen Kd==null set i=0 loop set Jd=UnitItemInSlot(Kd,i) if Jd!=null then if GetItemTypeId(Jd)=='I02M' then if I1==null then set I1=Jd endif elseif GetItemTypeId(Jd)=='I02N' then if A1==null then set A1=Jd endif elseif GetItemTypeId(Jd)=='I02O' then if N1==null then set N1=Jd endif endif endif set i=i+1 exitwhen i>5 endloop exitwhen Kd!=LC set Kd=bx[R1] endloop if(I1!=null)and not To[R1*3]then set To[R1*3]=true call RemoveItem(I1) call SetPlayerTechResearched(Player(R1),'R00E',GetPlayerTechCount(Player(R1),'R00E',true)+1) call iC(Player(R1),"Defense system upgraded.") if Od!=LC then call iC(Player(O1),"Upgraded target's defense system.") endif else set I1=null endif if(A1!=null)and not To[R1*3+1]then set To[R1*3+1]=true call RemoveItem(A1) call SetPlayerTechResearched(Player(R1),'R008',GetPlayerTechCount(Player(R1),'R008',true)+1) call iC(Player(R1),"Weapon system upgraded.") if Od!=LC then call iC(Player(O1),"Upgraded target's weapon system.") endif else set A1=null endif if(N1!=null)and not To[R1*3+2]then set To[R1*3+2]=true call RemoveItem(N1) call UnitAddAbility(LC,'A0HO') call Dj(LC,125.0) call iC(Player(R1),"Energy system upgraded.") if Od!=LC then call iC(Player(O1),"Upgraded target's energy system.") endif else set N1=null endif if(I1==null)and(A1==null)and(N1==null)then if Od==LC then call iC(Player(O1),"Required circuit board not in your inventory.") else call iC(Player(O1),"Required circuit board not in your or target's inventory.") endif call Vf(Od,'A06M',2,false) endif endfunction function b1 takes nothing returns nothing set LA=CreateTrigger() call TriggerAddCondition(LA,Condition(function E1)) call TriggerAddAction(LA,function X1) endfunction function B1 takes nothing returns boolean return GetSpellAbilityId()=='A01K' endfunction function c1 takes unit Od,integer C1,location TJ returns nothing local player uJ=GetOwningPlayer(Od) local unit UJ local unit KD local integer d1 local unit array D1 local location f1=GetUnitLoc(Od) local location F1=Location(GetLocationX(TJ),GetLocationY(TJ)) local real g1=AngleBetweenPoints(f1,F1) set C1=bC(C1+1,2)+1 set KD=Tf('o00J',uJ,f1,GetUnitFacing(Od)) call UnitAddAbility(KD,'A090') set UJ=Tf('o00N',uJ,TJ,0) call IssueTargetOrder(KD,"drunkenhaze",UJ) call TriggerSleepAction(DistanceBetweenPoints(f1,F1)*0.0007) call RemoveLocation(f1) call RemoveLocation(F1) call RemoveUnit(KD) call RemoveUnit(UJ) set d1=C1 loop set d1=d1-1 set UJ=Tf('n000',uJ,TJ,0.00) call UnitAddAbility(UJ,'A01L') call UnitAddAbility(UJ,'A04X') if d1<(C1-1)then set D1[d1]=Tf('n000',Player(PLAYER_NEUTRAL_PASSIVE),TJ,0.00) call StopSoundBJ(OE,false) call PlaySoundOnUnitBJ(OE,100,D1[d1]) endif call ExplodeUnitBJ(UJ) call TriggerSleepAction(0.25) call RemoveUnit(UJ) exitwhen d1==0 set f1=TJ set TJ=Ec(TJ,GetRandomReal(36.00,180.00),BC(g1+GetRandomReal(-30.00,30.00))) call RemoveLocation(f1) endloop call RemoveLocation(TJ) call TriggerSleepAction(1.0) set d1=C1-1 loop set d1=d1-1 call RemoveUnit(D1[d1]) exitwhen d1==0 call RC(0.25) endloop endfunction function G1 takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local integer mc=GetUnitAbilityLevelSwapped('A01K',SJ) local location XY if GetSpellTargetUnit()==null then set XY=GetSpellTargetLoc() else set XY=GetUnitLoc(GetSpellTargetUnit()) endif call c1(SJ,mc,XY) endfunction function h1 takes nothing returns nothing set mA=CreateTrigger() call TriggerAddCondition(mA,Condition(function B1)) call TriggerAddAction(mA,function G1) endfunction function H1 takes location Vp,real j1 returns nothing local location Ep local location Xp local location J1 local real Hq local unit Op local integer i=Jx[0] loop exitwhen i<1 if Jx[i]==1 then set Op=Qi[i+Jx[0]] set Ep=GetUnitLoc(Op) set Hq=DistanceBetweenPoints(Ep,Vp) if(j1<1590)and(Hq<1901)then call UnitAddAbility(Op,'A0D7') set Xp=Ec(Ep,2600-Hq,BC(AngleBetweenPoints(Vp,Ep))) call IssuePointOrderLoc(Op,"move",Xp) call RemoveLocation(Xp) elseif(Hq<1601)or((Hq+2000)-1 then call UnitRemoveAbility(Qi[i+Jx[0]],'A0D7') endif set i=i-1 endloop endfunction function K1 takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local boolean b=false local integer l1 set l1=GetRandomInt(1,1+IMaxBJ(0,bC(De,5))) call uk(IMaxBJ(0,De-IMaxBJ(0,(l1-2)*5))) loop exitwhen l1<1 if Th()then set b=true endif set l1=l1-1 endloop if b then call Ph() endif call DestroyTrigger(jD) set jD=null endfunction function L1 takes nothing returns boolean return GetSpellAbilityId()=='A03A' endfunction function m1 takes nothing returns nothing local location ud=GetSpellTargetLoc() local unit LC=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local location xt=GetUnitLoc(LC) local real Hq=DistanceBetweenPoints(ud,xt) local unit ot local unit rt local unit bp local integer Wk local trigger jD call RemoveUnit(ee[iP]) set bp=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'ewsp',ud,0) call SetUnitColor(bp,PLAYER_COLOR_RED) if not vv then call aC("Nuclear missile launched by "+AD(iP)+"!") endif call PingMinimapForForceEx(Fx,GetLocationX(ud),GetLocationY(ud),2.4,0,93.36,35.55,0.39) call H1(ud,Hq/10.0+1400.0) set rt=qf('o00B',Player(PLAYER_NEUTRAL_PASSIVE),Ec(xt,RMaxBJ(200,RMinBJ(4000,DistanceBetweenPoints(ud,xt)*0.5)),AngleBetweenPoints(xt,ud)),0) call SetUnitFlyHeightBJ(rt,6000.00,9000.00) call RC(0.25) set ot=CreateUnitAtLoc(Player(PLAYER_NEUTRAL_PASSIVE),'o00B',xt,0) call IssueTargetOrder(ot,"attack",rt) call RC(2.75) call RemoveUnit(rt) call RemoveUnit(ot) if Hq>2500 then call RC(1.0) set Hq=Hq-2500.0 endif if Hq>2500 then call RC(1.0) set Hq=Hq-2500.0 endif call k1() call OC(Hq/ 2500.0) call RemoveUnit(bp) set Wk=wk(ud,iP,Fd(iP)) set ee[iP]=CreateUnit(Player(iP),'n00B',14000,10500,0) call RemoveLocation(ud) call RemoveLocation(xt) if GetRandomInt(0,Wk+1)>1 then set jD=CreateTrigger() call TriggerAddAction(jD,function K1) call TriggerRegisterTimerEvent(jD,GetRandomInt(3,30),false) endif loop exitwhen Wk<1 call OC(ph(150.0)) if De>0 then call uk(De-1) endif set Wk=Wk-1 endloop endfunction function M1 takes nothing returns nothing set MA=CreateTrigger() call TriggerAddCondition(MA,Condition(function L1)) call TriggerAddAction(MA,function m1) endfunction function p1 takes nothing returns boolean return GetIssuedOrderId()==OrderId("immolation") endfunction function P1 takes nothing returns nothing local unit LC=GetOrderedUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) if qr[iP]then return endif set qr[iP]=true call IssueImmediateOrder(LC,"holdposition") call SetPlayerAbilityAvailable(oP,'A0CK',true) set fr[iP]=0.0 call SetUnitMoveSpeed(LC,Ld(iP,false)) call UnitAddAbility(LC,'Abun') call UnitAddAbility(LC,'Aeth') call UnitAddAbility(LC,'A0K6') call RC(2.9) if not Ed(iP)then return endif if GetUnitAbilityLevel(LC,'B02B')<1 then return endif call UnitRemoveAbility(LC,'Abun') call UnitRemoveAbility(LC,'Aeth') if B[iP]==6 then call SetUnitAbilityLevel(LC,'A02C',18) endif endfunction function q1 takes nothing returns nothing set pA=CreateTrigger() call TriggerAddCondition(pA,Condition(function p1)) call TriggerAddAction(pA,function P1) endfunction function Q1 takes nothing returns boolean return GetIssuedOrderId()==OrderId("unimmolation") endfunction function S1 takes nothing returns nothing local unit LC=GetOrderedUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) if not qr[iP]then return endif set qr[iP]=false call RemoveUnit(kr[iP]) set kr[iP]=null call SetPlayerAbilityAvailable(oP,'A0CK',false) set fr[iP]=1.0 call SetUnitMoveSpeed(LC,Ld(iP,false)) call TriggerSleepAction(0.1) call UnitRemoveAbility(LC,'A0K6') if B[iP]==6 then call SetUnitAbilityLevel(LC,'A02C',1+GetUnitAbilityLevel(LC,'A00A')) endif if Ed(iP)then if GetUnitAbilityLevel(LC,'Abun')<1 then call UnitAddAbility(LC,'Abun') endif if GetUnitAbilityLevel(LC,'Aeth')<1 then call UnitAddAbility(LC,'Aeth') endif call RC(2.9) endif call UnitRemoveAbility(LC,'Abun') call UnitRemoveAbility(LC,'Aeth') set kr[iP]=qf('n017',oP,GetUnitLoc(LC),0) endfunction function t1 takes nothing returns nothing set PA=CreateTrigger() call TriggerAddCondition(PA,Condition(function Q1)) call TriggerAddAction(PA,function S1) endfunction function T1 takes nothing returns boolean return GetSpellAbilityId()=='A02C' endfunction function u1 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local unit LC=GetSpellTargetUnit() local real U1=0.35+GetRandomReal(0.03*Fd(GetPlayerId(GetOwningPlayer(Od))),0.31) local real w1=GetUnitState(Od,UNIT_STATE_MAX_MANA)-GetUnitState(Od,UNIT_STATE_MANA) local real EH=0.5*GetUnitState(LC,UNIT_STATE_LIFE) local real W1=1.0 local real Y1=0.01 local lightning fx=null if GetUnitTypeId(LC)=='u00B' then call iC(GetOwningPlayer(Od),"Transfer aborted. Invalid target.") call Vf(Od,'A02C',19,false) return endif if IsUnitType(LC,UNIT_TYPE_HERO)or(IsUnitType(LC,UNIT_TYPE_ANCIENT)and(GetPlayerId(GetOwningPlayer(LC))>9))then if LC==po then set W1=0.25 else set W1=0.5 endif elseif GetUnitAbilityLevel(LC,'AIlz')>0 then set W1=0.75 endif if Od==LC then set U1=U1*2.0 endif if w1<40.0 then call iC(GetOwningPlayer(Od),"Transfer aborted. Energy level near capacity.") call Vf(Od,'A02C',19,false) return endif if(EH*U1*W1)<40.0 then call iC(GetOwningPlayer(Od),"Transfer aborted. Target health insufficient.") call Vf(Od,'A02C',19,false) return endif if GetUnitAbilityLevel(LC,'A09D')!=2 then if(EH*U1)>w1 then set EH=w1/U1 endif call SetUnitState(LC,UNIT_STATE_LIFE,GetUnitState(LC,UNIT_STATE_LIFE)-EH*W1) set w1=RMinBJ(EH,1125.0)*U1 set EH=EH-1125.0 loop exitwhen EH<1.0 set U1=U1-Y1 set Y1=Y1+Y1 if U1<0.01 then set U1=0.01 endif set w1=w1+RMinBJ(EH,125.0)*U1 set EH=EH-125.0 endloop call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+w1*W1) endif if Od!=LC then set fx=AddLightningEx("DRAM",true,GetUnitX(Od),GetUnitY(Od),50,GetUnitX(LC),GetUnitY(LC),50) call SetLightningColor(fx,1,0.75,0.75,1) call TriggerSleepAction(0.1) call DestroyLightning(fx) set fx=null endif endfunction function z1 takes nothing returns nothing set qA=CreateTrigger() call TriggerAddCondition(qA,Condition(function T1)) call TriggerAddAction(qA,function u1) endfunction function Z1 takes nothing returns boolean return GetLearnedSkillBJ()=='A051' endfunction function v2 takes nothing returns nothing call UnitAddItemById(GetLearningUnit(),'I020') endfunction function e2 takes nothing returns nothing set QA=CreateTrigger() call TriggerAddCondition(QA,Condition(function Z1)) call TriggerAddAction(QA,function v2) endfunction function o2 takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"borgforcefield",XC(jD)) if iP>-1 then call StoreInteger(Ae,"borgforcefieldturnoffdone",I2S(iP),2) call iC(Player(iP),"Force field generator overloading...") call RC(10) if GetStoredInteger(Ae,"borgforcefieldturnoffdone",I2S(iP))>1 then call iC(Player(iP),"Force field generator overloaded.") call qS(iP,GetStoredBoolean(Ae,"borgforcefieldturnoffnanites",I2S(iP)),true) endif endif call FlushStoredInteger(Ae,"borgforcefield",XC(jD)) call DisableTrigger(jD) call DestroyTrigger(jD) endfunction function r2 takes integer iP returns trigger local trigger jD=CreateTrigger() call StoreInteger(Ae,"borgforcefield",XC(jD),iP) call TriggerAddAction(jD,function o2) call TriggerRegisterTimerEvent(jD,110,false) return jD endfunction function i2 takes nothing returns boolean return GetSpellAbilityId()=='A053' endfunction function a2 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) if GetStoredInteger(Ae,"borgforcefieldturnoffdone",I2S(iP))>0 then call qS(iP,GetStoredBoolean(Ae,"borgforcefieldturnoffnanites",I2S(iP)),true) endif endfunction function n2 takes integer iP,boolean QS returns trigger local trigger jD=CreateTrigger() call StoreBoolean(Ae,"borgforcefieldturnoffnanites",I2S(iP),QS) call StoreInteger(Ae,"borgforcefieldturnoffdone",I2S(iP),1) call TriggerAddCondition(jD,Condition(function i2)) call TriggerAddAction(jD,function a2) call TriggerRegisterUnitEvent(jD,X[iP],EVENT_UNIT_SPELL_EFFECT) return jD endfunction function V2 takes nothing returns boolean return GetSpellAbilityId()=='AOwk' endfunction function E2 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local real X2=vx[iP]*50.0-7.0 local integer O2=1 local real tS=0.0 local boolean QS=UnitHasBuffBJ(Od,'BNms') local trigger R2=r2(iP) local trigger I2 local boolean A2=vx[iP]<0.62 call RemoveUnit(ee[iP]) set vx[iP]=vx[iP]+0.08-0.01*RMinBJ(Fe,3) call SetUnitAbilityLevel(Od,'A05C',9) call SetUnitAbilityLevel(Od,'A09D',2) if QS then call UnitRemoveAbility(Od,'BNms') endif call PS(iP,"+") call SaveEffectHandle(qi,StringHash("borgforcefieldfx"),iP,AddSpecialEffectTarget("Abilities\\Spells\\Human\\ManaShield\\ManaShieldCaster.mdl",Od,"origin")) set I2=n2(iP,QS) loop call RC(1.0) exitwhen not Ed(iP) exitwhen GetStoredInteger(Ae,"borgforcefieldturnoffdone",I2S(iP))<1 exitwhen GetUnitState(Od,UNIT_STATE_MANA)0 then call qS(iP,QS,Ed(iP)) endif if IsTriggerEnabled(R2)then call StoreInteger(Ae,"borgforcefield",XC(R2),-1) endif call RC(2) call FlushStoredBoolean(Ae,"borgforcefieldturnoffnanites",I2S(iP)) call DestroyTrigger(I2) if A2 and not(vx[iP]<0.62)then call iC(Player(iP),"Force Field system has become degraded.") endif call RC(1) set ee[iP]=qf('n00A',Player(iP),GetUnitLoc(Od),0) endfunction function N2 takes nothing returns nothing set sA=CreateTrigger() call TriggerAddCondition(sA,Condition(function V2)) call TriggerAddAction(sA,function E2) endfunction function b2 takes nothing returns boolean return GetSpellAbilityId()=='A046' endfunction function B2 takes nothing returns nothing local unit c2=GetSpellAbilityUnit() local unit vH=qf('o00J',GetOwningPlayer(c2),GetUnitLoc(c2),0) call UnitAddAbility(vH,'A045') call IssueTargetOrder(vH,"innerfire",c2) call RC(4) call RemoveUnit(vH) endfunction function C2 takes nothing returns nothing set SA=CreateTrigger() call TriggerAddCondition(SA,Condition(function b2)) call TriggerAddAction(SA,function B2) endfunction function d2 takes nothing returns boolean return GetSpellAbilityId()=='A047' endfunction function D2 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer NH=GetUnitAbilityLevelSwapped('A047',Od) call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+500.0) call PlaySoundOnUnitBJ(NE,65,Od) call KillSoundWhenDoneBJ(GetLastPlayedSound()) if NH==1 then call OC(150.0) elseif NH==2 then call OC(115.0) elseif NH==3 then call OC(95.0) elseif NH==4 then call OC(80.0) elseif NH==5 then call OC(70.0) else call OC(60.0) endif if Xd(Od)then call iC(GetOwningPlayer(Od),"Backup battery finished recharging.") endif endfunction function f2 takes nothing returns nothing set tA=CreateTrigger() call TriggerAddCondition(tA,Condition(function d2)) call TriggerAddAction(tA,function D2) endfunction function F2 takes nothing returns boolean return GetSpellAbilityId()=='A0CJ' endfunction function G2 takes nothing returns nothing local item Jd=GetSpellTargetItem() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) local integer Lc=GetItemTypeId(Jd) local boolean QS=GetUnitAbilityLevel(LC,'BNms')>0 if GetUnitAbilityLevel(LC,'A0CJ')>1 then return endif if(Lc!='I02A')and(Lc!='I02B')then call iC(oP,"You must target a shield capacitor item.") return endif if UnitHasItem(LC,Jd)then call iC(oP,"Targeted item cannot be in your inventory.") return endif if not IsItemPawnable(Jd)then call iC(oP,"You cannot integrate a replicated item.") return endif call RemoveItem(Jd) call SetUnitAbilityLevel(LC,'A0CJ',2) set Xi[iP]=1 call SetUnitMoveSpeed(LC,Ld(iP,false)) if QS then call UnitRemoveAbility(LC,'BNms') endif call SetPlayerAbilityAvailable(oP,'A05G'+MS(LC),false) call SetPlayerAbilityAvailable(oP,'A05G'+MS(LC)+1,true) if QS then call IssueImmediateOrder(LC,"manashieldon") call IssueImmediateOrder(LC,"stop") endif call iC(oP,"Nanites generator upgraded. Remaining parts placed on the ground at your feet.") call CreateItem('I04J',GetUnitX(LC),GetUnitY(LC)) set oP=null set LC=null set Jd=null endfunction function h2 takes nothing returns nothing set TA=CreateTrigger() call TriggerAddCondition(TA,Condition(function F2)) call TriggerAddAction(TA,function G2) endfunction function H2 takes nothing returns boolean return GetIssuedOrderId()==OrderId("immolation") endfunction function j2 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetOrderedUnit())) if qr[iP]then return endif set qr[iP]=true endfunction function J2 takes nothing returns nothing set uA=CreateTrigger() call TriggerAddCondition(uA,Condition(function H2)) call TriggerAddAction(uA,function j2) endfunction function k2 takes nothing returns boolean return(GetIssuedOrderId()==OrderId("unimmolation"))and(GetUnitAbilityLevel(GetOrderedUnit(),'B027')>0) endfunction function K2 takes integer iP returns boolean return(iP<10)or(iP>11) endfunction function l2 takes nothing returns boolean local unit LC=GetFilterUnit() if GetUnitPointValue(LC)<101 then return false endif if IsUnitType(LC,UNIT_TYPE_ANCIENT)or IsUnitType(LC,UNIT_TYPE_MECHANICAL)then return false endif if K2(GetPlayerId(GetOwningPlayer(LC)))then return false endif return true endfunction function L2 takes nothing returns nothing call IssueTargetOrder(GetEnumUnit(),"attack",gx) endfunction function m2 takes nothing returns nothing call IssuePointOrder(GetEnumUnit(),"move",Fr[0],Fr[1]) endfunction function M2 takes nothing returns nothing local unit Od=GetOrderedUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local location ud local group g local effect fx if not qr[iP]then return endif set qr[iP]=false set ud=GetUnitLoc(Od) set g=bc(1600.00,ud,Condition(function l2)) set fx=AddSpecialEffectLoc("Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFog.mdl",ud) call TriggerSleepAction(0.1) if Xd(Od)then set gx=Od call ForGroup(g,function L2) else set Fr[0]=GetLocationX(ud) set Fr[1]=GetLocationY(ud) call ForGroup(g,function m2) endif call RemoveLocation(ud) call DestroyGroup(g) call DestroyEffect(fx) endfunction function p2 takes nothing returns nothing set UA=CreateTrigger() call TriggerAddCondition(UA,Condition(function k2)) call TriggerAddAction(UA,function M2) endfunction function P2 takes nothing returns boolean return GetSpellAbilityId()=='A09C' endfunction function q2 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local location tF=GetUnitLoc(Od) local location ud=GetSpellTargetLoc() local integer mc=GetUnitAbilityLevelSwapped(GetSpellAbilityId(),Od) local unit vH=Tf('o00J',Player(PLAYER_NEUTRAL_AGGRESSIVE),tF,GetUnitFacing(Od)) call RemoveLocation(tF) call UnitAddAbility(vH,'A0BY') call SetUnitAbilityLevel(vH,'A0BY',mc) call IssuePointOrderLoc(vH,"clusterrockets",ud) call RC(2) call RemoveUnit(vH) call RemoveLocation(ud) endfunction function Q2 takes nothing returns nothing set wA=CreateTrigger() call TriggerAddCondition(wA,Condition(function P2)) call TriggerAddAction(wA,function q2) endfunction function S2 takes nothing returns boolean return GetSpellAbilityId()=='A0EF' endfunction function t2 takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local integer NH=GetUnitAbilityLevel(SJ,'A0EF') local location XY=GetSpellTargetLoc() local player oP=GetOwningPlayer(SJ) local location ud=GetUnitLoc(SJ) local unit UJ local unit KD set KD=Tf('o00J',oP,ud,GetUnitFacing(SJ)) call UnitAddAbility(KD,'A0EG') set UJ=Tf('o00N',oP,XY,0) call IssueTargetOrder(KD,"drunkenhaze",UJ) call RC(DistanceBetweenPoints(ud,XY)*0.0012) call RemoveLocation(ud) call RemoveUnit(KD) call RemoveUnit(UJ) set UJ=qf('n012'+Dr,oP,XY,0.00) if Dr==0 then set Dr=2 else set Dr=0 endif call SetUnitAnimation(UJ,"stand medium") call RC(4+NH*2) call RemoveUnit(UJ) endfunction function T2 takes nothing returns nothing set WA=CreateTrigger() call TriggerAddCondition(WA,Condition(function S2)) call TriggerAddAction(WA,function t2) endfunction function u2 takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer iP=GetStoredInteger(Ae,"pyro_combust_msg",XC(jD)) if Ed(iP)then call iC(Player(iP),"Fuel tanks fully recharged.") endif call FlushStoredString(Ae,"pyro_combust_msg",XC(jD)) call DestroyTrigger(jD) endfunction function U2 takes nothing returns boolean return GetSpellAbilityId()=='A0E9' endfunction function w2 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer NH=8+2*GetUnitAbilityLevel(Od,'A0E9') local effect KD=AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Barkskin\\BarkSkinTarget.mdl",Od,"chest") local trigger jD=CreateTrigger() local real EH call StoreInteger(Ae,"pyro_combust_msg",XC(jD),iP) call TriggerAddAction(jD,function u2) call TriggerRegisterTimerEvent(jD,120,false) call AttachSoundToUnit(KE,Od) call SetSoundVolume(KE,105) call StartSound(KE) loop call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)+50.0) set EH=GetUnitState(Od,UNIT_STATE_LIFE) if EH>5.0 then call SetUnitState(Od,UNIT_STATE_LIFE,EH-4.0) endif call RC(1) exitwhen not Ed(iP) set NH=NH-1 exitwhen NH<1 endloop call StopSound(KE,false,true) call DestroyEffect(KD) endfunction function W2 takes nothing returns nothing set YA=CreateTrigger() call TriggerAddCondition(YA,Condition(function U2)) call TriggerAddAction(YA,function w2) endfunction function Y2 takes integer iP,unit Od,unit LC,integer NH,real Hq,real lP,boolean z2 returns unit local real Z2=RMinBJ((500-(Hq-500)*(0.36-NH*0.01))/500,1.0) local real gH=(200+50*NH+Go[iP*2])*Z2*lP local real EH=GetUnitState(LC,UNIT_STATE_LIFE) local unit vH set Go[iP*2]=0 set Go[iP*2+1]=1 if UnitHasBuffBJ(LC,'B01J')then set gH=gH*0.166666 endif if gH0)then return endif set vH=qf('o00J',GetOwningPlayer(Od),GetUnitLoc(LC),0) call UnitAddAbility(vH,'A0ET') call SetUnitAbilityLevel(vH,'A0ET',NH) call IssueTargetOrder(vH,"innerfire",LC) call AttachSoundToUnit(lE,LC) call SetSoundVolume(lE,127) call StartSound(lE) if IsUnitType(LC,UNIT_TYPE_HERO)then call UnitRemoveAbility(LC,'A0EO') call UnitRemoveAbility(LC,'A0EP') call UnitRemoveAbility(LC,'A0EQ') call UnitRemoveAbility(LC,'A0ER') call UnitRemoveAbility(LC,'A0ES') call UnitRemoveAbility(LC,'A0HH') call UnitRemoveAbility(LC,'A0JE') call UnitRemoveAbility(LC,'A0JF') set EH=GetUnitState(LC,UNIT_STATE_MAX_LIFE) if EH>99999 then call UnitAddAbility(LC,'A0JF') elseif EH>69999 then call UnitAddAbility(LC,'A0JE') elseif EH>49999 then call UnitAddAbility(LC,'A0HH') elseif EH>34999 then call UnitAddAbility(LC,'A0ES') elseif EH>24999 then call UnitAddAbility(LC,'A0ER') elseif EH>17499 then call UnitAddAbility(LC,'A0EQ') elseif EH>9999 then call UnitAddAbility(LC,'A0EP') else call UnitAddAbility(LC,'A0EO') endif endif call RC(0.5) call RemoveUnit(vH) set vH=null call StopSound(lE,false,true) loop exitwhen LC==null set EH=GetUnitState(LC,UNIT_STATE_LIFE) exitwhen not(EH>0) set gH=GetRandomReal(i3,i3*1.1) if GetUnitAbilityLevel(LC,'Avul')>0 then set gH=RMinBJ(gH,EH-1.0) endif if IsUnitType(LC,UNIT_TYPE_HERO)then call lD("-"+I2S(NC(gH)),LC,255,128,0,true,12,0.5) else call lD("-"+I2S(NC(gH)),LC,255,128,0,true,8,0.5) endif if gH>=EH then call SetUnitState(LC,UNIT_STATE_LIFE,1) call UnitDamageTarget(Od,LC,9999,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) exitwhen true else call SetUnitState(LC,UNIT_STATE_LIFE,EH-gH) endif set i3=i3*a3 set i=i+1 exitwhen i>9 if i<3 then call RC(0.5) else call RC(0.5*(i-1.0)) endif endloop endfunction function n3 takes nothing returns nothing set ZA=CreateTrigger() call TriggerAddCondition(ZA,Condition(function o3)) call TriggerAddAction(ZA,function r3) endfunction function V3 takes nothing returns boolean return GetSpellAbilityId()=='A0JT' endfunction function E3 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer NH=GetUnitAbilityLevel(Od,'A0JT') if NH==1 then set Cr[iP]=AddSpecialEffectTarget("Abilities\\Spells\\Other\\Incinerate\\IncinerateBuff.mdl",Od,"chest") call UnitAddAbility(Od,'A0JU') call SetUnitAbilityLevel(Od,'A01B',1) call SetUnitAbilityLevel(Od,'A0JT',2) elseif NH==2 then call UnitRemoveAbility(Od,'A0JU') call UnitAddAbility(Od,'A0JV') call SetUnitAbilityLevel(Od,'A01B',2) call SetUnitAbilityLevel(Od,'A0JT',3) call TriggerSleepAction(0.1) call UnitRemoveAbility(Od,'Boar') else call UnitRemoveAbility(Od,'A0JV') call SetUnitAbilityLevel(Od,'A01B',3) call SetUnitAbilityLevel(Od,'A0JT',1) call TriggerSleepAction(0.1) call UnitRemoveAbility(Od,'Boar') call DestroyEffect(Cr[iP]) set Cr[iP]=null endif endfunction function X3 takes nothing returns nothing set vN=CreateTrigger() call TriggerAddCondition(vN,Condition(function V3)) call TriggerAddAction(vN,function E3) endfunction function O3 takes nothing returns boolean return GetSpellAbilityId()=='A0EW' endfunction function R3 takes nothing returns nothing local location ud=GetSpellTargetLoc() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local unit I3=qf('o019',oP,GetUnitLoc(LC),GetUnitFacing(LC)) local fogmodifier A3 call SetUnitTimeScale(I3,10) call IssuePointOrderLoc(I3,"move",ud) call RemoveLocation(ud) set ud=null call UnitApplyTimedLife(I3,'BOwd',20.1) call OC(18.5) if(I3!=null)and GetUnitState(I3,UNIT_STATE_LIFE)>0 then set ud=GetUnitLoc(I3) call RC(1) if(I3!=null)and GetUnitState(I3,UNIT_STATE_LIFE)>0 then call RemoveLocation(ud) set ud=GetUnitLoc(I3) endif endif if ud!=null then set A3=CreateFogModifierRadiusLoc(oP,FOG_OF_WAR_VISIBLE,ud,800.00,true,false) call FogModifierStart(A3) call RemoveLocation(ud) call OC(60) call DestroyFogModifier(A3) endif endfunction function N3 takes nothing returns nothing set eN=CreateTrigger() call TriggerAddCondition(eN,Condition(function O3)) call TriggerAddAction(eN,function R3) endfunction function b3 takes nothing returns boolean local integer Lc=GetUnitTypeId(GetDyingUnit()) return(Lc>='n01A')and(Lc<='n01D') endfunction function B3 takes nothing returns nothing local unit LC=GetDyingUnit() local integer Lc=GetUnitTypeId(LC)-'n01A' set Wr[GetPlayerId(GetOwningPlayer(LC))*4+Lc]=-1 if Lc==2 then call RC(2.666) call SetUnitBlendTime(LC,0) else if Lc==0 then call RC(1.867) elseif Lc==1 then call RC(1.667) else call RC(3.334) endif call SetUnitBlendTime(LC,0) call SetUnitAnimation(LC,"decay flesh") endif call GroupAddUnit(bj_suspendDecayFleshGroup,LC) call TimerStart(bj_delayedSuspendDecayTimer,0.01,false,null) endfunction function c3 takes nothing returns nothing set xN=CreateTrigger() call TriggerAddCondition(xN,Condition(function b3)) call TriggerAddAction(xN,function B3) endfunction function C3 takes nothing returns boolean local integer Oy=GetSpellAbilityId() return(Oy>='A0M5')and(Oy<='A0M7') endfunction function d3 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() call CreateItem(GetSpellAbilityId()-'A0M5'+'I04D',GetUnitX(LC),GetUnitY(LC)) endfunction function D3 takes nothing returns nothing set oN=CreateTrigger() call TriggerAddCondition(oN,Condition(function C3)) call TriggerAddAction(oN,function d3) endfunction function f3 takes real x,real y returns nothing local unit Op local real F3 local real g3 local real G3 local real h3 local integer H3=0 local integer i=Jx[0] loop exitwhen i<1 if Jx[i]==1 then set Op=Qi[i+Jx[0]] set F3=GetUnitX(Op) set g3=GetUnitY(Op) if not HC(F3,g3,x,y,224)then if GetRandomInt(0,H3)>0 then if F3>x then set G3=GetRandomReal(x+265,x+440) else set G3=GetRandomReal(x-440,x-265) endif if g3>y then set h3=GetRandomReal(y+265,y+440) else set h3=GetRandomReal(y-440,y-265) endif call IssuePointOrder(Op,"move",G3,h3) endif set H3=H3+4 endif endif set i=i-1 endloop set Op=null endfunction function j3 takes unit SJ,real J3,real x,real y returns nothing local real EH local unit LC local group g=CreateGroup() call GroupEnumUnitsInRange(g,x,y,96,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if(GetUnitAbilityLevel(LC,'Avul')<1)and(GetUnitAbilityLevel(LC,'Aloc')<1)and(GetUnitAbilityLevel(LC,'A09D')!=2)then set EH=GetUnitState(LC,UNIT_STATE_LIFE) if(EH-J3)>1.0 then call SetUnitState(LC,UNIT_STATE_LIFE,EH-J3) else call SetUnitState(LC,UNIT_STATE_LIFE,1.0) endif call UnitDamageTarget(SJ,LC,J3,true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) endif call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set g=null endfunction function k3 takes unit SJ,integer tJ,real xk,real K3,integer l3,integer L3,real m3,real M3 returns nothing local player uJ=GetOwningPlayer(SJ) local unit UJ local unit KD local real p3=GetUnitX(SJ) local real P3=GetUnitY(SJ) if xk>0.0 then if(GetUnitState(SJ,UNIT_STATE_MAX_MANA)-GetUnitState(SJ,UNIT_STATE_MANA))>=xk then call SetUnitState(SJ,UNIT_STATE_MANA,GetUnitState(SJ,UNIT_STATE_MANA)+xk) set xk=0.0 endif endif set KD=CreateUnit(uJ,'o00J',p3,P3,GetUnitFacing(SJ)) call UnitAddAbility(KD,'A030') set UJ=CreateUnit(uJ,'o00N',m3,M3,0) call IssueTargetOrder(KD,"drunkenhaze",UJ) call RC(CC(p3,P3,m3,M3)*0.0012) call RemoveUnit(KD) call RemoveUnit(UJ) if xk>0.0 then call SetUnitState(SJ,UNIT_STATE_MANA,GetUnitState(SJ,UNIT_STATE_MANA)+xk) endif if K3>0.0 then call j3(SJ,K3*0.5,m3,M3) endif set UJ=CreateUnit(uJ,'n000',m3,M3,0.00) call UnitAddAbility(UJ,E[IMinBJ(tJ-1,9)]) if l3>0 then call UnitAddAbility(UJ,'A0MA') call SetUnitAbilityLevel(UJ,'A0MA',IMinBJ(tJ,l3+2)) endif if L3>0 then call UnitAddAbility(UJ,'A0MB') call SetUnitAbilityLevel(UJ,'A0MB',IMinBJ(tJ,L3+2)) endif set KD=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'n000',m3,M3,0.00) call StopSoundBJ(OE,false) call PlaySoundOnUnitBJ(OE,100,KD) call ExplodeUnitBJ(UJ) call RC(1.1) call RemoveUnit(UJ) call RemoveUnit(KD) set UJ=null set KD=null set uJ=null endfunction function q3 takes nothing returns boolean return GetSpellAbilityId()=='A0L6' endfunction function Q3 takes nothing returns nothing local unit SJ=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(SJ)) local integer tJ=GetUnitAbilityLevel(SJ,'A0L6') local real x local real y local real lw local real gH if GetSpellTargetUnit()==null then set x=GetLocationX(GetSpellTargetLoc()) set y=GetLocationY(GetSpellTargetLoc()) else set x=GetUnitX(GetSpellTargetUnit()) set y=GetUnitY(GetSpellTargetUnit()) endif if tJ>10 then set lw=250 set gH=550 elseif tJ>9 then set lw=230 set gH=550 elseif tJ>8 then set lw=200 set gH=460 elseif tJ>7 then set lw=175 set gH=380 elseif tJ>6 then set lw=150 set gH=310 elseif tJ>5 then set lw=130 set gH=250 elseif tJ>4 then set lw=110 set gH=200 elseif tJ>3 then set lw=95 set gH=165 elseif tJ>2 then set lw=80 set gH=130 elseif tJ>1 then set lw=70 set gH=115 else set lw=60 set gH=100 endif set Ei[iP]=Ei[iP]+1 if tr[iP*19+1]>0 then call SetUnitAbilityLevel(SJ,'A0CN',tr[iP*19+1]) endif call f3(x,y) call k3(SJ,tJ,tr[iP*19+1]*0.01*lw,tr[iP*19+2]*0.225*gH,tr[iP*19+3],tr[iP*19+4],x,y) call RC(18) set Ei[iP]=Ei[iP]-1 if(Ei[iP]<1)and Ed(iP)then call SetUnitAbilityLevel(SJ,'A0CN',9) call UnitRemoveAbility(SJ,'B02Y') endif set SJ=null endfunction function s3 takes nothing returns nothing set rN=CreateTrigger() call TriggerAddCondition(rN,Condition(function q3)) call TriggerAddAction(rN,function Q3) endfunction function S3 takes nothing returns boolean return GetIssuedOrderId()==OrderId("immolation") endfunction function t3 takes nothing returns nothing local unit Od=GetOrderedUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local effect array KD local integer i=0 local real T3=268.0+220.0*(1.0-Pow(0.9,ho)) if qr[iP]then return endif set qr[iP]=true loop exitwhen i>3 if tr[iP*19+6+i]>0 then set ur[iP*4+i]=CreateUnit(oP,'n01A'+i,GetUnitX(Od)+GetRandomInt(-90,90),GetUnitY(Od)+GetRandomInt(-90,90),GetRandomInt(0,359)) set KD[i]=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(ur[iP*4+i]),GetUnitY(ur[iP*4+i])) if fe<1 then if J<3 then call UnitAddAbility(ur[iP*4+i],'A0KE') endif else call UnitAddAbility(ur[iP*4+i],'A06Z') endif if i==0 then call SetUnitAbilityLevel(ur[iP*4+i],'A0M0',tr[iP*19+6+i]) call SetUnitAbilityLevel(ur[iP*4+i],'A0M9',tr[iP*19+6+i]) if go[iP]then call IssueImmediateOrder(ur[iP*4+i],"healon") endif call SetUnitState(ur[iP*4+i],UNIT_STATE_MANA,Wr[iP*4+i]) call SetUnitMoveSpeed(ur[iP*4+i],T3) elseif i==1 then call SetUnitAbilityLevel(ur[iP*4+i],'A0LA',tr[iP*19+6+i]) call SetUnitMoveSpeed(ur[iP*4+i],T3) elseif i==2 then call SetUnitAbilityLevel(ur[iP*4+i],'A0M2',tr[iP*19+6+i]) call SetUnitAbilityLevel(ur[iP*4+i],'A0M3',tr[iP*19+6+i]) call SetUnitAbilityLevel(ur[iP*4+i],'A0IA',tr[iP*19+6+i]) if tr[iP*19+6+i]>5 then call UnitAddAbility(ur[iP*4+i],'A0CT'+tr[iP*19+6+i]-6) endif elseif i==3 then call TriggerRegisterUnitEvent(oN,ur[iP*4+i],EVENT_UNIT_SPELL_EFFECT) call SetUnitAbilityLevel(ur[iP*4+i],'A041',6+(tr[iP*19+6]+tr[iP*19+7]+tr[iP*19+8])/2+tr[iP*19+9]) call SetUnitAbilityLevel(ur[iP*4+i],'A0M4',tr[iP*19+6+i]) if tr[iP*19+6+i]>1 then call UnitAddAbility(ur[iP*4+i],a[tr[iP*19+6+i]-2]) endif call SetUnitState(ur[iP*4+i],UNIT_STATE_MANA,Wr[iP*4+i]) call IssueImmediateOrder(ur[iP*4+i],"manashieldon") call SetUnitMoveSpeed(ur[iP*4+i],T3) endif call IssueTargetOrder(ur[iP*4+i],"smart",Od) else set KD[i]=null endif set i=i+1 endloop call TriggerSleepAction(Xx) set i=0 loop exitwhen i>3 if KD[i]!=null then call DestroyEffect(KD[i]) set KD[i]=null endif set i=i+1 endloop endfunction function u3 takes nothing returns nothing set iN=CreateTrigger() call TriggerAddCondition(iN,Condition(function S3)) call TriggerAddAction(iN,function t3) endfunction function U3 takes nothing returns boolean return GetIssuedOrderId()==OrderId("unimmolation") endfunction function w3 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetOrderedUnit())) if not qr[iP]then return endif set qr[iP]=false call bj(iP) endfunction function W3 takes nothing returns nothing set aN=CreateTrigger() call TriggerAddCondition(aN,Condition(function U3)) call TriggerAddAction(aN,function w3) endfunction function y3 takes nothing returns nothing local unit Od=GetTriggerUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) call RC(1) if Ed(iP)and(GetUnitAbilityLevel(Od,'B02K')<1)then set qr[iP]=false call bj(iP) endif endfunction function Y3 takes nothing returns nothing set nN=CreateTrigger() call TriggerAddAction(nN,function y3) endfunction function z3 takes nothing returns boolean return GetUnitTypeId(GetOrderedUnit())=='n01A' endfunction function Z3 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetOrderedUnit())) local integer gJ=GetIssuedOrderId() if gJ==OrderId("healon")then set go[iP]=true elseif gJ==OrderId("healoff")then set go[iP]=false endif endfunction function v4 takes nothing returns nothing set VN=CreateTrigger() call TriggerAddCondition(VN,Condition(function z3)) call TriggerAddAction(VN,function Z3) endfunction function e4 takes nothing returns boolean return GetSpellAbilityId()=='A0KP' endfunction function x4 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer NH=GetUnitAbilityLevel(Od,'A0KP') local unit LC=GetSpellTargetUnit() local lightning fx=null local real qz local real lw=GetUnitState(Od,UNIT_STATE_MANA) local real m=(lw-50.0)*0.20 local real EH=GetUnitState(LC,UNIT_STATE_LIFE) local real kC=GetUnitState(LC,UNIT_STATE_MAX_LIFE) local real n local boolean o4=false if NH>5 then return endif if(Od!=LC)then set fx=AddLightning("LEAS",true,GetUnitX(Od),GetUnitY(Od),GetUnitX(LC),GetUnitY(LC)) endif if NH<2 then set qz=0.40 elseif NH<3 then set qz=0.50 set o4=GetRandomInt(0,4)==0 elseif NH<4 then set qz=0.65 set o4=GetRandomInt(0,2)==0 elseif NH<5 then set qz=0.80 set o4=GetRandomInt(0,2)>0 else set qz=1.00 set o4=true endif set n=m*qz if n>(kC-EH)then set m=(kC-EH)/qz endif call SetUnitState(Od,UNIT_STATE_MANA,lw-m) call SetUnitState(LC,UNIT_STATE_LIFE,EH+n) if o4 then call Vf(Od,'A0KP',6,false) endif if(Od!=LC)then if not o4 then call TriggerSleepAction(0.1) endif call DestroyLightning(fx) set fx=null endif endfunction function r4 takes nothing returns nothing set EN=CreateTrigger() call TriggerAddCondition(EN,Condition(function e4)) call TriggerAddAction(EN,function x4) endfunction function i4 takes item Jd returns boolean local integer Lc=GetItemTypeId(Jd) return(Lc=='I02M')or(Lc=='I02N')or(Lc=='I02O') endfunction function a4 takes unit LC returns boolean if GetPlayerId(GetOwningPlayer(LC))>8 then return false endif if not IsUnitType(LC,UNIT_TYPE_HERO)then return(GetUnitTypeId(LC)=='n01D')or(GetUnitTypeId(LC)=='n01A')or(GetUnitTypeId(LC)=='z009') endif return true endfunction function n4 takes nothing returns boolean return GetSpellAbilityId()=='A0KQ' endfunction function V4 takes nothing returns nothing local unit LC=GetSpellTargetUnit() local item Jd=GetSpellTargetItem() local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local integer E4=GetUnitAbilityLevel(Od,'A0KQ') local integer NH=(E4-1)/5+1 local lightning fx=null local real lw=GetUnitState(Od,UNIT_STATE_MANA) local real m local real Bm local real kC local real X4 if Jd!=null then if not i4(Jd)then call iC(oP,"Targeted item must be a circuit board.") call Vf(Od,'A0KQ',26,false) return endif call RemoveItem(Jd) if Ur[iP]<501.00 then call iC(oP,"Circuit board restored to great condition.") endif set Ur[iP]=Ur[iP]+1000.0 call SetUnitAbilityLevel(Od,'A0KQ',NH*5) call Vf(Od,'A0KQ',26,false) return endif if Od==LC then call Vf(Od,'A0KQ',26,false) return endif if not a4(LC)then call iC(oP,"Invalid target for energy transfer.") call Vf(Od,'A0KQ',26,false) return endif if NH<2 then set m=lw-100.0 set X4=GetRandomInt(80,88) elseif NH<3 then set m=lw-75.0 set X4=GetRandomInt(59,67) elseif NH<4 then set m=lw-50.0 set X4=GetRandomInt(44,50) elseif NH<5 then set m=lw-25.0 set X4=GetRandomInt(34,38) elseif NH<6 then set m=lw-0.0 set X4=GetRandomInt(26,28) else return endif if lw>999.0 then set m=m-250.0 elseif GetUnitAbilityLevel(Od,'B02K')>0 then if m>5.0 then set m=m-5.0 endif endif set fx=AddLightning("DRAM",true,GetUnitX(LC),GetUnitY(LC),GetUnitX(Od),GetUnitY(Od)) set Bm=GetUnitState(LC,UNIT_STATE_MANA) set kC=GetUnitState(LC,UNIT_STATE_MAX_MANA) if m>(kC-Bm)then set m=kC-Bm endif set X4=X4+X4*li[iP] if(Ur[iP]-X4*(m/500.0))<0.1 then set m=(Ur[iP]/X4)*500.0 endif set li[iP]=li[iP]+0.01*(m/500.0) if li[iP]>1.0 then set li[iP]=1.0 endif call SetUnitState(Od,UNIT_STATE_MANA,lw-m) call SetUnitState(LC,UNIT_STATE_MANA,Bm+m) set Ur[iP]=Ur[iP]-X4*(m/500.0) if Ur[iP]<1.0 then call iC(oP,"Circuit board burnt out. Replace it to re-enable Power Surge.") call SetUnitAbilityLevel(Od,'A0KQ',NH*5-4) elseif Ur[iP]<101.0 then call SetUnitAbilityLevel(Od,'A0KQ',NH*5-3) elseif Ur[iP]<251.0 then call SetUnitAbilityLevel(Od,'A0KQ',NH*5-2) elseif Ur[iP]<501.0 then call SetUnitAbilityLevel(Od,'A0KQ',NH*5-1) else call SetUnitAbilityLevel(Od,'A0KQ',NH*5) endif call TriggerSleepAction(0.1) call DestroyLightning(fx) set fx=null endfunction function O4 takes nothing returns nothing set XN=CreateTrigger() call TriggerAddCondition(XN,Condition(function n4)) call TriggerAddAction(XN,function V4) endfunction function R4 takes group g,location ud returns nothing local effect array KD local location array sk local unit array I4 local unit LC local real x local real y local integer iP local integer array id local integer i=0 local integer c loop set LC=FirstOfGroup(g) exitwhen LC==null set I4[i]=LC set i=i+1 call GroupRemoveUnit(g,LC) endloop set c=i set sk[GetPlayerId(U)]=GetCameraTargetPositionLoc() loop exitwhen i<1 set i=i-1 call UnitAddAbility(I4[i],'Avul') set iP=GetPlayerId(GetOwningPlayer(I4[i])) set ui[iP]=ui[iP]+1 set id[iP]=ui[iP] if ud==null then set x=GetUnitX(I4[i]) set y=GetUnitY(I4[i]) else set x=GetLocationX(ud) set y=GetLocationY(ud) endif set KD[i]=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x,y) set KD[i+9]=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",oe[iP]) call SetUnitPositionLoc(I4[i],oe[iP]) if not HC(GetLocationX(sk[iP]),GetLocationY(sk[iP]),x,y,1000)then call PanCameraToTimedLocForPlayer(Player(iP),oe[iP],0.15) endif call RemoveLocation(oe[iP]) if not RectContainsCoords(vE,x,y)then set oe[iP]=Location(x,y) else set oe[iP]=GetRectCenter(vE) endif endloop call RemoveLocation(sk[GetPlayerId(U)]) if ud!=null then call RemoveLocation(ud) endif if c<1 then return endif call RC(0.33) loop exitwhen i>=c if I4[i]!=null then call UnitRemoveAbility(I4[i],'Avul') endif call DestroyEffect(KD[i]) call DestroyEffect(KD[i+9]) set i=i+1 endloop call OC(19.67) loop exitwhen i<1 set i=i-1 if I4[i]!=null then set iP=GetPlayerId(GetOwningPlayer(I4[i])) if ui[iP]==id[iP]then if not Ed(iP)then call RemoveLocation(oe[iP]) set oe[iP]=GetRectCenter(vE) elseif not RectContainsLoc(vE,oe[iP])then call GroupAddUnit(g,I4[i]) endif endif endif endloop call R4(g,GetRectCenter(vE)) endfunction function A4 takes unit Od,integer iP,integer N4 returns nothing local effect Vt local effect Et local real x1=GetUnitX(Od) local real y1=GetUnitY(Od) local real x2 local real y2 local real array sk set ui[iP]=ui[iP]+1 if Od==Mi then call VS(Od,5) set x2=GetUnitX(po) set y2=GetUnitY(po) elseif I[N4]!=null then set x2=GetUnitX(I[N4]) set y2=GetUnitY(I[N4]) else set x2=GetUnitX(X[N4]) set y2=GetUnitY(X[N4]) endif set sk[GetPlayerId(U)]=GetCameraTargetPositionX() set sk[GetPlayerId(U)+9]=GetCameraTargetPositionY() set Vt=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",x1,y1) call SetUnitPosition(Od,x2,y2) set Et=AddSpecialEffect("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",GetUnitX(Od),GetUnitY(Od)) if not HC(sk[iP],sk[iP+9],x1,y1,1000)then if Player(iP)==U then call PanCameraToTimed(x2,y2,0.15) endif endif call RC(0.3) call DestroyEffect(Vt) call DestroyEffect(Et) set Vt=null set Et=null endfunction function b4 takes unit SJ returns nothing local group g2=CreateGroup() local group g=CreateGroup() local unit LC if SJ==Mi then call DestroyGroup(g) call DestroyGroup(g2) call A4(SJ,GetPlayerId(GetOwningPlayer(SJ)),GetPlayerId(GetOwningPlayer(SJ))) set g=null set g2=null return endif call GroupAddUnit(g2,SJ) if not RectContainsCoords(vE,GetUnitX(SJ),GetUnitY(SJ))then call GroupEnumUnitsInRange(g,GetUnitX(SJ),GetUnitY(SJ),150.00,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if(LC!=SJ)and(GetUnitPointValue(LC)==3)then if Xd(LC)and(GetUnitState(LC,UNIT_STATE_MANA)>500)and(Ti[GetPlayerId(GetOwningPlayer(LC))]==0)then call SetUnitState(LC,UNIT_STATE_MANA,GetUnitState(LC,UNIT_STATE_MANA)-250) call GroupAddUnit(g2,LC) endif endif call GroupRemoveUnit(g,LC) endloop endif call DestroyGroup(g) set g=null call R4(g2,null) call DestroyGroup(g2) set g2=null endfunction function B4 takes unit Od,integer N4 returns boolean local real x local real y if I[N4]!=null then return false endif set x=GetUnitX(Od) set y=GetUnitY(Od) if RectContainsCoords(vE,x,y)then return true endif set x=GetUnitX(X[N4]) set y=GetUnitY(X[N4]) if RectContainsCoords(vE,x,y)then return true endif return false endfunction function c4 takes unit Od returns string return"|r"+vD(GetPlayerId(GetOwningPlayer(Od)))+GetHeroProperName(Od)+"|r|cffffcc00" endfunction function C4 takes nothing returns boolean return GetSpellAbilityId()=='A0KR' endfunction function d4 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local player oP=GetOwningPlayer(Od) local integer iP=GetPlayerId(oP) local integer NH=GetUnitAbilityLevel(Od,'A0KR') local unit LC if(NH==3)or(NH==4)then return endif if NH==5 then call TriggerSleepAction(0.1) if Ed(iP)then call b4(Od) endif return endif if NH==1 then set LC=GetSpellTargetUnit() if GetUnitPointValue(LC)!=3 then call iC(oP,"You must select another player's officer.") else set yr[iP]=GetPlayerId(GetOwningPlayer(LC)) call TriggerSleepAction(0.1) call iC(oP,c4(LC)+" is your partner.") call SetUnitAbilityLevel(Od,'A0KR',2) endif return endif if yr[iP]<0 then if C>1 then call iC(oP,"You must select a new partner.") endif call SetUnitAbilityLevel(Od,'A0KR',1) return endif if B4(Od,yr[iP])then call iC(oP,"You cannot teleport into or out of the lab unless your partner is dead inside.") call Vf(Od,'A0KR',4,false) return endif if GetUnitState(Od,UNIT_STATE_MANA)<500.0 then call TriggerSleepAction(0.1) else call Vf(Od,'A0KR',1,true) endif if Ed(iP)then call UnitAddAbility(Od,'Abun') call UnitAddAbility(Od,'A0PN') call IssueImmediateOrder(Od,"voodoo") endif endfunction function D4 takes nothing returns nothing set ON=CreateTrigger() call TriggerAddCondition(ON,Condition(function C4)) call TriggerAddAction(ON,function d4) endfunction function f4 takes nothing returns boolean return GetSpellAbilityId()=='A0PN' endfunction function F4 takes nothing returns nothing local integer iP=GetPlayerId(GetOwningPlayer(GetSpellAbilityUnit())) set Ti[iP]=GetTimeOfDay() endfunction function g4 takes nothing returns nothing set RN=CreateTrigger() call TriggerAddCondition(RN,Condition(function f4)) call TriggerAddAction(RN,function F4) endfunction function G4 takes nothing returns boolean return GetSpellAbilityId()=='A0PN' endfunction function h4 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) local real YD=GetTimeOfDay()-Ti[iP] set Ti[iP]=0 call UnitRemoveAbility(LC,'A0PN') call UnitRemoveAbility(LC,'Abun') if YD<0.048 then return endif if Ed(iP)then if yr[iP]>-1 then call A4(LC,iP,yr[iP]) endif endif endfunction function H4 takes nothing returns nothing set IN=CreateTrigger() call TriggerAddCondition(IN,Condition(function G4)) call TriggerAddAction(IN,function h4) endfunction function j4 takes nothing returns boolean local integer id=GetSpellAbilityId() return(id=='A0L3')or(id=='A0L4')or(id=='A0L5') endfunction function J4 takes nothing returns nothing local integer id=GetSpellAbilityId() local player oP=GetOwningPlayer(GetSpellAbilityUnit()) call SelectUnitForPlayerSingle(Tr[GetPlayerId(oP)*3+id-'A0L3'],oP) endfunction function k4 takes nothing returns nothing set AN=CreateTrigger() call TriggerAddCondition(AN,Condition(function j4)) call TriggerAddAction(AN,function J4) endfunction function K4 takes nothing returns nothing local player oP=GetTriggerPlayer() local integer iP=GetPlayerId(oP) local integer i=0 local trigger jD=GetTriggeringTrigger() call DisableTrigger(jD) loop exitwhen i>2 if IsUnitSelected(Tr[iP*3+i],oP)then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],oP) endif call SelectUnitRemoveForPlayer(Tr[iP*3+i],oP) endif set i=i+1 endloop call RC(0.5) call EnableTrigger(jD) endfunction function l4 takes nothing returns nothing set NN=CreateTrigger() call TriggerAddAction(NN,function K4) endfunction function L4 takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local string m4=XC(jD) local integer iP=GetStoredInteger(Ae,"distortion_player",m4) local player oP=Player(iP) local group g=CreateGroup() local unit LC=null local boolean M4 loop set M4=true call GroupEnumUnitsOfPlayer(g,oP,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if GetUnitTypeId(LC)=='h00D' then set M4=false endif call GroupRemoveUnit(g,LC) endloop exitwhen M4 call TriggerSleepAction(3.0*Xx) endloop call SetPlayerTechResearched(oP,'R01T',tr[iP*19+4]) call DestroyGroup(g) call FlushStoredInteger(Ae,"distortion_player",m4) call DestroyTrigger(jD) endfunction function p4 takes integer iP returns nothing local trigger jD=CreateTrigger() call StoreInteger(Ae,"distortion_player",XC(jD),iP) call TriggerAddAction(jD,function L4) call TriggerRegisterTimerEvent(jD,0,false) endfunction function P4 takes nothing returns boolean local integer Lc=GetSpellAbilityId() return(Lc=='A0CA')or((Lc>'A0LA')and(Lc<'A0LR')) endfunction function q4 takes nothing returns nothing local integer Lc=GetSpellAbilityId() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer iP=GetPlayerId(oP) local integer i local integer j local real n if Lc=='A0CA' then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],oP) endif call SelectUnitRemoveForPlayer(LC,oP) return endif if Lc>'A0LI' then set i=2 set j=Lc-'A0LI' elseif Lc>'A0LE' then set i=1 set j=Lc-'A0LE' else set i=0 set j=Lc-'A0LA' endif if tr[iP*19+5*i]<1 then call iC(oP,"You have no points allocated.") return endif set tr[iP*19+5*i]=tr[iP*19+5*i]-1 set tr[iP*19+5*i+j]=tr[iP*19+5*i+j]+1 if tr[iP*19+5*i+j]<(8-i/2*4)then call SetUnitAbilityLevel(LC,Lc,tr[iP*19+5*i+j]+1) else call UnitRemoveAbility(LC,Lc) endif call Hj(iP) if tr[iP*19+5*i]<1 then if Ed(iP)then call SelectUnitAddForPlayer(X[iP],oP) endif call SelectUnitRemoveForPlayer(LC,oP) endif if Lc=='A0LG' then set n=1.03+0.04*tr[iP*19+5*i+j] if n>wr then set wr=n endif elseif Lc=='A0LD' then call SetPlayerTechResearched(oP,'Rhpt',(tr[iP*19+3]-1)*2+1) elseif Lc=='A0LE' then call p4(iP) endif if i<2 then return endif if j==1 then set i=GetUnitTypeId(X[iP])-'O01B' call SetPlayerTechResearched(oP,'R01Q'+i,tr[iP*19+11]) call SetUnitAcquireRangeBJ(X[iP],900-200*i+(100-25*i)*tr[iP*19+11]) elseif j==2 then if tr[iP*19+12]<4 then call SetPlayerTechResearched(oP,'R01S',tr[iP*19+12]) else call SetPlayerTechResearched(oP,'R020',1) endif elseif j==3 then call SetUnitMoveSpeed(X[iP],Ld(iP,true)) elseif j==4 then if pv[iP*Nx+4]>0 then call SetUnitAbilityLevel(X[iP],'A0KT',tr[iP*19+14]+5) else call SetUnitAbilityLevel(X[iP],'A0KT',tr[iP*19+14]+1) endif elseif j==5 then loop exitwhen GetUnitAbilityLevel(X[iP],'A0KP')<6 call TriggerSleepAction(0.1) endloop call SetUnitAbilityLevel(X[iP],'A0KP',tr[iP*19+15]+1) elseif j==6 then loop exitwhen GetUnitAbilityLevel(X[iP],'A0KQ')<26 call TriggerSleepAction(0.1) endloop call SetUnitAbilityLevel(X[iP],'A0KQ',GetUnitAbilityLevel(X[iP],'A0KQ')+5) elseif j==7 then call SetHeroInt(X[iP],GetHeroInt(X[iP],false)+3,true) call Sg(X[iP]) elseif j==8 then if mx[iP]>0 then call UnitRemoveAbility(X[iP],V[mx[iP]-1]) endif set mx[iP]=mx[iP]+1 call UnitAddAbility(X[iP],V[mx[iP]-1]) endif endfunction function Q4 takes nothing returns nothing set bN=CreateTrigger() call TriggerAddCondition(bN,Condition(function P4)) call TriggerAddAction(bN,function q4) endfunction function s4 takes nothing returns boolean return GetSpellAbilityId()=='A0ND' endfunction function S4 takes nothing returns nothing local unit yU=GetSpellTargetUnit() call SetUnitState(yU,UNIT_STATE_LIFE,GetUnitState(yU,UNIT_STATE_LIFE)+GetUnitState(yU,UNIT_STATE_MAX_LIFE)/25) endfunction function t4 takes nothing returns nothing set BN=CreateTrigger() call TriggerAddCondition(BN,Condition(function s4)) call TriggerAddAction(BN,function S4) endfunction function T4 takes nothing returns boolean return GetSpellAbilityId()=='A0NE' endfunction function u4 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local integer O1=GetPlayerId(GetOwningPlayer(Od)) local unit LC=GetSpellTargetUnit() local item I1=null local item A1=null local item N1=null local integer iO='A0NJ' local integer iG='A0NF' local integer iP='A0NG' local boolean bO local boolean bG local boolean bP local boolean U4=false local boolean w4=false local boolean W4=false local item Jd local unit Kd local integer i=GetUnitTypeId(LC) if i=='O001' then set iO='A0NH' set U4=true set w4=true set W4=true elseif i=='O01F' then set iO='A0NK' set U4=true set w4=true set W4=true elseif(i=='O00F')or(i=='O00M')then set iO='A0NI' endif set bO=GetUnitAbilityLevel(LC,iO)>0 set bG=GetUnitAbilityLevel(LC,iG)>0 set bP=GetUnitAbilityLevel(LC,iP)>0 if bO and bG and bP then call iC(Player(O1),"Target robot cannot be further modified.") call Vf(Od,'A0NE',2,false) return endif set Kd=Od loop exitwhen Kd==null set i=0 loop set Jd=UnitItemInSlot(Kd,i) if Jd!=null then if GetItemTypeId(Jd)=='I02M' then if I1==null then set I1=Jd endif elseif GetItemTypeId(Jd)=='I02N' then if A1==null then set A1=Jd endif elseif GetItemTypeId(Jd)=='I02O' then if N1==null then set N1=Jd endif endif endif set i=i+1 exitwhen i>5 endloop exitwhen Kd!=Od set Kd=bx[O1] endloop if(I1!=null)and not bO then call RemoveItem(I1) call UnitAddAbility(LC,iO) call iC(Player(O1),"Upgraded target's maximum health.") if not U4 then call TriggerRegisterUnitEvent(CN,LC,EVENT_UNIT_DEATH) endif else set I1=null endif if(A1!=null)and not bG then call RemoveItem(A1) call UnitAddAbility(LC,iG) call iC(Player(O1),"Upgraded target's attack speed.") if not w4 then call TriggerRegisterUnitEvent(dN,LC,EVENT_UNIT_DEATH) endif else set A1=null endif if(N1!=null)and not bP then call RemoveItem(N1) call UnitAddAbility(LC,iP) call iC(Player(O1),"Upgraded target's energy regeneration.") if not W4 then call TriggerRegisterUnitEvent(DN,LC,EVENT_UNIT_DEATH) endif else set N1=null endif if(I1==null)and(A1==null)and(N1==null)then call iC(Player(O1),"Required circuit board not in your inventory.") call Vf(Od,'A0NE',2,false) endif endfunction function y4 takes nothing returns nothing set cN=CreateTrigger() call TriggerAddCondition(cN,Condition(function T4)) call TriggerAddAction(cN,function u4) endfunction function Y4 takes nothing returns nothing local unit VF=GetDyingUnit() local real x=GetUnitX(VF) local real y=GetUnitY(VF) call CreateItem('I02M',x,y) endfunction function z4 takes nothing returns nothing set CN=CreateTrigger() call TriggerAddAction(CN,function Y4) endfunction function Z4 takes nothing returns nothing local unit VF=GetDyingUnit() local real x=GetUnitX(VF) local real y=GetUnitY(VF) call CreateItem('I02N',x,y) endfunction function v5 takes nothing returns nothing set dN=CreateTrigger() call TriggerAddAction(dN,function Z4) endfunction function e5 takes nothing returns nothing local unit VF=GetDyingUnit() local real x=GetUnitX(VF) local real y=GetUnitY(VF) call CreateItem('I02O',x,y) endfunction function x5 takes nothing returns nothing set DN=CreateTrigger() call TriggerAddAction(DN,function e5) endfunction function o5 takes nothing returns boolean return GetSpellAbilityId()=='A0NP' endfunction function r5 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() if GetUnitAbilityLevel(LC,'A0NP')==1 then call UnitAddAbility(LC,'Abun') call UnitAddAbility(LC,'Aeth') call SetUnitAbilityLevel(LC,'A0NP',2) return endif call UnitRemoveAbility(LC,'Abun') call UnitRemoveAbility(LC,'Aeth') call SetUnitAbilityLevel(LC,'A0NP',1) endfunction function i5 takes nothing returns nothing set fN=CreateTrigger() call TriggerAddCondition(fN,Condition(function o5)) call TriggerAddAction(fN,function r5) endfunction function a5 takes nothing returns boolean return GetSpellAbilityId()=='A0P6' endfunction function n5 takes nothing returns nothing local unit VF=GetSpellAbilityUnit() call UnitRemoveAbility(VF,'Abun') call UnitRemoveAbility(VF,'Aeth') call UnitRemoveAbility(VF,'A0P6') call UnitAddAbility(VF,'A0NL') endfunction function V5 takes nothing returns nothing set FN=CreateTrigger() call TriggerAddCondition(FN,Condition(function a5)) call TriggerAddAction(FN,function n5) endfunction function E5 takes player oP,unit LC,integer zh,string Zh,integer mc returns unit local unit vH=CreateUnit(oP,'o00J',GetUnitX(LC),GetUnitY(LC),0.00) call UnitAddAbility(vH,zh) call SetUnitAbilityLevel(vH,zh,mc) call IssueTargetOrder(vH,Zh,LC) return vH endfunction function X5 takes player oP,group O5,integer zh,string Zh,integer mc returns nothing local unit array dS local integer WC=0 local unit LC loop set LC=FirstOfGroup(O5) exitwhen LC==null set dS[WC]=E5(oP,LC,zh,Zh,mc) set WC=WC+1 call GroupRemoveUnit(O5,LC) endloop call DestroyGroup(O5) set O5=null call TriggerSleepAction(0.01) loop exitwhen WC<1 set WC=WC-1 call RemoveUnit(dS[WC]) set dS[WC]=null endloop endfunction function R5 takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local string m4=XC(jD) local group O5=LoadGroupHandle(qi,StringHash("postcastspell_group"),StringHash(m4)) local integer iP=GetStoredInteger(Ae,"postcastspell_player",m4) local integer zh=GetStoredInteger(Ae,"postcastspell_spellid",m4) local string Zh=GetStoredString(Ae,"postcastspell_spellcmd",m4) local integer mc=GetStoredInteger(Ae,"postcastspell_level",m4) call X5(Player(iP),O5,zh,Zh,mc) call RemoveSavedHandle(qi,StringHash("postcastspell_group"),StringHash(m4)) call FlushStoredInteger(Ae,"postcastspell_player",m4) call FlushStoredInteger(Ae,"postcastspell_spellid",m4) call FlushStoredString(Ae,"postcastspell_spellcmd",m4) call FlushStoredInteger(Ae,"postcastspell_level",m4) call DestroyTrigger(jD) endfunction function I5 takes player oP,group O5,integer zh,string Zh,integer mc returns nothing local trigger jD=CreateTrigger() local string m4=XC(jD) call SaveGroupHandle(qi,StringHash("postcastspell_group"),StringHash(m4),O5) call StoreInteger(Ae,"postcastspell_player",m4,GetPlayerId(oP)) call StoreInteger(Ae,"postcastspell_spellid",m4,zh) call StoreString(Ae,"postcastspell_spellcmd",m4,Zh) call StoreInteger(Ae,"postcastspell_level",m4,mc) call TriggerAddAction(jD,function R5) call TriggerRegisterTimerEvent(jD,0.1,false) endfunction function A5 takes integer N5,real x,real y,player oP returns nothing local group g=CreateGroup() local group b5=CreateGroup() local unit LC local real Bc=144 local boolean b=false if N5>3 then set Bc=1200 elseif N5>2 then set Bc=900 elseif N5>1 then set Bc=625 endif call GroupEnumUnitsInRange(g,x,y,Bc,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if IsUnitType(LC,UNIT_TYPE_MECHANICAL)and IsUnitType(LC,UNIT_TYPE_HERO)then if GetUnitAbilityLevel(LC,'B034')>0 then call GroupAddUnit(b5,LC) set b=true endif endif call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set g=null if b then call I5(oP,b5,'A0J2',"slow",1) endif endfunction function B5 takes unit c5 returns integer local real Bm=GetUnitState(c5,UNIT_STATE_MANA) if Bm<249.99 then return 1 elseif Bm<899.99 then return 2 elseif Bm<1497.99 then return 3 endif return 4 endfunction function C5 takes nothing returns boolean return GetSpellAbilityId()=='A0NQ' endfunction function d5 takes nothing returns nothing local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local integer N5 if GetUnitAbilityLevel(LC,'A0NQ')==1 then call SetUnitAbilityLevel(LC,'A0NQ',2) set N5=B5(LC) if GetUnitAbilityLevel(LC,'B034')>0 then call A5(N5,GetUnitX(LC),GetUnitY(LC),oP) endif call SetUnitAbilityLevel(LC,'A0NS',N5) call SetUnitAbilityLevel(LC,'A0NT',N5) call SetUnitAbilityLevel(LC,'A0NU',N5) call SetUnitAbilityLevel(LC,'A0NV',N5) call SetPlayerAbilityAvailable(oP,'A0NR',true) call SetPlayerAbilityAvailable(oP,'A0NS',true) call SetPlayerAbilityAvailable(oP,'A0NT',true) call SetPlayerAbilityAvailable(oP,'A0NU',true) call SetPlayerAbilityAvailable(oP,'A0NV',true) return endif call SetUnitAbilityLevel(LC,'A0NQ',1) call SetPlayerAbilityAvailable(oP,'A0NR',false) call SetPlayerAbilityAvailable(oP,'A0NS',false) call SetPlayerAbilityAvailable(oP,'A0NT',false) call SetPlayerAbilityAvailable(oP,'A0NU',false) call SetPlayerAbilityAvailable(oP,'A0NV',false) endfunction function D5 takes nothing returns nothing set gN=CreateTrigger() call TriggerAddCondition(gN,Condition(function C5)) call TriggerAddAction(gN,function d5) endfunction function f5 takes nothing returns nothing local unit LC=GetTriggerUnit() local integer N5 if Xd(LC)then set N5=B5(LC) call SetUnitAbilityLevel(LC,'A0NS',N5) call SetUnitAbilityLevel(LC,'A0NT',N5) call SetUnitAbilityLevel(LC,'A0NU',N5) call SetUnitAbilityLevel(LC,'A0NV',N5) endif endfunction function F5 takes nothing returns nothing set GN=CreateTrigger() call TriggerAddAction(GN,function f5) endfunction function g5 takes nothing returns nothing local unit yU=GetLearningUnit() local integer Xu=GetLearnedSkill() local integer NH=GetUnitAbilityLevel(yU,Xu) if NH==1 then call SetPlayerAbilityAvailable(GetOwningPlayer(yU),Xu+1,true) if Xu=='A0O5' then call SetPlayerAbilityAvailable(GetOwningPlayer(yU),'A0O9',true) endif endif call SetUnitAbilityLevel(yU,Xu+1,NH) if Xu=='A0O5' then call SetUnitAbilityLevel(yU,'A0O9',NH) elseif Xu=='A0O7' then call SetPlayerTechResearched(GetOwningPlayer(yU),'Robs',NH) call Dj(yU,250) endif endfunction function G5 takes nothing returns nothing set hN=CreateTrigger() call TriggerAddAction(hN,function g5) endfunction function h5 takes nothing returns boolean return GetSpellAbilityId()=='A0OA' endfunction function H5 takes nothing returns nothing local unit yU=GetSpellAbilityUnit() local player oP=GetOwningPlayer(yU) local item j5=GetSpellTargetItem() local integer Lc=GetItemTypeId(j5) local integer iK=GetUnitAbilityLevel(yU,'A0OA')-1 if Lc!='I001' then call iC(oP,"Must target an ammo upgrade.") return endif if GetPlayerTechCount(oP,'R01Y',true)>=iK then if iK>5 then call iC(oP,"Robot's ammunition cannot be further upgraded.") elseif iK<1 then call iC(oP,"You need the Flamethrower ability in order for the robot to upgrade its ammunition.") else call iC(oP,"You need a higher level of Flamethrower before the robot can upgrade its ammunition again.") endif return endif call RemoveItem(j5) set iK=GetPlayerTechCount(oP,'R01Y',true)+1 call SetPlayerTechResearched(oP,'R01Y',iK) endfunction function J5 takes nothing returns nothing set HN=CreateTrigger() call TriggerAddCondition(HN,Condition(function h5)) call TriggerAddAction(HN,function H5) endfunction function k5 takes unit Od returns nothing local integer iP=0 loop if not Xd(Od)then return endif exitwhen iP>8 if(Yv[iP]!=null)and(B[iP]==12)and(not zv[iP])then if GetUnitState(Yv[iP],UNIT_STATE_MANA)>99 then if not HC(GetUnitX(Od),GetUnitY(Od),GetUnitX(Yv[iP]),GetUnitY(Yv[iP]),630)then call Yk(Od,Yv[iP],500) endif endif endif set iP=iP+1 endloop endfunction function K5 takes nothing returns nothing call k5(X[0]) endfunction function l5 takes nothing returns nothing call k5(X[1]) endfunction function L5 takes nothing returns nothing call k5(X[2]) endfunction function m5 takes nothing returns nothing call k5(X[3]) endfunction function M5 takes nothing returns nothing call k5(X[4]) endfunction function p5 takes nothing returns nothing call k5(X[5]) endfunction function P5 takes nothing returns nothing call k5(X[6]) endfunction function q5 takes nothing returns nothing call k5(X[7]) endfunction function Q5 takes nothing returns nothing call k5(X[8]) endfunction function s5 takes nothing returns nothing if Gi[0]!=null then return endif set Gi[0]=CreateTrigger() call TriggerAddAction(Gi[0],function K5) set Gi[1]=CreateTrigger() call TriggerAddAction(Gi[1],function l5) set Gi[2]=CreateTrigger() call TriggerAddAction(Gi[2],function L5) set Gi[3]=CreateTrigger() call TriggerAddAction(Gi[3],function m5) set Gi[4]=CreateTrigger() call TriggerAddAction(Gi[4],function M5) set Gi[5]=CreateTrigger() call TriggerAddAction(Gi[5],function p5) set Gi[6]=CreateTrigger() call TriggerAddAction(Gi[6],function P5) set Gi[7]=CreateTrigger() call TriggerAddAction(Gi[7],function q5) set Gi[8]=CreateTrigger() call TriggerAddAction(Gi[8],function Q5) endfunction function S5 takes nothing returns nothing set jN=CreateTrigger() call TriggerAddAction(jN,function s5) endfunction function t5 takes unit yU,real lP returns nothing local real KP=lP*GetUnitState(yU,UNIT_STATE_MAX_LIFE) local real EH=GetUnitState(yU,UNIT_STATE_LIFE) if EH>KP then call SetUnitState(yU,UNIT_STATE_LIFE,EH-KP) else call SetUnitState(yU,UNIT_STATE_LIFE,2) endif endfunction function T5 takes nothing returns nothing local integer Lc=GetUnitTypeId(GetEventDamageSource()) if Lc=='U009' then call t5(GetTriggerUnit(),0.014+0.003*Qq(Jx[0])) elseif Lc=='z00B' then call t5(GetTriggerUnit(),0.017) elseif(Lc=='z00A')or(Lc=='U007')then call t5(GetTriggerUnit(),0.009) endif endfunction function u5 takes nothing returns nothing set JN=CreateTrigger() call TriggerAddAction(JN,function T5) endfunction function U5 takes nothing returns boolean return(GetSpellAbilityId()=='A08N')and(GetUnitAbilityLevel(GetSpellAbilityUnit(),'A08N')==2) endfunction function w5 takes nothing returns nothing local unit VF=GetSpellAbilityUnit() local integer kF=1 local string XF=GetStoredString(Ae,"droidremote_ladlink",XC(VF)) if GetUnitTypeId(VF)=='O009' then set kF=2 elseif GetUnitTypeId(VF)=='O00A' then set kF=3 endif call JF(VF,XF,GetPlayerId(GetOwningPlayer(VF)),kF,null) endfunction function W5 takes nothing returns nothing set kN=CreateTrigger() call TriggerAddCondition(kN,Condition(function U5)) call TriggerAddAction(kN,function w5) endfunction function y5 takes nothing returns nothing call RemoveUnit(GetTriggerUnit()) call DestroyTrigger(GetTriggeringTrigger()) endfunction function Y5 takes unit Od,player oP,integer z5 returns nothing local trigger jD local unit XW=qf(z5,oP,GetUnitLoc(Od),GetUnitFacing(Od)) local integer i=GetUnitAbilityLevel(Od,'A08O') if i==3 then set i=120 else set i=100+GetRandomInt(57+3*C,66+6*C) if i==4 then set i=i+20 endif endif call SetUnitColor(XW,ConvertPlayerColor(11)) call SetUnitVertexColorBJ(XW,50.78,46.88,56.64,70.0) call IssueTargetOrderBJ(XW,"smart",Od) call SetUnitLifeBJ(XW,100.00) set jD=CreateTrigger() call TriggerRegisterUnitLifeEvent(jD,XW,GREATER_THAN,i) call TriggerAddAction(jD,function y5) endfunction function Z5 takes nothing returns boolean return(GetSpellAbilityId()=='A08O')and(GetUnitAbilityLevel(GetSpellAbilityUnit(),'A08O')>1) endfunction function v6 takes nothing returns nothing local unit VF=GetSpellAbilityUnit() if GetUnitTypeId(VF)=='O008' then call Y5(VF,GetOwningPlayer(VF),'z006') elseif GetUnitTypeId(VF)=='O009' then call Y5(VF,GetOwningPlayer(VF),'z00I') else call Y5(VF,GetOwningPlayer(VF),'z00J') endif endfunction function e6 takes nothing returns nothing set KN=CreateTrigger() call TriggerAddCondition(KN,Condition(function Z5)) call TriggerAddAction(KN,function v6) endfunction function x6 takes nothing returns boolean return(GetSpellAbilityId()=='A0AL')and(GetUnitAbilityLevel(GetSpellAbilityUnit(),'A0AL')>1) endfunction function o6 takes nothing returns nothing local unit VF=GetSpellAbilityUnit() local location XY if GetSpellTargetUnit()==null then set XY=GetSpellTargetLoc() else set XY=GetUnitLoc(GetSpellTargetUnit()) endif call sJ(VF,7,XY) endfunction function r6 takes nothing returns nothing set lN=CreateTrigger() call TriggerAddCondition(lN,Condition(function x6)) call TriggerAddAction(lN,function o6) endfunction function i6 takes nothing returns boolean return GetSpellAbilityId()=='A08C' endfunction function a6 takes integer NH returns integer if NH<2 then return 500 elseif NH<3 then return 750 elseif NH<4 then return 1050 elseif NH<5 then return 1300 elseif NH<6 then return 1650 elseif NH<7 then return 1950 elseif NH<8 then return 2350 elseif NH<9 then return 2650 elseif NH<10 then return 3100 elseif NH<11 then return 3450 elseif NH<12 then return 4000 elseif NH<13 then return 4350 elseif NH<14 then return 5000 elseif NH<15 then return 5350 elseif NH<16 then return 6150 else return 6500 endif endfunction function n6 takes nothing returns nothing local unit VF=GetSpellAbilityUnit() local integer NH=GetUnitAbilityLevelSwapped('A08C',VF) local effect KD=AddSpecialEffectTarget("Abilities\\Spells\\Items\\StaffOfSanctuary\\Staff_Sanctuary_Target.mdl",VF,"overhead") call UnitAddAbility(VF,'A08B') call SetUnitAbilityLevel(VF,'A09X',NH+1) call SetHeroStr(VF,GetHeroStr(VF,false)+a6(NH),true) call OC(20.5-bC(NH+1,2)) call UnitRemoveAbility(VF,'A08B') loop call RC(0.5) exitwhen VF==null exitwhen IsUnitDeadBJ(VF) exitwhen GetUnitAbilityLevel(VF,'B00X')<1 endloop call DestroyEffect(KD) if VF!=null then call SetHeroStr(VF,GetHeroStr(VF,false)-a6(NH),true) call SetUnitAbilityLevel(VF,'A09X',1) endif endfunction function V6 takes nothing returns nothing set LN=CreateTrigger() call TriggerAddCondition(LN,Condition(function i6)) call TriggerAddAction(LN,function n6) endfunction function E6 takes nothing returns boolean return GetSpellAbilityId()=='A09Y' endfunction function X6 takes nothing returns nothing call Yk(GetSpellAbilityUnit(),GetSpellTargetUnit(),100+150*GetUnitAbilityLevel(GetSpellAbilityUnit(),'A09Y')) endfunction function O6 takes nothing returns nothing set mN=CreateTrigger() call TriggerAddCondition(mN,Condition(function E6)) call TriggerAddAction(mN,function X6) endfunction function R6 takes nothing returns boolean return(GetSpellAbilityId()=='A03P')and(GetUnitAbilityLevel(GetSpellAbilityUnit(),'A03P')>1) endfunction function I6 takes nothing returns nothing call vk(GetSpellAbilityUnit(),GetSpellTargetUnit()) endfunction function A6 takes nothing returns nothing set MN=CreateTrigger() call TriggerAddCondition(MN,Condition(function R6)) call TriggerAddAction(MN,function I6) endfunction function N6 takes nothing returns boolean return(GetLearnedSkill()=='A0C1')or(GetLearnedSkill()=='A0C7') endfunction function b6 takes nothing returns nothing call UnitRemoveAbility(GetLearningUnit(),a[IMaxBJ((GetLearnedSkillLevel()-2),0)]) call UnitAddAbility(GetLearningUnit(),a[IMaxBJ((GetLearnedSkillLevel()-1),0)]) call Dj(GetLearningUnit(),250.0) endfunction function B6 takes nothing returns nothing set pN=CreateTrigger() call TriggerAddCondition(pN,Condition(function N6)) call TriggerAddAction(pN,function b6) endfunction function c6 takes nothing returns boolean return GetLearnedSkill()=='A0JI' endfunction function C6 takes nothing returns nothing local unit VF=GetLearningUnit() local integer mc=GetLearnedSkillLevel() local integer Ef='A0JQ' local integer i=0 loop exitwhen i>7 exitwhen Ki[i]==VF set i=i+1 endloop if i<8 then set Ef='A0OK'+i endif if mc==1 then call UnitAddAbility(VF,Ef) else call SetUnitAbilityLevel(VF,Ef,mc) endif endfunction function d6 takes nothing returns nothing set PN=CreateTrigger() call TriggerAddCondition(PN,Condition(function c6)) call TriggerAddAction(PN,function C6) endfunction function D6 takes nothing returns boolean local integer i=GetSpellAbilityId() return(i=='A088')or(i=='A0HI')or(i=='A0HJ') endfunction function f6 takes nothing returns nothing local unit Od=GetSpellAbilityUnit() local location tF=GetUnitLoc(Od) local location ud=GetSpellTargetLoc() local integer mc=GetUnitAbilityLevelSwapped(GetSpellAbilityId(),Od) local unit vH=Tf('o00J',Player(PLAYER_NEUTRAL_AGGRESSIVE),tF,GetUnitFacing(Od)) call RemoveLocation(tF) call UnitAddAbility(vH,'A0BZ') call SetUnitAbilityLevel(vH,'A0BZ',mc) call IssuePointOrderLoc(vH,"clusterrockets",ud) call RC(2) call RemoveUnit(vH) call RemoveLocation(ud) endfunction function F6 takes nothing returns nothing set qN=CreateTrigger() call TriggerAddCondition(qN,Condition(function D6)) call TriggerAddAction(qN,function f6) endfunction function g6 takes nothing returns nothing local unit VF=GetTriggerUnit() call eH(GetOwningPlayer(VF),VF,'A0EZ',"bloodlust",2) set VF=null endfunction function G6 takes nothing returns nothing set QN=CreateTrigger() call TriggerAddAction(QN,function g6) endfunction function h6 takes nothing returns boolean return(GetPlayerId(GetOwningPlayer(GetEventDamageSource()))>9)and(GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<167.0) endfunction function H6 takes nothing returns nothing local unit VF=GetTriggerUnit() call DisableTrigger(sN) call eH(GetOwningPlayer(VF),VF,'A0EZ',"bloodlust",2) call RC(2) call EnableTrigger(sN) set VF=null endfunction function j6 takes nothing returns nothing set sN=CreateTrigger() call TriggerAddCondition(sN,Condition(function h6)) call TriggerAddAction(sN,function H6) endfunction function J6 takes nothing returns boolean return GetIssuedOrderId()==OrderId("manashieldoff") endfunction function k6 takes nothing returns nothing local unit K6=GetOrderedUnit() call TriggerSleepAction(0.01) call IssueImmediateOrderBJ(K6,"manashieldon") endfunction function l6 takes nothing returns nothing set SN=CreateTrigger() call TriggerAddCondition(SN,Condition(function J6)) call TriggerAddAction(SN,function k6) endfunction function L6 takes nothing returns boolean return GetUnitPointValue(GetManipulatingUnit())!=3 endfunction function m6 takes nothing returns nothing local unit LC=GetManipulatingUnit() local item Jd=GetManipulatedItem() local integer Hd=GetItemTypeId(Jd) if(Hd=='I01S')or(Hd=='I000')then set dv=LC endif if Hd=='I03A' then call UnitRemoveItem(LC,Jd) return endif if(Hd=='I00M')or(Hd=='I00P')or(Hd=='I04I')or(Hd=='I02C')or(Hd=='I02J')or(Hd=='I03E')or(Hd=='I04C')then call Lg(Jd,Hd-2,0,LC) return endif if(Hd=='I023')or(Hd=='I04A')then if GetItemCharges(Jd)<1 then call SetItemCharges(Jd,1) endif endif if GetItemLevel(Jd)>0 then if IsItemPawnable(Jd)or not Sy(Hd)then call pg(Jd,Qg(Jd,LC),LC) endif else call Bg(LC,Hd,Jd) endif endfunction function M6 takes nothing returns nothing set tN=CreateTrigger() call TriggerAddCondition(tN,Condition(function L6)) call TriggerAddAction(tN,function m6) endfunction function p6 takes unit LC,integer iP returns nothing local boolean QS=(GetUnitAbilityLevel(LC,'BNms')>0) if GetUnitAbilityLevel(LC,'A05C')==10 then return endif if QS then call UnitRemoveAbility(LC,'BNms') endif call SetUnitMoveSpeed(LC,Ld(iP,false)) call SetPlayerAbilityAvailable(Player(iP),'A05E'+IMinBJ(Pv[iP*3+2],2)+Xi[iP],false) call SetPlayerAbilityAvailable(Player(iP),'A05E'+IMinBJ(Pv[iP*3+2],2)+Xi[iP]+1,true) if QS then call IssueImmediateOrder(LC,"manashieldon") call IssueImmediateOrder(LC,"stop") endif endfunction function P6 takes unit LC,integer iP returns nothing local integer sH=GetStoredInteger(Ae,I2S(iP),"riotshield_equipped") if sH>-1 then call StoreInteger(Ae,I2S(sH),"riotshield_protecting",-1) call iC(Player(sH),"|r|cffff8000NOTE|r |cffffcc00Riot Shield is no longer protecting ally.") else call UnitAddAbility(LC,'AId4') endif call StoreInteger(Ae,I2S(iP),"riotshield_equipped",iP) endfunction function q6 takes item Jd,unit LC returns boolean local integer Hd=GetItemTypeId(Jd) local integer iP=GetPlayerId(GetOwningPlayer(LC)) local location tF if(Hd=='I01S')or(Hd=='I000')then set dv=LC endif if Hd=='I03A' then if not Ug(Jd,LC)then if B[iP]==4 then call UnitRemoveAbility(LC,'A04G'+Fv[iP]) elseif Do[iP*Co+8]>0 then call UnitRemoveAbility(LC,'A0MS') endif endif return false endif if(Hd=='I00M')or(Hd=='I00P')or(Hd=='I04I')or(Hd=='I02C')or(Hd=='I02J')or(Hd=='I03E')or(Hd=='I04C')then call Lg(Jd,Hd-2,0,LC) return false endif if(Hd=='I023')or(Hd=='I04A')then if GetItemCharges(Jd)<1 then call SetItemCharges(Jd,1) endif endif if(Hd=='I04E')or(Hd=='I04D')or(Hd=='I04F')then if not OG(iP)then call CreateItem(Hd,GetUnitX(LC),GetUnitY(LC)) if not vv then call iC(Player(iP),"Cannot use until another drug wears off.") endif elseif Hd=='I04E' then call RG(iP,3,"drugspeed") elseif Hd=='I04D' then call RG(iP,2,"drugbuffout") else call RG(iP,1,"drugmentat") endif return false elseif(Hd=='I004')or(Hd=='I01B')or(Hd=='I01C')then if Hd=='I004' then if not QG('I01L',LC,iP)then call SetPlayerStateBJ(Player(iP),PLAYER_STATE_RESOURCE_GOLD,30+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD)) endif elseif Hd=='I01B' then if not QG('I01K',LC,iP)then call SetPlayerStateBJ(Player(iP),PLAYER_STATE_RESOURCE_GOLD,20+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD)) endif else if not QG('I003',LC,iP)then call SetPlayerStateBJ(Player(iP),PLAYER_STATE_RESOURCE_GOLD,60+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD)) endif endif return false endif if(Hd=='I01K')or(Hd=='I003')or(Hd=='I01L')then if Ie[iP]!=null then call mG(Ie[iP],Jd,Player(iP),false) elseif pv[iP*Nx+13]>0 then call PG(bx[iP],Jd,Player(iP)) endif return false endif if(Hd=='I01D')or(Hd=='I03G')then set Jd=CreateItem('I00B',GetUnitX(LC),GetUnitY(LC)) if not Og(LC,Jd,bg(LC,'I00B'))then call cg(LC,Jd) endif return false endif if(Hd=='I01J')or(Hd=='I03F')then set Jd=CreateItem('I00A',GetUnitX(LC),GetUnitY(LC)) if not Og(LC,Jd,bg(LC,'I00A'))then call cg(LC,Jd) endif return false endif if(Hd=='I00B')or(Hd=='I01S')then if GetStoredInteger(Ae,"unitmakingbattery",XC(LC))==0 then if GetUnitStateSwap(UNIT_STATE_MANA,LC)<250.0 then call Fg(LC,Jd) return false endif endif if Hd=='I01S' then return false endif endif if Hd=='I01P' then if tD()then call TriggerRegisterTimerEvent(gI,0,false) else call iC(Player(iP),"Scan failed. Restore power to the city first.") endif return false endif if Hd=='I01G' then if te>0 then call Fk(0) call Fk(0) else call Fk(60) endif return false endif if Hd=='I048' then set Hd=GetUnitAbilityLevel(LC,'A03H') if Hd<7 then if Hd==1 then call SetUnitAbilityLevel(LC,'A03H',7) else call SetUnitAbilityLevel(LC,'A03H',Hd-1) endif call Yf(LC,"Abilities\\Spells\\Undead\\ReplenishHealth\\ReplenishHealthCaster.mdl","origin") else call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD,250+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_GOLD)) call iC(Player(iP),"Your power armor doesn't need repairing.") endif return false endif if Hd=='I02F' then if Sx[iP*4]<1 then set Sx[iP*4]=1 call ModifyHeroSkillPoints(LC,bj_MODIFYMETHOD_ADD,1) call Yf(LC,"Objects\\Spawnmodels\\Undead\\UndeadDissipate\\UndeadDissipate.mdl","origin") else call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER,15+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER)) call iC(Player(iP),"You cannot purchase that implant more than once.") endif return false endif if Hd=='I022' then if Sx[iP*4+1]<1 then set Sx[iP*4+1]=1 set Hd=GetUnitAbilityLevel(LC,'A00A')+mx[iP] if Hd>0 then call UnitRemoveAbility(LC,V[IMaxBJ(Hd-1,0)]) endif set mx[iP]=mx[iP]+1 call UnitAddAbility(LC,V[IMaxBJ(Hd,0)]) call UnitAddAbility(LC,'A0PF') call Yf(LC,"Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCaster.mdl","origin") else call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER,20+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER)) call iC(Player(iP),"You cannot purchase that implant more than once.") endif return false endif if Hd=='I029' then if Sx[iP*4+2]<1 then set Sx[iP*4+2]=1 call UnitAddItemByIdSwapped('I03H',LC) else call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER,25+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER)) call iC(Player(iP),"You cannot purchase that implant more than once.") endif return false endif if Hd=='I02G' then if Sx[iP*4+3]<1 then set Sx[iP*4+3]=1 set pv[iP*Nx+1]=pv[iP*Nx+1]+30 call SetUnitMoveSpeed(LC,Ld(iP,false)) call Yf(LC,"Abilities\\Spells\\Human\\Avatar\\AvatarCaster.mdl","origin") else call SetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER,30+GetPlayerState(Player(iP),PLAYER_STATE_RESOURCE_LUMBER)) call iC(Player(iP),"You cannot purchase that implant more than once.") endif return false endif if Hd=='I02A' then call Dj(LC,250.0) endif if ug(Jd,LC)then return false endif if Hd=='I01H' then set Ie[iP]=Jd return false endif if IsItemPawnable(Jd)or not Sy(Hd)then call StoreInteger(Ae,"validatingitem",XC(LC),1) if pg(Jd,Qg(Jd,LC),LC)then call StoreInteger(Ae,"validatingitem",XC(LC),0) return false endif call StoreInteger(Ae,"validatingitem",XC(LC),0) endif if Bg(LC,Hd,Jd)then return false endif if(Hd=='I00K')or(Hd=='I02T')then call Dj(LC,250.0) return false endif if(Hd=='I00S')or(Hd=='I01O')or(Hd=='I03Q')then call Dj(LC,500.0) return false endif if Hd=='I03V' then call Dj(LC,750.0) return false endif if Hd=='I01A' then call Dj(LC,1500.0) return false endif if Hd=='I02A' then call p6(LC,iP) return false endif if Hd=='I03C' then call P6(LC,iP) call Yf(LC,"Abilities\\Spells\\Human\\Defend\\DefendCaster.mdl","origin") return false endif if Hd=='I01Y' then set uo[iP]=uo[iP]+1 return false endif if Hd=='I02H' then call OF(Jd,iP) return false endif if(B[iP]==9)and(Hd=='I023')then set Hd=GetUnitAbilityLevel(LC,'A0K7') if(Hd<9)and(Hd>0)then call SetUnitAbilityLevel(LC,'A0K7',Hd+8) endif return false endif if Hd=='I016' then return true endif if Hd=='I018' then set yv[iP]=yv[iP]+0.10 return true endif return false endfunction function Q6 takes nothing returns nothing local unit LC=GetManipulatingUnit() if q6(GetManipulatedItem(),LC)then call TriggerSleepAction(0.01) call Sg(LC) endif endfunction function s6 takes nothing returns nothing set TN=CreateTrigger() call TriggerAddAction(TN,function Q6) endfunction function S6 takes unit LC,integer iP returns nothing local boolean QS=(GetUnitAbilityLevel(LC,'BNms')>0) if GetUnitAbilityLevel(LC,'A05C')==10 then return endif if QS then call UnitRemoveAbility(LC,'BNms') endif call SetUnitMoveSpeed(LC,Ld(iP,true)) call SetPlayerAbilityAvailable(Player(iP),'A05E'+IMinBJ(Pv[iP*3+2],2)+1+Xi[iP],false) call SetPlayerAbilityAvailable(Player(iP),'A05E'+IMinBJ(Pv[iP*3+2],2)+Xi[iP],true) if QS then call IssueImmediateOrder(LC,"manashieldon") call IssueImmediateOrder(LC,"stop") endif endfunction function t6 takes unit LC,integer iP returns nothing local integer T6=GetStoredInteger(Ae,I2S(iP),"riotshield_protecting") call UnitRemoveAbility(LC,'AId4') call StoreInteger(Ae,I2S(iP),"riotshield_equipped",-1) if T6>-1 then if T6>8 then call UnitRemoveAbility(Yv[T6-9],'AId4') call StoreInteger(Ae,I2S(T6-9),"riotshield_cadet",-1) else call UnitRemoveAbility(X[T6],'AId4') call StoreInteger(Ae,I2S(T6),"riotshield_equipped",-1) endif call StoreInteger(Ae,I2S(iP),"riotshield_protecting",-1) endif endfunction function u6 takes item Jd,unit LC returns boolean local integer Hd=GetItemTypeId(Jd) local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer i if GetStoredInteger(Ae,"validatingitem",XC(LC))==0 then if(Hd=='I00K')or(Hd=='I02T')then call Fj(LC,250.0) return false endif if(Hd=='I00S')or(Hd=='I01O')or(Hd=='I03Q')then call Fj(LC,500.0) return false endif if Hd=='I03V' then call Fj(LC,750.0) return false endif if Hd=='I01A' then call Fj(LC,1500.0) return false endif endif if Jd==Ie[iP]then set Ie[iP]=null return false endif if Hd=='I02A' then if not kd(LC,Hd,Jd)then call S6(LC,iP) endif call Fj(LC,250.0) return false endif if Hd=='I03C' then if not kd(LC,Hd,Jd)then call t6(LC,iP) endif return false endif if Hd=='I01Y' then if GetStoredInteger(Ae,"validatingitem",XC(LC))==0 then set uo[iP]=uo[iP]-1 endif return false endif if(Hd=='I03A')and((B[iP]==4)or(Do[iP*Co+8]>0))then return true endif if(B[iP]==9)and(Hd=='I023')then set Hd=GetUnitAbilityLevel(LC,'A0K7') if(Hd>8)and not kd(LC,'I023',Jd)and not kd(bx[iP],'I024',null)then call SetUnitAbilityLevel(LC,'A0K7',Hd-8) endif return false endif if Hd=='I018' then set yv[iP]=yv[iP]-0.10 return true endif return false endfunction function U6 takes nothing returns nothing local unit LC=GetManipulatingUnit() local item Jd=GetManipulatedItem() local integer i local integer iP if wF(Jd,GetPlayerId(GetOwningPlayer(LC)),1)then call u6(Jd,LC) call TriggerSleepAction(0.1) if GetItemTypeId(Jd)=='I02H' then call UF(Jd) endif call RemoveItem(Jd) return endif if not u6(Jd,LC)then return endif if GetItemTypeId(Jd)=='I03A' then set i=25 loop if GetUnitAbilityLevel(LC,'B01C')<1 then set iP=GetPlayerId(GetOwningPlayer(LC)) if Ed(iP)then if B[iP]==4 then call UnitAddAbility(LC,'A04G'+Fv[iP]) else call UnitAddAbility(LC,'A0MS') endif endif exitwhen true endif set i=i-1 exitwhen i<1 call TriggerSleepAction(Xx) endloop else call TriggerSleepAction(0.01) call Sg(LC) endif endfunction function w6 takes nothing returns nothing set uN=CreateTrigger() call TriggerAddAction(uN,function U6) endfunction function W6 takes player oP,unit Od,boolean y6 returns nothing local unit VF local integer i=0 local integer kF=0 local item Jd local integer Lc local boolean Y6 local integer array z6 local integer array Z6 local integer WC=0 local real EH local integer iP=GetPlayerId(oP) local boolean v7 local integer e7=0 local integer array x7 local string XF="" loop exitwhen Ji[kF]==null set kF=kF+1 endloop set ki[kF+6]=0 if B[iP]==12 then set ki[kF]=0 else set ki[kF]=1 endif set EH=RMaxBJ(1.0,RMinBJ(2000,GetUnitState(Od,UNIT_STATE_MANA))/2.0) call SetUnitState(Od,UNIT_STATE_MANA,RMaxBJ(0,GetUnitState(Od,UNIT_STATE_MANA)-RMinBJ(2000,GetUnitState(Od,UNIT_STATE_MANA)))) loop exitwhen i>19 set z6[i]=0 set i=i+1 endloop if y6 then set i=5 loop exitwhen i<0 set Y6=true set v7=false set Jd=UnitItemInSlot(Od,i) set Lc=GetItemTypeId(Jd) if not IsItemPawnable(Jd)and Sy(Lc)then set Y6=false elseif Lc=='I01Y' then set Z6[WC]='AId3' set WC=WC+1 set z6[7]=z6[7]+50 set z6[8]=z6[8]+12 set z6[9]=z6[9]+25 set v7=true elseif Lc=='I01M' then if z6[0]<3 then set z6[0]=z6[0]+1 if(B[iP]==1)and(z6[0]>1)then set x7[e7]=Lc set e7=e7+1 endif else set Y6=false endif elseif Lc=='I00K' then set z6[1]=z6[1]+1 set v7=true elseif Lc=='I00S' then set z6[1]=z6[1]+2 set v7=true elseif Lc=='I01A' then set z6[1]=z6[1]+6 set z6[2]=z6[2]+2 set v7=true elseif Lc=='I00N' then set z6[2]=z6[2]+2 set v7=true elseif Lc=='I04G' then set z6[2]=z6[2]+3 set v7=true elseif Lc=='I02T' then set z6[2]=z6[2]+2 set z6[1]=z6[1]+1 set v7=true elseif Lc=='I03Q' then set z6[2]=z6[2]+4 set z6[1]=z6[1]+2 set v7=true elseif Lc=='I02Q' then set z6[2]=z6[2]+6 set v7=true elseif Lc=='I02W' then set z6[2]=z6[2]+4 set Z6[WC]='AId5' set WC=WC+1 set v7=true elseif Lc=='I03T' then set z6[2]=z6[2]+6 set Z6[WC]='AId8' set WC=WC+1 set v7=true elseif Lc=='I01Q' then set z6[2]=z6[2]+8 set v7=true elseif Lc=='I01R' then set z6[3]=z6[3]+1 set v7=true elseif Lc=='I00Q' then set Z6[WC]='AIsx' set WC=WC+1 set v7=true elseif Lc=='I00U' then set Z6[WC]='A04E' set WC=WC+1 set v7=true elseif Lc=='I03J' then set Z6[WC]='A0HD' set WC=WC+1 set v7=true elseif Lc=='I019' then set Z6[WC]='AIs2' set WC=WC+1 set z6[16]=z6[16]+1 set v7=true elseif Lc=='I01F' then if(z6[4]<1)and IsItemPawnable(UnitItemInSlot(Od,i))and not IsItemInvulnerable(UnitItemInSlot(Od,i))then set z6[4]=z6[4]+1 set v7=true else set Y6=false endif elseif Lc=='I001' then set z6[5]=z6[5]+2 elseif Lc=='I01I' then if z6[6]<1 then set z6[6]=z6[6]+1 else set Y6=false endif elseif Lc=='I01V' then set Z6[WC]='AId1' set WC=WC+1 set v7=true elseif Lc=='I00E' then set Z6[WC]='AId2' set WC=WC+1 set v7=true elseif Lc=='I00G' then set Z6[WC]='AId5' set WC=WC+1 set v7=true elseif Lc=='I00I' then set Z6[WC]='AId8' set WC=WC+1 set v7=true elseif Lc=='I00W' then set Z6[WC]='AId7' set WC=WC+1 set v7=true elseif Lc=='I02Y' then set Z6[WC]='AId7' set WC=WC+1 set v7=true elseif Lc=='I03C' then set Z6[WC]='AId4' set WC=WC+1 set z6[18]=z6[18]+1 set v7=true elseif Lc=='I01W' then set z6[7]=z6[7]+20 set v7=true elseif Lc=='I01T' then set z6[8]=z6[8]+5 set v7=true elseif Lc=='I01L' then set z6[8]=z6[8]+2 elseif Lc=='I01K' then set z6[9]=z6[9]+25 elseif Lc=='I003' then set z6[17]=z6[17]+48 elseif Lc=='I02M' then set z6[10]=z6[10]+1 set v7=true elseif Lc=='I02N' then set z6[10]=z6[10]+1 set v7=true elseif Lc=='I02O' then set z6[10]=z6[10]+1 set v7=true elseif Lc=='I00C' then if z6[13]<1 then set z6[13]=z6[13]+1 if GetItemCharges(UnitItemInSlot(Od,i))>1 then call SetItemCharges(UnitItemInSlot(Od,i),GetItemCharges(UnitItemInSlot(Od,i))-1) set Y6=false endif else set Y6=false endif elseif Lc=='I02A' then set z6[1]=z6[1]+1 set z6[14]=z6[14]+1 set v7=true elseif Lc=='I04A' then set z6[19]=z6[19]+1 set v7=true elseif Lc=='I023' then if z6[15]<1 then set z6[15]=z6[15]+1 set v7=true else set Y6=false endif elseif Lc=='I02H' then if EF(XC(UnitItemInSlot(Od,i)))==null then set z6[12]=z6[12]+1 set XF=XC(UnitItemInSlot(Od,i)) set v7=true else set Y6=false endif else set Y6=false endif if Y6 then call RemoveItem(UnitItemInSlot(Od,i)) endif if v7 and(pv[iP*Nx+10]>15)then set x7[e7]=Lc set e7=e7+1 endif set i=i-1 endloop endif if B[iP]==9 then set z6[8]=z6[8]+2*z6[0] set z6[5]=z6[5]+1 elseif B[iP]==8 then set z6[10]=z6[10]+2 elseif B[iP]==10 then set z6[7]=z6[7]+30 elseif B[iP]==5 then set z6[9]=z6[9]+75 endif call TriggerSleepAction(0.1) if z6[0]>2 then set VF=qf('O00A',oP,GetUnitLoc(Od),0) call ModifyHeroSkillPoints(VF,bj_MODIFYMETHOD_ADD,16+z6[10]) call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A089') call SelectHeroSkill(VF,'A088') call SelectHeroSkill(VF,'A09Z') call SelectHeroSkill(VF,'A08C') call SetUnitAbilityLevel(VF,'A0EE',3) call SetUnitAbilityLevel(VF,'A09Y',3) elseif z6[0]==2 then set VF=qf('O009',oP,GetUnitLoc(Od),0) call ModifyHeroSkillPoints(VF,bj_MODIFYMETHOD_ADD,11+z6[10]) call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') call SetUnitAbilityLevel(VF,'A0EE',2) call SetUnitAbilityLevel(VF,'A09Y',2) else set VF=qf('O008',oP,GetUnitLoc(Od),0) call ModifyHeroSkillPoints(VF,bj_MODIFYMETHOD_ADD,2+z6[10]) call SelectHeroSkill(VF,'A07Z') call SelectHeroSkill(VF,'A07Z') endif call TriggerRegisterUnitEvent(iI,VF,EVENT_UNIT_DEATH) set Ji[kF]=VF call UnitRemoveAbility(VF,'A0AD'-z6[14]) call SuspendHeroXPBJ(false,VF) call SetUnitColor(VF,ConvertPlayerColor(11)) call SetUnitState(VF,UNIT_STATE_LIFE,EH) call SetUnitState(VF,UNIT_STATE_MANA,EH/4.0) call IssueImmediateOrder(VF,"manashieldon") call SetHeroAgi(VF,GetHeroAgi(VF,false)+z6[8],true) call SetHeroStr(VF,GetHeroStr(VF,false)+z6[9],true) call SetUnitAbilityLevel(VF,'A042',NC(GetHeroStr(VF,false)/25)+1) if z6[14]>0 then set z6[7]=z6[7]-20 endif call SetUnitMoveSpeed(VF,GetUnitDefaultMoveSpeed(VF)+z6[7]) set EH=0 set i=0 loop exitwhen i>8 if AC(Player(i))then set EH=EH+IMinBJ(uv[i],wv*10) endif set i=i+1 endloop call SetUnitUserData(VF,NC((IMaxBJ(60000,NC(EH))*(100.0+I2R(z6[17])/10.0))/100.0)) call TriggerSleepAction(0.1) call TriggerRegisterTimerEvent(aI,1,false) if B[iP]==4 then if GetStoredInteger(Ae,"herocount","totalplayers")>1 then call SetUnitAbilityLevel(VF,'A0CI',2) else set z6[11]=z6[11]+1 endif elseif B[iP]==5 then call SetUnitAbilityLevel(VF,'A0EE',GetUnitAbilityLevel(VF,'A0EE')+3) elseif B[iP]==2 then call UnitAddAbility(VF,'Aihn') call SetUnitAbilityLevel(VF,'Aihn',z6[0]*2) elseif B[iP]==7 then set z6[1]=z6[1]+1 set z6[2]=z6[2]+1 elseif B[iP]==6 then set z6[13]=z6[13]+1 call TriggerRegisterUnitLifeEvent(QN,VF,LESS_THAN,167.00) call TriggerRegisterUnitEvent(sN,VF,EVENT_UNIT_DAMAGED) endif loop set WC=WC-1 exitwhen WC<0 call UnitAddAbility(VF,Z6[WC]) endloop if z6[1]>0 then call UnitAddAbility(VF,a[z6[1]-1]) endif if z6[2]>0 then call UnitAddAbility(VF,V[z6[2]-1]) endif if z6[5]>0 then call UnitAddAbility(VF,Hx[z6[5]-1]) endif if z6[3]>0 then call SetUnitAbilityLevel(VF,'A08E',2) set Qr=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Brilliance\\Brilliance.mdl",VF,"origin") set ki[kF+6]=1 endif if z6[16]>0 then call SetUnitAbilityLevel(VF,'A0BI',2) endif if z6[11]>0 then call UnitAddAbility(VF,'A0FK') endif if z6[6]>0 then call SetUnitAbilityLevel(VF,'A08F',2) endif if z6[18]>0 then call SetUnitAbilityLevel(VF,'A0F7',2) endif if z6[19]>0 then call SetUnitAbilityLevel(VF,'A03P',2) endif if z6[12]>0 then call SetUnitAbilityLevel(VF,'A08N',2) call UnitAddAbility(VF,'A0KM') else call SetUnitAbilityLevel(VF,'A02X',2) endif call StoreString(Ae,"droidremote_ladlink",XC(VF),XF) if z6[4]>0 then if B[iP]==11 then call SetUnitAbilityLevel(VF,'A08O',4) else call SetUnitAbilityLevel(VF,'A08O',2) endif elseif B[iP]==11 then call SetUnitAbilityLevel(VF,'A08O',3) endif if z6[13]>0 then if z6[13]==1 then if B[iP]!=6 then call UnitAddAbility(VF,'A0MU') else call UnitAddAbility(VF,'A0HE') endif else call UnitAddAbility(VF,'A08Y') endif endif if z6[15]>0 then call SetUnitAbilityLevel(VF,'A0AL',2) endif set i=0 loop exitwhen i>=e7 call StoreInteger(Ae,"ladfusion_item_"+I2S(i),XC(VF),x7[i]) set i=i+1 endloop call StoreInteger(Ae,"ladfusion_item_count",XC(VF),e7) endfunction function o7 takes unit LC returns boolean local integer iP=GetPlayerId(GetOwningPlayer(LC)) local item Jd local integer Lc local unit Kd local integer r7=0 local integer i=0 loop exitwhen i>5 set Jd=UnitItemInSlot(LC,i) set Lc=GetItemTypeId(Jd) if(Lc>'I01S')and(Lc<'I01Y')and IsItemPawnable(Jd)then set r7=r7+1 endif set i=i+1 endloop if(GetUnitPointValue(LC)==3)and(pv[iP*Nx+13]>0)then set Kd=bx[iP] set i=0 loop exitwhen i>5 set Lc=GetItemTypeId(UnitItemInSlot(Kd,i)) if(Lc>'I01S')and(Lc<'I01Y')then set r7=r7+1 endif set i=i+1 endloop endif return r7==6 endfunction function i7 takes unit LC returns nothing local integer iP=GetPlayerId(GetOwningPlayer(LC)) local item Jd local integer Lc local unit Kd local integer i=0 loop exitwhen i>5 set Jd=UnitItemInSlot(LC,i) set Lc=GetItemTypeId(Jd) if(Lc>'I01S')and(Lc<'I01Y')and IsItemPawnable(Jd)then call RemoveItem(UnitItemInSlot(LC,i)) endif set i=i+1 endloop if(GetUnitPointValue(LC)==3)and(pv[iP*Nx+13]>0)then set Kd=bx[iP] set i=0 loop exitwhen i>5 set Lc=GetItemTypeId(UnitItemInSlot(Kd,i)) if(Lc>'I01S')and(Lc<'I01Y')then call RemoveItem(UnitItemInSlot(Kd,i)) endif set i=i+1 endloop endif call UnitAddItemById(LC,'I01Y') endfunction function a7 takes unit LC returns boolean local integer iP=GetPlayerId(GetOwningPlayer(LC)) local unit Kd=LC local item Jd local integer Lc local integer ZF local integer n7 local item array V7 local integer array E7 local integer X7=0 set V7[0]=null set V7[1]=null set V7[2]=null set V7[3]=null set V7[4]=null set V7[5]=null set E7[0]='I04J' set E7[1]='I02M' set E7[2]='I02N' set E7[3]='I02O' set E7[4]='I00N' set E7[5]='I00N' loop exitwhen Kd==null set ZF=0 loop exitwhen X7>5 exitwhen ZF>5 set Jd=UnitItemInSlot(Kd,ZF) if IsItemPawnable(Jd)then set Lc=GetItemTypeId(Jd) set n7=0 loop exitwhen n7>5 if V7[n7]==null then if(E7[n7]==Lc)or((n7>3)and(E7[n7]==(Lc-1)))then set V7[n7]=Jd set X7=X7+1 exitwhen true endif endif set n7=n7+1 endloop endif set ZF=ZF+1 endloop if Kd==LC then set Kd=bx[iP] else set Kd=null endif endloop if X7<6 then return false endif set n7=0 loop exitwhen n7>5 call RemoveItem(V7[n7]) set n7=n7+1 endloop call CreateItem('I02A',GetUnitX(LC),GetUnitY(LC)) return true endfunction function O7 takes integer id returns boolean return(id=='I02P')or(id=='I02S')or(id=='I02V')or(id=='I03P')or(id=='I03S') endfunction function R7 takes unit LC,integer Hd,item Jd,integer CF returns integer local integer array I7 local item array V7 local integer A7=0 local integer Z6=0 local integer Lc local integer i local integer j local unit Kd local item ld local integer iP=GetPlayerId(GetOwningPlayer(LC)) local integer N7=0 if Hd=='I02P' then set I7[0]='I02L'+Nv[2] set I7[1]='I00N' set I7[2]='I00N' set I7[3]='I00N' set A7=4 elseif Hd=='I02S' then set I7[0]='I02L'+Nv[3] set I7[1]='I00N' set I7[2]='I00K' set A7=3 elseif Hd=='I02V' then set I7[0]='I02L'+Nv[4] set I7[1]='I00N' set I7[2]='I00N' set I7[3]='I00G' set A7=4 elseif Hd=='I03P' then set I7[0]='I02L'+Nv[7] set I7[1]='I00N' set I7[2]='I00N' set I7[3]='I00K' set I7[4]='I00K' set A7=5 elseif Hd=='I03S' then set I7[0]='I02L'+Nv[8] set I7[1]='I00N' set I7[2]='I00N' set I7[3]='I00N' set I7[4]='I00I' set A7=5 endif if I7[0]=='I02M' then if ModuloInteger(CF,2)==1 then set N7=1 endif elseif I7[0]=='I02N' then if ModuloInteger(CF/2,2)==1 then set N7=2 endif elseif I7[0]=='I02O' then if ModuloInteger(CF/4,2)==1 then set N7=4 endif endif if N7>0 then set V7[0]=null set Z6=Z6+1 set I7[0]=-1 endif set Kd=LC set i=0 loop exitwhen Z6==A7 exitwhen i>5 set ld=UnitItemInSlot(Kd,i) if IsItemPawnable(ld)then set Lc=GetItemTypeId(ld) set j=0 loop exitwhen j>=A7 if(I7[j]!=-1)and((Lc==I7[j])or((j>0)and(Lc==(I7[j]+1))))then set V7[Z6]=UnitItemInSlot(Kd,i) set Z6=Z6+1 set I7[j]=-1 set j=A7 endif set j=j+1 endloop endif set i=i+1 if i==6 then if(GetUnitPointValue(Kd)==3)and(pv[iP*Nx+13]>0)then set Kd=bx[iP] set i=0 endif endif endloop if Z6==A7 then set i=0 loop exitwhen i>=Z6 if V7[i]!=null then call RemoveItem(V7[i]) endif set i=i+1 endloop call RemoveItem(Jd) call UnitAddItemById(LC,Hd+1) return-1-N7 endif if(Z6==(A7-1))and(I7[0]!=-1)then return 0 endif return A7 endfunction function b7 takes unit LC,integer Hd,item Jd returns nothing local integer bl=R7(LC,Hd,Jd,0) local string Vd if bl<0 then return endif if bl==0 then set Vd="You don't have the correct circuit board in your inventory to create the item." else set Vd="You need all "+I2S(bl)+" components in your inventory to create the item." endif call iC(GetOwningPlayer(LC),Vd) endfunction function B7 takes nothing returns nothing call RemoveUnit(GetTriggerUnit()) call DestroyTrigger(GetTriggeringTrigger()) endfunction function c7 takes integer Lc returns integer if(Lc=='O005')or(Lc=='O00O')or(Lc=='O01E')then return'z00E' elseif(Lc=='O00U')or(Lc=='O004')or(Lc=='O00P')then return'z00G' elseif(Lc=='O003')or(Lc=='O00Q')then return'z00H' elseif(Lc=='O00T')or(Lc=='O018')then return'z00D' elseif(Lc=='O01C')then return'z003' elseif(Lc=='O01B')then return'z008' else return'z00F' endif endfunction function C7 takes unit Od,player oP returns nothing local trigger jD local unit XW=qf(c7(GetUnitTypeId(Od)),oP,GetUnitLoc(Od),GetUnitFacing(Od)) call SetUnitVertexColorBJ(XW,100,100,100,75.00) call IssueTargetOrder(XW,"smart",Od) call UnitAddAbility(XW,Uv[Fd(GetPlayerId(oP))+1]) if B[GetPlayerId(oP)]==4 then call SetUnitAcquireRangeBJ(XW,1200.00+40*GetPlayerTechCount(oP,'R00U',true)) elseif GetPlayerTechCount(oP,'R01Q',true)>0 then call SetUnitAcquireRangeBJ(XW,900+100*GetPlayerTechCount(oP,'R01Q',true)) elseif GetPlayerTechCount(oP,'R01R',true)>0 then call SetUnitAcquireRangeBJ(XW,700+75*GetPlayerTechCount(oP,'R01R',true)) elseif GetPlayerTechCount(oP,'R010',true)>0 then call SetUnitAcquireRangeBJ(XW,900.00+15*GetPlayerTechCount(oP,'R010',true)) endif call SetUnitState(XW,UNIT_STATE_LIFE,100.00) set jD=CreateTrigger() call TriggerRegisterUnitLifeEvent(jD,XW,GREATER_THAN,100.00+GetRandomInt(57+3*C,66+6*C)) call TriggerAddAction(jD,function B7) endfunction function d7 takes nothing returns boolean local item Jd=GetManipulatedItem() local unit Od=GetManipulatingUnit() local integer iP=GetPlayerId(GetOwningPlayer(Od)) local integer sg=GetHeroInt(Od,true)+pv[iP*Nx+10] local integer id=GetItemTypeId(Jd) if(id=='I00Y')or(id=='I00Z')then set sg=sg+pv[iP*Nx+6] elseif((id>'I004')and(id<'I009'))or((id>'I024')and(id<'I029'))or((id>'I03K')and(id<'I03P'))then set sg=sg+Do[iP*Co+5] endif if id=='I01N' then return true endif if((qF(GetItemLevel(Jd))-100)*2/(2+pv[iP*Nx+14])+100)>sg then call SetItemCharges(Jd,GetItemCharges(Jd)+1) call iC(GetOwningPlayer(Od),"You need more intelligence to use this item.") return false endif return true endfunction function D7 takes nothing returns nothing local item Jd=GetManipulatedItem() local integer Hd=GetItemTypeId(Jd) local unit LC=GetManipulatingUnit() local player oP=GetOwningPlayer(LC) local integer i local location tF if Hd=='I003' then if OG(GetPlayerId(oP))then call RG(GetPlayerId(oP),1,"drugmentat") else call SetItemCharges(Jd,(GetItemCharges(Jd)+1)) call iC(oP,"Cannot use until another drug wears off.") endif return endif if Hd=='I01K' then if OG(GetPlayerId(oP))then call RG(GetPlayerId(oP),2,"drugbuffout") else call SetItemCharges(Jd,(GetItemCharges(Jd)+1)) call iC(oP,"Cannot use until another drug wears off.") endif return endif if Hd=='I01L' then if OG(GetPlayerId(oP))then call RG(GetPlayerId(oP),3,"drugspeed") else call SetItemCharges(Jd,(GetItemCharges(Jd)+1)) call iC(oP,"Cannot use until another drug wears off.") endif return endif if Hd=='I01F' then if IsItemInvulnerable(Jd)then return endif if GetItemCharges(Jd)<1 then call SetItemInvulnerable(Jd,true) endif call C7(LC,oP) call OC(120) if(Jd!=null)and(GetItemLifeBJ(Jd)>0.0)then call SetItemCharges(Jd,GetItemCharges(Jd)+1) call SetItemInvulnerable(Jd,false) endif return endif if Hd=='I007' then if GetItemCharges(Jd)<1 then call TriggerSleepAction(0.01) call UnitAddItemByIdSwapped('I027',LC) endif return endif if Hd=='I005' then if GetItemCharges(Jd)<1 then call TriggerSleepAction(0.01) call UnitAddItemByIdSwapped('I025',LC) endif return endif if Hd=='I03L' then if GetItemCharges(Jd)<1 then call TriggerSleepAction(0.01) call UnitAddItemByIdSwapped('I03N',LC) endif return endif if Hd=='I02Z' then if GetItemCharges(Jd)<1 then call TriggerSleepAction(0.01) call UnitAddItemByIdSwapped('I030',LC) endif return endif if Hd=='I027' then call TriggerSleepAction(0.01) set Jd=UnitAddItemByIdSwapped('I007',LC) call SetItemCharges(Jd,bg(LC,'I007')) return endif if Hd=='I025' then call TriggerSleepAction(0.01) set Jd=UnitAddItemByIdSwapped('I005',LC) call SetItemCharges(Jd,bg(LC,'I005')) return endif if Hd=='I03N' then call TriggerSleepAction(0.01) set Jd=UnitAddItemByIdSwapped('I03L',LC) call SetItemCharges(Jd,bg(LC,'I03L')) return endif if Hd=='I030' then call TriggerSleepAction(0.01) set Jd=UnitAddItemByIdSwapped('I02Z',LC) call SetItemCharges(Jd,2) return endif if Hd=='I02D' then call SetItemCharges(Jd,1) call b4(LC) return endif if Hd=='I02H' then call SetItemCharges(Jd,1) call JF(LC,XC(Jd),GetPlayerId(oP),0,Jd) return endif if Hd=='I01S' then if GetItemCharges(Jd)<1 then call sF('I000') elseif GetItemCharges(Jd)==(Cv-1)then call SetUnitLifeBJ(mb,1.00) endif return endif if Hd=='I001' then call zG(oP,true) return endif if Hd=='I00Y' then call Vj(oP,-1) return endif if Hd=='I01X' then if o7(LC)then call i7(LC) else call iC(oP,"You need all six ExoSuit pieces in your inventory to use this.") endif return endif if Hd=='I04J' then if not a7(LC)then call iC(oP,"You need all of the components in your inventory to create the item.") endif return endif if O7(Hd)then call b7(LC,Hd,Jd) return endif if Hd=='I01M' then call W6(oP,LC,true) return endif if Hd=='I01N' then if B[GetPlayerId(oP)]==12 then call RemoveItem(Jd) call W6(oP,LC,false) if Fd(GetPlayerId(oP))<3 then call iC(oP,"Insufficient intelligence to fuse items with droid.") endif endif return endif if Hd=='I018' then call RemoveItem(Jd) set i=GetPlayerId(oP) set cx=i call TriggerSleepAction(1) if cx==i then set cx=10+i call ModifyHeroStat(bj_HEROSTAT_INT,LC,bj_MODIFYMETHOD_ADD,20) set yv[i]=yv[i]+0.10 call TriggerSleepAction(0.01) call Sg(LC) endif return endif if Hd=='I00N' then if GetUnitTypeId(LC)!='O00U' then call iC(oP,"Only cyborgs (class) can integrate micro-fusion generators.") return endif if not IsItemPawnable(Jd)then call iC(oP,"You cannot integrate a replicated item.") return endif set Hd=GetUnitAbilityLevel(LC,'A09C')-1 if Hd>-1 then set Hd=Hd/5 endif set i=GetPlayerId(oP) if Mr[i]>Hd then if Hd>2 then call iC(oP,"You have already integrated the maximum of four micro-fusion generators.") elseif Hd<0 then call iC(oP,"You need the Cluster Rockets ability in order to integrate micro-fusion generators.") else call iC(oP,"You need a higher level of Cluster Rockets before you can integrate another micro-fusion generator.") endif return endif set Mr[i]=Mr[i]+1 call RemoveItem(Jd) if mx[i]>0 then call UnitRemoveAbility(LC,V[mx[i]-1]) endif call UnitAddAbility(LC,V[mx[i]+1]) set mx[i]=mx[i]+2 return endif if GetItemType(Jd)==ITEM_TYPE_PERMANENT then if(Hd=='I03V')or(Hd=='I00E')then return endif if pv[GetPlayerId(oP)*Nx+2]>0 then if not IsItemPawnable(Jd)then call iC(oP,"You cannot integrate a replicated item.") return endif call RemoveItem(Jd) if Hd=='I00G' then call UnitAddAbility(LC,'A06Z') call StoreInteger(Ae,"integrated_armor",I2S(GetPlayerId(oP)),'A06Z') elseif Hd=='I00I' then call UnitAddAbility(LC,'A09B') call StoreInteger(Ae,"integrated_armor",I2S(GetPlayerId(oP)),'A09B') elseif Hd=='I00W' then call UnitAddAbility(LC,'A0FC') call StoreInteger(Ae,"integrated_armor",I2S(GetPlayerId(oP)),'A0FC') endif call StoreInteger(Ae,"integrated_vest",I2S(GetPlayerId(oP)),Hd) else call iC(oP,"Only survivalists (trait) can integrate a combat vest.") endif return endif endfunction function f7 takes nothing returns nothing set UN=CreateTrigger() call TriggerAddCondition(UN,Condition(function d7)) call TriggerAddAction(UN,function D7) endfunction function F7 takes unit hJ,unit Od,player oP returns nothing local effect KD=null local real x local real y local real g7 local real WC local real LP=GetUnitState(hJ,UNIT_STATE_LIFE) local integer iP local boolean array G7 if LP>1.0 then if pv[GetPlayerId(oP)*Nx+6]>0 then set LP=GetUnitState(hJ,UNIT_STATE_MAX_LIFE) endif set x=GetUnitX(hJ) set y=GetUnitY(hJ) set g7=GetUnitFacing(hJ) call SetUnitUserData(hJ,1000) call UnitRemoveAbility(hJ,'A04T') call SetUnitExploded(hJ,false) call KillUnit(hJ) call RemoveUnit(hJ) set hJ=CreateUnit(oP,'n00F',x,y,g7) call SetUnitState(hJ,UNIT_STATE_LIFE,LP) call SetUnitMoveSpeed(hJ,190) if Xd(Od)then set x=GetUnitX(Od) set y=GetUnitY(Od) else set x=GetUnitX(I[GetPlayerId(oP)]) set y=GetUnitY(I[GetPlayerId(oP)]) endif call IssuePointOrder(hJ,"move",x,y) if((C>1)or(fe>0))and(te<1)and(GetRandomInt(1,J*J)<2)then call Yh(oP,hJ,'A0KA',"curse") else call TriggerSleepAction(0.01) endif call RC(20) if hJ==null then return endif if(GetUnitState(hJ,UNIT_STATE_LIFE)>1.0)and(GetUnitAbilityLevel(hJ,'B02C')>0)then set LP=GetUnitLifePercent(hJ) set x=GetUnitX(hJ) set y=GetUnitY(hJ) set g7=GetUnitFacing(hJ) call RemoveUnit(hJ) set hJ=CreateUnit(Nr,'n004'+GetRandomInt(0,1),x,y,g7) call SetUnitLifePercentBJ(hJ,LP) call SetUnitUserData(hJ,2) call UnitRemoveAbility(hJ,'Awan') call uf(hJ,0.0) call SetUnitColor(hJ,PLAYER_COLOR_BROWN) call SetUnitVertexColorBJ(hJ,100,50.00,50.00,0) call UnitAddAbility(hJ,'A02W') call SetUnitAbilityLevel(hJ,'A02W',2) call TriggerSleepAction(0.1) call CJ(hJ,null) return endif if pv[GetPlayerId(oP)*Nx+6]>0 then call OC(GetRandomInt(40,46+(4-J)*13)-20) else call OC(GetRandomInt(60,70+(4-J)*20)-20) endif if hJ==null then return endif if GetUnitState(hJ,UNIT_STATE_LIFE)>1.0 then set LP=GetUnitLifePercent(hJ) set x=GetUnitX(hJ) set y=GetUnitY(hJ) set g7=GetUnitFacing(hJ) set iP=0 loop set G7[iP]=IsUnitSelected(hJ,Player(iP)) exitwhen iP>7 set iP=iP+1 endloop call RemoveUnit(hJ) if(fe==1)and(mo<1)and(Nv[11]<1)and(Nv[12]<1)and(Ve>2)and(GetRandomInt(1,5+35*C)==1)then set Nv[11]=1 set hJ=CreateUnit(oP,'n005',x,y,g7) call Wf(hJ,2) set bv[1]=hJ call TriggerRegisterTimerEvent(xR,1,false) else set hJ=CreateUnit(oP,'n004'+GetRandomInt(0,1),x,y,g7) call SetUnitUserData(hJ,0) endif set KD=AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIre\\AIreTarget.mdl",hJ,"origin") call SetUnitLifePercentBJ(hJ,LP) call SetUnitMoveSpeed(hJ,GetUnitDefaultMoveSpeed(hJ)*(1.0+1.0-Pow(0.9,ho))) set iP=0 loop if G7[iP]then call SelectUnitAddForPlayer(hJ,Player(iP)) endif exitwhen iP>7 set iP=iP+1 endloop call TriggerSleepAction(2.5*Xx) call DestroyEffect(KD) set KD=null endif endif endfunction function h7 takes integer H7 returns boolean local integer IH=sr/ 4 set IH=IH*IH*IH if GetRandomInt(350*Mx,499+350*Mx)=H7 then set sr=sr-H7 return true endif endif return false endfunction function j7 takes integer iP,integer Bc,real J7,real k7 returns integer local real K7=k7 local unit LC local group g=CreateGroup() call GroupEnumUnitsInRange(g,GetUnitX(X[iP]),GetUnitY(X[iP]),Bc,null) loop set LC=FirstOfGroup(g) exitwhen LC==null if LC!=X[iP]then if GetUnitPointValue(LC)==3 then if UnitHasItemOfTypeBJ(LC,'I01E')then set K7=K7+J7*k7 endif endif endif call GroupRemoveUnit(g,LC) endloop call DestroyGroup(g) set g=null return R2I(K7) endfunction function l7 takes integer iP,unit hJ returns nothing local integer i=0 local integer h=EC(hJ) local integer IH local integer H7=3 loop exitwhen i>10 if Hr[iP*12+i]==h then if uv[iP]<9*wv then call iC(Player(iP),"|r|cff00ff00HINT|r |cffffcc00Only your first attempt to finish inoculizing a particular zombie can succeed.") endif return endif set i=i+1 endloop set Hr[iP*12+Hr[iP*12+11]]=h if Hr[iP*12+11]>9 then set Hr[iP*12+11]=0 else set Hr[iP*12+11]=Hr[iP*12+11]+1 endif if GetRandomInt(0,999)24 then set i=1 else set i=0 endif set IH=jr[C+3-J-i]+50*i if fe<1 then set IH=j7(iP,900,0.15,IH) else set IH=j7(iP,625,0.05,IH) endif if iP==GetPlayerId(GetOwningPlayer(hJ))then set IH=IH/(2+Mx) elseif IH<824 then set IH=IH+(IH/100)*(sr/3)+sr set sr=sr-1 if sr<0 then set sr=0 endif set H7=H7-1 endif if GetRandomInt(0,999)2 then set IH=18*(5-fe)-2*Nv[5]+6 else set IH=11*(10-fe-Nv[5]) endif if(GetUnitUserData(hJ)==fe)or(C<3)or(GetRandomInt(0,99)0 then if pv[GetPlayerId(oP)*Nx+6]>0 then set Ex[iP]=IMaxBJ(Ex[iP]/2-1,0) else set Ex[iP]=IMaxBJ(Ex[iP]-1,0) endif if Ex[iP]<1 then call iC(oP,"Wound completely bandaged.") call UnitRemoveBuffBJ('Blsh',X[iP]) else call iC(oP,"Wound partially bandaged.") endif endif endfunction function m7 takes integer iP,integer iT,boolean M7 returns boolean local integer p7=0 local string P7="riotshield_equipped" local unit mC=X[iT] local integer T6 local real x local real y local integer Jq=30 if M7 then set p7=9 set P7="riotshield_cadet" set mC=Yv[iT] endif if GetStoredInteger(Ae,I2S(iT),P7)>-1 then set mC=null return false endif set T6=GetStoredInteger(Ae,I2S(iP),"riotshield_protecting") if T6>-1 then if T6>8 then call UnitRemoveAbility(Yv[T6-9],'AId4') call StoreInteger(Ae,I2S(T6-9),"riotshield_cadet",-1) else call UnitRemoveAbility(X[T6],'AId4') call StoreInteger(Ae,I2S(T6),"riotshield_equipped",-1) endif endif call UnitAddAbility(mC,'AId4') call StoreInteger(Ae,I2S(iT),P7,iP) call StoreInteger(Ae,I2S(iP),"riotshield_protecting",iT+p7) set mC=null return true endfunction function q7 takes unit Od,unit Q7 returns nothing local real x=GetUnitX(Od) local real y=GetUnitY(Od) local lightning fx local real Bm=GetUnitState(Od,UNIT_STATE_MANA) if Bm>500 then set Bm=500 endif call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)-Bm) set fx=AddLightning("FORK",true,x,y,GetUnitX(Q7),GetUnitY(Q7)) if GetRandomReal(Bm,550)>499 then set Bm=500 call lD("0%",Q7,64,160,255,true,11,1.9) else call lD(I2S(IMaxBJ(NC(100.0-Bm*100.0/500.0),1))+"%",Q7,64,160,255,true,11,1.9) call SetUnitState(Q7,UNIT_STATE_MANA,RMaxBJ(GetUnitState(Q7,UNIT_STATE_MANA)-Bm,0)) endif call TriggerSleepAction(Xx) call DestroyLightning(fx) call RC(2) if(Bm>499)and(po!=null)then call UnitRemoveAbility(Q7,'A05C') call UnitRemoveAbility(Q7,'A09D') call DestroyEffect(LoadEffectHandle(qi,StringHash("Nemesis"),StringHash("ForceFieldFX"))) endif endfunction function s7 takes unit Od,unit Q7 returns nothing local real x=GetUnitX(Od) local real y=GetUnitY(Od) local real h local real v local lightning array fx local integer c=0 local real Bm=GetUnitState(Od,UNIT_STATE_MANA) local integer i=0 if Bm>500 then set Bm=500 elseif Bm>250 then set Bm=250 else set Bm=0 endif call SetUnitState(Od,UNIT_STATE_MANA,GetUnitState(Od,UNIT_STATE_MANA)-Bm) loop set h=GetUnitX(Ee[i]) set v=GetUnitY(Ee[i]) if not HC(x,y,h,v,2700)then if GetUnitState(Ee[i],UNIT_STATE_MANA)>250 then set fx[c]=AddLightning("FORK",true,h,v,x,y) set c=c+1 set Bm=Bm+GetUnitState(Ee[i],UNIT_STATE_MANA) call SetUnitState(Ee[i],UNIT_STATE_MANA,0) if GetUnitAbilityLevel(Ee[i],'A0JA')<1 then call UnitAddAbility(Ee[i],'A0JA') endif endif endif set i=i+1 exitwhen i>5 endloop set fx[c]=AddLightning("FORK",true,x,y,GetUnitX(Q7),GetUnitY(Q7)) set c=c+1 if Bm>249 then set mo=IMinBJ(mo+NC(Bm/250.0),51) endif if mo>50 then call UnitRemoveAbility(Q7,'A05C') call UnitRemoveAbility(Q7,'A09D') call DestroyEffect(LoadEffectHandle(qi,StringHash("Nemesis"),StringHash("ForceFieldFX"))) endif set i=100-((mo-1)*100)/50 call lD(I2S(i)+"%",Q7,64,160,255,true,11,1.9) call TriggerSleepAction(Xx) loop exitwhen c<1 set c=c-1 call DestroyLightning(fx[c]) endloop endfunction function S7 takes player oP,unit mC,integer t7,integer mc returns nothing if UnitHasBuffBJ(mC,'Bprg')and(t7!='A0BR')then call iC(oP,"Stim was ineffective.") else call eH(oP,mC,t7,"bloodlust",mc) endif endfunction function T7 takes unit LC,unit mC returns integer local integer iP=GetPlayerId(GetOwningPlayer(mC)) local integer mc=2 if(GetUnitPointValue(mC)==3)and(pv[iP*Nx+7]>0)then set mc=1 endif if(LC==mC)and(Do[iP*Co+5]>0)then set mc=mc+1 endif return mc endfunction function u7 takes player oP,unit LC,unit mC returns nothing local effect KD=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Heal\\HealTarget.mdl",mC,"origin") local integer iP=GetPlayerId(oP) local boolean U7=pv[iP*Nx+6]>0 local boolean w7=Do[iP*Co+4]>0 local boolean W7=GetUnitAbilityLevel(mC,'BUfa')>0 local real r=GetUnitState(mC,UNIT_STATE_LIFE) local real n=RMaxBJ(GetHeroInt(LC,true)*3.0-300.0,3.00) if U7 and(not IsUnitType(mC,UNIT_TYPE_HERO))then set n=n*2 endif if W7 then if n>49.3 then set n=SquareRoot(n*40.0) else set n=n*0.9 endif endif if(r<168)and w7 then set n=168-r+n endif set n=n+pv[iP*Nx+6] if mC==LC then set n=n+Do[iP*Co+4] endif if GetUnitAbilityLevel(LC,'A00C')>0 then set n=n+12.0+5.5*GetUnitAbilityLevel(LC,'A00C') endif call SetUnitState(mC,UNIT_STATE_LIFE,r+n) if GetUnitPointValue(mC)==3 then call L7(oP,GetPlayerId(GetOwningPlayer(mC))) if not w7 then call Yh(oP,mC,'A0BS',"frostarmor") else call TriggerSleepAction(0.01) endif if U7 and not W7 then call wg(mC,1) else call TriggerSleepAction(1.0) endif else if not w7 then call Yh(oP,mC,'A0BS',"frostarmor") else call TriggerSleepAction(0.01) endif call TriggerSleepAction(1.0) endif call DestroyEffect(KD) set KD=null endfunction function y7 takes nothing returns boolean return GetAbilityName(GetSpellAbilityId())=="TriggerItem" endfunction function Y7 takes nothing returns nothing local integer vw=GetSpellAbilityId() local unit LC=GetSpellAbilityUnit() local player oP=GetOwningPlayer(LC) local unit mC=GetSpellTargetUnit() local item Jd local location XY local effect KD=null if vw=='AUdc' then if(GetUnitTypeId(mC)=='n008')and(GetUnitAbilityLevel(mC,'AIlz')<1)then if GetRandomInt(0,99)<(73+6*J+Do[GetPlayerId(oP)*Co+4]+sr/8)then call SetUnitInvulnerable(mC,true) set KD=AddSpecialEffectTarget("Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl",mC,"origin") call RC(0.5) call SetUnitInvulnerable(mC,false) call DestroyEffect(KD) if mC!=null then call F7(mC,LC,oP) endif endif endif return endif if vw=='A0KB' then if GetUnitTypeId(mC)=='n00F' then set Jd=ng(LC,'I01E',bg(LC,'I01E'),null) if Jd!=null then call SetItemCharges(Jd,GetItemCharges(Jd)+1) endif call l7(GetPlayerId(oP),mC) endif return endif if vw=='A02I' then call u7(oP,LC,mC) return endif if vw=='A04U' then if mC==null then set XY=GetSpellTargetLoc() else set XY=GetUnitLoc(mC) endif call sJ(LC,7,XY) set Jd=ng(LC,'I023',1,null) if Jd==null then set Jd=ng(LC,'I024',1,null) endif if Jd!=null then call SetItemCharges(Jd,1) endif return endif if vw=='A02E' then call S7(oP,mC,'A02F',T7(LC,mC)) return endif if vw=='A02H' then call S7(oP,mC,'A02G',T7(LC,mC)) return endif if vw=='A0IP' then call S7(oP,mC,'A0IO',T7(LC,mC)) return endif if vw=='A0BQ' then call S7(oP,mC,'A0BR',1) return endif if vw=='A0D9' then if IsUnitType(mC,UNIT_TYPE_MECHANICAL)then if GetUnitTypeId(mC)!='O01F' then call iC(oP,"Robotic targets are invalid except for the crime prevention unit.") else if not m7(GetPlayerId(GetOwningPlayer(LC)),GetPlayerId(GetOwningPlayer(mC)),GetUnitPointValue(mC)!=3)then call iC(oP,"Target is already protected by a riot shield.") endif endif elseif(GetUnitPointValue(mC)==3)or(GetUnitTypeId(mC)=='O00E')then if not m7(GetPlayerId(GetOwningPlayer(LC)),GetPlayerId(GetOwningPlayer(mC)),GetUnitPointValue(mC)!=3)then call iC(oP,"Target is already protected by a riot shield.") endif else call iC(oP,"Invalid target.") endif return endif if vw=='A0MM' then call vk(LC,mC) set Jd=ng(LC,'I04A',1,null) if Jd==null then set Jd=ng(LC,'I04B',1,null) endif if Jd!=null then call SetItemCharges(Jd,1) endif return endif if vw=='A0PG' then set Jd=ng(LC,'I00E',1,null) if pv[GetPlayerId(oP)*Nx+2]<1 then call iC(oP,"Only survivalists (trait) can deconstruct a kevlar vest.") elseif not IsItemPawnable(Jd)then call iC(oP,"You cannot deconstruct a replicated item.") elseif GetUnitAbilityLevel(mC,'A0KE')>0 then call iC(oP,"Target already has a kevlar helmet.") else call RemoveItem(Jd) call UnitAddAbility(mC,'A0KE') if GetUnitTypeId(mC)=='O00E' then call iC(GetOwningPlayer(mC),"Kevlar helmet equipped on cadet.") else call iC(GetOwningPlayer(mC),"Kevlar helmet equipped.") endif if GetOwningPlayer(mC)!=GetOwningPlayer(LC)then call iC(GetOwningPlayer(LC),"Equipped target with kevlar helmet.") endif endif return endif if vw=='A0J9' then if mC!=po then call iC(oP,"Invalid target.") elseif GetUnitAbilityLevel(po,'A09D')==2 then if mo>50 then call q7(LC,mC) else call s7(LC,mC) endif else call iC(oP,"Target is not using a force field.") endif return endif endfunction function z7 takes nothing returns nothing set wN=CreateTrigger() call TriggerAddCondition(wN,Condition(function y7)) call TriggerAddAction(wN,function Y7) endfunction function Z7 takes nothing returns nothing local integer iP local integer i local real Bm local timer Ch=GetExpiredTimer() set iP=-1 set i=0 loop exitwhen i>8 if G[i]==Ch then set iP=i exitwhen true endif set i=i+1 endloop set Bm=GetUnitStateSwap(UNIT_STATE_MANA,X[iP]) if UnitHasItemOfTypeBJ(X[iP],'I012')then if Bm<100.00 then call Lg(GetItemOfTypeFromUnitBJ(X[iP],'I012'),'I010',-1,X[iP]) return endif call StartTimerBJ(G[iP],false,2.00) endif if((Bm<900.0)and(Bm>800.0))or((Bm<250.0)and(Bm>150.0))then call Mf(X[iP]) endif endfunction function v8 takes nothing returns nothing local integer i set WN=CreateTrigger() call TriggerAddAction(WN,function Z7) set i=0 loop exitwhen i>8 set G[i]=CreateTimer() call TriggerRegisterTimerExpireEventBJ(WN,G[i]) set i=i+1 endloop endfunction function e8 takes real x,real y returns nothing local integer i=GetRandomInt(1,4) local unit Jg loop exitwhen i<1 set Jg=CreateUnit(to,'nrat',x,y,GetRandomInt(0,359)) call SetUnitState(Jg,UNIT_STATE_LIFE,GetUnitState(Jg,UNIT_STATE_LIFE)-IMaxBJ(0,GetRandomInt(-10,30))) call SetUnitUserData(Jg,1000) set i=i-1 endloop endfunction function x8 takes real x,real y returns nothing local unit BJ=CreateUnit(Player(10),'ncg2',x,y,GetRandomInt(0,359)) set nv=nv+1 call SetUnitColor(BJ,ConvertPlayerColor(12)) call RC(GetRandomInt(J,2+2*J)) if GetUnitState(BJ,UNIT_STATE_LIFE)>0 then call UnitAddAbility(BJ,'AIdn') call UnitAddAbility(BJ,'A04T') call SetUnitExploded(BJ,true) endif endfunction function o8 takes integer Vk,boolean r8 returns integer local integer i8=4*J if te>0 then set i8=5 endif set i8=i8-Kr if i8<0 then set i8=0 endif if(Nv[2]<1)and(Vk<(9-i8))then set Nv[2]=GetRandomInt(1,3) return'I02P' endif if(Nv[3]<1)and(Vk>(89+i8))then set Nv[3]=GetRandomInt(1,3) return'I02S' endif if(Nv[4]<1)and(Vk>46)and(Vk<(56-i8))then set Nv[4]=GetRandomInt(1,3) return'I02V' endif if r8 and(Nv[7]<1)and(Vk>(89+i8))then set Nv[7]=GetRandomInt(1,3) return'I03P' endif if r8 and(Nv[8]<1)and(Vk>46)and(Vk<(56-i8))then set Nv[8]=GetRandomInt(1,3) return'I03S' endif return-1 endfunction function a8 takes nothing returns boolean return GetUnitPointValue(GetDyingUnit())>9999 endfunction function n8 takes nothing returns nothing local integer Vk=GetRandomInt(0,99) local integer Lc=GetUnitPointValue(GetDyingUnit())-10000 local location tF=GetUnitLoc(GetDyingUnit()) local real x=GetLocationX(tF) local real y=GetLocationY(tF) local integer Hd=-1 local item dm local player oP if Lc==1 then if Vk<24 then set Hd='I00A' elseif Vk<49 then set Hd='I00B' elseif Vk<63 then set Hd='I00C' elseif Vk<73 then set Hd='I003' elseif Vk<83 then set Hd='I01K' elseif Vk<93 then set Hd='I01L' elseif Vk<98 then set Hd='I001' else call e8(x,y) endif elseif Lc==2 then if Vk<22 then set Hd='I007' elseif Vk<37 then set Hd='I00B' elseif Vk<(59+Ri[3])then set Hd='I005' set Ri[3]=Ri[3]-8 if Ri[3]<-12 then set Ri[3]=-12 endif elseif Vk<81 then set Hd='I03L' elseif Vk<84 then set Hd='I01I' elseif Vk<94 then set Hd='I00Y' elseif Vk<99 then set Hd='I001' else call e8(x,y) endif elseif Lc==7 then if Vk<20 then set Hd='I00A' elseif Vk<45 then set Hd='I003' elseif Vk<65 then set Hd='I01K' elseif Vk<95 then set Hd='I01L' else set Hd='I00Y' endif elseif Lc==3 then set Hd=o8(Vk,false) if Hd<0 then if Vk<(10+Ri[0])then set Hd='I00E' set Ri[0]=Ri[0]-10 if Ri[0]<-5 then set Ri[0]=-5 endif elseif Vk<(25+Ri[5])then set Hd='I00G' if Ri[5]>0 then set Ri[5]=0 else set Ri[5]=-8 endif elseif Vk<37 then set Hd='I00Q' set Ri[5]=11 elseif Vk<70 then set Hd='I00N' elseif Vk<(90+Ri[4])then set Hd='I00K' set Ri[4]=Ri[4]-4 if Ri[4]<-6 then set Ri[4]=-6 endif elseif Vk<98 then set Hd='I00S' else call x8(x,y) endif endif elseif Lc==4 then set Hd=o8(Vk,true) if Hd<0 then if Vk<25 then set Hd='I00S' elseif Vk<(40+Ri[1])then set Hd='I00I' set Ri[1]=Ri[1]-9 if Ri[1]<-3 then set Ri[1]=-3 endif elseif Vk<50 then set Hd='I00W' elseif Vk<(62+Ri[2])then set Hd='I00U' set Ri[2]=Ri[2]-8 if Ri[2]<-2 then set Ri[2]=-2 endif elseif Vk<74 then set Hd='I03J' elseif Vk<99 then set Hd='I04G' else call x8(x,y) endif endif elseif Lc==5 then if Vk<49 then set Hd='I014' elseif Vk<79 then set Hd='I015' elseif Vk<99 then set Hd='I016' else set Hd='I020' endif elseif Lc==8 then set oP=zC(null) if(Vk<99)or(oP==null)then set Hd='I031'+IMinBJ(bC(Vk,11),8) else call IssueTargetOrder(Tf('z009',oP,tF,GetRandomInt(0,359)),"smart",X[GetPlayerId(oP)]) endif elseif Lc==9 then if Nv[13]==1 then set Nv[13]=2 call DisableTrigger(rR) call DestroyTrigger(rR) endif call EnableTrigger(vb) if Vk<16 then set Hd='I03V' elseif Vk<32 then set Hd='I03X' elseif Vk<50 then set Hd='I040' elseif Vk<66 then set Hd='I042' elseif Vk<83 then set Hd='I044' else set Hd='I046' endif elseif Lc==6 then if Vk<11 then set Hd='I01A' elseif Vk<21 then set Hd='I018' elseif Vk<32 then set Hd='I019' elseif Vk<42 then set Hd='I01O' elseif Vk<53 then set Hd='I02Y' elseif Vk<63 then set Hd='I02Z' elseif Vk<70 then set Hd='I01F' else set Hd='I01Q'+GetRandomInt(0,2) endif if Hd==Oe then if Oe=='I01F' then set Hd='I01Q'+GetRandomInt(0,2) else set Hd='I01F' endif endif set Oe=Hd endif if Hd!=-1 then if(Hd=='I003')or(Hd=='I01K')or(Hd=='I01L')then call YG(Hd,tF,1,IMaxBJ(1,4-te)) elseif(Hd=='I014')then call YG(Hd,tF,1,2+fe) else if Hd=='I018' then call YG('I016',tF,C/2,C/2) endif set dm=CreateItemLoc(Hd,tF) endif if Hd=='I00B' then if fe>1 then call SetItemCharges(dm,1) else call SetItemCharges(dm,3-Mx) endif elseif Hd=='I01S' then set cv=dm call SetItemCharges(cv,6) call SetUnitLifeBJ(mb,1.00) call EnableTrigger(YN) endif endif call RemoveLocation(tF) set tF=null endfunction function V8 takes nothing returns nothing set yN=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(yN,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_DEATH) call TriggerAddCondition(yN,Condition(function a8)) call TriggerAddAction(yN,function n8) endfunction function E8 takes nothing returns boolean return(cv!=null)and(GetItemLifeBJ(cv)>0.0) endfunction function X8 takes nothing returns nothing local integer Gg=GetItemCharges(cv) local boolean SF=UnitHasItem(dv,cv) if Gg<(Cv-1)then call SetUnitLifeBJ(mb,1.00) elseif SF then call iC(GetOwningPlayer(dv),"Solar battery fully charged.") endif if Gg==0 then call sF('I01S') else call SetItemCharges(cv,Gg+1) endif endfunction function O8 takes nothing returns nothing set YN=CreateTrigger() call DisableTrigger(YN) call TriggerRegisterUnitLifeEvent(YN,mb,GREATER_THAN,GetUnitStateSwap(UNIT_STATE_MAX_LIFE,mb)-1.1) call TriggerAddCondition(YN,Condition(function E8)) call TriggerAddAction(YN,function X8) endfunction function R8 takes nothing returns boolean return GetItemTypeId(GetSoldItem())=='I01E' endfunction function I8 takes nothing returns nothing call DisableTrigger(zN) call SetItemCharges(GetSoldItem(),bg(GetBuyingUnit(),'I01E')) call TriggerSleepAction(0.1) call EnableTrigger(zN) endfunction function A8 takes nothing returns nothing set zN=CreateTrigger() call TriggerRegisterUnitEvent(zN,XB,EVENT_UNIT_SELL_ITEM) call TriggerAddCondition(zN,Condition(function R8)) call TriggerAddAction(zN,function I8) endfunction function N8 takes nothing returns nothing local effect KD local location ud local integer i=GetRandomInt(0,98) if i<25 then set ud=GetRandomLocInRect(Ln) elseif i<45 then set ud=GetRandomLocInRect(mn) elseif i<57 then set ud=GetRandomLocInRect(Mn) elseif i<68 then set ud=GetRandomLocInRect(pn) elseif i<77 then set ud=GetRandomLocInRect(Pn) elseif i<86 then set ud=GetRandomLocInRect(qn) elseif i<92 then set ud=GetRandomLocInRect(Qn) elseif i<97 then set ud=GetRandomLocInRect(sn) else set ud=GetRandomLocInRect(Sn) endif set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) set bv[2]=qf('h00C',Player(PLAYER_NEUTRAL_PASSIVE),ud,GetRandomInt(0,359)) call StopSoundBJ(fE,false) call PlaySoundBJ(fE) if te<1 then call aC("ChronoTech Corp. sent your squad a powerful item from the future!") call aC("(scanners detected its presence in the park)") set Nv[13]=1 set i=0 loop exitwhen i>8 if AC(Player(i))then call TriggerRegisterPlayerChatEvent(rR,Player(i),"-search",true) endif set i=i+1 endloop endif set i=0 loop call TriggerRegisterPlayerUnitEvent(vb,Player(i),EVENT_PLAYER_UNIT_USE_ITEM,null) set i=i+1 exitwhen i>8 endloop call DisableTrigger(vb) call TriggerSleepAction(0.33) call DestroyEffect(KD) set KD=null set ud=null endfunction function b8 takes nothing returns nothing set ZN=CreateTrigger() call TriggerAddAction(ZN,function N8) endfunction function B8 takes nothing returns boolean return GetItemLevel(GetManipulatedItem())>8 endfunction function c8 takes nothing returns nothing local unit Od=GetManipulatingUnit() local player oP=GetOwningPlayer(Od) local integer iP local integer id=GetItemTypeId(GetManipulatedItem()) call DisableTrigger(vb) if id=='I03V' then call UnitAddAbility(Od,'A0IU') elseif id=='I03X' then set iP=GetPlayerId(oP) set wo[iP]=wo[iP]+1 call zG(oP,true) elseif id=='I040' then call UnitAddAbility(Od,'A0IZ') elseif id=='I042' then call SetHeroInt(Od,GetHeroInt(Od,false)+5,true) elseif id=='I044' then set iP=GetPlayerId(oP) set Do[iP*Co]=Do[iP*Co]+1 set id=GetUnitTypeId(Od) if(id=='O005')or(id=='O00O')or(id=='O01E')then call Ru(Od,'A0MW') elseif(id=='O00U')or(id=='O004')or(id=='O00P')then call Ru(Od,'A003') elseif(id=='O003')or(id=='O00Q')then call Ru(Od,'A00F') elseif(id=='O00T')or(id=='O018')then call Ru(Od,'A04W') elseif(id=='O01C')or(id=='O01B')then call Ru(Od,'A0KV') else call Ru(Od,'A004') endif elseif id=='I046' then set iP=GetPlayerId(oP) set id=GetUnitAbilityLevel(Od,'A00A')+mx[iP] if id>0 then call UnitRemoveAbility(Od,V[IMaxBJ(id-1,0)]) endif set mx[iP]=mx[iP]+1 call UnitAddAbility(Od,V[id]) endif call DestroyTrigger(vb) endfunction function C8 takes nothing returns nothing set vb=CreateTrigger() call TriggerAddCondition(vb,Condition(function B8)) call TriggerAddAction(vb,function c8) endfunction function d8 takes nothing returns boolean local integer Hd=GetItemTypeId(GetManipulatedItem()) return(Hd=='I00K')or(Hd=='I02T')or(Hd=='I00S')or(Hd=='I03Q')or(Hd=='I01A') endfunction function D8 takes nothing returns nothing local unit LC=GetManipulatingUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) if(ti[iP]>0)then call UnitRemoveAbility(LC,'A0PG'+ti[iP]) endif set ti[iP]=ti[iP]+1 call UnitAddAbility(LC,'A0PG'+ti[iP]) call Dj(LC,250.0) endfunction function f8 takes nothing returns nothing set eb=CreateTrigger() call TriggerAddCondition(eb,Condition(function d8)) call TriggerAddAction(eb,function D8) endfunction function F8 takes nothing returns boolean local integer Hd=GetItemTypeId(GetManipulatedItem()) return(Hd=='I00K')or(Hd=='I02T')or(Hd=='I00S')or(Hd=='I03Q')or(Hd=='I01A') endfunction function g8 takes nothing returns nothing local unit LC=GetManipulatingUnit() local integer iP=GetPlayerId(GetOwningPlayer(LC)) if ti[iP]<1 then return endif call UnitRemoveAbility(LC,'A0PG'+ti[iP]) set ti[iP]=ti[iP]-1 if(ti[iP]>0)then call UnitAddAbility(LC,'A0PG'+ti[iP]) endif call Fj(LC,250.0) endfunction function G8 takes nothing returns nothing set xb=CreateTrigger() call TriggerAddCondition(xb,Condition(function F8)) call TriggerAddAction(xb,function g8) endfunction function h8 takes integer eh,player oP returns boolean if(eh=='I014')or(eh=='I015')or(eh=='I016')or(eh=='I020')or(eh=='I04D')or(eh=='I04E')or(eh=='I04F')then call iC(oP,"Invalid target.") return true endif return false endfunction function H8 takes nothing returns boolean local integer o1=GetSpellAbilityId() if(o1=='A05P')or(o1=='A0FA')then return GetUnitAbilityLevel(GetSpellAbilityUnit(),o1)<3 endif return false endfunction function j8 takes nothing returns nothing local integer o1=GetSpellAbilityId() local unit J8=GetSpellAbilityUnit() local item Jd=GetSpellTargetItem() local player oP=GetOwningPlayer(J8) local integer iP=GetPlayerId(oP) local effect KD=null local effect Et=null local integer Lc local real Hq local location ud if bx[iP]!=null then call SetUnitPosition(bx[iP],GetUnitX(X[iP]),GetUnitY(X[iP])) endif if Jd==null then call iC(oP,"Invalid target.") call Vf(J8,o1,3,false) return endif if not Ed(iP)then call iC(oP,"You must be alive to transport an item.") call Vf(J8,o1,3,false) return endif set Lc=GetItemTypeId(Jd) if vh(Lc,oP)or h8(Lc,oP)then call Vf(J8,o1,3,false) return endif set Hq=dC(GetUnitLoc(J8),GetUnitLoc(X[iP])) if UnitHasItem(J8,Jd)then if(Hq>350)and(o1!='A0FA')then call iC(oP,"You must stand near your locker to withdraw an item.") call Vf(J8,o1,3,false) return endif if Hq>350 then set ud=GetUnitLoc(J8) set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) call RemoveLocation(ud) set ud=GetUnitLoc(X[iP]) set Et=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) call RemoveLocation(ud) endif call TF(Jd,GetUnitLoc(X[iP])) if(Lc=='I003')or(Lc=='I01K')or(Lc=='I01L')then if QG(Lc,X[iP],iP)then call RemoveItem(Jd) endif else call cg(X[iP],Jd) endif if Hq<351 then call Vf(J8,o1,3,false) else call TriggerSleepAction(0.33) call DestroyEffect(KD) call DestroyEffect(Et) endif return elseif o1=='A0FA' then call iC(oP,"You must target an item inside the locker.") call Vf(J8,o1,3,false) return endif if HC(GetItemX(Jd),GetItemY(Jd),GetUnitX(X[iP]),GetUnitY(X[iP]),256)then call iC(oP,"You must stand next to the item you wish to transport.") call Vf(J8,o1,3,false) return endif if uF(J8)then call iC(oP,"Locker is full.") call Vf(J8,o1,3,false) return endif if Hq<351 then call UnitAddItem(J8,Jd) call Vf(J8,o1,3,false) return endif if GetUnitState(X[iP],UNIT_STATE_MANA)<150 then call iC(oP,"Not enough energy to teleport item.") call Vf(J8,o1,3,false) return endif set ud=GetItemLoc(Jd) set KD=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) call RemoveLocation(ud) set ud=GetUnitLoc(J8) set Et=AddSpecialEffectLoc("Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl",ud) call RemoveLocation(ud) call UnitAddItem(J8,Jd) call SetUnitState(X[iP],UNIT_STATE_MANA,RMaxBJ(0,GetUnitState(X[iP],UNIT_STATE_MANA)-150)) call TriggerSleepAction(0.33) call DestroyEffect(KD) call DestroyEffect(Et) endfunction function k8 takes nothing returns nothing set ob=CreateTrigger() call TriggerAddCondition(ob,Condition(function H8)) call TriggerAddAction(ob,function j8) endfunction function K8 takes nothing returns boolean return GetSpellAbilityId()=='A0E0' endfunction function l8 takes nothing returns nothing local unit J8=GetSpellAbilityUnit() local player oP=GetOwningPlayer(J8) local integer iP=GetPlayerId(oP) local integer i=0 local location ud local item Jd if not Ed(iP)then call iC(oP,"You must be alive to empty your locker.") return endif if dC(GetUnitLoc(J8),GetUnitLoc(X[iP]))>350 then call iC(oP,"You must stand next to your locker to empty it.") return endif set ud=GetUnitLoc(X[iP]) loop exitwhen i>5 set Jd=UnitItemInSlot(J8,i) if Jd!=null then call UnitRemoveItem(J8,Jd) call SetItemPositionLoc(Jd,ud) endif set i=i+1 endloop call RemoveLocation(ud) endfunction function L8 takes nothing returns nothing set rb=CreateTrigger() call TriggerAddCondition(rb,Condition(function K8)) call TriggerAddAction(rb,function l8) endfunction function m8 takes nothing returns boolean return GetSpellAbilityId()=='A0E4' endfunction function M8 takes nothing returns nothing local unit J8=GetSpellAbilityUnit() local integer bl=-1 local integer i=0 local item Jd local integer CF=0 if GetUnitAbilityLevel(J8,'A0EA')>1 then set CF=CF+1 endif if GetUnitAbilityLevel(J8,'A0EB')>1 then set CF=CF+2 endif if GetUnitAbilityLevel(J8,'A0EC')>1 then set CF=CF+4 endif loop exitwhen i>5 set Jd=UnitItemInSlot(J8,i) if Jd!=null then if O7(GetItemTypeId(Jd))then set bl=R7(J8,GetItemTypeId(Jd),Jd,CF) exitwhen bl<0 endif endif set i=i+1 endloop if i<6 then set CF=-1*bl-1 if CF>0 then call SetUnitAbilityLevel(J8,'A0EA'+CF/2,1) endif call iC(GetOwningPlayer(J8),"Constructed an item.") else if bl<0 then call iC(GetOwningPlayer(J8),"Locker contains no Design Plans.") elseif bl==0 then call iC(GetOwningPlayer(J8),"Locker doesn't contain the correct circuit board.") else call iC(GetOwningPlayer(J8),"Locker doesn't contain the necessary components.") endif endif endfunction function p8 takes nothing returns nothing set ib=CreateTrigger() call TriggerAddCondition(ib,Condition(function m8)) call TriggerAddAction(ib,function M8) endfunction function P8 takes nothing returns boolean local integer id=GetSpellAbilityId() return(id>'A0E0')and(id<'A0E4') endfunction function q8 takes nothing returns nothing local unit J8=GetSpellAbilityUnit() call UnitAddItem(J8,CreateItem('I02M'-'A0E1'+GetSpellAbilityId(),GetUnitX(J8),GetUnitY(J8))) endfunction function Q8 takes nothing returns nothing set ab=CreateTrigger() call TriggerAddCondition(ab,Condition(function P8)) call TriggerAddAction(ab,function q8) endfunction function s8 takes nothing returns boolean local integer id=GetSpellAbilityId() return(id>='A0EA')and(id<'A0ED') endfunction function S8 takes nothing returns nothing local unit J8=GetSpellAbilityUnit() local integer nD=GetSpellAbilityId()-'A0EA' local player oP=GetOwningPlayer(J8) local integer i=0 local item Jd if GetUnitAbilityLevel(J8,'A0EA'+nD)==1 then loop set Jd=UnitItemInSlot(J8,i) exitwhen(Jd!=null)and(GetItemTypeId(Jd)==('I02M'+nD)) set i=i+1 exitwhen i>5 endloop if i>5 then call iC(oP,"Locker doesn't contain that circuit board.") else call SetUnitAbilityLevel(J8,'A0EA'+nD,2) call RemoveItem(Jd) endif else if uF(J8)then call iC(oP,"Locker is full.") else call SetUnitAbilityLevel(J8,'A0EA'+nD,1) call UnitAddItem(J8,CreateItem('I02M'+nD,GetUnitX(J8),GetUnitY(J8))) endif endif endfunction function t8 takes nothing returns nothing set nb=CreateTrigger() call TriggerAddCondition(nb,Condition(function s8)) call TriggerAddAction(nb,function S8) endfunction function T8 takes nothing returns nothing local unit J8=GetManipulatingUnit() local integer Tc=GetPlayerId(GetOwningPlayer(J8))+9 if(Px[Tc]!=null)and uF(J8)then call RemoveUnit(Px[Tc]) set Px[Tc]=null set Tc=0 loop call UnitRemoveAbility(J8,'A0E1'+Tc) call UnitAddAbility(J8,'A0E1'+Tc+4) set Tc=Tc+1 exitwhen Tc>2 endloop endif endfunction function u8 takes nothing returns nothing set Vb=CreateTrigger() call TriggerAddAction(Vb,function T8) endfunction function U8 takes nothing returns nothing local unit J8=GetManipulatingUnit() local integer Tc=GetPlayerId(GetOwningPlayer(J8))+9 call TriggerSleepAction(0.1) if(Px[Tc]==null)and not uF(J8)then set Px[Tc]=qf('n011',GetOwningPlayer(J8),GetUnitLoc(Px[Tc-9]),0) set Tc=0 loop call UnitRemoveAbility(J8,'A0E1'+Tc+4) call UnitAddAbility(J8,'A0E1'+Tc) set Tc=Tc+1 exitwhen Tc>2 endloop endif endfunction function w8 takes nothing returns nothing set Eb=CreateTrigger() call TriggerAddAction(Eb,function U8) endfunction function W8 takes nothing returns nothing local unit J8=GetManipulatingUnit() local item Jd=GetManipulatedItem() local player oP=GetOwningPlayer(J8) local integer iP=GetPlayerId(oP) call UnitRemoveItem(J8,Jd) if(not Ed(iP))or HC(GetUnitX(J8),GetUnitY(J8),GetUnitX(X[iP]),GetUnitY(X[iP]),350)then call SetItemPositionLoc(Jd,Td(GetRectCenter(vE),0,200)) else call SetItemPositionLoc(Jd,Td(GetUnitLoc(X[iP]),100,120)) endif call iC(oP,"You must be at least a Lieutenant (Rank 6) to use your locker.") endfunction function y8 takes nothing returns nothing set Xb=CreateTrigger() call TriggerAddAction(Xb,function W8) endfunction function Y8 takes nothing returns boolean return GetSpellAbilityId()=='A0J5' endfunction function z8 takes nothing returns nothing local unit J8=GetSpellAbilityUnit() local item Jd=GetSpellTargetItem() local player oP=GetOwningPlayer(J8) local integer iP=GetPlayerId(oP) local integer ed=-1 local integer Z8 if Jd==null then call iC(oP,"Invalid target.") return endif if not Ed(iP)then call iC(oP,"You must be alive to auction an item.") return endif if not UnitHasItem(J8,Jd)then call iC(oP,"You must target an item inside the locker.") return endif if CheckItemStatus(Jd,bj_ITEM_STATUS_PAWNABLE)then set ed=RY(GetItemTypeId(Jd),GetItemCharges(Jd)) endif if ed<0 then call iC(oP,"That item cannot be auctioned.") return endif if ed<2 then call iC(oP,"That item isn't worth enough to auction.") return endif call RemoveItem(Jd) call iC(oP,"Item registered on auction website.") set Z8=(ed*2)/ 3 if Z8>1000 then set Z8=1000 endif set ed=GetRandomInt(ed/4,(ed*3)/2) if ed2000 then set ed=1500 elseif ed>1000 then set ed=1000+(ed-1000)/2 endif call OC(ed*0.02) call SetPlayerState(oP,PLAYER_STATE_RESOURCE_GOLD,GetPlayerState(oP,PLAYER_STATE_RESOURCE_GOLD)+ed) if not vv then if ed<(Z8+Z8/2)then call iC(oP,"You received "+I2S(ed)+" credits from the auction of an item.") else call iC(oP,"You received "+I2S(ed)+" credits from the auction of an item!") endif endif endfunction function vvv takes nothing returns nothing set Ob=CreateTrigger() call TriggerAddCondition(Ob,Condition(function Y8)) call TriggerAddAction(Ob,function z8) endfunction function vev takes nothing returns boolean return GetSpellAbilityId()=='A0J6' endfunction function vxv takes nothing returns nothing local unit J8=GetSpellAbilityUnit() local unit LC=GetSpellTargetUnit() local player oP=GetOwningPlayer(J8) local integer iP=GetPlayerId(oP) local real vov local real vrv local integer ed if(LC==null)or(GetUnitTypeId(LC)!='z005')then call iC(oP,"You must target a powered kiosk.") call Vf(J8,'A0J6',2,false) return endif if not Ed(iP)then call iC(oP,"You must be alive to hack a kiosk.") call Vf(J8,'A0J6',2,false) return endif if HC(GetUnitX(LC),GetUnitY(LC),GetUnitX(X[iP]),GetUnitY(X[iP]),350)then call iC(oP,"You must stand next to the kiosk you're trying to hack.") call Vf(J8,'A0J6',2,false) return endif if yo[10]4 then return elseif IsUnitType(LC,UNIT_TYPE_MECHANICAL)then return endif call JK(LC,0) endfunction function vGv takes nothing returns nothing set Cb=CreateTrigger() call TriggerAddAction(Cb,function vgv) endfunction function vhv takes nothing returns nothing local unit LC=GetLeavingUnit() if GetUnitPointValue(LC)>4 then return elseif IsUnitType(LC,UNIT_TYPE_MECHANICAL)then return elseif not HK(LC)then return endif if fe<1 then if IsUnitType(LC,UNIT_TYPE_HERO)and(Kv>1)then call iC(GetOwningPlayer(LC),"|cffff8000WARNING|r |cffffcc00You left the bomb shelter's radiation protection.") endif endif endfunction function vHv takes nothing returns nothing set db=CreateTrigger() call TriggerAddAction(db,function vhv) endfunction function vjv takes nothing returns nothing local integer i=0 local location ud local boolean b local integer vJv=Ve local integer vkv=w if vv then return endif if te<1 then if vJv0)or(vJv>=vkv)then call SetPlayerTechResearchedSwap('R00Z',1,Player(PLAYER_NEUTRAL_PASSIVE)) endif if(te>0)or(vJv2)then loop exitwhen ne[i]==null set ud=GetUnitLoc(ne[i]) set b=GetUnitUserData(ne[i])==1 call RemoveUnit(ne[i]) set ne[i]=qf('z005',Player(PLAYER_NEUTRAL_PASSIVE),ud,17.00) if b then call UnitSetUsesAltIconBJ(true,ne[i]) endif set i=i+1 endloop call SetPlayerTechResearchedSwap('Rhss',1,Player(PLAYER_NEUTRAL_PASSIVE)) if te<1 then if J>2 then call aC("Automated black markets are now operational.") set i=0 loop exitwhen i>8 if uv[i]==0 then call iC(Player(i),"|r|cff00ff00HINT|r |cffffcc00A.B.M.s, once found, are represented on your minimap by a gray dot.") endif set i=i+1 endloop call RC(3) endif endif endif if(te<1)and(vJv>=vkv)then call SetUnitOwner(Qb,Player(9),false) call SetUnitOwner(sb,Player(9),false) call SetUnitOwner(Sb,Player(9),false) call SetUnitOwner(tb,Player(9),false) call SetUnitOwner(qb,Player(9),false) call SetUnitOwner(Pb,Player(9),false) call TriggerRegisterEnterRectSimple(Cb,zV) call TriggerRegisterLeaveRectSimple(db,zV) call TriggerRegisterEnterRectSimple(Cb,ZV) call TriggerRegisterLeaveRectSimple(db,ZV) call TriggerRegisterEnterRectSimple(Cb,rE) call TriggerRegisterLeaveRectSimple(db,rE) call TriggerRegisterEnterRectSimple(Cb,eE) call TriggerRegisterLeaveRectSimple(db,eE) call TriggerRegisterEnterRectSimple(Cb,xE) call TriggerRegisterLeaveRectSimple(db,xE) call TriggerRegisterEnterRectSimple(Cb,oE) call TriggerRegisterLeaveRectSimple(db,oE) if J>2 then call aC("Bomb shelters have been revealed and now provide radiation protection.") call aC("|cffff8000NOTE|r |cffffcc00All units in a bomb shelter must exit and re-enter to benefit.") set i=0 loop exitwhen i>8 if uv[i]==0 then call iC(Player(i),"|r|cff00ff00HINT|r |cffffcc00Bomb shelters are represented on your minimap by a green dot.") endif set i=i+1 endloop call RC(3) endif endif if(te<1)and((vJv2))then set i=0 loop exitwhen i>5 call UnitRemoveAbility(Lr[i],'A0KG') set i=i+1 endloop if J>2 then call aC("Teleportion evacuation stations inside bomb shelters are now active.") set i=0 loop exitwhen i>8 if uv[i]==0 then call iC(Player(i),"|r|cff00ff00HINT|r |cffffcc00You can rescue a civ by sending it to a Televac that has at least 250 energy.") endif set i=i+1 endloop endif call RC(6) set i=0 loop exitwhen i>5 call SetUnitState(Lr[i],UNIT_STATE_MANA,GetRandomReal(1,25)) set i=i+1 endloop endif if(te<1)and(vJv==vkv)then call TriggerRegisterTimerEvent(Gb,GetRandomInt(3,20),false) endif endfunction function vKv takes nothing returns nothing set Db=CreateTrigger() call TriggerAddAction(Db,function vjv) endfunction function vlv takes unit LC,integer i returns nothing local texttag qD=CreateTextTag() call SetTextTagText(qD,"<"+I2S(i)+"0s",0.027) call SetTextTagPos(qD,GetUnitX(LC)-120,GetUnitY(LC),150) if i>14 then call SetTextTagColor(qD,(30-i)*17,255,0,255) elseif i>2 then call SetTextTagColor(qD,255,112+i*18/2,0,255) else call SetTextTagColor(qD,255,49+i*36,0,255) endif call SetTextTagPermanent(qD,false) call SetTextTagLifespan(qD,10) set qD=null endfunction function vLv takes unit LC,integer i returns nothing local texttag qD=CreateTextTag() call SetTextTagText(qD,I2S(i)+"/8",0.027) call SetTextTagPos(qD,GetUnitX(LC)+40,GetUnitY(LC),150) if i>7 then call SetTextTagColor(qD,255,204,0,255) else call SetTextTagColor(qD,255,255,255,255) endif call SetTextTagPermanent(qD,false) call SetTextTagLifespan(qD,10) set qD=null endfunction function vmv takes nothing returns boolean return GetUnitTypeId(GetEnteringUnit())=='h000' endfunction function vMv takes nothing returns nothing local unit Ok=GetEnteringUnit() local string Ik=XC(Ok) local location tF=null local integer i=30 if te>0 then set i=60 endif if GetStoredInteger(Ae,"apc_stage",Ik)>1 then return endif call UnitAddAbility(Ok,'A04G') call StoreInteger(Ae,"apc_stage",Ik,2) call EnableTrigger(LoadTriggerHandle(qi,StringHash("apc_trig_board"),StringHash(Ik))) loop call RemoveGuardPosition(Ok) call RC(10.0) set i=i-1 exitwhen i<1 exitwhen(Ok==null)or not(GetUnitState(Ok,UNIT_STATE_LIFE)>0) exitwhen GetStoredInteger(Ae,"apc_stage",Ik)>2 if tD()then call vlv(Ok,i) call vLv(Ok,GetUnitUserData(Ok)) endif if(i==6)and not vv then call aC("A.P.C. leaves in 60 seconds...") set tF=GetUnitLoc(Ok) call PingMinimapLocForForceEx(Fx,tF,5.00,bj_MINIMAPPINGSTYLE_FLASHY,57.81,85.16,100.0) call RemoveLocation(tF) endif endloop if(Ok!=null)and(GetUnitState(Ok,UNIT_STATE_LIFE)>0)then call UnitRemoveAbility(Ok,'A04G') call StoreInteger(Ae,"apc_stage",Ik,4) call StoreInteger(Ae,"apc_trig_board_done",Ik,1) if(GetUnitUserData(Ok)>0)and not vv then call aC("A.P.C. leaving with "+I2S(GetUnitUserData(Ok))+" civilians inside.") set tF=GetUnitLoc(Ok) call PingMinimapLocForForceEx(Fx,tF,2.00,bj_MINIMAPPINGSTYLE_FLASHY,57.81,85.16,100.0) call RemoveLocation(tF) set tF=null endif call SetUnitUserData(Ok,GetUnitUserData(Ok)+1) call EnableTrigger(LoadTriggerHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik))) call TriggerRegisterTimerEvent(LoadTriggerHandle(qi,StringHash("apc_trig_dismiss"),StringHash(Ik)),0.1,false) endif set Ok=null endfunction function vpv takes nothing returns nothing set fb=CreateTrigger() call TriggerAddCondition(fb,Condition(function vmv)) call TriggerAddAction(fb,function vMv) endfunction function vPv takes nothing returns boolean local unit Ok=GetEnteringUnit() return(GetUnitTypeId(Ok)=='h000')and(GetUnitUserData(Ok)>0) endfunction function vqv takes nothing returns nothing local unit Ok=GetEnteringUnit() local integer ck=GetUnitUserData(Ok)-1 call Xk(Ok,false) call RemoveUnit(Ok) if(ck>0)and not vv then call Xm(ck) endif endfunction function vQv takes nothing returns nothing set Fb=CreateTrigger() call TriggerRegisterEnterRectSimple(Fb,Un) call TriggerRegisterEnterRectSimple(Fb,un) call TriggerRegisterEnterRectSimple(Fb,wn) call TriggerRegisterEnterRectSimple(Fb,Tn) call TriggerAddCondition(Fb,Condition(function vPv)) call TriggerAddAction(Fb,function vqv) endfunction function vsv takes nothing returns nothing local location tF=null local unit Nm=null local real Bm local real vSv=2001 local integer i=0 loop exitwhen i>5 set Bm=GetUnitState(Lr[i],UNIT_STATE_MANA) if Bm250 then call SetUnitVertexColor(Nm,32,128,255,255) else call SetUnitVertexColor(Nm,0,255,0,255) endif set tF=null endfunction function vtv takes nothing returns boolean return not vv endfunction function vTv takes nothing returns nothing call vsv() call TriggerRegisterTimerEvent(gb,GetRandomInt(1110,1350),false) endfunction function vuv takes nothing returns nothing set gb=CreateTrigger() call TriggerAddCondition(gb,Condition(function vtv)) call TriggerAddAction(gb,function vTv) endfunction function vUv takes nothing returns nothing call vsv() endfunction function vwv takes nothing returns nothing set Gb=CreateTrigger() call TriggerAddAction(Gb,function vUv) endfunction function vWv takes nothing returns nothing local unit Nm=GetTriggerUnit() if GetUnitAbilityLevel(Nm,'B02E')<1 then call SetUnitVertexColor(Nm,32,128,255,255) endif set Nm=null endfunction function vyv takes nothing returns nothing set hb=CreateTrigger() call TriggerAddAction(hb,function vWv) endfunction function vYv takes nothing returns nothing local trigger jD=GetTriggeringTrigger() local integer i=er local real x=GetUnitX(vr) local real y=GetUnitY(vr) set vr=null set er=0 if i>0 then set kv=kv-i set i=i/ 3 loop exitwhen i<1 call uh(x+GetRandomInt(-300,300),y+GetRandomInt(-300,300),false) set i=i-1 endloop call Ph() endif call DestroyTrigger(jD) endfunction function vzv takes nothing returns nothing local trigger jD local location ud local integer i=GetRandomInt(0,3) if sh()then if i==0 then set ud=GetRandomLocInRect(aE) elseif i==1 then set ud=GetRandomLocInRect(nE) elseif i==2 then set ud=GetRandomLocInRect(EE) else set ud=GetRandomLocInRect(VE) endif set vr=qf('hfoo',Player(PLAYER_NEUTRAL_PASSIVE),ud,270) set jD=CreateTrigger() call TriggerAddAction(jD,function vYv) call TriggerRegisterUnitEvent(jD,vr,EVENT_UNIT_DEATH) call UnitAddAbility(vr,'A0J7') call UnitAddAbility(vr,'AIl2') call SetUnitState(vr,UNIT_STATE_LIFE,60000) set er=-4 call SetUnitAbilityLevel(vr,'A0J7',6+C+C/3) call Ph() endif call DestroyTrigger(Hb) endfunction function vZv takes nothing returns nothing set Hb=CreateTrigger() call TriggerAddAction(Hb,function vzv) endfunction function v_v takes nothing returns nothing local integer kh=Kv call StopSound(cE,false,false) call StopSound(CE,false,false) call StopSound(dE,false,false) call StopSound(DE,false,false) if kh>=5 then call StartSound(cE) elseif kh==4 then call StartSound(CE) elseif kh==3 then call StartSound(dE) elseif kh==2 then call StartSound(DE) endif endfunction function v0v takes nothing returns nothing set jb=CreateTrigger() call TriggerAddAction(jb,function v_v) endfunction function v1v takes nothing returns nothing local integer kh=GetRandomInt(4-J,5-J) if te>0 then set kh=6 endif loop exitwhen kh<1 call Th() set kh=kh-1 endloop call TriggerRegisterTimerEvent(kb,0,false) endfunction function v2v takes nothing returns nothing set Jb=CreateTrigger() call TriggerAddAction(Jb,function v1v) endfunction function v3v takes nothing returns nothing local real Oh=4.5 local boolean b=false local integer l1 if(kv>mv)or(De>0)or(Ye>1)then if(kv0)then set l1=GetRandomInt(1,1+IMaxBJ(0,bC(De+Ye,5))) call uk(IMaxBJ(0,De-IMaxBJ(0,(l1-2)*5))) loop exitwhen l1<1 if Th()then set b=true endif set l1=l1-1 endloop if b then call Ph() endif endif if te>0 then set l1=Ye call OC(RMaxBJ(RMaxBJ(10.0-bC(De,10)-l1,8),74.0-0.76*I2R(kv+Nv[5]*2+De-Be))) set l1=Ye set Ye=0 call OC(RMaxBJ(RMaxBJ(10.0-bC(De,5)-l1,4),74.0-0.66*I2R(kv+Nv[5]*2+De+2*l1*(l1-1)-Be))) else set l1=Ye call OC(RMaxBJ(RMaxBJ(15.0-bC(De,10)-l1,10),79.0-0.6*I2R(kv+Nv[5]*2+De-Be))) set l1=Ye set Ye=0 call OC(RMaxBJ(RMaxBJ(15.0-bC(De,5)-l1,5),79.0-0.6*I2R(kv+Nv[5]*2+De+2*l1*(l1-1)-Be))) endif loop exitwhen Re<1 if te>0 then set Oh=1.7+I2R(jo)/2.0 endif set Oh=(Oh+Re*1.1)*(1.03-0.02*C) set Re=0 call OC(Oh*Oh) set Oh=2.0 endloop else call OC(60.0) endif call TriggerRegisterTimerEvent(kb,0,false) endfunction function v4v takes nothing returns nothing set kb=CreateTrigger() call TriggerAddAction(kb,function v3v) endfunction function v5v takes unit LC,real lP returns nothing local real EH=GetUnitState(LC,UNIT_STATE_LIFE) local real gH set lP=lP+0.005*Be set gH=GetUnitState(LC,UNIT_STATE_MAX_LIFE)*lP*GetRandomReal(0.8,1.2) call lD("-"+I2S(NC(gH)),LC,0,223,0,true,12,0.9) if gH>EH then call KillUnit(LC) else call SetUnitState(LC,UNIT_STATE_LIFE,EH-gH) endif endfunction function v6v takes nothing returns boolean return GetUnitTypeId(GetDyingUnit())=='hfoo' endfunction function v7v takes nothing returns nothing local unit th=GetDyingUnit() local integer Mg=GetUnitUserData(th) local integer ZH if Mg!=997 then if Mg!=998 then if Mg!=999 then set ZH=GetUnitTypeId(GetKillingUnit()) if ZH=='o00R' then set Re=bC(Re,2) elseif ZH=='O001' then set ZH=GetPlayerId(GetOwningPlayer(GetKillingUnit())) if Ed(ZH)and not HC(GetUnitX(Yv[ZH]),GetUnitY(Yv[ZH]),GetUnitX(X[ZH]),GetUnitY(X[ZH]),2900)then set Re=Re+1 endif else set Re=Re+1 endif else set Ye=Ye+1+bC(Ye,3) endif endif set Xr=Xr+1 call uh(GetUnitX(th),GetUnitY(th),Mg==999) if Bi>0 then set Bi=Bi-1 call Rd(162) endif if ce!=null then if fe>0 then call v5v(ce,0.025) else call v5v(ce,0.04) endif endif endif set kv=kv-1 call Ph() if te<1 then call PostTriggerExecuteBJ(zE,true) endif set th=null endfunction function v8v takes nothing returns nothing set Kb=CreateTrigger() call TriggerRegisterPlayerUnitEventSimple(Kb,Player(PLAYER_NEUTRAL_PASSIVE),EVENT_PLAYER_UNIT_DEATH) call TriggerAddCondition(Kb,Condition(function v6v)) call TriggerAddAction(Kb,function v7v) endfunction function v9v takes nothing returns nothing local unit th=GetDyingUnit() call PC(th,0,144,GetUnitX(th),GetUnitY(th),GetRandomInt(2000,4000),true,true,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) endfunction function evv takes nothing returns nothing set lb=CreateTrigger() call TriggerAddAction(lb,function v9v) endfunction function eev takes nothing returns nothing local unit th local group g=fc(Player(PLAYER_NEUTRAL_PASSIVE)) loop set th=FirstOfGroup(g) exitwhen th==null if GetUnitTypeId(th)=='hfoo' then if GetUnitUserData(th)>(5-fe)then call Sh(th) endif endif call GroupRemoveUnit(g,th) endloop call DestroyGroup(g) set g=null endfunction function exv takes nothing returns nothing set Lb=CreateTrigger() call TriggerAddAction(Lb,function eev) endfunction function eov takes nothing returns nothing call Ll() call Ml() call Pl() call Ql() call Sl() call Tl() call xL() call rL() call XL() call RL() call bL() call cL() call gm() call Hm() call km() call sm() call tm() call um() call wm() call ym() call Zm() call eM() call rM() call aM() call EM() call OM() call IM() call NM() call BM() call CM() call DM() call FM() call JM() call KM() call uM() call ZM() call ap() call Cp() call Dp() call gp() call hp() call jp() call kp() call Pp() call sp() call tp() call up() call Wp() call Yp() call eP() call rP() call RP() call AP() call cP() call DP() call FP() call GP() call HP() call JP() call bq() call Yq() call xQ() call VQ() call OQ() call NQ() call cQ() call gQ() call hQ() call JQ() call lQ() call MQ() call qQ() call tQ() call zQ() call xs() call is() call ns() call Es() call Rs() call Bs() call Cs() call fs() call Hs() call Js() call Ks() call Ms() call qs() call Ss() call ws() call ys() call vS() call rS() call aS() call XS() call bS() call fS() call GS() call jS() call KS() call mS() call uS() call zS() call it() call Ot() call At() call Bt() call Ct() call Dt() call kt() call lt() call mt() call pt() call Ut() call Yt() call Zt() call oT() call aT() call NT() call cT() call dT() call gT() call hT() call JT() call lT() call MT() call qT() call sT() call TT() call UT() call yT() call zT() call vu() call Ou() call Nu() call du() call fu() call gu() call hu() call Ju() call Ku() call mu() call qu() call Su() call uu() call Uu() call Wu() call Zu() call xU() call rU() call aU() call VU() call fU() call gU() call hU() call jU() call lU() call mU() call pU() call uU() call wU() call YU() call ew() call nw() call Ow() call cw() call Hw() call Lw() call Mw() call sw() call Tw() call ww() call oW() call VW() call OW() call cW() call DW() call GW() call JW() call LW() call PW() call sW() call UW() call yW() call zW() call xy() call iy() call ny() call Ey() call Iy() call by() call Cy() call Fy() call Gy() call jy() call Ky() call my() call Py() call sy() call wy() call zy() call eY() call rY() call nY() call OY() call lY() call pY() call QY() call SY() call TY() call WY() call ZY() call xz() call Ez() call Iz() call hz() call Kz() call Mz() call Qz() call uz() call Wz() call zz() call VZ() call cZ() call DZ() call gZ() call HZ() call kZ() call lZ() call mZ() call PZ() call sZ() call tZ() call uZ() call YZ() call v0() call o0() call a0() call E0() call R0() call N0() call c0() call f0() call G0() call j0() call L0() call Q0() call t0() call U0() call r1() call V1() call b1() call h1() call M1() call q1() call t1() call z1() call e2() call N2() call C2() call f2() call h2() call J2() call p2() call Q2() call T2() call W2() call x3() call n3() call X3() call N3() call c3() call D3() call s3() call u3() call W3() call Y3() call v4() call r4() call O4() call D4() call g4() call H4() call k4() call l4() call Q4() call t4() call y4() call z4() call v5() call x5() call i5() call V5() call D5() call F5() call G5() call J5() call S5() call u5() call W5() call e6() call r6() call V6() call O6() call A6() call B6() call d6() call F6() call G6() call j6() call l6() call M6() call s6() call w6() call f7() call z7() call v8() call V8() call O8() call A8() call b8() call C8() call f8() call G8() call k8() call L8() call p8() call Q8() call t8() call u8() call w8() call y8() call vvv() call viv() call vnv() call vEv() call vAv() call vBv() call vdv() call vFv() call vGv() call vHv() call vKv() call vpv() call vQv() call vuv() call vwv() call vyv() call vZv() call v0v() call v2v() call v4v() call v8v() call evv() call exv() endfunction function erv takes nothing returns nothing call ConditionalTriggerExecute(ME) call ConditionalTriggerExecute(pE) call ConditionalTriggerExecute(PE) call ConditionalTriggerExecute(QE) call ConditionalTriggerExecute(sE) call ConditionalTriggerExecute(SE) endfunction function eiv takes nothing returns nothing call SetPlayerStartLocation(Player(0),0) call ForcePlayerStartLocation(Player(0),0) call SetPlayerColor(Player(0),ConvertPlayerColor(0)) call SetPlayerRacePreference(Player(0),RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(0),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_HUMAN) 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_HUMAN) 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_HUMAN) 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_HUMAN) call SetPlayerRaceSelectable(Player(4),false) call SetPlayerController(Player(4),MAP_CONTROL_USER) call SetPlayerStartLocation(Player(5),5) call ForcePlayerStartLocation(Player(5),5) call SetPlayerColor(Player(5),ConvertPlayerColor(5)) call SetPlayerRacePreference(Player(5),RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(5),false) call SetPlayerController(Player(5),MAP_CONTROL_USER) call SetPlayerStartLocation(Player(6),6) call ForcePlayerStartLocation(Player(6),6) call SetPlayerColor(Player(6),ConvertPlayerColor(6)) call SetPlayerRacePreference(Player(6),RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(6),false) call SetPlayerController(Player(6),MAP_CONTROL_USER) call SetPlayerStartLocation(Player(7),7) call ForcePlayerStartLocation(Player(7),7) call SetPlayerColor(Player(7),ConvertPlayerColor(7)) call SetPlayerRacePreference(Player(7),RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(7),false) call SetPlayerController(Player(7),MAP_CONTROL_USER) call SetPlayerStartLocation(Player(8),8) call ForcePlayerStartLocation(Player(8),8) call SetPlayerColor(Player(8),ConvertPlayerColor(8)) call SetPlayerRacePreference(Player(8),RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(8),false) call SetPlayerController(Player(8),MAP_CONTROL_USER) call SetPlayerStartLocation(Player(9),9) call ForcePlayerStartLocation(Player(9),9) call SetPlayerColor(Player(9),ConvertPlayerColor(9)) call SetPlayerRacePreference(Player(9),RACE_PREF_HUMAN) call SetPlayerRaceSelectable(Player(9),false) call SetPlayerController(Player(9),MAP_CONTROL_COMPUTER) call SetPlayerStartLocation(Player(10),10) call ForcePlayerStartLocation(Player(10),10) call SetPlayerColor(Player(10),ConvertPlayerColor(10)) call SetPlayerRacePreference(Player(10),RACE_PREF_UNDEAD) call SetPlayerRaceSelectable(Player(10),false) call SetPlayerController(Player(10),MAP_CONTROL_COMPUTER) call SetPlayerStartLocation(Player(11),11) call ForcePlayerStartLocation(Player(11),11) call SetPlayerColor(Player(11),ConvertPlayerColor(11)) call SetPlayerRacePreference(Player(11),RACE_PREF_UNDEAD) call SetPlayerRaceSelectable(Player(11),false) call SetPlayerController(Player(11),MAP_CONTROL_COMPUTER) endfunction function InitCustomTeams takes nothing returns nothing call SetPlayerTeam(Player(0),0) call SetPlayerTeam(Player(1),0) call SetPlayerTeam(Player(2),0) call SetPlayerTeam(Player(3),0) call SetPlayerTeam(Player(4),0) call SetPlayerTeam(Player(5),0) call SetPlayerTeam(Player(6),0) call SetPlayerTeam(Player(7),0) call SetPlayerTeam(Player(8),0) call SetPlayerTeam(Player(9),0) call SetPlayerTeam(Player(10),1) call SetPlayerState(Player(10),PLAYER_STATE_ALLIED_VICTORY,1) call SetPlayerTeam(Player(11),1) call SetPlayerState(Player(11),PLAYER_STATE_ALLIED_VICTORY,1) call SetPlayerAllianceStateAllyBJ(Player(10),Player(11),true) call SetPlayerAllianceStateAllyBJ(Player(11),Player(10),true) call SetPlayerAllianceStateVisionBJ(Player(10),Player(11),true) call SetPlayerAllianceStateVisionBJ(Player(11),Player(10),true) endfunction function eav takes nothing returns nothing call SetStartLocPrioCount(0,8) call SetStartLocPrio(0,0,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,1,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,2,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,3,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,4,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,5,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(0,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(1,8) call SetStartLocPrio(1,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,1,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,2,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,3,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,4,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,5,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(1,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(2,8) call SetStartLocPrio(2,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,2,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,3,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,4,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,5,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(2,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(3,8) call SetStartLocPrio(3,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,3,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,4,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,5,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(3,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(4,8) call SetStartLocPrio(4,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,3,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,4,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,5,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(4,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(5,8) call SetStartLocPrio(5,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,3,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,4,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,5,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(5,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(6,8) call SetStartLocPrio(6,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,3,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,4,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,5,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,6,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(6,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(7,8) call SetStartLocPrio(7,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,3,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,4,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,5,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,6,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(7,7,8,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(8,8) call SetStartLocPrio(8,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,3,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,4,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,5,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,6,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(8,7,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrioCount(9,9) call SetStartLocPrio(9,0,0,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,1,1,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,2,2,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,3,3,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,4,4,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,5,5,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,6,6,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,7,7,MAP_LOC_PRIO_HIGH) call SetStartLocPrio(9,8,8,MAP_LOC_PRIO_HIGH) endfunction function main takes nothing returns nothing call SetCameraBounds(-15616.0+GetCameraMargin(CAMERA_MARGIN_LEFT),-15872.0+GetCameraMargin(CAMERA_MARGIN_BOTTOM),15616.0-GetCameraMargin(CAMERA_MARGIN_RIGHT),15360.0-GetCameraMargin(CAMERA_MARGIN_TOP),-15616.0+GetCameraMargin(CAMERA_MARGIN_LEFT),15360.0-GetCameraMargin(CAMERA_MARGIN_TOP),15616.0-GetCameraMargin(CAMERA_MARGIN_RIGHT),-15872.0+GetCameraMargin(CAMERA_MARGIN_BOTTOM)) call SetDayNightModels("Environment\\DNC\\DNCDalaran\\DNCDalaranTerrain\\DNCDalaranTerrain.mdl","Environment\\DNC\\DNCDalaran\\DNCDalaranUnit\\DNCDalaranUnit.mdl") call NewSoundEnvironment("Default") call SetAmbientDaySound("DalaranRuinsDay") call SetAmbientNightSound("DalaranRuinsNight") call SetMapMusic("Music",true,0) call Wc() call rC() call yc() call oC() call Uc() call wc() call eov() call erv() endfunction function config takes nothing returns nothing call SetMapName("|cffffcc00SWAT: Aftermath|r B091207") call SetMapDescription("Coop map against waves of undead. Teamwork is essential as is using each class's strengths to their fullest. Enemies are numerous and extremely dangerous, providing non-stop & intense action. |cff81bf0dBeta 091207|r") call SetPlayers(12) call SetTeams(12) call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER) call DefineStartLocation(0,-1216.0,-1664.0) call DefineStartLocation(1,-1216.0,-1664.0) call DefineStartLocation(2,-1216.0,-1664.0) call DefineStartLocation(3,-1216.0,-1664.0) call DefineStartLocation(4,-1216.0,-1664.0) call DefineStartLocation(5,-1216.0,-1664.0) call DefineStartLocation(6,-1216.0,-1664.0) call DefineStartLocation(7,-1216.0,-1664.0) call DefineStartLocation(8,-1216.0,-1664.0) call DefineStartLocation(9,-1216.0,-1664.0) call DefineStartLocation(10,2560.0,10752.0) call DefineStartLocation(11,2560.0,10752.0) call eiv() call InitCustomTeams() call eav() endfunction