HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

help needed JASS

05-12-2006, 10:31 AM#1
geocine
Instead of typing in the console "/sdadwe" to achieve a +3 levelup, I want to do hotkey combinations like ctrl+l. How can i change the call for HeroLevelUpTrigger?

Or how to use it with the arrow keys if its not possible with hotkeys.
like a combination of "up+up+lef+right"


Collapse JASS:
trigger HeroLevelUpTrigger=CreateTrigger()

call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[1],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[2],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[3],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[4],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[5],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[1],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[2],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[3],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[4],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[5],"/sdadwe",true)

function HeroLevelUp takes nothing returns nothing
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,"Test")
call SetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())], GetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())])+1, true)
endfunction
05-12-2006, 10:55 AM#2
Blade.dk
http://www.wc3jass.com/viewtopic.php?t=153

You can use that script to detect arrow key combinations.

Unless I remember wrong, starting a message with / is not possible on bnet, it will give you an error.
05-12-2006, 11:24 AM#3
geocine
How about hot keys... is it possible. I'm not using it in bnet it's just for lan game. I'm editing a leaked DOTA map. And I injected those JASS scripts and works like a charm but i don't know how to change to said combo and hotkeys

How can i change this

Collapse JASS:
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[5],"/sdadwe",true)

it get this errors

Line 14627: Undeclared function GetHandleHandle
Line 14627: Undeclared function Handle2Trigger
Line 14628: Undeclared function GetHandleString
Line 14631: Undeclared function GetHandleHandle
Line 14631: Undeclared function Handle2Timer
Line 14632: Undeclared function GetHandleReal
Line 14633: Cannot convert null to real
Line 14634: Undeclared function GetHandleInteger
Line 14635: Cannot convert null to integer
Line 14648: Undeclared function SetHandleHandle
Line 14666: Undeclared function SetHandleHandle
Line 14675: Undeclared function SetHandleHandle
Line 14679: Undeclared function SetHandleInteger
Line 14695: Undeclared function SetHandleHandle
Line 14696: Undeclared function SetHandleString
Line 14697: Undeclared function SetHandleReal
Line 15279: Cannot convert boolean to real
Line 15280: Cannot convert boolean to real
Line 15281: Cannot convert boolean to real
Line 15282: Cannot convert boolean to real
Line 15283: Cannot convert boolean to real
Line 15284: Cannot convert boolean to real
Line 15285: Cannot convert boolean to real
Line 15286: Cannot convert boolean to real
Line 15287: Cannot convert boolean to real
Line 15288: Cannot convert boolean to real
05-12-2006, 01:22 PM#4
sheep.spirit
The problem you are facing seems like you didnt import the hadle functions properly, try importing the handle functions again
05-12-2006, 04:04 PM#5
geocine
Sorry but can't dig deeper. Can you explain to me how to impoert handle functions. Kindly give me an example from the script given by blade and made by dataangel. Help much appreciated
05-12-2006, 04:22 PM#6
Thunder_Eye
The handle vars can be found here

http://www.wc3sear.ch/index.php?p=JA...e5cb6521039961
05-12-2006, 04:26 PM#7
geocine
so i'll paste that code along with this one

http://www.wc3jass.com/viewtopic.php?t=153
dataangel..
05-12-2006, 04:36 PM#8
Thunder_Eye
The handle vars must be ontop all other functions
05-12-2006, 05:04 PM#9
geocine
I am still having errors kindly check out my file. Help me experts, for i know your the most knowledgeable people when it comes to JASS

Collapse JASS:
globals
integer array A
boolean array B
integer array C
integer array D
integer array E
boolean F=false
boolean array G
boolean H=false
string array I
boolean array j
timer array J
integer array k
integer array K
timer array L
integer array M
timer n=CreateTimer()
integer array N
integer o=0
integer O=0
item P=null
integer array q
integer array Q
boolean R=false
boolean s=false
boolean S=false
boolean T=false
boolean U=false
string v=" v6.32b"
integer V=0
integer W=0
integer X=0
integer Y=0
real Z=0
item aa=null
integer aA=0
real array ab
item array aB
multiboard ac=null
unit aC=null
boolean array ad
boolean array aD
integer ae=150
boolean aE=false
boolean af=false
boolean aF=false
boolean array ag
location aG=null
location ah=null
location aH=null
location ai=null
location aI=null
boolean aj=true
boolean aJ=true
boolean ak=true
boolean aK=true
boolean al=true
boolean aL=true
boolean am=true
boolean aM=true
boolean an=true
boolean aN=true
boolean ao=true
boolean aO=true
integer ap=3
integer aP=1
location aq=null
location aQ=null
location ar=null
location aR=null
location as=null
location aS=null
location at=null
location aT=null
location au=null
location aU=null
location av=null
location aV=null
location aw=null
location aW=null
integer array ax
integer array aX
integer array ay
integer array aY
integer az=80
integer array aZ
integer a0=0
integer array a1
unit array a2
boolean a3=false
quest a4=null
quest a5=null
integer a6=0
integer a7=0
player array a8
player array a9
boolean Aa=false
boolean array AA
integer array Ab
integer array AB
integer array Ac
integer array AC
integer Ad=0
integer AD=0
integer Ae=0
boolean AE=false
integer array Af
integer array AF
unit Ag=null
unit AG=null
boolean Ah=false
real AH=0
unit Ai=null
unit array AI
integer array Aj
boolean AJ=false
force Ak=CreateForce()
force AK=CreateForce()
player array Al
player array AL
player Am=null
boolean AM=false
leaderboard array An
integer AN=0
integer Ao=0
integer array AO
gamecache Ap=null
real array AP
real array Aq
player AQ=null
unit Ar=null
real AR=0
item array As
item array AS
item array At
item array AT
item array Au
item array AU
boolean Av=false
boolean AV=false
integer Aw=0
location array AW
unit AX=null
group AY=CreateGroup()
boolean Az=false
rect AZ
rect A0
rect A1
rect A2
rect A3
rect A4
rect A5
rect A6
rect A7
rect A8
rect A9
rect ba
rect bA
rect bb
rect bB
rect bc
rect bC
rect bd
rect bD
rect be
rect bE
rect bf
rect bF
rect bg
rect bG
rect bh
rect bH
rect bi
rect bI
rect bj
rect bJ
rect bk
rect bK
rect bl
rect bL
rect bm
rect bM
rect bn
rect bN
rect bo
rect bO
rect bp
rect bP
rect bq
rect bQ
rect br
rect bR
rect bs
rect bS
rect bt
rect bT
rect bu
rect bU
rect bv
rect bV
camerasetup bw=CreateCameraSetup()
camerasetup bW=CreateCameraSetup()
camerasetup bx=CreateCameraSetup()
camerasetup bX=CreateCameraSetup()
sound by
sound bY
sound bz
sound bZ
sound b0
sound b1
sound b2
sound b3
sound b4
sound b5
sound b6
sound b7
sound b8
trigger b9=CreateTrigger()
trigger Ba=CreateTrigger()
trigger BA=CreateTrigger()
trigger Bb=CreateTrigger()
trigger BB=CreateTrigger()
trigger Bc=CreateTrigger()
trigger BC=CreateTrigger()
trigger Bd=CreateTrigger()
trigger BD=CreateTrigger()
trigger Be=CreateTrigger()
trigger BE=CreateTrigger()
trigger Bf=CreateTrigger()
trigger BF=CreateTrigger()
trigger Bg=CreateTrigger()
trigger BG=CreateTrigger()
trigger Bh=CreateTrigger()
trigger BH=CreateTrigger()
trigger Bi=CreateTrigger()
trigger BI=CreateTrigger()
trigger Bj=CreateTrigger()
trigger BJ=CreateTrigger()
trigger Bk=CreateTrigger()
trigger BK=CreateTrigger()
trigger Bl=CreateTrigger()
trigger BL=CreateTrigger()
trigger Bm=CreateTrigger()
trigger BM=CreateTrigger()
trigger Bn=CreateTrigger()
trigger BN=CreateTrigger()
trigger Bo=CreateTrigger()
trigger BO=CreateTrigger()
trigger Bp=CreateTrigger()
trigger BP=CreateTrigger()
trigger Bq=CreateTrigger()
trigger BQ=CreateTrigger()
trigger Br=CreateTrigger()
trigger BR=CreateTrigger()
trigger Bs=CreateTrigger()
trigger BS=CreateTrigger()
trigger Bt=CreateTrigger()
trigger BT=CreateTrigger()
trigger Bu=CreateTrigger()
trigger BU=CreateTrigger()
trigger Bv=CreateTrigger()
trigger BV=CreateTrigger()
trigger Bw=CreateTrigger()
trigger BW=CreateTrigger()
trigger BX=CreateTrigger()
trigger BY=CreateTrigger()
trigger Bz=CreateTrigger()
trigger BZ=CreateTrigger()
trigger B0=CreateTrigger()
trigger B1=CreateTrigger()
trigger B2=CreateTrigger()
trigger B3=CreateTrigger()
trigger B4=CreateTrigger()
trigger B5=CreateTrigger()
trigger B6=CreateTrigger()
trigger B7=CreateTrigger()
trigger B8=CreateTrigger()
trigger B9=CreateTrigger()
trigger ca=CreateTrigger()
trigger cA=CreateTrigger()
trigger cb=CreateTrigger()
trigger cB=CreateTrigger()
trigger cc=CreateTrigger()
trigger cC=CreateTrigger()
trigger cd=CreateTrigger()
trigger cD=CreateTrigger()
trigger ce=CreateTrigger()
trigger cE=CreateTrigger()
trigger cf=CreateTrigger()
trigger cF=CreateTrigger()
trigger cg=CreateTrigger()
trigger cG=CreateTrigger()
trigger ch=CreateTrigger()
trigger cH=CreateTrigger()
trigger ci=CreateTrigger()
trigger cI=CreateTrigger()
trigger cj=CreateTrigger()
trigger cJ=CreateTrigger()
trigger ck=CreateTrigger()
trigger cK=CreateTrigger()
trigger cl=CreateTrigger()
trigger cL=CreateTrigger()
trigger cm=CreateTrigger()
trigger cM=CreateTrigger()
trigger cn=CreateTrigger()
trigger cN=CreateTrigger()
trigger co=CreateTrigger()
trigger cO=CreateTrigger()
trigger cp=CreateTrigger()
trigger cP=CreateTrigger()
trigger cq=CreateTrigger()
trigger cQ=CreateTrigger()
trigger cr=CreateTrigger()
trigger cR=CreateTrigger()
trigger cs=CreateTrigger()
trigger cS=CreateTrigger()
trigger ct=null
trigger cT=null
trigger cu=null
trigger cU=null
trigger cv=CreateTrigger()
trigger cV=null
trigger cw=null
trigger cW=CreateTrigger()
trigger cx=CreateTrigger()
trigger cX=CreateTrigger()
trigger cy=CreateTrigger()
trigger cY=CreateTrigger()
trigger cz=CreateTrigger()
trigger cZ=CreateTrigger()
trigger c0=CreateTrigger()
trigger c1=CreateTrigger()
trigger c2=CreateTrigger()
trigger c3=null
trigger c4=null
trigger c5=null
trigger c6=null
trigger c7=null
trigger c8=CreateTrigger()
trigger c9=null
trigger Ca=null
trigger CA=CreateTrigger()
trigger Cb=null
trigger CB=null
trigger Cc=null
trigger CC=null
trigger Cd=null
trigger CD=null
trigger Ce=null
trigger CE=null
trigger Cf=null
trigger Cg=null
trigger CG=null
trigger Ch=null
trigger CH=null
trigger Ci=null
trigger CI=null
trigger Cj=null
trigger CJ=null
trigger Ck=null
trigger CK=null
trigger Cl=null
trigger CL=null
trigger Cm=null
trigger CM=null
trigger Cn=null
trigger CN=null
trigger Co=null
trigger CO=null
trigger Cp=null
trigger CP=null
trigger Cq=null
trigger CQ=null
trigger Cr=null
trigger CR=null
trigger Cs=null
trigger CS=null
trigger Ct=null
trigger CT=null
trigger Cu=null
trigger CU=null
trigger Cv=null
trigger CV=null
trigger Cw=null
trigger CW=null
trigger CX=null
trigger CY=null
trigger Cz=null
trigger CZ=null
trigger C0=null
trigger C1=null
trigger C2=null
trigger C3=null
trigger C4=null
trigger C5=null
trigger C6=null
trigger C7=null
trigger C8=null
trigger C9=null
trigger da=null
trigger dA=null
trigger db=null
trigger dB=null
trigger dc=null
trigger dC=null
trigger dd=null
trigger dD=null
trigger de=null
trigger dE=null
trigger df=null
trigger dF=null
trigger dg=null
trigger dG=null
trigger dh=null
trigger dH=null
trigger di=null
trigger dI=null
trigger dj=null
trigger dJ=null
trigger dk=null
trigger dK=null
trigger dl=null
trigger dL=null
trigger dm=CreateTrigger()
trigger dM=null
trigger dn=null
trigger dN=null
trigger do=null
trigger dO=null
trigger dp=null
trigger dP=null
trigger dq=null
trigger dQ=null
trigger dr=null
trigger dR=null
trigger ds=null
trigger dS=null
trigger dt=null
trigger dT=null
trigger du=null
trigger dU=null
trigger dv=null
trigger dV=null
trigger dw=null
trigger dW=null
trigger dX=null
trigger dy=null
trigger dY=null
trigger dz=null
trigger dZ=null
trigger d0=null
trigger d1=null
trigger d2=null
trigger d3=null
trigger d4=null
trigger d5=null
trigger d6=null
trigger d7=null
trigger d8=null
trigger d9=null
trigger Da=null
trigger DA=null
trigger Db=null
trigger DB=null
trigger Dc=null
trigger DC=null
trigger Dd=null
trigger DD=null
trigger De=null
trigger DE=null
trigger Df=null
trigger DF=null
trigger Dg=null
trigger DG=null
trigger Dh=null
trigger DH=null
trigger Di=null
trigger DI=null
trigger Dj=null
trigger DJ=null
trigger Dk=null
trigger DK=null
trigger Dl=CreateTrigger()
trigger HeroLevelUpTrigger=CreateTrigger()
trigger MoneyMakerTrigger=CreateTrigger()
unit DL
unit Dm
unit DM
unit Dn
unit DN
unit Do
unit DO
unit Dp
unit DP
unit Dq
unit DQ
unit Dr
unit DR
unit Ds
unit DS
unit Dt
unit DT
unit Du
unit DU
unit Dv
unit DV
unit Dw
unit Dx
unit DX
unit Dy
unit DY
unit Dz
unit DZ
unit D0
unit D1
unit D2
unit D3
unit D4
unit D5
unit D6
unit D7
unit D8
unit D9
unit ea
unit eA
unit eb
unit eB
unit eC
unit ed
unit eD
unit ee
unit eE
unit ef
unit eF
unit eg
unit eG
unit eh
unit eH
unit ei
unit eI
unit ej
unit eJ
unit ek
unit eK
unit el
unit eL
unit em
unit eM
unit en
unit eN
unit eo
unit eO
unit ep
unit eP
unit eq
unit eQ
unit er
unit eR
unit es
unit eS
unit et
unit eT
unit eu
unit eU
unit ev
unit eV
unit ew
unit eW
unit ex
unit eX
unit ey
unit eY
unit ez
endglobals
function eZ takes player e0 returns boolean
if(e0==Al[0])then
return true
endif
if(e0==Al[1])then
return true
endif
if(e0==Al[2])then
return true
endif
if(e0==Al[3])then
return true
endif
if(e0==Al[4])then
return true
endif
if(e0==Al[5])then
return true
endif
return false
endfunction
function e1 takes player e0 returns boolean
if(e0==AL[0])then
return true
endif
if(e0==AL[1])then
return true
endif
if(e0==AL[2])then
return true
endif
if(e0==AL[3])then
return true
endif
if(e0==AL[4])then
return true
endif
if(e0==AL[5])then
return true
endif
return false
endfunction
function e2 takes player e3 returns boolean
if(GetPlayerSlotState(e3)==PLAYER_SLOT_STATE_PLAYING)then
if(GetPlayerController(e3)==MAP_CONTROL_USER)then
return true
endif
endif
return false
endfunction
function e4 takes nothing returns nothing
if(e2(GetEnumPlayer()))then
set bj_forceCountPlayers=bj_forceCountPlayers+1
endif
endfunction
function e5 takes force f returns integer
set bj_forceCountPlayers=0
call ForForce(f,function e4)
return bj_forceCountPlayers
endfunction
function e6 takes integer e7,player e3 returns nothing
call SetPlayerTechMaxAllowed(e3,e7,0)
set B[GetUnitPointValueByType(e7)]=true
endfunction
function e8 takes integer e7 returns nothing
call e6(e7,Al[1])
call e6(e7,Al[2])
call e6(e7,Al[3])
call e6(e7,Al[4])
call e6(e7,Al[5])
call e6(e7,AL[1])
call e6(e7,AL[2])
call e6(e7,AL[3])
call e6(e7,AL[4])
call e6(e7,AL[5])
endfunction
function e9 takes integer e7 returns nothing
call SetPlayerTechMaxAllowed(Al[1],e7,0)
call SetPlayerTechMaxAllowed(Al[2],e7,0)
call SetPlayerTechMaxAllowed(Al[3],e7,0)
call SetPlayerTechMaxAllowed(Al[4],e7,0)
call SetPlayerTechMaxAllowed(Al[5],e7,0)
call SetPlayerTechMaxAllowed(AL[1],e7,0)
call SetPlayerTechMaxAllowed(AL[2],e7,0)
call SetPlayerTechMaxAllowed(AL[3],e7,0)
call SetPlayerTechMaxAllowed(AL[4],e7,0)
call SetPlayerTechMaxAllowed(AL[5],e7,0)
endfunction
function Ea takes player e3 returns nothing
local integer EA=V
local integer Eb=W
loop
exitwhen EA>Eb
call SetPlayerTechMaxAllowed(e3,k[EA],0)
set EA=EA+1
endloop
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
call SetPlayerTechMaxAllowed(e3,k[EA],0)
set EA=EA+1
endloop
endfunction
function EB takes nothing returns nothing
call Ea(Al[1])
call Ea(Al[2])
call Ea(Al[3])
call Ea(Al[4])
call Ea(Al[5])
call Ea(AL[1])
call Ea(AL[2])
call Ea(AL[3])
call Ea(AL[4])
call Ea(AL[5])
endfunction
function Ec takes real x1,real y1,real x2,real y2 returns real
return SquareRoot(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)))
endfunction
function EC takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function Ed takes player ED returns nothing
local trigger t=CreateTrigger()
local dialog d=DialogCreate()
call RemovePlayer(ED,PLAYER_GAME_RESULT_DEFEAT)
set bj_changeLevelShowScores=true
call DialogSetMessage(d,"Defeat!")
set t=CreateTrigger()
call TriggerRegisterDialogButtonEvent(t,DialogAddButton(d,"Quit Game",GetLocalizedHotkey("GAMEOVER_QUIT_MISSION")))
call TriggerAddAction(t,function CustomDefeatQuitBJ)
call DialogDisplay(ED,d,true)
call VolumeGroupSetVolumeForPlayerBJ(ED,SOUND_VOLUMEGROUP_UI,1.)
call StartSoundForPlayerBJ(ED,bj_defeatDialogSound)
endfunction
function Ee takes player ED returns nothing
local trigger t=CreateTrigger()
local dialog d=DialogCreate()
call RemovePlayer(ED,PLAYER_GAME_RESULT_VICTORY)
set bj_changeLevelShowScores=true
call DialogSetMessage(d,GetLocalizedString("GAMEOVER_VICTORY_MSG"))
set t=CreateTrigger()
call TriggerRegisterDialogButtonEvent(t,DialogAddButton(d,"Quit Game",GetLocalizedHotkey("GAMEOVER_QUIT_MISSION")))
call TriggerAddAction(t,function CustomVictoryQuitBJ)
call DialogDisplay(ED,d,true)
call VolumeGroupSetVolumeForPlayerBJ(ED,SOUND_VOLUMEGROUP_UI,1.)
call StartSoundForPlayerBJ(ED,bj_victoryDialogSound)
endfunction
function EE takes nothing returns nothing
local integer EA
local integer Eb
local integer Ef=0
set AN=V
set EA=V
set Eb=W
loop
exitwhen EA>Eb
set Ef=Ef+1
set AO[Ef]=EA
set EA=EA+1
endloop
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
set Ef=Ef+1
set AO[Ef]=EA
set EA=EA+1
endloop
set Ao=Ef
endfunction
function EF takes nothing returns integer
local integer Eg=GetRandomInt(AN,Ao)
local integer EG=AO[Eg]
set EG=AO[Eg]
if(AN==Ao)then
set AO[Eg]=0
return EG
endif
if(Eg==Ao)then
set Ao=Ao-1
return EG
endif
set AO[Eg]=AO[Ao]
set Ao=Ao-1
return EG
endfunction
function Eh takes player EH,string Ei returns nothing
local sound EI=CreateSoundFromLabel("InterfaceError",false,false,false,10,10)
if(GetLocalPlayer()==EH)then
if(Ei!="") and (Ei!=null)then
call ClearTextMessages()
call DisplayTimedTextToPlayer(EH,.5,-1.,2.,"|cffffcc00"+Ei+"|r")
endif
call StartSound(EI)
endif
call KillSoundWhenDone(EI)
set EI=null
endfunction
function Ej takes string EJ,unit Ek,real EK,integer El,integer EL,integer Em,integer EM returns nothing
local texttag t=CreateTextTag()
call SetTextTagText(t,EJ,.02)
call SetTextTagPosUnit(t,Ek,.0)
call SetTextTagColor(t,El,EL,Em,EM)
call SetTextTagVelocity(t,0,.01)
call SetTextTagVisibility(t,true)
call SetTextTagFadepoint(t,2.)
call SetTextTagLifespan(t,EK)
call SetTextTagPermanent(t,false)
endfunction
function En takes unit EN returns nothing
call PauseUnit(EN,true)
call IssueImmediateOrderById(EN,851972)
call PauseUnit(EN,false)
endfunction
function Eo takes nothing returns boolean
if(GetTimeOfDay()>6. and GetTimeOfDay()<18.)then
return true
else
return false
endif
endfunction
function EO takes nothing returns nothing
set bj_rescueChangeColorUnit=bj_rescueChangeColorUnit or (GetEnumItem()!=bj_itemRandomCurrentPick)
endfunction
function EP takes nothing returns nothing
call FlushGameCache(InitGameCache("DotACache.x"))
set Ap=InitGameCache("DotACache.x")
endfunction
function Eq takes handle h returns integer
return h
return 0
endfunction
function EQ takes handle h returns string
return I2S(Eq(h))
endfunction
function Er takes string ER returns nothing
call FlushStoredMission(Ap,ER)
endfunction
function Es takes string ER,string ES,handle Et returns nothing
call StoreInteger(Ap,ER,ES,Eq(Et))
endfunction
function ET takes string ER,string ES,integer Eu returns nothing
call StoreInteger(Ap,ER,ES,Eu)
endfunction
function EU takes string ER,string ES,integer Eu returns nothing
call StoreInteger(Ap,ER,ES,Eu)
endfunction
function Ev takes string ER,string ES,real Eu returns nothing
call StoreReal(Ap,ER,ES,Eu)
endfunction
function EV takes string ER,string ES,boolean Eu returns nothing
call StoreBoolean(Ap,ER,ES,Eu)
endfunction
function Ew takes string ER,string ES returns unit
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function EW takes string ER,string ES returns player
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function Ex takes string ER,string ES returns timer
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function EX takes string ER,string ES returns trigger
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function Ey takes string ER,string ES returns group
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function EY takes string ER,string ES returns effect
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function Ez takes string ER,string ES returns location
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function EZ takes string ER,string ES returns triggeraction
return GetStoredInteger(Ap,ER,ES)
return null
endfunction
function E0 takes string ER,string ES returns integer
return GetStoredInteger(Ap,ER,ES)
endfunction
function E1 takes string ER,string ES returns integer
return GetStoredInteger(Ap,ER,ES)
endfunction
function E2 takes string ER,string ES returns real
return GetStoredReal(Ap,ER,ES)
endfunction
function E3 takes string ER,string ES returns boolean
return GetStoredBoolean(Ap,ER,ES)
endfunction
function E4 takes real x returns real
local real E5=GetRectMinX(bj_mapInitialPlayableArea)+50
if(x<E5)then
return E5
endif
set E5=GetRectMaxX(bj_mapInitialPlayableArea)-50
if(x>E5)then
return E5
endif
return x
endfunction
function E6 takes real y returns real
local real E5=GetRectMinY(bj_mapInitialPlayableArea)+50
if(y<E5)then
return E5
endif
set E5=GetRectMaxY(bj_mapInitialPlayableArea)-50
if(y>E5)then
return E5
endif
return y
endfunction
function E7 takes integer E8 returns nothing
local unit u=CreateUnit(Player(15),'e01W',0,0,270)
call UnitAddAbility(u,E8)
call UnitRemoveAbility(u,E8)
call RemoveUnit(u)
endfunction
function RemoveLastCreatedEffectIn1Second takes nothing returns nothing
local effect fx=bj_lastCreatedEffect
call PolledWait(1)
call DestroyEffect(fx)
endfunction
function E9 takes nothing returns nothing
call SetUnitOwner(DQ,Al[1],false)
call SetUnitOwner(DM,Al[2],false)
call SetUnitOwner(Dt,Al[3],false)
call SetUnitOwner(Dm,Al[4],false)
call SetUnitOwner(Dr,Al[5],false)
call SetUnitOwner(Ds,AL[1],false)
call SetUnitOwner(DS,AL[2],false)
call SetUnitOwner(D3,AL[3],false)
call SetUnitOwner(DT,AL[4],false)
call SetUnitOwner(Du,AL[5],false)
endfunction
function fa takes unit EN returns boolean
local integer ID=GetUnitTypeId(EN)
if ID=='n00V' or ID=='n00W' or ID=='n002' or ID=='n001' or ID=='n00X' or ID=='nC38' or ID=='n01K'then
return true
endif
return false
endfunction
function fA takes nothing returns nothing
if(GetOwningPlayer(GetEnumUnit())==Player(0))then
call SetUnitOwner(GetEnumUnit(),Al[0],false)
if fa(GetEnumUnit())==false then
call SetUnitColor(GetEnumUnit(),ConvertPlayerColor(0))
endif
else
call SetUnitOwner(GetEnumUnit(),AL[0],false)
if fa(GetEnumUnit())==false then
call SetUnitColor(GetEnumUnit(),ConvertPlayerColor(6))
endif
endif
endfunction
function fb takes nothing returns nothing
local group fB=CreateGroup()
call GroupEnumUnitsOfPlayer (fB,Player(0),null)
call ForGroup(fB,function fA)
call GroupClear(fB)
call GroupEnumUnitsOfPlayer (fB,Player(6),null)
call ForGroup(fB,function fA)
call DestroyGroup(fB)
endfunction
function fc takes nothing returns nothing
local integer x=0
local integer y=0
local trigger t
set Al[0]=Player(0)
set Al[1]=Player(1)
set Al[2]=Player(2)
set Al[3]=Player(3)
set Al[4]=Player(4)
set Al[5]=Player(5)
set AL[0]=Player(6)
set AL[1]=Player(7)
set AL[2]=Player(8)
set AL[3]=Player(9)
set AL[4]=Player(10)
set AL[5]=Player(11)
set Am=Player(12)
if GetPlayerState(Al[0],PLAYER_STATE_OBSERVER)!=0 or GetPlayerState(AL[0],PLAYER_STATE_OBSERVER)!=0 then
set Az=true
set Al[0]=Player(13)
set AL[0]=Player(14)
call SetAllyColorFilterState(0)
endif
call ForceAddPlayer(Ak,Al[0])
call ForceAddPlayer(Ak,Al[1])
call ForceAddPlayer(Ak,Al[2])
call ForceAddPlayer(Ak,Al[3])
call ForceAddPlayer(Ak,Al[4])
call ForceAddPlayer(Ak,Al[5])
call ForceAddPlayer(AK,AL[0])
call ForceAddPlayer(AK,AL[1])
call ForceAddPlayer(AK,AL[2])
call ForceAddPlayer(AK,AL[3])
call ForceAddPlayer(AK,AL[4])
call ForceAddPlayer(AK,AL[5])
loop
exitwhen x>5
loop
exitwhen y>5
if(x!=y)then
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(0),true)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(1),true)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(2),true)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(3),true)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(4),true)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(5),true)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(6),false)
call SetPlayerAlliance(Al[x],Al[y],ConvertAllianceType(7),false)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(0),true)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(1),true)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(2),true)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(3),true)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(4),true)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(5),true)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(6),false)
call SetPlayerAlliance(AL[x],AL[y],ConvertAllianceType(7),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(0),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(1),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(2),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(3),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(4),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(5),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(6),false)
call SetPlayerAlliance(Al[x],AL[y],ConvertAllianceType(7),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(0),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(1),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(2),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(3),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(4),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(5),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(6),false)
call SetPlayerAlliance(AL[x],Al[y],ConvertAllianceType(7),false)
endif
set y=y+1
endloop
set y=0
set x=x+1
endloop
call SetPlayerTeam(Al[0],0)
call SetPlayerTeam(Al[1],0)
call SetPlayerTeam(Al[2],0)
call SetPlayerTeam(Al[3],0)
call SetPlayerTeam(Al[4],0)
call SetPlayerTeam(Al[5],0)
call SetPlayerTeam(AL[0],1)
call SetPlayerTeam(AL[1],1)
call SetPlayerTeam(AL[2],1)
call SetPlayerTeam(AL[3],1)
call SetPlayerTeam(AL[4],1)
call SetPlayerTeam(AL[5],1)
call SetPlayerName(Al[0],"The Sentinel")
call SetPlayerName(AL[0],"The Scourge")
call E9()
if(Al[0]!=Player(0) or AL[0]!=Player(6))then
call fb()
endif
endfunction
function fC takes nothing returns nothing
local integer EA
local integer Eb
set I[GetPlayerId(Al[0])]="|c00ff0303"
set I[GetPlayerId(Al[1])]="|c000042ff"
set I[GetPlayerId(Al[2])]="|c001ce6b9"
set I[GetPlayerId(Al[3])]="|c00540081"
set I[GetPlayerId(Al[4])]="|c00fffc01"
set I[GetPlayerId(Al[5])]="|c00ff8000"
set I[GetPlayerId(AL[0])]="|c0020c000"
set I[GetPlayerId(AL[1])]="|c00e55bb0"
set I[GetPlayerId(AL[2])]="|c00959697"
set I[GetPlayerId(AL[3])]="|c007ebff1"
set I[GetPlayerId(AL[4])]="|c00106246"
set I[GetPlayerId(AL[5])]="|c004e2a04"
call SetPlayerColor(Al[0],PLAYER_COLOR_RED)
call SetPlayerColor(Al[1],PLAYER_COLOR_BLUE)
call SetPlayerColor(Al[2],PLAYER_COLOR_CYAN)
call SetPlayerColor(Al[3],PLAYER_COLOR_PURPLE)
call SetPlayerColor(Al[4],PLAYER_COLOR_YELLOW)
call SetPlayerColor(Al[5],PLAYER_COLOR_ORANGE)
call SetPlayerColor(AL[0],PLAYER_COLOR_GREEN)
call SetPlayerColor(AL[1],PLAYER_COLOR_PINK)
call SetPlayerColor(AL[2],PLAYER_COLOR_LIGHT_GRAY)
call SetPlayerColor(AL[3],PLAYER_COLOR_LIGHT_BLUE)
call SetPlayerColor(AL[4],PLAYER_COLOR_AQUA)
call SetPlayerColor(AL[5],PLAYER_COLOR_BROWN)
set EA=1
set Eb=5
loop
if(e2(Al[EA])==false)then
call SetPlayerName(Al[EA],"Player "+I2S(EA))
endif
if(e2(AL[EA])==false)then
call SetPlayerName(AL[EA],"Player "+I2S(5+EA))
endif
set EA=EA+1
exitwhen EA>Eb
endloop
endfunction
function fd takes nothing returns nothing
local integer fD
local integer fe
local integer EA
local integer Eb
call EP()
call fC()
set fe=e5(Ak)
set fD=e5(AK)
call StartTimerBJ(n,false,99999.)
set EA=1
set Eb=5
loop
exitwhen EA>Eb
if(e2(Al[EA]))then
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_GOLD,(3500/fe))
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_LUMBER,0)
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,5)
endif
if(e2(AL[EA]))then
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_GOLD,(3500/fD))
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_LUMBER,0)
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,5)
endif
set EA=EA+1
endloop
call SetTimeOfDay(6.)
call UseTimeOfDayBJ(true)
call SetTimeOfDayScalePercentBJ(50.)
call SetSkyModel("Environment\\Sky\\FoggedSky\\FoggedSky.mdl")
set V=1
set k[1]='Nbrn'
set k[2]='Npbm'
set k[3]='Edem'
set k[4]='Hlgr'
set k[5]='Harf'
set k[6]='N016'
set k[7]='Nbbc'
set k[8]='Naka'
set k[9]='H000'
set k[10]='Orkn'
set k[11]='Emoo'
set k[12]='Emns'
set k[13]='O00P'
set k[14]='Usyl'
set k[15]='H004'
set k[16]='E005'
set k[17]='N01O'
set k[18]='HC92'
set k[19]='Hjai'
set k[20]='Hvwd'
set k[21]='HC49'
set k[22]='Uktl'
set k[23]='H001'
set k[24]='Hmbr'
set k[25]='H00K'
set k[26]='Hamg'
set k[27]='Huth'
set k[28]='Ntin'
set k[29]='Hmkg'
set k[30]='Hblm'
set k[31]='H008'
set k[32]='Ucrl'
set k[33]='Ogrh'
set k[34]='Otch'
set k[35]='N01A'
set k[36]='H00A'
set k[37]='H00D'
set k[38]='E00P'
set W=38
set X=49
set k[49]='NC00'
set k[50]='Ulic'
set k[51]='U006'
set k[52]='Ekee'
set k[53]='Udre'
set k[54]='UC76'
set k[55]='EC57'
set k[56]='UC18'
set k[57]='UC11'
set k[58]='H00V'
set k[59]='Eevi'
set k[60]='UC60'
set k[61]='H00H'
set k[62]='Ofar'
set k[63]='Oshd'
set k[64]='U00F'
set k[65]='U00K'
set k[66]='U00E'
set k[67]='Ubal'
set k[68]='E004'
set k[69]='EC77'
set k[70]='Hvsh'
set k[71]='O00J'
set k[72]='Udea'
set k[73]='Nfir'
set k[74]='Opgh'
set k[75]='E002'
set k[76]='EC45'
set k[77]='U00A'
set k[78]='Ewar'
set k[79]='UC01'
set k[80]='U007'
set k[81]='UC91'
set k[82]='UC42'
set k[83]='U008'
set k[84]='U000'
set k[85]='E01B'
set k[86]='E01A'
set k[87]='U00P'
set Y=87
set AB[1]='Nbrn'
set AB[2]='Edem'
set AB[3]='N016'
set AB[4]='Nbbc'
set AB[5]='Naka'
set AB[6]='O00P'
set AB[7]='Usyl'
set AB[8]='E005'
set AB[9]='N01O'
set AB[10]='HC92'
set AB[11]='Hvwd'
set AB[12]='HC49'
set AB[13]='Huth'
set AB[14]='Ogrh'
set AB[15]='U006'
set AB[16]='EC57'
set AB[17]='Eevi'
set AB[18]='Ubal'
set AB[19]='E004'
set AB[20]='EC77'
set AB[21]='Hvsh'
set AB[22]='Nfir'
set AB[23]='E002'
set AB[24]='EC45'
set AB[25]='Ewar'
set AB[26]='U000'
set AB[27]='H00V'
set AB[28]='E01B'
set Ad=28
set AC[1]='Npbm'
set AC[2]='Hlgr'
set AC[3]='Harf'
set AC[4]='H000'
set AC[5]='H001'
set AC[6]='Hamg'
set AC[7]='H008'
set AC[8]='Ucrl'
set AC[9]='Otch'
set AC[10]='NC00'
set AC[11]='Udre'
set AC[12]='UC11'
set AC[13]='Ofar'
set AC[14]='U00F'
set AC[15]='U00K'
set AC[16]='O00J'
set AC[17]='Udea'
set AC[18]='Opgh'
set AC[19]='U00A'
set AC[20]='U007'
set AC[21]='UC91'
set AC[22]='UC42'
set AC[23]='U008'
set AC[24]='H00D'
set AD=24
set Ac[1]='Orkn'
set Ac[2]='Emoo'
set Ac[3]='Emns'
set Ac[4]='H004'
set Ac[5]='Hjai'
set Ac[6]='Uktl'
set Ac[7]='Hmbr'
set Ac[8]='H00K'
set Ac[9]='Ntin'
set Ac[10]='Hmkg'
set Ac[11]='Hblm'
set Ac[12]='N01A'
set Ac[13]='H00A'
set Ac[14]='Ulic'
set Ac[15]='Ekee'
set Ac[16]='UC76'
set Ac[17]='UC18'
set Ac[18]='UC01'
set Ac[19]='UC60'
set Ac[20]='H00H'
set Ac[21]='Oshd'
set Ac[22]='U00E'
set Ac[23]='E01A'
set Ac[24]='U00P'
set Ac[25]='E00P'
set Ae=25
call EE()
endfunction
function fE takes integer ff,integer fF,integer fg,integer fG,integer fh returns nothing
set ax[a0]=ff
set aX[a0]=fF
set ay[a0]=fg
set aY[a0]=fG
set aZ[a0]=fh
set a1[a0]=4
if(ff==0)then
set a1[a0]=a1[a0]-1
endif
if(fF==0)then
set a1[a0]=a1[a0]-1
endif
if(fg==0)then
set a1[a0]=a1[a0]-1
endif
if(fG==0)then
set a1[a0]=a1[a0]-1
endif
set a0=a0+1
set az=a0
endfunction
function fH takes nothing returns nothing
set a0=1
call fE('rots','rump','mcri',0,'bfhr')
call fE('stwa','tbar','rsps',0,'tfar')
call fE('shdt','tbar','srrc',0,'sor9')
call fE('rej4','sor1','ram3','vddl','olig')
call fE('rump','oli2','rwiz',0,'kgal')
call fE('srbd','whwd','fgrg',0,'rde4')
call fE('bgst','sksh','spsh',0,'ram1')
call fE('belv','tmmt','sand',0,'rde0')
call fE('ram1','rde0','wcyc',0,'rnsp')
call fE('whwd','srtl','penr',0,'rugt')
call fE('srtl','lure','rreb',0,'ofir')
call fE('flag','stwa','rre1',0,'ocor')
call fE('soul','rej2','lhst',0,'spre')
call fE('rst1','tgxp','stre',0,'hlst')
call fE('tbar','lgdh','sbok',0,'gsou')
call fE('whwd','ciri','shhn',0,'soul')
call fE('srtl','shrs','sora',0,'pspd')
call fE('iwbr','tbsm','mcou',0,'sfog')
call fE('rdis','tmmt','ciri',0,'wswd')
call fE('modt','shhn',0,0,'grsl')
call fE('tmmt','sora','rlif',0,'ccmd')
call fE('scul','jdrn',0,0,'rots')
call fE('ratf','flag','sora',0,'gldo')
call fE('rhe2','sor2','tmsc',0,'lure')
call fE('shcw','rej6',0,0,'ratf')
call fE('shcw','shtm','ciri',0,'rej2')
call fE('jdrn','prvt',0,0,'horl')
call fE('pgin','hbth','oli2',0,'oslo')
call fE('soul','ratf','clfm',0,'oven')
call fE('sor2','sksh','texp',0,'ofro')
call fE('shrs','crys',0,0,'ram4')
call fE('shtm','tmsc','rma2',0,'rej5')
call fE('rej5','rma2',0,0,'lnrn')
call fE('lnrn','rma2',0,0,'mlst')
call fE('mlst','rma2',0,0,'mnsf')
call fE('mnsf','rma2',0,0,'rej1')
call fE('tgxp','rspl',0,0,'tlum')
call fE('iwbr','tkno','stel',0,'klmm')
call fE('tbsm','tmsc','tdex',0,'rat6')
call fE('pgma','stre',0,0,'pdiv')
call fE('pclr','ratf','gvsm',0,'kybl')
call fE('infs','klmm','sfog',0,'mnst')
call fE('belv','flag','pinv',0,'rnec')
call fE('wswd','rde2','oli2',0,'schl')
call fE('bgst','shtm','bspd',0,'ches')
call fE('ches','bspd',0,0,'I002')
call fE('I002','bspd',0,0,'I001')
endfunction
function fi takes nothing returns nothing
local integer EA
local integer Eb
call SetPlayerHandicapXP(Al[1],1)
call SetPlayerHandicapXP(Al[2],1)
call SetPlayerHandicapXP(Al[3],1)
call SetPlayerHandicapXP(Al[4],1)
call SetPlayerHandicapXP(Al[5],1)
call SetPlayerHandicapXP(AL[1],1)
call SetPlayerHandicapXP(AL[2],1)
call SetPlayerHandicapXP(AL[3],1)
call SetPlayerHandicapXP(AL[4],1)
call SetPlayerHandicapXP(AL[5],1)
call SetPlayerState(Al[0],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(Al[1],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(Al[2],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(Al[3],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(Al[4],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(Al[5],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(AL[0],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(AL[1],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(AL[2],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(AL[3],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(AL[4],PLAYER_STATE_GIVES_BOUNTY,1)
call SetPlayerState(AL[5],PLAYER_STATE_GIVES_BOUNTY,1)
call SetUnitInvulnerable(D2,true)
call SetUnitInvulnerable(D5,true)
call SetUnitInvulnerable(D0,true)
call SetUnitInvulnerable(DN,true)
call SetUnitInvulnerable(DZ,true)
call SetUnitInvulnerable(D1,true)
call SetUnitInvulnerable(DY,true)
call SetUnitInvulnerable(Dz,true)
call SetUnitInvulnerable(Dy,true)
call SetUnitInvulnerable(eb,true)
call SetUnitInvulnerable(Dw,true)
call SetUnitInvulnerable(ek,true)
call SetUnitInvulnerable(eB,true)
call SetUnitInvulnerable(ea,true)
call SetUnitInvulnerable(D9,true)
call SetUnitInvulnerable(ei,true)
call SetUnitInvulnerable(eH,true)
call SetUnitInvulnerable(eI,true)
call SetUnitInvulnerable(eg,true)
call SetUnitInvulnerable(eF,true)
call SetUnitInvulnerable(eG,true)
call SetUnitInvulnerable(eE,true)
call SetUnitInvulnerable(ef,true)
call SetUnitInvulnerable(eh,true)
call SetUnitInvulnerable(ed,true)
call SetUnitInvulnerable(ee,true)
call SetUnitInvulnerable(eC,true)
call SetUnitInvulnerable(eD,true)
call SetUnitInvulnerable(DO,true)
call SetUnitInvulnerable(Dp,true)
call SetUnitInvulnerable(DP,true)
call SetUnitInvulnerable(ew,true)
call SetUnitInvulnerable(ej,true)
call SetUnitInvulnerable(eJ,true)
call SetUnitInvulnerable(eO,true)
call SetUnitInvulnerable(eo,true)
call SetUnitInvulnerable(eN,true)
call SetUnitInvulnerable(eL,true)
call SetUnitInvulnerable(el,true)
call SetUnitInvulnerable(eK,true)
call SetUnitInvulnerable(em,true)
call SetUnitInvulnerable(eM,true)
call SetUnitInvulnerable(en,true)
call SetUnitInvulnerable(ev,true)
call SetUnitInvulnerable(eu,true)
call SetUnitInvulnerable(eU,true)
call SetUnitInvulnerable(eR,true)
call SetUnitInvulnerable(er,true)
call SetUnitInvulnerable(ep,true)
call SetUnitInvulnerable(eP,true)
call SetUnitInvulnerable(eq,true)
call SetUnitInvulnerable(eT,true)
call SetUnitInvulnerable(es,true)
call SetUnitInvulnerable(eS,true)
call SetUnitInvulnerable(et,true)
call SetUnitInvulnerable(Dx,true)
call SetUnitInvulnerable(eQ,true)
call SetUnitPathing(ey,false)
call SetUnitPathing(eX,false)
call SetUnitPathing(ex,false)
call SetUnitPathing(eW,false)
call SetUnitPathing(eY,false)
call SetUnitInvulnerable(eY,true)
call SetUnitInvulnerable(eW,true)
call SetUnitInvulnerable(ex,true)
call SetUnitInvulnerable(eX,true)
call SetUnitInvulnerable(ey,true)
call UnitAddAbility(eX,'ANab')
call UnitAddAbility(ex,'ANab')
call UnitAddAbility(eW,'ANab')
call UnitAddAbility(ey,'ANab')
call UnitAddAbility(eY,'ANab')
set aG=GetUnitLoc(eY)
set ah=GetUnitLoc(ey)
set aH=GetUnitLoc(ex)
set ai=GetUnitLoc(eW)
set aI=GetUnitLoc(eX)
set Aw='A06G'
set AW[1]=ah
set AW[2]=ai
set AW[3]=aH
set AW[4]=aI
set AW[5]=aG
set aq=GetRectCenter(A0)
set aQ=GetRectCenter(A1)
set ar=GetRectCenter(AZ)
set aR=GetRectCenter(A7)
set aS=GetRectCenter(A8)
set as=GetRectCenter(A6)
set at=GetRectCenter(bb)
set au=GetRectCenter(bA)
set aT=GetRectCenter(ba)
set aU=GetRectCenter(A5)
set aV=GetRectCenter(A4)
set av=GetRectCenter(A3)
set aw=GetRectCenter(bd)
set aW=GetRectCenter(bB)
call fH()
if Az then
call e8('HC92')
endif
set AQ=Al[1]
call ExecuteFunc("fI")
call ExecuteFunc("fj")
call ExecuteFunc("fJ")
call ExecuteFunc("fk")
call ExecuteFunc("fK")
call ExecuteFunc("fl")
call ExecuteFunc("fL")
call ExecuteFunc("fm")
call ExecuteFunc("fM")
call ExecuteFunc("fn")
call ExecuteFunc("fN")
call ExecuteFunc("fo")
call ExecuteFunc("fO")
endfunction
function fp takes nothing returns nothing
set a4=CreateQuestBJ(0,"TDA Rules v1.11","TRIGSTR_3685","ReplaceableTextures\\CommandButtons\\BTNBansheeMaster.blp")
set a5=CreateQuestBJ(0,"League Rules","TRIGSTR_3690","ReplaceableTextures\\CommandButtons\\BTNBansheeMaster.blp")
call QuestSetEnabled(a5,false)
call CreateQuestBJ(2,"Contacts","Website: [url]www.dota-allstars.com\nDownload[/url] Site: [url]www.getdota.com\n\nIf[/url] you find any bugs or have suggestions drop me an email at [email][email protected]","ReplaceableTextures\\CommandButtons\\BTNSpy.blp[/email]")
call CreateQuestBJ(2,"Credits","First and foremost, thanks to the community for supporting the map for so long. We wouldn't be here without you.\n\nSome people that have helped me in one form or another include, but not limited to: KI-Hunterkiller, Arthur5863, Neichus, Zetta, Plastic.Angel, TheRandomDude, Naz, RodOfNod, Mercurial, Trystero, Cottontop, Switch, Terrorblaze, eva00r, TheMantis, Ska_Goblin and SetzerGabbiani. Many others have contributed in some form or another, thank you.\n\nI have written all the content in this map from scratch. Though the map has grown alot since, many of the original ideas are to be credited to Eul for the first DotA on ROC and then Meian/Guinsoo on TFT. The very original game concept credit goes to the makers of AoS on Starcraft. \n\n\nThanks to Vexorian for Wc3 Map Optimizer\nThanks to PitzerMike for The Widgetizer\nEdwardSwolenToe for the Aphotic Shield Model\nSome icons from wc3sear.ch (see changelogs)","ReplaceableTextures\\CommandButtons\\BTNAmbush.blp")
call CreateQuestBJ(2,"Useful Information","Game Modes:\n-ap, -ar, -lm, -mm, -tr, -dm, -mr, -sp, -aa, -ai, -as, -id, -sm, -np, -sc\n\nGame Commands:\n-ma, -ms, -cs, -csboardon, -csboardoff, -disablehelp, -enablehelp, -unstuck, -recreate, -swaphero\n\nUseful links:\nwww.dota-allstars.com/orbs\nwww.dota-allstars.com/bugs\nwww.dota-allstars.com/banlist","ReplaceableTextures\\CommandButtons\\BTNNecromancerAdept.blp")
endfunction
function fP takes nothing returns nothing
local integer fe=e5(Ak)
local integer fD=e5(AK)
local integer EA
local integer Eb
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,I[GetPlayerId(GetTriggerPlayer())]+GetPlayerName(GetTriggerPlayer())+"|r"+"|c00ff0303 has left the game.|r")
if(eZ(GetTriggerPlayer()))then
set EA=1
set Eb=5
loop
exitwhen EA>Eb
if(Al[EA]!=GetTriggerPlayer())then
if(e2(Al[EA]))then
call SetPlayerAllianceStateBJ(GetTriggerPlayer(),Al[EA],4)
call SetPlayerState(Al[EA],PLAYER_STATE_GOLD_GATHERED,GetPlayerState(Al[EA],PLAYER_STATE_RESOURCE_GOLD)+(GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)/fe))
call SetPlayerTaxRateBJ(('d'/fe),PLAYER_STATE_RESOURCE_GOLD,GetTriggerPlayer(),Al[EA])
endif
endif
set EA=EA+1
endloop
else
set EA=1
set Eb=5
loop
exitwhen EA>Eb
if(AL[EA]!=GetTriggerPlayer())then
if(e2(AL[EA]))then
call SetPlayerAllianceStateBJ(GetTriggerPlayer(),AL[EA],4)
call SetPlayerState(AL[EA],PLAYER_STATE_GOLD_GATHERED,GetPlayerState(AL[EA],PLAYER_STATE_RESOURCE_GOLD)+(GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)/fe))
call SetPlayerTaxRateBJ(('d'/fe),PLAYER_STATE_RESOURCE_GOLD,GetTriggerPlayer(),AL[EA])
endif
endif
set EA=EA+1
endloop
endif
call SetPlayerStateBJ(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD,0)
endfunction
function fq takes nothing returns boolean
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false)then
return false
endif
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_SUMMONED))then
return false
endif
if(IsUnitIllusion(GetTriggerUnit()))then
return false
endif
if(GetTriggerEventId()!=EVENT_PLAYER_HERO_REVIVE_FINISH)then
if(ag[GetUnitPointValue(GetTriggerUnit())])then
return false
endif
else
call SetUnitInvulnerable(GetTriggerUnit(),false)
call UnitRemoveAbility(GetTriggerUnit(),'A0EV')
call UnitRemoveAbility(GetTriggerUnit(),'A0E9')
call UnitRemoveAbility(GetTriggerUnit(),'SCva')
call UnitRemoveAbility(GetTriggerUnit(),'A0AZ')
call UnitRemoveAbility(GetTriggerUnit(),'A09J')
endif
return true
endfunction
function fQ takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location fr
local location fR
if(eZ(GetOwningPlayer(EN)))then
set fr=GetRectCenter(A9)
set fR=GetRandomLocInRect(A9)
else
set fr=GetRectCenter(A2)
set fR=GetRandomLocInRect(A2)
endif
set ag[GetUnitPointValue(EN)]=true
call PanCameraToTimedLocForPlayer(GetOwningPlayer(EN),fr,0)
call ClearSelectionForPlayer(GetOwningPlayer(EN))
call SelectUnitAddForPlayer(EN,GetOwningPlayer(EN))
set A[GetPlayerId(GetOwningPlayer(EN))]=0
set a2[GetPlayerId(GetOwningPlayer(EN))]=EN
set B[GetUnitPointValue(EN)]=true
set Aj[GetPlayerId(GetOwningPlayer(EN))]=Aj[GetPlayerId(GetOwningPlayer(EN))]+1
if(R)then
if(eZ(GetOwningPlayer(EN)))then
set Ab[0]=Ab[0]+1
else
set Ab[1]=Ab[1]+1
endif
if((Aj[GetPlayerId(GetOwningPlayer(EN))]>1) and (EN!=AI[GetPlayerId(GetOwningPlayer(EN))]))then
call SetHeroXP(EN,GetHeroXP(AI[GetPlayerId(GetOwningPlayer(EN))]),false)
call UnitAddItem(EN,UnitItemInSlotBJ(AI[GetPlayerId(GetOwningPlayer(EN))],1))
call UnitAddItem(EN,UnitItemInSlotBJ(AI[GetPlayerId(GetOwningPlayer(EN))],2))
call UnitAddItem(EN,UnitItemInSlotBJ(AI[GetPlayerId(GetOwningPlayer(EN))],3))
call UnitAddItem(EN,UnitItemInSlotBJ(AI[GetPlayerId(GetOwningPlayer(EN))],4))
call UnitAddItem(EN,UnitItemInSlotBJ(AI[GetPlayerId(GetOwningPlayer(EN))],5))
call UnitAddItem(EN,UnitItemInSlotBJ(AI[GetPlayerId(GetOwningPlayer(EN))],6))
call RemoveUnit(AI[GetPlayerId(GetOwningPlayer(EN))])
endif
endif
if(GetTriggerEventId()==EVENT_PLAYER_HERO_REVIVE_FINISH)then
call SetUnitPositionLoc(EN,fr)
else
call SetUnitPositionLoc(EN,fR)
endif
call RemoveLocation(fr)
call RemoveLocation(fR)
endfunction
function fs takes unit fS returns nothing
local integer ft=GetUnitPointValue(fS)
local unit fT
if(ft==3)then
call ExecuteFunc("fU")
elseif(ft==37)then
call ExecuteFunc("fv")
call ExecuteFunc("fV")
call ExecuteFunc("fw")
call ExecuteFunc("fW")
elseif(ft==38)then
call ExecuteFunc("fX")
call ExecuteFunc("fy")
call ExecuteFunc("fY")
call ExecuteFunc("fz")
elseif(ft==8)then
call ExecuteFunc("fZ")
call ExecuteFunc("f0")
elseif(ft==31)then
call ExecuteFunc("f1")
call ExecuteFunc("f2")
call ExecuteFunc("f3")
call ExecuteFunc("f4")
elseif(ft==9)then
call ExecuteFunc("f5")
call ExecuteFunc("f6")
elseif(ft==36)then
call ExecuteFunc("f7")
call ExecuteFunc("f8")
call ExecuteFunc("f9")
call ExecuteFunc("Fa")
elseif(ft==19)then
call ExecuteFunc("FA")
elseif(ft==34)then
call ExecuteFunc("Fb")
call ExecuteFunc("FB")
call ExecuteFunc("Fc")
call ExecuteFunc("FC")
call ExecuteFunc("Fd")
elseif(ft==11)then
call ExecuteFunc("FD")
call ExecuteFunc("Fe")
call ExecuteFunc("FE")
call ExecuteFunc("Ff")
elseif(ft==22)then
call ExecuteFunc("FF")
call ExecuteFunc("Fg")
call ExecuteFunc("FG")
call ExecuteFunc("Fh")
elseif(ft==12)then
call ExecuteFunc("FH")
elseif(ft==7)then
call ExecuteFunc("Fi")
call ExecuteFunc("FI")
elseif(ft==30)then
call ExecuteFunc("Fj")
call ExecuteFunc("FJ")
call ExecuteFunc("Fk")
call ExecuteFunc("FK")
elseif(ft==16)then
call ExecuteFunc("Fl")
call ExecuteFunc("FL")
elseif(ft==13)then
call ExecuteFunc("Fm")
call ExecuteFunc("FM")
call ExecuteFunc("Fn")
call ExecuteFunc("FN")
call ExecuteFunc("Fo")
call ExecuteFunc("FO")
call PolledWait(1)
call SetUnitPathing(fS,false)
set fT=CreateUnit(GetOwningPlayer(fS),GetUnitTypeId(fS),GetUnitX(fS),GetUnitY(fS),GetUnitFacing(fS))
set a2[GetPlayerId(GetOwningPlayer(fS))]=fT
call RemoveUnit(fS)
call ClearSelectionForPlayer(GetOwningPlayer(fT))
call SelectUnitAddForPlayer(fT,GetOwningPlayer(fT))
elseif(ft==21)then
call ExecuteFunc("Fp")
elseif(ft==29)then
call ExecuteFunc("FP")
call ExecuteFunc("Fq")
call ExecuteFunc("FQ")
elseif(ft==5)then
call ExecuteFunc("Fr")
elseif(ft==33)then
call ExecuteFunc("FR")
call ExecuteFunc("Fs")
call ExecuteFunc("FS")
call ExecuteFunc("DW")
elseif(ft==26)then
call ExecuteFunc("Ft")
call ExecuteFunc("FT")
elseif(ft==35)then
call ExecuteFunc("Fu")
call ExecuteFunc("FU")
call ExecuteFunc("Fv")
call ExecuteFunc("GS")
call ExecuteFunc("FV")
elseif(ft==14)then
call ExecuteFunc("SS")
call ExecuteFunc("Fw")
call ExecuteFunc("FW")
elseif(ft==18)then
call ExecuteFunc("II")
call ExecuteFunc("Fx")
call ExecuteFunc("FX")
elseif(ft==17)then
call ExecuteFunc("Fy")
call ExecuteFunc("FY")
call ExecuteFunc("Fz")
call ExecuteFunc("FZ")
call ExecuteFunc("F0")
call ExecuteFunc("F1")
call ExecuteFunc("F2")
elseif(ft==25)then
call ExecuteFunc("F3")
call ExecuteFunc("F4")
call ExecuteFunc("F5")
elseif(ft==28)then
call ExecuteFunc("F6")
call ExecuteFunc("F7")
call ExecuteFunc("F8")
elseif(ft==32)then
call ExecuteFunc("F9")
call ExecuteFunc("ga")
call ExecuteFunc("gA")
call ExecuteFunc("gb")
elseif(ft==27)then
call ExecuteFunc("gB")
call ExecuteFunc("gc")
call ExecuteFunc("gC")
elseif(ft==20)then
call ExecuteFunc("gd")
elseif(ft==24)then
call ExecuteFunc("gD")
call ExecuteFunc("ge")
call ExecuteFunc("gE")
elseif(ft==6)then
call ExecuteFunc("gf")
call ExecuteFunc("gF")
elseif(ft==74)then
call ExecuteFunc("gg")
call ExecuteFunc("gG")
call ExecuteFunc("gh")
call ExecuteFunc("gH")
elseif(ft==63)then
call ExecuteFunc("gi")
call ExecuteFunc("gI")
elseif(ft==70)then
call ExecuteFunc("gj")
call ExecuteFunc("gJ")
call ExecuteFunc("gk")
elseif(ft==51)then
call ExecuteFunc("gK")
call ExecuteFunc("gl")
elseif(ft==77)then
call ExecuteFunc("gL")
elseif(ft==76)then
call ExecuteFunc("gm")
call ExecuteFunc("gM")
call ExecuteFunc("gn")
elseif(ft==52)then
call ExecuteFunc("gN")
elseif(ft==50)then
call ExecuteFunc("CF")
elseif(ft==82)then
call ExecuteFunc("go")
call ExecuteFunc("gO")
call ExecuteFunc("gp")
elseif(ft==57)then
call ExecuteFunc("RP")
elseif(ft==58)then
call ExecuteFunc("gP")
elseif(ft==66)then
call ExecuteFunc("gq")
call ExecuteFunc("gQ")
call ExecuteFunc("gr")
elseif(ft==73)then
call ExecuteFunc("gR")
call ExecuteFunc("gs")
call ExecuteFunc("gS")
call ExecuteFunc("gt")
call ExecuteFunc("NL")
elseif(ft==53)then
call ExecuteFunc("gT")
call ExecuteFunc("gu")
elseif(ft==78)then
call ExecuteFunc("gU")
elseif(ft==64)then
call ExecuteFunc("gv")
call ExecuteFunc("gV")
call ExecuteFunc("gw")
elseif(ft==61)then
call ExecuteFunc("NW")
elseif(ft==65)then
call ExecuteFunc("gW")
call ExecuteFunc("gx")
call ExecuteFunc("gX")
call ExecuteFunc("gy")
elseif(ft==81)then
call ExecuteFunc("gY")
elseif(ft==71)then
call ExecuteFunc("gz")
call ExecuteFunc("gZ")
call ExecuteFunc("g0")
call ExecuteFunc("g3")
elseif(ft==59)then
call ExecuteFunc("g4")
call ExecuteFunc("g5")
elseif(ft==62)then
call ExecuteFunc("g6")
call ExecuteFunc("g7")
call ExecuteFunc("g8")
elseif(ft==55)then
call ExecuteFunc("g9")
elseif(ft==69)then
call ExecuteFunc("Ga")
elseif(ft==60)then
call ExecuteFunc("GA")
call ExecuteFunc("Gb")
call ExecuteFunc("GB")
call ExecuteFunc("Gc")
elseif(ft==67)then
call ExecuteFunc("GC")
call ExecuteFunc("Gd")
call ExecuteFunc("GD")
elseif(ft==68)then
call ExecuteFunc("Ge")
elseif(ft==72)then
call ExecuteFunc("GE")
call ExecuteFunc("Gf")
call ExecuteFunc("GF")
elseif(ft==85)then
set Ag=fS
call ExecuteFunc("Gg")
call ExecuteFunc("HL")
call ExecuteFunc("HS")
call ExecuteFunc("GG")
call ExecuteFunc("Gh")
call ExecuteFunc("TV")
call ExecuteFunc("VL")
call ExecuteFunc("GH")
elseif(ft==86)then
call ExecuteFunc("Gi")
call ExecuteFunc("GI")
call ExecuteFunc("VR")
elseif(ft==87)then
call ExecuteFunc("Gj")
call ExecuteFunc("GJ")
call ExecuteFunc("Gk")
call ExecuteFunc("GK")
endif
endfunction
function Gl takes nothing returns boolean
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false)then
return false
endif
if(AA[GetUnitPointValue(GetTriggerUnit())])then
return false
endif
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_SUMMONED))then
return false
endif
if(IsUnitIllusion(GetTriggerUnit()))then
return false
endif
return true
endfunction
function GL takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer EA
local integer Eb
set AA[GetUnitPointValue(EN)]=true
set a2[GetPlayerId(GetOwningPlayer(EN))]=EN
set B[GetUnitPointValue(EN)]=true
call e8(GetUnitTypeId(EN))
call SetPlayerStateBJ(GetOwningPlayer(EN),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
set EA=V
set Eb=W
loop
exitwhen EA>Eb
call SetPlayerTechMaxAllowed(GetOwningPlayer(EN),k[EA],0)
set EA=EA+1
endloop
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
call SetPlayerTechMaxAllowed(GetOwningPlayer(EN),k[EA],0)
set EA=EA+1
endloop
call fs (EN)
if(j[GetPlayerId(GetOwningPlayer(EN))])then
call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(EN)),10.,("An enemy has repicked into "+(GetUnitName(EN)+".")))
elseif(ad[GetPlayerId(GetOwningPlayer(EN))])then
call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(EN)),10.,("An enemy has randomed "+(GetUnitName(EN)+".")))
else
call DisplayTimedTextToForce(GetPlayersEnemies(GetOwningPlayer(EN)),10.,("An enemy has chosen "+(GetUnitName(EN)+".")))
endif
if(GetUnitTypeId(EN)=='E005')then
call DisplayTimedTextToPlayer(GetOwningPlayer(EN),0,0,60.," ")
call DisplayTimedTextToPlayer(GetOwningPlayer(EN),0,0,60.,"|c00ff0303"+"Do not purchase attack-modifying items (Sange, Stygian Desolator, etc) as they will cause Luna's attack to completely malfunction."+"|r")
endif
if(GetUnitTypeId(EN)=='E01B')then
call DisplayTimedTextToPlayer(GetOwningPlayer(EN),0,0,30.," ")
call DisplayTimedTextToPlayer(GetOwningPlayer(EN),0,0,30.,"|c00ff0303"+"Droppable Items do not drop while phased. Activated items on death (like aegis) will not trigger while phased on unpathable terrain."+"|r")
endif
if(ad[GetPlayerId(GetOwningPlayer(EN))]==false)then
if(T==false and s==false and S==false and a3==false and R==false and AE==false)then
call SetPlayerStateBJ(GetOwningPlayer(EN),PLAYER_STATE_RESOURCE_GOLD,175+GetPlayerState(GetOwningPlayer(EN),PLAYER_STATE_RESOURCE_GOLD))
endif
endif
endfunction
function Gm takes nothing returns nothing
call AdjustPlayerStateBJ(8,Al[1],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,Al[2],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,Al[3],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,Al[4],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,Al[5],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,AL[1],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,AL[2],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,AL[3],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,AL[4],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(8,AL[5],PLAYER_STATE_RESOURCE_GOLD)
endfunction
function GM takes nothing returns boolean
if(GetUnitTypeId(GetFilterUnit())=='o003')then
call KillUnit(GetFilterUnit())
return true
endif
return false
endfunction
function Gn takes nothing returns nothing
local group fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function GM))
call DestroyGroup(fB)
endfunction
function GN takes unit fS returns nothing
local string Go=EQ(GetOwningPlayer(fS))
local unit GO=Ew(Go,"BearItemHolder")
local location Gp
if(eZ(GetOwningPlayer(fS)))then
set Gp=GetRectCenter(A9)
else
set Gp=GetRectCenter(A2)
endif
if GO!=null then
call SetItemPositionLoc(UnitRemoveItemFromSlot(GO,0),Gp)
call SetItemPositionLoc(UnitRemoveItemFromSlot(GO,1),Gp)
call SetItemPositionLoc(UnitRemoveItemFromSlot(GO,2),Gp)
call SetItemPositionLoc(UnitRemoveItemFromSlot(GO,3),Gp)
call SetItemPositionLoc(UnitRemoveItemFromSlot(GO,4),Gp)
call SetItemPositionLoc(UnitRemoveItemFromSlot(GO,5),Gp)
endif
endfunction
function Gq takes nothing returns boolean
if(not (IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)))then
return false
endif
return true
endfunction
function GQ takes nothing returns nothing
local boolean Gr=false
local unit GR=GetDyingUnit()
local unit Gs=GetKillingUnit()
local player Gt=GetOwningPlayer(Gs)
local player GT=GetOwningPlayer(GR)
local location Gp
if(Gt==null)then
set Gt=GT
endif
if(U)then
call UnitRemoveItemFromSlotSwapped(GetRandomInt(1,6),GR)
endif
if(eZ(GT))then
if(eZ(Gt))then
set Gr=true
if(Gt==GT)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r Has killed himself!"))
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r Has been killed by his teammate"))
endif
elseif(e1(Gt))then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(Gt)]+GetPlayerName(Gt)+"|r just pawned "+I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r's head for an extra "+I2S(('d'+(GetHeroLevel(GR)*5)))+" gold!"))
call AdjustPlayerStateBJ(('d'+(GetHeroLevel(GR)*5)),Gt,PLAYER_STATE_RESOURCE_GOLD)
set M[GetPlayerId(Al[0])]=(M[GetPlayerId(Al[0])]+1)
set K[GetPlayerId(AL[0])]=(K[GetPlayerId(AL[0])]+1)
set E[2]=(E[2]+1)
set E[1]=0
if(not (Gt==AL[0]))then
set K[GetPlayerId(Gt)]=(K[GetPlayerId(Gt)]+1)
set C[GetPlayerId(Gt)]=(C[GetPlayerId(Gt)]+1)
endif
endif
endif
if(e1(GT))then
if(e1(Gt))then
set Gr=true
if(Gt==GT)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r Has killed himself!"))
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r Has been killed by his teammate"))
endif
elseif(eZ(Gt))then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(Gt)]+GetPlayerName(Gt)+"|r just pawned "+I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r's head for an extra "+I2S(('d'+(GetHeroLevel(GR)*5)))+" gold!"))
call AdjustPlayerStateBJ(('d'+(GetHeroLevel(GR)*5)),Gt,PLAYER_STATE_RESOURCE_GOLD)
set M[GetPlayerId(AL[0])]=(M[GetPlayerId(AL[0])]+1)
set K[GetPlayerId(Al[0])]=(K[GetPlayerId(Al[0])]+1)
set E[1]=(E[1]+1)
set E[2]=0
if(not (Gt==Al[0]))then
set K[GetPlayerId(Gt)]=(K[GetPlayerId(Gt)]+1)
set C[GetPlayerId(Gt)]=(C[GetPlayerId(Gt)]+1)
endif
endif
endif
if(Gt==Am)then
if(GetUnitTypeId(Gs)=='n00L')then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r Has been killed by Roshan"))
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GT)]+GetPlayerName(GT)+"|r Has been killed by Neutral Creeps"))
endif
set Gr=true
endif
if(C[GetPlayerId(GT)]>2)then
if(Gr==false)then
if(C[GetPlayerId(GT)]==3)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c0000ff40killing spree|r has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+50 gold)"))))
call AdjustPlayerStateBJ(50,Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]==4)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00400080dominating|r streak has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+100 gold)"))))
call AdjustPlayerStateBJ('d',Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]==5)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00ff0080mega kill|r has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+150 gold)"))))
call AdjustPlayerStateBJ(150,Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]==6)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00ff8000unstoppable|r streak has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+200 gold)"))))
call AdjustPlayerStateBJ(200,Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]==7)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00808000wicked sick|r streak has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+250 gold)"))))
call AdjustPlayerStateBJ(250,Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]==8)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00ff80ffmonster kill|r streak has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+200 gold)"))))
call AdjustPlayerStateBJ(250,Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]==9)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00ff0000GODLIKE|r streak has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+350 gold)"))))
call AdjustPlayerStateBJ(350,Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
if(C[GetPlayerId(GT)]>9)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(GT)]+GetPlayerName(GT))+("|r's |c00ff8000beyond GODLIKE streak|r has been ended by "+((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"! (+400 gold)"))))
call AdjustPlayerStateBJ((C[GetPlayerId(GT)]*50),Gt,PLAYER_STATE_RESOURCE_GOLD)
endif
endif
endif
if(Gr==false)then
if(C[GetPlayerId(Gt)]>2)then
if(C[GetPlayerId(Gt)]==3)then
call PlaySoundBJ(b1)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r is on a |c0000ff40killing spree|r!"))
endif
if(C[GetPlayerId(Gt)]==4)then
call PlaySoundBJ(by)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r is |c00400080dominating!|r"))
endif
if(C[GetPlayerId(Gt)]==5)then
call PlaySoundBJ(b2)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r has a |c00ff0080mega kill|r!!"))
endif
if(C[GetPlayerId(Gt)]==6)then
call PlaySoundBJ(b5)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r is |c00ff8000unstoppable|r!!"))
endif
if(C[GetPlayerId(Gt)]==7)then
call PlaySoundBJ(b6)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r is |c00808000Wicked Sick|r!!"))
endif
if(C[GetPlayerId(Gt)]==8)then
call PlaySoundBJ(b7)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r has a |c00ff80ffmonster kill|r!"))
endif
if(C[GetPlayerId(Gt)]==9)then
call PlaySoundBJ(bZ)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r |c00ff0000is GODLIKE!!!|r"))
endif
if(C[GetPlayerId(Gt)]>9)then
call PlaySoundBJ(b0)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r is |c00ff8000beyond GODLIKE|r!!  Someone KILL HIM!"))
endif
endif
if(E[1]>4)then
call PolledWait(1.5)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,I[GetPlayerId(Al[0])]+"The Sentinel|r are "+I[GetPlayerId(Al[0])]+"OWNING!!!|r")
call PlaySoundBJ(b3)
endif
if(E[2]>4)then
call PolledWait(1.5)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,I[GetPlayerId(AL[0])]+"The Scourge|r are "+I[GetPlayerId(AL[0])]+"OWNING!!!|r")
call PlaySoundBJ(b3)
endif
endif
call StartTimerBJ(J[GetPlayerId(Gt)],false,11.5)
if(Gr==false)then
if(not (Gt==Al[0]))then
if(not (Gt==AL[0]))then
if(not (Gt==Am))then
call PolledWait(1.5)
set D[GetPlayerId(Gt)]=(D[GetPlayerId(Gt)]+1)
if(D[GetPlayerId(Gt)]==2)then
call PlaySoundBJ(bY)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r just got a |c000000ffDouble Kill|r!"))
endif
if(D[GetPlayerId(Gt)]>2)then
call PlaySoundBJ(b4)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,((I[GetPlayerId(Gt)]+GetPlayerName(Gt))+"|r just got a |c0000ff40Triple Kill|r!!!"))
endif
endif
endif
endif
endif
if(Gr==false)then
set C[GetPlayerId(GT)]=0
endif
set C[0]=0
set C[6]=0
set M[GetPlayerId(GT)]=(M[GetPlayerId(GT)]+1)
call ConditionalTriggerExecute(Bw)
call AdjustPlayerStateBJ((GetHeroLevel(GR)*-30),GT,PLAYER_STATE_RESOURCE_GOLD)
call StartTimerBJ(L[GetPlayerId(GT)],false,(I2R(GetHeroLevel(GR))*4.))
if(R==false)then
set A[GetPlayerId(GT)]=GetHeroLevel(GR)*4
loop
call PolledWait(1.85)
set A[GetPlayerId(GT)]=A[GetPlayerId(GT)]-2
exitwhen A[GetPlayerId(GT)]<1
endloop
if(e1(GT))then
set Gp=GetRectCenter(A2)
else
set Gp=GetRectCenter(A9)
endif
if(IsUnitDeadBJ(GR))then
call PanCameraToTimedLocForPlayer(GT,Gp,1.)
endif
call ReviveHeroLoc(GR,Gp,true)
call RemoveLocation(Gp)
else
if(eZ(GT))then
set Q[0]=(Q[0]+1)
endif
if(e1(GT))then
set Q[1]=(Q[1]+1)
endif
set AI[GetPlayerId(GT)]=GR
call SetPlayerStateBJ(GetOwningPlayer(GetTriggerUnit()),PLAYER_STATE_RESOURCE_FOOD_CAP,5)
if(Q[0]==IMinBJ(W,Y-X+1))then
call TriggerExecute(BR)
endif
if(Q[1]==IMinBJ(W,Y-X+1))then
call TriggerExecute(Br)
endif
call PolledWait((GetHeroLevel(GR)*4)-1)
if(GetUnitTypeId(GR)=='U006')then
call ExecuteFunc("Gn")
endif
if((GetUnitTypeId(GR)=='N01O') or (GetUnitTypeId(GR)=='N015') or (GetUnitTypeId(GR)=='N014') or (GetUnitTypeId(GR)=='N013'))then
call GN(GR)
endif
endif
endfunction
function Gu takes nothing returns boolean
if(IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO)==false)then
return false
endif
if(GetPlayerController(GetOwningPlayer(GetKillingUnit()))!=MAP_CONTROL_USER)then
return false
endif
if(GetDyingUnit()==GetKillingUnit())then
return false
endif
if(GetOwningPlayer(GetKillingUnit())==null)then
return false
endif
if(eZ(GetOwningPlayer(GetKillingUnit())))then
if(eZ(GetOwningPlayer(GetDyingUnit())))then
return false
endif
endif
if(e1(GetOwningPlayer(GetKillingUnit())))then
if(e1(GetOwningPlayer(GetDyingUnit())))then
return false
endif
endif
return true
endfunction
function GU takes nothing returns nothing
call DisableTrigger(BD)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,(I[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+(GetPlayerName(GetOwningPlayer(GetKillingUnit()))+("|r just drew "+(I[0]+"first blood!|r (+200 gold)")))))
call AdjustPlayerStateBJ(200,GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_GOLD)
call PlaySoundBJ(bz)
endfunction
function Gv takes nothing returns boolean
if(GetUnitTypeId(GetDyingUnit())!='n00L')then
return false
endif
return true
endfunction
function IsHero takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))then
return true
endif
return false
endfunction
function GV takes nothing returns nothing
if(eZ(GetOwningPlayer(GetKillingUnit())))then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Roshan has been slain by the |c00ff0000Sentinel|r!  Each Sentinel player receives 800 bonus gold.")
call AdjustPlayerStateBJ(800,Al[1],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,Al[2],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,Al[3],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,Al[4],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,Al[5],PLAYER_STATE_RESOURCE_GOLD)
endif
if(e1(GetOwningPlayer(GetKillingUnit())))then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"Roshan has been slain by the |c00004000Scourge|r!  Each Scourge player receives 800 bonus gold.")
call AdjustPlayerStateBJ(800,AL[1],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,AL[2],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,AL[3],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,AL[4],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(800,AL[5],PLAYER_STATE_RESOURCE_GOLD)
endif
call DisableTrigger(Be)
endfunction
function Gw takes nothing returns nothing
set D[1]=0
endfunction
function GW takes nothing returns nothing
set D[2]=0
endfunction
function Gx takes nothing returns nothing
set D[3]=0
endfunction
function GX takes nothing returns nothing
set D[4]=0
endfunction
function Gy takes nothing returns nothing
set D[5]=0
endfunction
function GY takes nothing returns nothing
set D[7]=0
endfunction
function Gz takes nothing returns nothing
set D[8]=0
endfunction
function GZ takes nothing returns nothing
set D[9]=0
endfunction
function G0 takes nothing returns nothing
set D[10]=0
endfunction
function G1 takes nothing returns nothing
set D[11]=0
endfunction
function G2 takes nothing returns nothing
set H=true
endfunction
function G3 takes nothing returns nothing
set F=true
endfunction
function G4 takes nothing returns nothing
set AV=true
endfunction
function G5 takes nothing returns boolean
if AV then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"You cannot use -swaphero after 90 seconds have elapsed.")
return false
endif
if GetUnitState(a2[GetPlayerId(GetTriggerPlayer())],UNIT_STATE_LIFE)==0 then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"You must have a living hero to swap with someone.")
return false
endif
if E3(EQ(GetTriggerPlayer()),"AlreadySwapped")then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"You can only initiate a swap request once.")
return false
endif
return true
endfunction
function G6 takes nothing returns nothing
if(GetUnitTypeId(GetEnumUnit())=='n004')then
call RemoveUnit(GetEnumUnit())
endif
if(GetUnitTypeId(GetEnumUnit())=='o003')then
call RemoveUnit(GetEnumUnit())
endif
endfunction
function G7 takes nothing returns nothing
local player Me=GetTriggerPlayer()
local player G8=EW(EQ(GetTriggeringTrigger()),"ToSwapTo")
local unit G9=a2[GetPlayerId(Me)]
local unit ha=a2[GetPlayerId(G8)]
local unit hA=CreateUnit(Me,'e01F',0,0,0)
local group fB=GetUnitsInRectOfPlayer(GetWorldBounds(),Me)
call ForGroup(fB,function G6)
call DestroyGroup(fB)
set fB=GetUnitsInRectOfPlayer(GetWorldBounds(),G8)
call ForGroup(fB,function G6)
call DestroyGroup(fB)
call UnitAddItem(hA,UnitItemInSlot(ha,0))
call UnitAddItem(hA,UnitItemInSlot(ha,1))
call UnitAddItem(hA,UnitItemInSlot(ha,2))
call UnitAddItem(hA,UnitItemInSlot(ha,3))
call UnitAddItem(hA,UnitItemInSlot(ha,4))
call UnitAddItem(hA,UnitItemInSlot(ha,5))
call UnitAddItem(ha,UnitItemInSlot(G9,0))
call UnitAddItem(ha,UnitItemInSlot(G9,1))
call UnitAddItem(ha,UnitItemInSlot(G9,2))
call UnitAddItem(ha,UnitItemInSlot(G9,3))
call UnitAddItem(ha,UnitItemInSlot(G9,4))
call UnitAddItem(ha,UnitItemInSlot(G9,5))
call UnitAddItem(G9,UnitItemInSlot(hA,0))
call UnitAddItem(G9,UnitItemInSlot(hA,1))
call UnitAddItem(G9,UnitItemInSlot(hA,2))
call UnitAddItem(G9,UnitItemInSlot(hA,3))
call UnitAddItem(G9,UnitItemInSlot(hA,4))
call UnitAddItem(G9,UnitItemInSlot(hA,5))
call RemoveUnit(hA)
call SetUnitOwner(ha,Me,true)
call SetUnitOwner(G9,G8,true)
set a2[GetPlayerId(Me)]=ha
set a2[GetPlayerId(G8)]=G9
call ClearSelectionForPlayer(Me)
call SelectUnitAddForPlayer(ha,Me)
call ClearSelectionForPlayer(G8)
call SelectUnitAddForPlayer(G9,G8)
endfunction
function hb takes nothing returns nothing
local player e3=GetTriggerPlayer()
local string Go=EQ(e3)
local player hB=EW(Go,"SwapHeroWithPlayer")
local dialog hc=DialogCreate()
local button hC
local unit fS=a2[GetPlayerId(e3)]
local trigger hd
call DialogSetMessage(hc,"Swap with "+GetPlayerName(e3)+" ("+GetUnitName(fS)+")")
call DialogAddButton(hc,"No",0)
set hC=DialogAddButton(hc,"Yes",1)
set hd=CreateTrigger()
call TriggerRegisterDialogButtonEvent(hd,hC)
call TriggerAddAction(hd,function G7)
call Es(EQ(hd),"ToSwapTo",e3)
call DialogDisplay(hB,hc,true)
call PolledWait(20)
call DialogDisplay(hB,hc,false)
call PolledWait(1)
call DialogDestroy(hc)
endfunction
function hD takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",Al[1])
call hb()
endfunction
function he takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",Al[2])
call hb()
endfunction
function hE takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",Al[3])
call hb()
endfunction
function hf takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",Al[4])
call hb()
endfunction
function hF takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",Al[5])
call hb()
endfunction
function hg takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",AL[1])
call hb()
endfunction
function hG takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",AL[2])
call hb()
endfunction
function hh takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",AL[3])
call hb()
endfunction
function hH takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",AL[4])
call hb()
endfunction
function hi takes nothing returns nothing
call Es(EQ(GetTriggerPlayer()),"SwapHeroWithPlayer",AL[5])
call hb()
endfunction
function hI takes nothing returns nothing
call EV(EQ(GetTriggerPlayer()),"AlreadySwapped",false)
endfunction
function hj takes nothing returns nothing
local player e3=GetTriggerPlayer()
local player hB
local dialog hc=DialogCreate()
local button hC
local integer EA=1
local trigger array hJ
call EV(EQ(GetTriggerPlayer()),"AlreadySwapped",true)
set hJ[1]=CreateTrigger()
call TriggerAddAction(hJ[1],function hD)
set hJ[2]=CreateTrigger()
call TriggerAddAction(hJ[2],function he)
set hJ[3]=CreateTrigger()
call TriggerAddAction(hJ[3],function hE)
set hJ[4]=CreateTrigger()
call TriggerAddAction(hJ[4],function hf)
set hJ[5]=CreateTrigger()
call TriggerAddAction(hJ[5],function hF)
set hJ[6]=CreateTrigger()
call TriggerAddAction(hJ[6],function hg)
set hJ[7]=CreateTrigger()
call TriggerAddAction(hJ[7],function hG)
set hJ[8]=CreateTrigger()
call TriggerAddAction(hJ[8],function hh)
set hJ[9]=CreateTrigger()
call TriggerAddAction(hJ[9],function hH)
set hJ[10]=CreateTrigger()
call TriggerAddAction(hJ[10],function hi)
set hC=DialogAddButton(hc,"Cancel",0)
set hJ[0]=CreateTrigger()
call TriggerRegisterDialogButtonEvent(hJ[0],hC)
call TriggerAddAction(hJ[0],function hI)
if eZ(e3)then
loop
exitwhen EA>5
if(e3!=Al[EA] and e2(Al[EA]))then
set hC=DialogAddButton(hc,I[GetPlayerId(Al[EA])]+GetPlayerName(Al[EA])+"|r - "+GetUnitName(a2[GetPlayerId(Al[EA])]),0)
call TriggerRegisterDialogButtonEvent(hJ[EA],hC)
endif
set EA=EA+1
endloop
else
loop
exitwhen EA>5
if(e3!=AL[EA] and e2(AL[EA]))then
set hC=DialogAddButton(hc,I[GetPlayerId(AL[EA])]+GetPlayerName(AL[EA])+"|r - "+GetUnitName(a2[GetPlayerId(AL[EA])]),0)
call TriggerRegisterDialogButtonEvent(hJ[5+EA],hC)
endif
set EA=EA+1
endloop
endif
call DialogSetMessage(hc,"Pick the player to swap with")
call DialogDisplay(e3,hc,true)
call PolledWait(10)
call DialogDisplay(e3,hc,false)
call PolledWait(1)
call DialogDestroy(hc)
endfunction
function hk takes nothing returns nothing
if(GetEventPlayerChatString()=="-csboardon")then
call LeaderboardDisplay(An[GetPlayerId(GetTriggerPlayer())],true)
else
call LeaderboardDisplay(An[GetPlayerId(GetTriggerPlayer())],false)
endif
endfunction
function hK takes nothing returns nothing
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"   Creeps Killed: "+I2S(Af[GetPlayerId(GetTriggerPlayer())])+" Creeps Denied: "+I2S(AF[GetPlayerId(GetTriggerPlayer())]))
endfunction
function hl takes nothing returns nothing
if(GetUnitTypeId(GetTriggerUnit())=='ugho')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='u001')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='unec')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='u002')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='esen')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='e00V')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='edry')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
if(GetUnitTypeId(GetTriggerUnit())=='e00W')then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetKillingUnit())))then
set AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
else
set Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]=Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]+1
endif
endif
call LeaderboardSetLabelBJ(An[GetPlayerId(GetOwningPlayer(GetKillingUnit()))],"Creep Kills: "+I2S(Af[GetPlayerId(GetOwningPlayer(GetKillingUnit()))])+"  Denies: "+I2S(AF[GetPlayerId(GetOwningPlayer(GetKillingUnit()))]))
endfunction
function hL takes nothing returns nothing
set aD[GetPlayerId(GetTriggerPlayer())]=true
endfunction
function hm takes nothing returns nothing
set aD[GetPlayerId(GetTriggerPlayer())]=false
endfunction
function hM takes nothing returns nothing
if(a2[GetPlayerId(GetTriggerPlayer())]==null)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,"No Hero is selected")
else
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10.,GetUnitName(a2[GetPlayerId(GetTriggerPlayer())])+" movespeed is "+I2S(R2I(GetUnitMoveSpeed(a2[GetPlayerId(GetTriggerPlayer())]))))
endif
endfunction
function hn takes nothing returns nothing
local integer EA=1
local integer Eb=5
if(e1(GetTriggerPlayer()))then
loop
exitwhen EA>Eb
if(a2[GetPlayerId(Al[EA])]!=null)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,20,I[GetPlayerId(Al[EA])]+GetPlayerName(Al[EA])+"|r controls "+GetUnitName(a2[GetPlayerId(Al[EA])]))
endif
set EA=EA+1
endloop
else
loop
exitwhen EA>Eb
if(a2[GetPlayerId(AL[EA])]!=null)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,20,I[GetPlayerId(AL[EA])]+GetPlayerName(AL[EA])+"|r controls "+GetUnitName(a2[GetPlayerId(AL[EA])]))
endif
set EA=EA+1
endloop
endif
endfunction
function hN takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))then
if(GetOwningPlayer(GetFilterUnit())==GetTriggerPlayer())then
return true
endif
endif
return false
endfunction
function ho takes nothing returns nothing
call UnitAddAbility(GetEnumUnit(),'A0AT')
call IssueImmediateOrderById(GetEnumUnit(),852663)
endfunction
function hO takes nothing returns nothing
local group fB=GetUnitsInRectMatching(GetWorldBounds(),Condition(function hN))
call ForGroupBJ(fB,function ho)
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,30.,"You are using unstuck. You will be sent to your base in 60 seconds.")
call DestroyGroup(fB)
endfunction
function hp takes nothing returns boolean
if(GetSpellAbilityId()!='A0AT')then
return false
endif
return true
endfunction
function hP takes nothing returns nothing
local location fr
if(eZ(GetOwningPlayer(GetTriggerUnit())))then
set fr=GetRectCenter(A9)
else
set fr=GetRectCenter(A2)
endif
call SetUnitPositionLoc(GetTriggerUnit(),fr)
call RemoveLocation(fr)
endfunction
function hq takes nothing returns boolean
if(IsUnitIllusion(GetFilterUnit())==false)then
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))then
if(GetOwningPlayer(GetFilterUnit())==GetTriggerPlayer())then
if(GetUnitTypeId(GetFilterUnit())=='U008')then
return true
endif
if(GetUnitTypeId(GetFilterUnit())=='U007')then
return true
endif
if(GetUnitTypeId(GetFilterUnit())=='Hlgr')then
return true
endif
if(GetUnitTypeId(GetFilterUnit())=='Eevi')then
return true
endif
if(GetUnitTypeId(GetFilterUnit())=='Ekee')then
return true
endif
endif
endif
endif
return false
endfunction
function hQ takes nothing returns nothing
call UnitAddAbility(GetEnumUnit(),'A0FI')
call IssueImmediateOrderById(GetEnumUnit(),852663)
call DisplayTimedTextToPlayer(GetOwningPlayer(GetEnumUnit()),0,0,60.,"|c00ff0303"+"Recreate is being performed on "+GetUnitName(GetEnumUnit())+". Please wait about 2 minutes"+"|r")
endfunction
function hr takes nothing returns nothing
local group fB
if(eZ(GetTriggerPlayer()))then
set fB=GetUnitsInRectMatching(bv,Condition(function hq))
else
set fB=GetUnitsInRectMatching(bV,Condition(function hq))
endif
call ForGroupBJ(fB,function hQ)
call DestroyGroup(fB)
endfunction
function hR takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0FI'))then
return false
endif
return true
endfunction
function hs takes integer hS,unit ht,unit hT returns nothing
local integer EA=1
local integer Eb=GetUnitAbilityLevelSwapped(hS,ht)
loop
exitwhen EA>Eb
call SelectHeroSkill(hT,hS)
set EA=EA+1
endloop
endfunction
function hu takes nothing returns nothing
local integer EA
local integer Eb
local unit hU
local location fr=GetUnitLoc(GetTriggerUnit())
set hU=CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),GetUnitTypeId(GetTriggerUnit()),fr,bj_UNIT_FACING)
call SetHeroXP(hU,GetHeroXP(GetTriggerUnit()),false)
set EA=1
set Eb=GetUnitAbilityLevelSwapped('Aamk',GetTriggerUnit())
loop
exitwhen EA>Eb
call SelectHeroSkill(bj_lastCreatedUnit,'Aamk')
set EA=EA+1
endloop
set EA=1
set Eb=6
loop
exitwhen EA>Eb
call UnitAddItem(hU,UnitItemInSlotBJ(GetTriggerUnit(),EA))
set EA=EA+1
endloop
if(GetUnitTypeId(GetTriggerUnit())=='Eevi')then
call hs('A04L',GetTriggerUnit(),hU)
call hs('A0H4',GetTriggerUnit(),hU)
call hs('AEvi',GetTriggerUnit(),hU)
call hs('A07Q',GetTriggerUnit(),hU)
endif
if(GetUnitTypeId(GetTriggerUnit())=='U008')then
call hs('A03D',GetTriggerUnit(),hU)
call hs('A02G',GetTriggerUnit(),hU)
call hs('A03E',GetTriggerUnit(),hU)
call hs('A093',GetTriggerUnit(),hU)
endif
if(GetUnitTypeId(GetTriggerUnit())=='U007')then
call hs('A0F9',GetTriggerUnit(),hU)
call hs('A06Y',GetTriggerUnit(),hU)
call hs('A01E',GetTriggerUnit(),hU)
call hs('A028',GetTriggerUnit(),hU)
endif
if(GetUnitTypeId(GetTriggerUnit())=='Hlgr')then
call hs('A03G',GetTriggerUnit(),hU)
call hs('A03F',GetTriggerUnit(),hU)
call hs('A0O3',GetTriggerUnit(),hU)
call hs('AEim',GetTriggerUnit(),hU)
endif
if(GetUnitTypeId(GetTriggerUnit())=='Ekee')then
call hs('A035',GetTriggerUnit(),hU)
call hs('A06W',GetTriggerUnit(),hU)
call hs('A06V',GetTriggerUnit(),hU)
call hs('A06X',GetTriggerUnit(),hU)
endif
call RemoveUnit(GetTriggerUnit())
call RemoveLocation(fr)
endfunction
function hv takes nothing returns nothing
call DisableTrigger(Br)
call DisableTrigger(BR)
call PauseAllUnitsBJ(true)
call Ed(AL[1])
call Ed(AL[2])
call Ed(AL[3])
call Ed(AL[4])
call Ed(AL[5])
call Ee(Al[1])
call Ee(Al[2])
call Ee(Al[3])
call Ee(Al[4])
call Ee(Al[5])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The Sentinel has won!  Get the latest version from www.getdota.com.")
call FlushGameCache(Ap)
endfunction
function hV takes nothing returns nothing
call DisableTrigger(Br)
call DisableTrigger(BR)
call PauseAllUnitsBJ(true)
call Ed(Al[1])
call Ed(Al[2])
call Ed(Al[3])
call Ed(Al[4])
call Ed(Al[5])
call Ee(AL[1])
call Ee(AL[2])
call Ee(AL[3])
call Ee(AL[4])
call Ee(AL[5])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"The Scourge has won!  Get the latest version from www.getdota.com.")
call FlushGameCache(Ap)
endfunction
function hw takes nothing returns nothing
call DestructableRestoreLife(GetEnumDestructable(),GetDestructableMaxLife(GetEnumDestructable()),false)
endfunction
function hW takes nothing returns nothing
call EnumDestructablesInRectAll(bj_mapInitialPlayableArea,function hw)
endfunction
function hx takes nothing returns boolean
if(IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))then
return false
endif
return true
endfunction
function hX takes nothing returns boolean
if(GetUnitTypeId(GetTriggerUnit())=='etol')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='unpl')then
return true
endif
return false
endfunction
function hy takes nothing returns boolean
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO)==false)then
return false
endif
if(UnitHasBuffBJ(GetTriggerUnit(),'BNdo'))then
return false
endif
if(UnitHasBuffBJ(GetTriggerUnit(),'BEsh'))then
return false
endif
return true
endfunction
function hY takes nothing returns boolean
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))then
return false
endif
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitLifePercent(GetTriggerUnit())<50.)then
return false
endif
return true
endfunction
function hz takes nothing returns boolean
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false)then
return false
endif
if(GetUnitLifePercent(GetTriggerUnit())<10)then
return false
endif
return true
endfunction
function hZ takes nothing returns nothing
if(hX() or hy() or hY() or hz())then
call IssueImmediateOrderById(GetAttacker(),851972)
endif
endfunction
function h0 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0CX'))then
return false
endif
return true
endfunction
function h1 takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local unit h2
local unit h3=GetSpellTargetUnit()
if(h3!=null)then
set h2=CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),'e00C',fr,bj_UNIT_FACING)
call UnitAddAbility(h2,'A0KZ')
call UnitApplyTimedLifeBJ(5.,'BTLF',h2)
call IssueTargetOrderById(h2,852066,h3)
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
endif
call RemoveLocation(fr)
endfunction
function h4 takes nothing returns boolean
if(not (GetItemType(GetManipulatedItem())==ITEM_TYPE_PURCHASABLE))then
return false
endif
return true
endfunction
function h5 takes nothing returns nothing
local item h6
call DisableTrigger(BT)
call UnitRemoveItemSwapped(GetManipulatedItem(),GetManipulatingUnit())
set h6=bj_lastRemovedItem
call UnitRemoveItemSwapped(GetItemOfTypeFromUnitBJ(GetManipulatingUnit(),GetItemTypeId(GetManipulatedItem())),GetManipulatingUnit())
call SetItemCharges(h6,(GetItemCharges(bj_lastRemovedItem)+GetItemCharges(h6)))
call UnitAddItem(GetTriggerUnit(),h6)
call RemoveItem(bj_lastRemovedItem)
call EnableTrigger(BT)
endfunction
function h7 takes nothing returns boolean
if(GetTriggerUnit()!=aC)then
return false
endif
if(IsUnitIllusion(GetAttacker()))then
call KillUnit(GetAttacker())
return false
endif
return true
endfunction
function h8 takes nothing returns nothing
if(UnitHasBuffBJ(GetTriggerUnit(),'BPSE'))then
call UnitRemoveAbility(GetTriggerUnit(),'BPSE')
endif
endfunction
function h9 takes nothing returns boolean
if(GetUnitTypeId(GetAttacker())!='n00L')then
return false
endif
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE))then
return true
endif
return false
endfunction
function Ha takes nothing returns nothing
local location HA=GetRectCenter(bP)
call SetUnitPositionLoc(GetAttacker(),HA)
call RemoveLocation(HA)
endfunction
function Hb takes nothing returns boolean
if(GetUnitTypeId(GetEnteringUnit())!='e00E')then
return false
endif
return true
endfunction
function HB takes nothing returns nothing
call ShowUnitHide(GetEnteringUnit())
call SetUnitPathing(GetEnteringUnit(),false)
call SetUnitInvulnerable(GetEnteringUnit(),true)
call UnitApplyTimedLifeBJ(20.,'BTLF',GetEnteringUnit())
endfunction
function Hc takes nothing returns nothing
local integer EA
local integer Eb
local integer HC
local integer Hd
set a6=e5(Ak)
set EA=1
set Eb=5
set HC=1
loop
exitwhen EA>Eb
if(e2(Al[EA]))then
set a8[HC]=Al[EA]
set HC=HC+1
endif
set EA=EA+1
endloop
set a7=e5(AK)
set EA=1
set Eb=5
set HC=1
loop
exitwhen EA>Eb
if(e2(AL[EA]))then
set a9[HC]=AL[EA]
set HC=HC+1
endif
set EA=EA+1
endloop
set ac=CreateMultiboardBJ(4,6+a7+a6,("DotA Allstars"+v))
call MultiboardSetItemValueBJ(ac,1,1,"Player")
call MultiboardSetItemValueBJ(ac,2,1,"Dead?")
call MultiboardSetItemValueBJ(ac,3,1," Kills")
call MultiboardSetItemValueBJ(ac,4,1,"Deaths")
call MultiboardSetItemValueBJ(ac,1,2,(I[GetPlayerId(Al[0])]+("The Sentinel"+"|r")))
call MultiboardSetItemValueBJ(ac,1,3+a6,(I[GetPlayerId(AL[0])]+("The Scourge"+"|r")))
call MultiboardSetItemValueBJ(ac,3,3+a6,"   0")
call MultiboardSetItemValueBJ(ac,4,3+a6,"    0")
call MultiboardSetItemValueBJ(ac,3,2,"   0")
call MultiboardSetItemValueBJ(ac,4,2,"    0")
set EA=1
set Eb=6+a7+a6
loop
exitwhen EA>Eb
call MultiboardSetItemWidthBJ(ac,1,EA,9.8)
call MultiboardSetItemWidthBJ(ac,2,EA,4.2)
call MultiboardSetItemWidthBJ(ac,3,EA,4.)
call MultiboardSetItemWidthBJ(ac,4,EA,4.6)
call MultiboardSetItemColorBJ(ac,2,EA,86.2,86.2,.0,0)
call MultiboardSetItemColorBJ(ac,3,EA,100.,.0,.0,0)
call MultiboardSetItemColorBJ(ac,4,EA,.0,5.,100.,0)
set EA=EA+1
endloop
set EA=1
set Eb=a6
loop
exitwhen EA>Eb
call MultiboardSetItemValueBJ(ac,1,(EA+2),(I[GetPlayerId(a8[EA])]+(GetPlayerName(a8[EA])+"|r")))
call MultiboardSetItemValueBJ(ac,2,(EA+2),"     ")
call MultiboardSetItemValueBJ(ac,3,(EA+2),"   0")
call MultiboardSetItemValueBJ(ac,4,(EA+2),"    0")
set EA=EA+1
endloop
set EA=1
set Eb=a7
loop
exitwhen EA>Eb
call MultiboardSetItemValueBJ(ac,1,(EA+3+a6),(I[GetPlayerId(a9[EA])]+(GetPlayerName(a9[EA])+"|r")))
call MultiboardSetItemValueBJ(ac,2,(EA+3+a6),"     ")
call MultiboardSetItemValueBJ(ac,3,(EA+3+a6),"   0")
call MultiboardSetItemValueBJ(ac,4,(EA+3+a6),"    0")
set EA=EA+1
endloop
set EA=1
set Eb=4
loop
exitwhen EA>Eb
set HC=1
set Hd=6+a7+a6
loop
exitwhen HC>Hd
call MultiboardSetItemStyleBJ(ac,EA,HC,true,false)
set HC=HC+1
endloop
set EA=EA+1
endloop
call MultiboardSetItemValueBJ(ac,1,6+a7+a6-2,"Time Elapsed")
call MultiboardSetItemColorBJ(ac,3,6+a7+a6-2,100.,100.,100.,0)
call MultiboardSetItemValueBJ(ac,1,6+a7+a6-1,(I[GetPlayerId(Al[0])]+("Towers Lost"+"|r")))
call MultiboardSetItemValueBJ(ac,1,6+a7+a6,(I[GetPlayerId(AL[0])]+("Towers Lost"+"|r")))
call MultiboardSetItemValueBJ(ac,3,6+a7+a6-1,"    0")
call MultiboardSetItemValueBJ(ac,3,6+a7+a6,"    0")
call MultiboardDisplay(ac,true)
endfunction
function HD takes nothing returns nothing
local integer EA
local integer Eb
call MultiboardSetItemValueBJ(ac,3,2,("   "+I2S(K[GetPlayerId(Al[0])])))
call MultiboardSetItemValueBJ(ac,4,2,("    "+I2S(M[GetPlayerId(Al[0])])))
call MultiboardSetItemValueBJ(ac,3,3+a6,("   "+I2S(K[GetPlayerId(AL[0])])))
call MultiboardSetItemValueBJ(ac,4,3+a6,("    "+I2S(M[GetPlayerId(AL[0])])))
set EA=1
set Eb=a6
loop
exitwhen EA>Eb
call MultiboardSetItemValueBJ(ac,3,(EA+2),("   "+I2S(K[GetPlayerId(a8[EA])])))
call MultiboardSetItemValueBJ(ac,4,(EA+2),("    "+I2S(M[GetPlayerId(a8[EA])])))
set EA=EA+1
endloop
set EA=1
set Eb=a7
loop
exitwhen EA>Eb
call MultiboardSetItemValueBJ(ac,3,(EA+3+a6),("   "+I2S(K[GetPlayerId(a9[EA])])))
call MultiboardSetItemValueBJ(ac,4,(EA+3+a6),("    "+I2S(M[GetPlayerId(a9[EA])])))
set EA=EA+1
endloop
endfunction
function He takes nothing returns boolean
if(GetUnitTypeId(GetTriggerUnit())=='e00R')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='e011')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='e00S')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='e019')then
return true
endif
return false
endfunction
function HE takes nothing returns nothing
set N[1]=(N[1]+1)
endfunction
function Hf takes nothing returns boolean
if(GetUnitTypeId(GetTriggerUnit())=='u00M')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='u00D')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='u00N')then
return true
endif
if(GetUnitTypeId(GetTriggerUnit())=='u00T')then
return true
endif
return false
endfunction
function HF takes nothing returns nothing
set N[2]=(N[2]+1)
endfunction
function Hg takes nothing returns nothing
local integer EA
local integer Eb
set EA=1
set Eb=a6
loop
exitwhen EA>Eb
if((GetPlayerState(Player(GetPlayerId(a8[EA])),PLAYER_STATE_RESOURCE_FOOD_USED)==0) and a2[GetPlayerId(a8[EA])]!=null and TimerGetRemaining(L[GetPlayerId(a8[EA])])>0)then
call MultiboardSetItemValueBJ(ac,2,(EA+2),("    "+I2S(R2I(TimerGetRemaining(L[GetPlayerId(a8[EA])])))))
else
call MultiboardSetItemValueBJ(ac,2,(EA+2),"     ")
endif
set EA=EA+1
endloop
set EA=1
set Eb=a7
loop
exitwhen EA>Eb
if((GetPlayerState(Player(GetPlayerId(a9[EA])),PLAYER_STATE_RESOURCE_FOOD_USED)==0) and a2[GetPlayerId(a9[EA])]!=null and TimerGetRemaining(L[GetPlayerId(a9[EA])])>0)then
call MultiboardSetItemValueBJ(ac,2,(EA+3+a6),("    "+I2S(R2I(TimerGetRemaining(L[GetPlayerId(a9[EA])])))))
else
call MultiboardSetItemValueBJ(ac,2,(EA+3+a6),"     ")
endif
set EA=EA+1
endloop
set o=((R2I(TimerGetElapsed(n))/60)-(1/2))
set O=ModuloInteger(R2I(TimerGetElapsed(n)),60)
if(O<10)then
call MultiboardSetItemValueBJ(ac,3,6+a7+a6-2,(" "+(I2S(o)+(":0"+I2S(O)))))
else
call MultiboardSetItemValueBJ(ac,3,6+a7+a6-2,(" "+(I2S(o)+(":"+I2S(O)))))
endif
call MultiboardSetItemValueBJ(ac,3,6+a7+a6-1,I[GetPlayerId(Al[0])]+"    "+I2S(N[1]))
call MultiboardSetItemValueBJ(ac,3,6+a7+a6,I[GetPlayerId(AL[0])]+"    "+I2S(N[2])+"|r")
endfunction
function HG takes nothing returns nothing
set An[GetPlayerId(Al[1])]=CreateLeaderboard()
set An[GetPlayerId(Al[2])]=CreateLeaderboard()
set An[GetPlayerId(Al[3])]=CreateLeaderboard()
set An[GetPlayerId(Al[4])]=CreateLeaderboard()
set An[GetPlayerId(Al[5])]=CreateLeaderboard()
set An[GetPlayerId(AL[1])]=CreateLeaderboard()
set An[GetPlayerId(AL[2])]=CreateLeaderboard()
set An[GetPlayerId(AL[3])]=CreateLeaderboard()
set An[GetPlayerId(AL[4])]=CreateLeaderboard()
set An[GetPlayerId(AL[5])]=CreateLeaderboard()
call PlayerSetLeaderboard(Al[1],An[GetPlayerId(Al[1])])
call PlayerSetLeaderboard(Al[2],An[GetPlayerId(Al[2])])
call PlayerSetLeaderboard(Al[3],An[GetPlayerId(Al[3])])
call PlayerSetLeaderboard(Al[4],An[GetPlayerId(Al[4])])
call PlayerSetLeaderboard(Al[5],An[GetPlayerId(Al[5])])
call PlayerSetLeaderboard(AL[1],An[GetPlayerId(AL[1])])
call PlayerSetLeaderboard(AL[2],An[GetPlayerId(AL[2])])
call PlayerSetLeaderboard(AL[3],An[GetPlayerId(AL[3])])
call PlayerSetLeaderboard(AL[4],An[GetPlayerId(AL[4])])
call PlayerSetLeaderboard(AL[5],An[GetPlayerId(AL[5])])
call LeaderboardDisplay(An[GetPlayerId(Al[1])],false)
call LeaderboardDisplay(An[GetPlayerId(Al[2])],false)
call LeaderboardDisplay(An[GetPlayerId(Al[3])],false)
call LeaderboardDisplay(An[GetPlayerId(Al[4])],false)
call LeaderboardDisplay(An[GetPlayerId(Al[5])],false)
call LeaderboardDisplay(An[GetPlayerId(AL[1])],false)
call LeaderboardDisplay(An[GetPlayerId(AL[2])],false)
call LeaderboardDisplay(An[GetPlayerId(AL[3])],false)
call LeaderboardDisplay(An[GetPlayerId(AL[4])],false)
call LeaderboardDisplay(An[GetPlayerId(AL[5])],false)
call LeaderboardSetLabelBJ(An[GetPlayerId(Al[1])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(Al[2])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(Al[3])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(Al[4])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(Al[5])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(AL[1])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(AL[2])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(AL[3])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(AL[4])],"Creep Kills: 0 Denies: 0")
call LeaderboardSetLabelBJ(An[GetPlayerId(AL[5])],"Creep Kills: 0 Denies: 0")
call EnableTrigger(Bm)
call EnableTrigger(BL)
endfunction
function Hh takes nothing returns nothing
local location fr=GetRectCenter(bP)
call SetCreepCampFilterState(false)
set aC=CreateUnitAtLoc(Player(12),'n00L',fr,bj_UNIT_FACING)
call RemoveLocation(fr)
endfunction
function HH takes nothing returns nothing
set aP=aP+1
endfunction
function Hi takes nothing returns nothing
set ap=ap+1
endfunction
function HI takes nothing returns boolean
if(not (GetOwningPlayer(GetTriggerUnit())==Al[0]))then
return false
endif
return true
endfunction
function Hj takes nothing returns nothing
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,aH)
endfunction
function HJ takes nothing returns boolean
if(not (GetOwningPlayer(GetTriggerUnit())==AL[0]))then
return false
endif
return true
endfunction
function Hk takes nothing returns nothing
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,aH)
endfunction
function HK takes nothing returns boolean
if(not (GetOwningPlayer(GetTriggerUnit())==Al[0]))then
return false
endif
return true
endfunction
function Hl takes nothing returns nothing
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,ai)
endfunction
function Hm takes nothing returns boolean
if(not (GetOwningPlayer(GetTriggerUnit())==AL[0]))then
return false
endif
return true
endfunction
function HM takes nothing returns nothing
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,ai)
endfunction
function Hn takes nothing returns boolean
if(not (GetOwningPlayer(GetTriggerUnit())==AL[0]))then
return false
endif
return true
endfunction
function HN takes nothing returns nothing
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,aI)
endfunction
function Ho takes nothing returns boolean
if(not (GetOwningPlayer(GetTriggerUnit())==Al[0]))then
return false
endif
return true
endfunction
function HO takes nothing returns nothing
call IssuePointOrderByIdLoc(GetTriggerUnit(),851983,aI)
endfunction
function Hp takes nothing returns boolean
if(a3)then
return Aa
endif
return F
endfunction
function HP takes group Hq,integer HQ returns nothing
local unit u
loop
set u=FirstOfGroup(Hq)
exitwhen(u==null)
call GroupRemoveUnit(Hq,u)
call SetUnitAbilityLevel(u,Aw,HQ)
endloop
endfunction
function Hr takes nothing returns nothing
if(aK)then
call CreateNUnitsAtLoc(ap,'ugho',AL[0],aQ,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(ap,'u001',AL[0],aQ,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,2)
if(al)then
call CreateNUnitsAtLoc(ap,'ugho',AL[0],aq,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(ap,'u001',AL[0],aq,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,3)
if(aL)then
call CreateNUnitsAtLoc(ap,'ugho',AL[0],ar,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(ap,'u001',AL[0],ar,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,4)
if(aj)then
call CreateNUnitsAtLoc(aP,'unec',AL[0],aS,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(aP,'u002',AL[0],aS,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,2)
if(aJ)then
call CreateNUnitsAtLoc(aP,'unec',AL[0],aR,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(aP,'u002',AL[0],aR,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,3)
if(ak)then
call CreateNUnitsAtLoc(aP,'unec',AL[0],as,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(aP,'u002',AL[0],as,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,4)
if(aN)then
call CreateNUnitsAtLoc(ap,'esen',Al[0],au,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(ap,'e00V',Al[0],au,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,2)
if(ao)then
call CreateNUnitsAtLoc(ap,'esen',Al[0],at,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(ap,'e00V',Al[0],at,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,3)
if(aO)then
call CreateNUnitsAtLoc(ap,'esen',Al[0],aT,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(ap,'e00V',Al[0],aT,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,4)
if(am)then
call CreateNUnitsAtLoc(aP,'edry',Al[0],aV,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(aP,'e00W',Al[0],aV,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,2)
if(aM)then
call CreateNUnitsAtLoc(aP,'edry',Al[0],aU,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(aP,'e00W',Al[0],aU,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,3)
if(an)then
call CreateNUnitsAtLoc(aP,'edry',Al[0],av,bj_UNIT_FACING)
else
call CreateNUnitsAtLoc(aP,'e00W',Al[0],av,bj_UNIT_FACING)
endif
call HP(bj_lastCreatedGroup,4)
endfunction
function HR takes nothing returns nothing
set aj=false
call DisableTrigger(B9)
endfunction
function Hs takes nothing returns nothing
set aJ=false
call DisableTrigger(ca)
endfunction
function Ht takes nothing returns nothing
set ak=false
call DisableTrigger(cA)
endfunction
function HT takes nothing returns nothing
set aK=false
call DisableTrigger(cb)
endfunction
function Hu takes nothing returns nothing
set al=false
call DisableTrigger(cB)
endfunction
function HU takes nothing returns nothing
set aL=false
call DisableTrigger(cc)
endfunction
function Hv takes nothing returns nothing
set am=false
call DisableTrigger(cC)
endfunction
function HV takes nothing returns nothing
set aM=false
call DisableTrigger(cd)
endfunction
function Hw takes nothing returns nothing
set an=false
call DisableTrigger(cD)
endfunction
function HW takes nothing returns nothing
set aN=false
call DisableTrigger(ce)
endfunction
function Hx takes nothing returns nothing
set ao=false
call DisableTrigger(cE)
endfunction
function HX takes nothing returns nothing
set aO=false
call DisableTrigger(cf)
endfunction
function Hy takes nothing returns boolean
if(aN or ao or aO or am or aM or an)then
return false
endif
return true
endfunction
function HY takes nothing returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"The Sentinel has destroyed all of the Scourge's unit producing structures. The Sentinel now have Mega Creeps")
call SetPlayerTechResearchedSwap('R00D',(GetPlayerTechCountSimple('R00D',Al[0])+30),Al[0])
call SetPlayerTechResearchedSwap('R00C',(GetPlayerTechCountSimple('R00C',Al[0])+30),Al[0])
call DisableTrigger(cF)
endfunction
function Hz takes nothing returns boolean
if(aK or al or aL or aj or aJ or ak)then
return false
endif
return true
endfunction
function HZ takes nothing returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"The Scourge has destroyed all of the Sentinel's unit producing structures. The Scourge now have Mega Creeps")
call SetPlayerTechResearchedSwap('R009',(GetPlayerTechCountSimple('R009',AL[0])+30),AL[0])
call SetPlayerTechResearchedSwap('R00B',(GetPlayerTechCountSimple('R00B',AL[0])+30),AL[0])
call DisableTrigger(cg)
endfunction
function H0 takes nothing returns boolean
if(GetUnitTypeId(GetDyingUnit())=='e00R')then
return true
endif
if(GetUnitTypeId(GetDyingUnit())=='e011')then
return true
endif
if(GetUnitTypeId(GetDyingUnit())=='e00S')then
return true
endif
if(GetUnitTypeId(GetDyingUnit())=='e019')then
return true
endif
return false
endfunction
function H1 takes nothing returns boolean
if(not (GetDyingUnit()==DY))then
return false
endif
if(not (IsUnitDeadBJ(Dz)))then
return false
endif
return true
endfunction
function H2 takes nothing returns boolean
if(not (GetDyingUnit()==Dz))then
return false
endif
if(not (IsUnitDeadBJ(DY)))then
return false
endif
return true
endfunction
function H3 takes nothing returns nothing
if(GetDyingUnit()==D6)then
call SetUnitInvulnerable(D2,false)
endif
if(GetDyingUnit()==D7)then
call SetUnitInvulnerable(D5,false)
endif
if(GetDyingUnit()==Do)then
call SetUnitInvulnerable(D0,false)
endif
if(GetDyingUnit()==D2)then
call SetUnitInvulnerable(DN,false)
endif
if(GetDyingUnit()==D5)then
call SetUnitInvulnerable(DZ,false)
endif
if(GetDyingUnit()==D0)then
call SetUnitInvulnerable(D1,false)
endif
if(GetDyingUnit()==DN)then
call SetUnitInvulnerable(eb,false)
call SetUnitInvulnerable(eB,false)
call SetUnitInvulnerable(eh,false)
call SetUnitInvulnerable(ed,false)
call SetUnitInvulnerable(eC,false)
call SetUnitInvulnerable(eH,false)
call SetUnitInvulnerable(Dz,false)
call SetUnitInvulnerable(DY,false)
call SetUnitInvulnerable(eE,false)
endif
if(GetDyingUnit()==DZ)then
call SetUnitInvulnerable(ea,false)
call SetUnitInvulnerable(Dw,false)
call SetUnitInvulnerable(ee,false)
call SetUnitInvulnerable(eD,false)
call SetUnitInvulnerable(ei,false)
call SetUnitInvulnerable(ef,false)
call SetUnitInvulnerable(Dz,false)
call SetUnitInvulnerable(DY,false)
call SetUnitInvulnerable(eE,false)
endif
if(GetDyingUnit()==D1)then
call SetUnitInvulnerable(ek,false)
call SetUnitInvulnerable(D9,false)
call SetUnitInvulnerable(eG,false)
call SetUnitInvulnerable(eg,false)
call SetUnitInvulnerable(eF,false)
call SetUnitInvulnerable(ef,false)
call SetUnitInvulnerable(eg,false)
call SetUnitInvulnerable(DY,false)
call SetUnitInvulnerable(Dz,false)
call SetUnitInvulnerable(eE,false)
endif
if(H1())then
call SetUnitInvulnerable(Dy,false)
endif
if(H2())then
call SetUnitInvulnerable(Dy,false)
endif
endfunction
function H4 takes nothing returns boolean
if(GetUnitTypeId(GetDyingUnit())=='u00M')then
return true
endif
if(GetUnitTypeId(GetDyingUnit())=='u00D')then
return true
endif
if(GetUnitTypeId(GetDyingUnit())=='u00N')then
return true
endif
if(GetUnitTypeId(GetDyingUnit())=='u00T')then
return true
endif
return false
endfunction
function H5 takes nothing returns boolean
if(not (GetDyingUnit()==eo))then
return false
endif
if(not (IsUnitDeadBJ(eO)))then
return false
endif
return true
endfunction
function H6 takes nothing returns boolean
if(not (GetDyingUnit()==eO))then
return false
endif
if(not (IsUnitDeadBJ(eo)))then
return false
endif
return true
endfunction
function H7 takes nothing returns nothing
if(GetDyingUnit()==eV)then
call SetUnitInvulnerable(DO,false)
endif
if(GetDyingUnit()==D4)then
call SetUnitInvulnerable(Dp,false)
endif
if(GetDyingUnit()==eA)then
call SetUnitInvulnerable(DP,false)
endif
if(GetDyingUnit()==DO)then
call SetUnitInvulnerable(ew,false)
endif
if(GetDyingUnit()==Dp)then
call SetUnitInvulnerable(ej,false)
endif
if(GetDyingUnit()==DP)then
call SetUnitInvulnerable(eJ,false)
endif
if(GetDyingUnit()==ew)then
call SetUnitInvulnerable(eT,false)
call SetUnitInvulnerable(em,false)
call SetUnitInvulnerable(eL,false)
call SetUnitInvulnerable(eq,false)
call SetUnitInvulnerable(eu,false)
call SetUnitInvulnerable(eQ,false)
call SetUnitInvulnerable(eO,false)
call SetUnitInvulnerable(eP,false)
call SetUnitInvulnerable(er,false)
call SetUnitInvulnerable(eo,false)
endif
if(GetDyingUnit()==ej)then
call SetUnitInvulnerable(ep,false)
call SetUnitInvulnerable(eM,false)
call SetUnitInvulnerable(el,false)
call SetUnitInvulnerable(ev,false)
call SetUnitInvulnerable(eR,false)
call SetUnitInvulnerable(er,false)
call SetUnitInvulnerable(eQ,false)
call SetUnitInvulnerable(eO,false)
call SetUnitInvulnerable(eo,false)
endif
if(GetDyingUnit()==eJ)then
call SetUnitInvulnerable(en,false)
call SetUnitInvulnerable(eK,false)
call SetUnitInvulnerable(es,false)
call SetUnitInvulnerable(eR,false)
call SetUnitInvulnerable(eS,false)
call SetUnitInvulnerable(et,false)
call SetUnitInvulnerable(Dx,false)
call SetUnitInvulnerable(eO,false)
call SetUnitInvulnerable(eo,false)
call SetUnitInvulnerable(eQ,false)
endif
if(H5())then
call SetUnitInvulnerable(eN,false)
endif
if(H6())then
call SetUnitInvulnerable(eN,false)
endif
endfunction
function H8 takes nothing returns nothing
call SetPlayerTechResearchedSwap('R007',(GetPlayerTechCountSimple('R007',Al[0])+1),Al[0])
call SetPlayerTechResearchedSwap('R00C',(GetPlayerTechCountSimple('R00C',Al[0])+1),Al[0])
call SetPlayerTechResearchedSwap('R008',(GetPlayerTechCountSimple('R008',Al[0])+1),Al[0])
call SetPlayerTechResearchedSwap('R00D',(GetPlayerTechCountSimple('R00D',Al[0])+1),Al[0])
call SetPlayerTechResearchedSwap('R009',(GetPlayerTechCountSimple('R009',AL[0])+1),AL[0])
call SetPlayerTechResearchedSwap('R003',(GetPlayerTechCountSimple('R003',AL[0])+1),AL[0])
call SetPlayerTechResearchedSwap('R00A',(GetPlayerTechCountSimple('R00A',AL[0])+1),AL[0])
call SetPlayerTechResearchedSwap('R00B',(GetPlayerTechCountSimple('R00B',AL[0])+1),AL[0])
endfunction
function H9 takes nothing returns nothing
local location fr=GetRectCenter(bD)
call SetCreepCampFilterState(false)
call RemoveUnit(CreateUnitAtLoc(Am,'nbdo',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nbds',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'ngst',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nggr',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nbdk',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nbwm',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nogm',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nomg',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nfpc',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nfpu',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nsth',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nstl',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nsat',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nwlg',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nkol',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nkob',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nkot',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'ncnk',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'ncen',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'ngns',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'nftb',fr,bj_UNIT_FACING))
call RemoveUnit(CreateUnitAtLoc(Am,'n00L',fr,bj_UNIT_FACING))
call RemoveLocation(fr)
endfunction
function ia takes nothing returns nothing
if(a3)then
call PolledWait('d')
endif
call EnableTrigger(cj)
call DisableTrigger(cI)
endfunction
function iA takes nothing returns nothing
local integer ib
local group fB
local location fr
set fB=GetUnitsInRectAll(bq)
set fr=GetRectCenter(bD)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,3)
if(ib==1)then
call CreateNUnitsAtLoc(2,'nbdo',Player(12),fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nbds',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(2,'ngst',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nggr',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(2,'nbdk',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nbwm',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bQ)
set fr=GetRectCenter(be)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,3)
if(ib==1)then
call CreateNUnitsAtLoc(2,'nbdo',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nbds',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(2,'ngst',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nggr',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(2,'nbdk',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nbwm',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(br)
set fr=GetRectCenter(bE)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,3)
if(ib==1)then
call CreateNUnitsAtLoc(2,'nogm',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nomg',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(1,'nfpc',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nfpu',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(1,'nsth',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nstl',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nsat',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bR)
set fr=GetRectCenter(bf)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,3)
if(ib==1)then
call CreateNUnitsAtLoc(2,'nogm',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nomg',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(1,'nfpc',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nfpu',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(1,'nsth',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nstl',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nsat',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bs)
set fr=GetRectCenter(bF)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,6)
if(ib==1)then
call CreateNUnitsAtLoc(3,'nwlg',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(2,'nstl',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(2,'nsat',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(2,'ngst',Am,fr,bj_UNIT_FACING)
endif
if(ib==4)then
call CreateNUnitsAtLoc(1,'nkol',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(3,'nkob',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nkot',Am,fr,bj_UNIT_FACING)
endif
if(ib==5)then
call CreateNUnitsAtLoc(2,'nftb',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nfsh',Am,fr,bj_UNIT_FACING)
endif
if(ib==6)then
call CreateNUnitsAtLoc(1,'ncnk',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'ncen',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bS)
set fr=GetRectCenter(bg)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,6)
if(ib==1)then
call CreateNUnitsAtLoc(3,'nwlg',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(2,'nstl',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(2,'nsat',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(2,'ngst',Am,fr,bj_UNIT_FACING)
endif
if(ib==4)then
call CreateNUnitsAtLoc(1,'nkol',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(3,'nkob',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nkot',Am,fr,bj_UNIT_FACING)
endif
if(ib==5)then
call CreateNUnitsAtLoc(2,'nftb',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nfsh',Am,fr,bj_UNIT_FACING)
endif
if(ib==6)then
call CreateNUnitsAtLoc(1,'ncnk',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'ncen',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bt)
set fr=GetRectCenter(bG)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,6)
if(ib==1)then
call CreateNUnitsAtLoc(3,'nwlg',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(2,'nstl',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(2,'nsat',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(2,'ngst',Am,fr,bj_UNIT_FACING)
endif
if(ib==4)then
call CreateNUnitsAtLoc(1,'nkol',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(3,'nkob',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nkot',Am,fr,bj_UNIT_FACING)
endif
if(ib==5)then
call CreateNUnitsAtLoc(2,'nftb',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nfsh',Am,fr,bj_UNIT_FACING)
endif
if(ib==6)then
call CreateNUnitsAtLoc(1,'ncnk',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'ncen',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bu)
set fr=GetRectCenter(bh)
if(CountUnitsInGroup(fB)==0)then
set ib=GetRandomInt(1,6)
if(ib==1)then
call CreateNUnitsAtLoc(3,'nwlg',Am,fr,bj_UNIT_FACING)
endif
if(ib==2)then
call CreateNUnitsAtLoc(2,'nstl',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(2,'nsat',Am,fr,bj_UNIT_FACING)
endif
if(ib==3)then
call CreateNUnitsAtLoc(2,'ngst',Am,fr,bj_UNIT_FACING)
endif
if(ib==4)then
call CreateNUnitsAtLoc(1,'nkol',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(3,'nkob',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nkot',Am,fr,bj_UNIT_FACING)
endif
if(ib==5)then
call CreateNUnitsAtLoc(2,'nftb',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nfsh',Am,fr,bj_UNIT_FACING)
endif
if(ib==6)then
call CreateNUnitsAtLoc(1,'ncnk',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'ncen',Am,fr,bj_UNIT_FACING)
endif
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bT)
set fr=GetRectCenter(bH)
if(CountUnitsInGroup(fB)==0)then
call CreateNUnitsAtLoc(3,'ngns',Am,fr,bj_UNIT_FACING)
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
set fB=GetUnitsInRectAll(bU)
set fr=GetRectCenter(bi)
if(CountUnitsInGroup(fB)==0)then
call CreateNUnitsAtLoc(2,'nftb',Am,fr,bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'nkol',Am,fr,bj_UNIT_FACING)
endif
call DestroyGroup(fB)
call RemoveLocation(fr)
endfunction
function iB takes nothing returns nothing
local integer Eg=GetRandomInt(1,9)
if(Eg==1)then
call CreateNUnitsAtLoc(1,'n00F',Al[0],av,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffSiege Golem|r has spawned for the |c00ff0000Sentinel|r and is taking the east path!")
endif
if(Eg==2)then
call CreateNUnitsAtLoc(1,'n00F',Al[0],aV,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffSiege Golem|r has spawned for the |c00ff0000Sentinel|r and is taking the west path!")
endif
if(Eg==3)then
call CreateNUnitsAtLoc(1,'n00F',Al[0],aU,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffSiege Golem|r has spawned for the |c00ff0000Sentinel|r and is taking the middle path!")
endif
if(Eg==4)then
call CreateNUnitsAtLoc(1,'n00E',Al[0],av,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffScary Fish|r has spawned for the |c00ff0000Sentinel|r and is taking the east path!")
endif
if(Eg==5)then
call CreateNUnitsAtLoc(1,'n00E',Al[0],aV,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffScary Fish|r has spawned for the |c00ff0000Sentinel|r and is taking the west path!")
endif
if(Eg==6)then
call CreateNUnitsAtLoc(1,'n00E',Al[0],aU,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffScary Fish|r has spawned for the |c00ff0000Sentinel|r and is taking the middle path!")
endif
if(Eg==7)then
call CreateNUnitsAtLoc(1,'n00D',Al[0],av,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"An |c000000ffAncient Hydra|r has spawned for the |c00ff0000Sentinel|r and is taking the east path!")
endif
if(Eg==8)then
call CreateNUnitsAtLoc(1,'n00D',Al[0],aV,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"An |c000000ffAncient Hydra|r has spawned for the |c00ff0000Sentinel|r and is taking the west path!")
endif
if(Eg==9)then
call CreateNUnitsAtLoc(1,'n00D',Al[0],aU,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"An |c000000ffAncient Hydra|r has spawned for the |c00ff0000Sentinel|r and is taking the middle path!")
endif
set Eg=GetRandomInt(1,9)
if(Eg==1)then
call CreateNUnitsAtLoc(1,'n00F',AL[0],as,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffSiege Golem|r has spawned for the |c00004000Scourge|r and is taking the east path!")
endif
if(Eg==2)then
call CreateNUnitsAtLoc(1,'n00F',AL[0],aS,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffSiege Golem|r has spawned for the |c00004000Scourge|r and is taking the west path!")
endif
if(Eg==3)then
call CreateNUnitsAtLoc(1,'n00F',AL[0],aR,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffSiege Golem|r has spawned for the |c00004000Scourge|r and is taking the middle path!")
endif
if(Eg==4)then
call CreateNUnitsAtLoc(1,'n00E',AL[0],as,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffScary Fish|r has spawned for the |c00004000Scourge|r and is taking the east path!")
endif
if(Eg==5)then
call CreateNUnitsAtLoc(1,'n00E',AL[0],aS,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffScary Fish|r has spawned for the |c00004000Scourge|r and is taking the west path!")
endif
if(Eg==6)then
call CreateNUnitsAtLoc(1,'n00E',AL[0],aR,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"A |c000000ffScary Fish|r has spawned for the |c00004000Scourge|r and is taking the middle path!")
endif
if(Eg==7)then
call CreateNUnitsAtLoc(1,'n00D',AL[0],as,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"An |c000000ffAncient Hydra|r has spawned for the |c00004000Scourge|r and is taking the east path!")
endif
if(Eg==8)then
call CreateNUnitsAtLoc(1,'n00D',AL[0],aS,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"An |c000000ffAncient Hydra|r has spawned for the |c00004000Scourge|r and is taking the west path!")
endif
if(Eg==9)then
call CreateNUnitsAtLoc(1,'n00D',AL[0],aR,bj_UNIT_FACING)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,"An |c000000ffAncient Hydra|r has spawned for the |c00004000Scourge|r and is taking the middle path!")
endif
endfunction
function ic takes nothing returns boolean
if(GetItemTypeId(GetManipulatedItem())!='olig')then
return false
endif
return true
endfunction
function iC takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location id
if(eZ(GetOwningPlayer(EN)))then
set id=GetRectCenter(A9)
else
set id=GetRectCenter(A2)
endif
call PolledWait(3.)
call PanCameraToTimedLocForPlayer(GetOwningPlayer(EN),id,1.)
call SetUnitPositionLoc(EN,id)
call RemoveLocation(id)
endfunction
function iD takes nothing returns boolean
if(not (GetSpellAbilityId()=='ACch'))then
return false
endif
return true
endfunction
function ie takes nothing returns nothing
call UnitApplyTimedLifeBJ(1200.,'BTLF',GetSpellTargetUnit())
call UnitAddAbility(GetSpellTargetUnit(),'Aeth')
endfunction
function iE takes nothing returns boolean
if(GetSpellAbilityId()!='A02W')then
return false
endif
return true
endfunction
function iF takes nothing returns nothing
call UnitResetCooldown(GetTriggerUnit())
endfunction
function ig takes nothing returns boolean
if(not (GetUnitTypeId(GetTriggerUnit())=='n00J'))then
return false
endif
if(IsUnitType(GetKillingUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
return true
endfunction
function iG takes nothing returns nothing
call UnitDamageTargetBJ(GetDyingUnit(),GetKillingUnit(),200.,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
endfunction
function ih takes nothing returns boolean
if(not (GetUnitTypeId(GetTriggerUnit())=='n00A'))then
return false
endif
if(IsUnitType(GetKillingUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
return true
endfunction
function iH takes nothing returns nothing
call UnitDamageTargetBJ(GetDyingUnit(),GetKillingUnit(),400.,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
endfunction
function ii takes nothing returns boolean
if(not (GetUnitTypeId(GetTriggerUnit())=='n006'))then
return false
endif
if(IsUnitType(GetKillingUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
return true
endfunction
function iI takes nothing returns nothing
call UnitDamageTargetBJ(GetDyingUnit(),GetKillingUnit(),600.,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
endfunction
function ij takes nothing returns boolean
if(GetSpellAbilityId()=='A0HB')then
return true
endif
if(GetSpellAbilityId()=='A0D3')then
return true
endif
if(GetSpellAbilityId()=='A0DF')then
return true
endif
return false
endfunction
function Trig_MultipleNecro_Func001002001 takes nothing returns boolean
return(GetUnitTypeId(GetEnumUnit())=='n00H')
endfunction
function iJ takes nothing returns nothing
if((GetUnitTypeId(GetEnumUnit())=='n00H') or (GetUnitTypeId(GetEnumUnit())=='n00G') or (GetUnitTypeId(GetEnumUnit())=='n00K') or (GetUnitTypeId(GetEnumUnit())=='n00J') or (GetUnitTypeId(GetEnumUnit())=='n00A') or (GetUnitTypeId(GetEnumUnit())=='n006'))then
call RemoveUnit(GetEnumUnit())
endif
endfunction
function ik takes nothing returns nothing
local group fB=GetUnitsOfPlayerAll(GetOwningPlayer(GetTriggerUnit()))
call ForGroupBJ(fB,function iJ)
call DestroyGroup(fB)
endfunction
function iK takes nothing returns boolean
if(GetItemTypeId(GetManipulatedItem())!='I007')then
return false
endif
return true
endfunction
function il takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location fr=GetUnitLoc(EN)
local unit h2
set h2=CreateUnitAtLoc(GetOwningPlayer(EN),'e00C',fr,bj_UNIT_FACING)
call UnitAddAbility(h2,'A0GR')
call UnitApplyTimedLifeBJ(2.,'BTLF',h2)
call IssueTargetOrderById(h2,852274,EN)
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
call RemoveLocation(fr)
endfunction
function iL takes nothing returns nothing
set P=GetEnumItem()
endfunction
function im takes nothing returns nothing
local integer Eg=GetRandomInt(1,10)
set P=null
call EnumItemsInRectBJ(bd,function iL)
if(P==null)then
set G[1]=true
else
set G[1]=false
endif
set P=null
call EnumItemsInRectBJ(bB,function iL)
if(P==null)then
set G[2]=true
else
set G[2]=false
endif
if(G[1] and G[2])then
if(Eg==1)then
call CreateItemLoc('fgrd',aw)
endif
if(Eg==2)then
call CreateItemLoc('pres',aw)
endif
if(Eg==3)then
call CreateItemLoc('pomn',aw)
endif
if(Eg==4)then
call CreateItemLoc('pnvu',aw)
endif
if(Eg==5)then
call CreateItemLoc('fgrd',aW)
endif
if(Eg==6)then
call CreateItemLoc('pres',aW)
endif
if(Eg==7)then
call CreateItemLoc('pomn',aW)
endif
if(Eg==8)then
call CreateItemLoc('pnvu',aW)
endif
if(Eg==9)then
call CreateItemLoc('I007',aw)
endif
if(Eg==10)then
call CreateItemLoc('I007',aW)
endif
set G[1]=false
set G[2]=false
endif
endfunction
function iM takes nothing returns nothing
local integer in=GetItemTypeId(GetManipulatedItem())
local unit EN=GetTriggerUnit()
if(in=='tsct')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'tsct'))
call UnitAddItemByIdSwapped('mcri',EN)
endif
if(in=='tst2')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'tst2'))
call UnitAddItemByIdSwapped('vddl',EN)
endif
if(in=='tpow')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'tpow'))
call UnitAddItemByIdSwapped('tstr',EN)
endif
if(in=='tint')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'tint'))
call UnitAddItemByIdSwapped('tin2',EN)
endif
if(in=='tdx2')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'tdx2'))
call UnitAddItemByIdSwapped('texp',EN)
endif
if(in=='rwat')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rwat'))
call UnitAddItemByIdSwapped('tdex',EN)
endif
if(in=='rspd')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rspd'))
call UnitAddItemByIdSwapped('rspl',EN)
endif
if(in=='rres')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rres'))
call UnitAddItemByIdSwapped('rsps',EN)
endif
if(in=='rman')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rman'))
call UnitAddItemByIdSwapped('rreb',EN)
endif
if(in=='rhe1')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rhe1'))
call UnitAddItemByIdSwapped('rre1',EN)
endif
if(in=='rre2')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rre2'))
call UnitAddItemByIdSwapped('rhe2',EN)
endif
if(in=='rhe3')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rhe3'))
call UnitAddItemByIdSwapped('rma2',EN)
endif
if(in=='manh')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'manh'))
call UnitAddItemByIdSwapped('rdis',EN)
endif
if(in=='guvi')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'guvi'))
call UnitAddItemByIdSwapped('gold',EN)
endif
if(in=='gfor')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'gfor'))
call UnitAddItemByIdSwapped('gomn',EN)
endif
if(in=='lmbr')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'lmbr'))
call UnitAddItemByIdSwapped('ward',EN)
endif
if(in=='evtl')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'evtl'))
call UnitAddItemByIdSwapped('lhst',EN)
endif
if(in=='ssil')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'ssil'))
call UnitAddItemByIdSwapped('stel',EN)
endif
if(in=='rag1')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rag1'))
call UnitAddItemByIdSwapped('rwiz',EN)
endif
if(in=='brac')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'brac'))
call UnitAddItemByIdSwapped('sbch',EN)
endif
if(in=='rde3')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rde3'))
call UnitAddItemByIdSwapped('rlif',EN)
endif
if(in=='rde1')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rde1'))
call UnitAddItemByIdSwapped('rde2',EN)
endif
if(in=='pmna')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'pmna'))
call UnitAddItemByIdSwapped('prvt',EN)
endif
if(in=='odef')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'odef'))
call UnitAddItemByIdSwapped('penr',EN)
endif
if(in=='rin1')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rin1'))
call UnitAddItemByIdSwapped('mcou',EN)
endif
if(in=='kpin')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'kpin'))
call UnitAddItemByIdSwapped('lgdh',EN)
endif
if(in=='hcun')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'hcun'))
call UnitAddItemByIdSwapped('rhth',EN)
endif
if(in=='gcel')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'gcel'))
call UnitAddItemByIdSwapped('hval',EN)
endif
if(in=='dsum')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'dsum'))
call UnitAddItemByIdSwapped('rst1',EN)
endif
if(in=='clsd')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'clsd'))
call UnitAddItemByIdSwapped('crys',EN)
endif
if(in=='rat9')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'rat9'))
call UnitAddItemByIdSwapped('clfm',EN)
endif
if(in=='cnob')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'cnob'))
call UnitAddItemByIdSwapped('ratc',EN)
endif
if(in=='ajen')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'ajen'))
call UnitAddItemByIdSwapped('bspd',EN)
endif
if(in=='afac')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'afac'))
call UnitAddItemByIdSwapped('spsh',EN)
endif
if(in=='wlsd')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'wlsd'))
call UnitAddItemByIdSwapped('wcyc',EN)
endif
if(in=='woms')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'woms'))
call UnitAddItemByIdSwapped('wshs',EN)
endif
if(in=='totw')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'totw'))
call UnitAddItemByIdSwapped('will',EN)
endif
if(in=='fgfh')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'fgfh'))
call UnitAddItemByIdSwapped('fgrg',EN)
endif
if(in=='sres')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'sres'))
call UnitAddItemByIdSwapped('srrc',EN)
endif
if(in=='I003')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'I003'))
call UnitAddItemByIdSwapped('sand',EN)
endif
if(in=='pghe')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'pghe'))
call UnitAddItemByIdSwapped('pgma',EN)
endif
if(in=='shar')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'shar'))
call UnitAddItemByIdSwapped('infs',EN)
endif
if(in=='hslv')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'hslv'))
call UnitAddItemByIdSwapped('pclr',EN)
endif
if(in=='moon')then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'moon'))
call UnitAddItemByIdSwapped('pinv',EN)
endif
endfunction
function iN takes unit EN,integer ff,integer fF,integer fg,integer fG,integer io,integer iO returns boolean
local effect ip
if(iO==2)then
if(UnitHasItemOfTypeBJ(EN,ff))then
if(UnitHasItemOfTypeBJ(EN,fF))then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,ff))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,fF))
set ip=AddSpecialEffectTargetUnitBJ("origin",EN,"Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl")
call UnitAddItemById(EN,io)
call DestroyEffect(ip)
return true
endif
endif
endif
if(iO==3)then
if(UnitHasItemOfTypeBJ(EN,ff))then
if(UnitHasItemOfTypeBJ(EN,fF))then
if(UnitHasItemOfTypeBJ(EN,fg))then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,ff))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,fF))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,fg))
set ip=AddSpecialEffectTargetUnitBJ("origin",EN,"Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl")
call UnitAddItemById(EN,io)
call DestroyEffect(ip)
return true
endif
endif
endif
endif
if(iO==4)then
if(UnitHasItemOfTypeBJ(EN,ff))then
if(UnitHasItemOfTypeBJ(EN,fF))then
if(UnitHasItemOfTypeBJ(EN,fg))then
if(UnitHasItemOfTypeBJ(EN,fG))then
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,ff))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,fF))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,fg))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,fG))
set ip=AddSpecialEffectTargetUnitBJ("origin",EN,"Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl")
call UnitAddItemById(EN,io)
call DestroyEffect(ip)
return true
endif
endif
endif
endif
endif
return false
endfunction
function iP takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer EA=1
local integer Eb=az
loop
exitwhen EA>Eb
if(iN(EN,ax[EA],aX[EA],ay[EA],aY[EA],aZ[EA],a1[EA]))then
set EA=Eb+1
endif
set EA=EA+1
endloop
endfunction
function iq takes nothing returns nothing
local unit EN=GetTriggerUnit()
local item iQ=GetManipulatedItem()
local integer ir=GetUnitTypeId(EN)
local integer iR=GetItemTypeId(iQ)
if(IsUnitType(EN,UNIT_TYPE_MELEE_ATTACKER))then
if(iR=='thdm')then
call RemoveItem(GetManipulatedItem())
call UnitAddItemByIdSwapped('tbak',EN)
endif
if(iR=='ocor')then
call RemoveItem(GetManipulatedItem())
call UnitAddItemByIdSwapped('nspi',EN)
endif
else
if(iR=='tbak')then
call RemoveItem(GetManipulatedItem())
call UnitAddItemByIdSwapped('thdm',EN)
endif
if(iR=='nspi')then
call RemoveItem(GetManipulatedItem())
call UnitAddItemByIdSwapped('ocor',EN)
endif
endif
if(ir=='Hvwd' or ir=='U00F')then
if(iR=='desc')then
call DisplayTimedTextToPlayer(GetOwningPlayer(EN),0,0,10,"|c00ff0303Your hero is not allowed to wield this item|r")
call PolledWait(3.)
call UnitRemoveItem(EN,iQ)
endif
endif
if(ir=='U007')then
if(iR=='ofro')then
call DisplayTimedTextToPlayer(GetOwningPlayer(EN),0,0,10,"|c00ff0303Do not use two avatars in right after each other, there is a warcraft engine bug with this.|r")
endif
endif
endfunction
function is takes nothing returns boolean
if(UnitHasItemOfTypeBJ(GetTriggerUnit(),'ram2')==false)then
return false
endif
if(UnitHasItemOfTypeBJ(GetTriggerUnit(),'oslo')==false)then
return false
endif
if((GetUnitTypeId(GetTriggerUnit())=='Hjai'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Emns'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='UC18'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='H00H'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Orkn'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='H004'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Ekee'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Ulic'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Hmbr'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='UC01'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='EC57'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Hmkg'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Hblm'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='U00E'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='E005'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='Hmkg'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='E01A'))then
return true
endif
return false
endfunction
function iS takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer ir=GetUnitTypeId(EN)
local effect ip=AddSpecialEffectTargetUnitBJ("origin",EN,"Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl")
call DestroyEffect(ip)
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'ram2'))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'oslo'))
if(ir=='Ulic' or ir=='Ekee' or ir=='UC18')then
call UnitAddItemByIdSwapped('sor3',EN)
endif
if(ir=='H00H' or ir=='Emns' or ir=='H004' or ir=='Hmbr')then
call UnitAddItemByIdSwapped('sor4',EN)
endif
if(ir=='Hjai' or ir=='Orkn' or ir=='UC01' or ir=='EC57')then
call UnitAddItemByIdSwapped('sor5',EN)
endif
if(ir=='Hblm' or ir=='U00E' or ir=='E005' or ir=='E01A')then
call UnitAddItemByIdSwapped('sor6',EN)
endif
if(GetUnitTypeId(GetTriggerUnit())=='Hmkg')then
call UnitAddItemByIdSwapped('sor6',GetTriggerUnit())
call ET(EQ(GetOwningPlayer(EN)),"MulticastLevel",E0(EQ(GetOwningPlayer(EN)),"MulticastLevel")+1)
endif
endfunction
function iT takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer EA=1
local integer Eb=6
local integer iu=0
local effect ip
loop
exitwhen EA>Eb
if(GetItemTypeId(UnitItemInSlotBJ(EN,EA))=='flag')then
set iu=iu+1
endif
set EA=EA+1
endloop
if(iu>1 and UnitHasItemOfTypeBJ(EN,'will'))then
set ip=AddSpecialEffectTargetUnitBJ("overhead",EN,"Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl")
call DestroyEffect(ip)
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'will'))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'flag'))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'flag'))
call UnitAddItemByIdSwapped('tels',EN)
endif
set iu=0
set EA=1
loop
exitwhen EA>Eb
if(GetItemTypeId(UnitItemInSlotBJ(EN,EA))=='gvsm')then
set iu=iu+1
endif
set EA=EA+1
endloop
if(iu>1 and UnitHasItemOfTypeBJ(EN,'hbth') and UnitHasItemOfTypeBJ(EN,'ward'))then
set ip=AddSpecialEffectTargetUnitBJ("origin",EN,"Abilities\\Spells\\Items\\AIem\\AIemTarget.mdl")
call DestroyEffect(ip)
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'hbth'))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'ward'))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'gvsm'))
call RemoveItem(GetItemOfTypeFromUnitBJ(EN,'gvsm'))
call UnitAddItemByIdSwapped('thdm',EN)
endif
endfunction
function iU takes nothing returns boolean
if(GetItemTypeId(GetManipulatedItem())=='horl')then
set Z=30.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='oven')then
set Z=210
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='mnst')then
set Z=45.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='I002')then
set Z=60.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='ches')then
set Z=60.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='pdiv')then
set Z=100.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='I001')then
set Z=60.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='bfhr')then
set Z=20.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='wswd')then
set Z=12.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='rej2')then
set Z=3
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='lnrn')then
set Z=40.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='spre')then
set Z=13.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='rots')then
set Z=300.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='tlum')then
set Z=60.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='sfog')then
set Z=15.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='mnsf')then
set Z=40.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='stwp')then
set Z=65.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='schl')then
set Z=70.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='rej1')then
set Z=40.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='kybl')then
set Z=120.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='rej5')then
set Z=40.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='ccmd')then
set Z=26.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='mlst')then
set Z=40.
return true
endif
if(GetItemTypeId(GetManipulatedItem())=='desc')then
set Z=25.
return true
endif
return false
endfunction
function iv takes nothing returns nothing
local integer EA=1
local integer Eb=6
local integer iV=GetItemTypeId(GetManipulatedItem())
local unit iw=GetManipulatingUnit()
loop
exitwhen EA>Eb
set aa=UnitItemInSlotBJ(iw,EA)
if(GetItemTypeId(aa)==iV)then
set aA=(aA+1)
set ab[aA]=Z
set aB[aA]=aa
call SetItemDroppable(aa,false)
endif
set EA=EA+1
endloop
endfunction
function iW takes nothing returns nothing
local integer EA=2
local integer Eb=aA
if(aA>0 and ab[1]<1.)then
loop
exitwhen EA>Eb
set ab[EA-1]=ab[EA]
set aB[EA-1]=aB[EA]
set EA=EA+1
endloop
set aA=aA-1
endif
set EA=1
set Eb=aA
loop
exitwhen EA>Eb
if(ab[EA]>=1.)then
set ab[EA]=ab[EA]-1
if(ab[EA]<1.)then
call SetItemDroppable(aB[EA],true)
endif
endif
set EA=EA+1
endloop
endfunction
function ix takes unit iX returns location
return AW[GetUnitAbilityLevel(iX,Aw)]
endfunction
function iy takes unit iX returns boolean
return(GetOwningPlayer(iX)==Al[0]) or (GetOwningPlayer(iX)==AL[0])
endfunction
function iY takes unit iX returns boolean
if(GetOwningPlayer(iX)==Al[0])then
return true
endif
return false
endfunction
function iz takes unit iX returns unit
return GetUnitUserData(iX)
return null
endfunction
function iZ takes unit iX returns nothing
call SetUnitUserData(iX,0)
call IssuePointOrderByIdLoc(iX,851983,ix(iX))
endfunction
function i0 takes nothing returns nothing
call iZ(GetEnumUnit())
endfunction
function i1 takes group Hq returns nothing
call ForGroup(Hq,function i0)
call GroupClear(Hq)
endfunction
function i2 takes nothing returns nothing
call IssueTargetOrderById(GetEnumUnit(),851983,Ar)
call GroupAddUnit(AY,GetEnumUnit())
call SetUnitUserData(GetEnumUnit(),Eq(Ar))
endfunction
function i3 takes nothing returns nothing
local unit u=GetEnumUnit()
if GetUnitCurrentOrder(u)==0 or not IsUnitInRange(u,Ar,GetUnitAcquireRange(u))then
call GroupRemoveUnit(AY,u)
call SetUnitUserData(u,0)
call IssuePointOrderByIdLoc(u,851983,ix(u))
endif
endfunction
function i4 takes unit iX,unit i5 returns boolean
if IsUnitEnemy(iX,GetOwningPlayer(i5))then
if GetOwningPlayer(iX)==Al[0] or GetOwningPlayer(iX)==AL[0] then
if(GetUnitUserData(iX)==0)then
return true
endif
endif
endif
return false
endfunction
function i6 takes nothing returns boolean
return i4(GetFilterUnit(),Ar)
endfunction
function i7 takes nothing returns nothing
local unit fS=Ew(EQ(GetExpiredTimer()),"Hero")
local string Go=EQ(fS)
call Es(Go,"Attacker",null)
call i1(Ey(Go,"Defenders"))
endfunction
function i8 takes unit fS,unit i9 returns boolean
local unit Ia
if IsUnitEnemy(i9,GetOwningPlayer(fS))then
set Ia=Ew(EQ(fS),"Attacker")
if Ia==null or Ia==i9 or not IsUnitAliveBJ(Ia)then
return true
endif
endif
return false
endfunction
function IA takes unit fS,unit i9 returns nothing
local string Go=EQ(fS)
local group Ib=Ey(Go,"Defenders")
local unit Ia=Ew(Go,"Attacker")
local boolexpr b
local group g
if(Ia!=i9) and (Ia!=null)then
call i1(Ib)
endif
call Es(Go,"Attacker",i9)
set AY=Ib
set Ar=i9
call ForGroup(Ib,function i3)
set b=Filter(function i6)
set g=CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(i9),GetUnitY(i9),500,b)
call ForGroup(g,function i2)
call DestroyGroup(g)
call DestroyBoolExpr(b)
call TimerStart(Ex(Go,"DefendTimer"),2,false,function i7)
endfunction
function IB takes nothing returns boolean
return i8(GetTriggerUnit(),GetAttacker())
endfunction
function Ic takes nothing returns nothing
call IA(GetTriggerUnit(),GetAttacker())
endfunction
function IC takes nothing returns boolean
if IsUnitType(GetOrderTargetUnit(),UNIT_TYPE_HERO) and not IsUnitIllusion(GetOrderTargetUnit())then
if GetIssuedOrderId()==851983 or GetIssuedOrderId()==851971 then
if IsUnitVisible(GetTriggerUnit(),GetOwningPlayer(GetOrderTargetUnit()))then
return i8(GetOrderTargetUnit(),GetTriggerUnit())
endif
endif
endif
return false
endfunction
function Id takes nothing returns nothing
call IA(GetOrderTargetUnit(),GetTriggerUnit())
endfunction
function Ie takes unit fS returns boolean
return E3(EQ(fS),"HeroAIManager")
endfunction
function IE takes unit fS returns nothing
local group g
local trigger t
local timer tm
local string Go=EQ(fS)
call EV(Go,"HeroAIManager",true)
set g=CreateGroup()
call Es(Go,"Defenders",g)
set t=CreateTrigger()
call Es(Go,"OnAttackOrder",t)
call TriggerRegisterUnitEvent(t,fS,EVENT_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(t,Condition(function IC))
call TriggerAddAction(t,function Id)
set t=CreateTrigger()
call Es(Go,"OnAttacked",t)
call TriggerRegisterUnitEvent(t,fS,EVENT_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function IB))
call TriggerAddAction(t,function Ic)
set tm=CreateTimer()
call Es(EQ(fS),"DefendTimer",tm)
call Es(EQ(tm),"Hero",fS)
endfunction
function If takes nothing returns boolean
return IsUnitFogged(GetAttacker(),Al[1]) or IsUnitFogged(GetAttacker(),AL[1])
endfunction
function IF takes nothing returns nothing
local unit Ig=GetAttacker()
local fogmodifier IG
local boolean b=false
if IsUnitAlly(GetTriggerUnit(),Al[0])then
set IG=CreateFogModifierRadius(Al[1],FOG_OF_WAR_VISIBLE,GetUnitX(Ig),GetUnitY(Ig),128,true,false)
elseif IsUnitAlly(GetTriggerUnit(),AL[0])then
set IG=CreateFogModifierRadius(AL[1],FOG_OF_WAR_VISIBLE,GetUnitX(Ig),GetUnitY(Ig),128,true,false)
endif
call FogModifierStart(IG)
call PolledWait(1)
call FogModifierStop(IG)
call DestroyFogModifier(IG)
set IG=null
endfunction
function Ih takes nothing returns boolean
return GetIssuedOrderId()==851986
endfunction
function IH takes nothing returns nothing
local unit Ii=GetTriggerUnit()
local unit h3=iz(Ii)
call SetUnitPosition(Ii,GetUnitX(Ii),GetUnitY(Ii))
if h3==null or not IsUnitVisible(h3,GetOwningPlayer(h3))then
call DisableTrigger(GetTriggeringTrigger())
call IssuePointOrderByIdLoc(Ii,851983,ix(Ii))
call EnableTrigger(GetTriggeringTrigger())
else
call IssueTargetOrderById(Ii,851983,iz(Ii))
endif
endfunction
function Ij takes nothing returns boolean
return iy(GetTriggerUnit())
endfunction
function IJ takes nothing returns nothing
local unit Ii=GetTriggerUnit()
local unit h3=iz(Ii)
call SetUnitPosition(Ii,GetUnitX(Ii),GetUnitY(Ii))
if h3==null or not IsUnitVisible(h3,GetOwningPlayer(h3))then
call DisableTrigger(GetTriggeringTrigger())
call IssuePointOrderByIdLoc(Ii,851983,ix(Ii))
call EnableTrigger(GetTriggeringTrigger())
else
call IssueTargetOrderById(Ii,851983,iz(Ii))
endif
endfunction
function Ik takes nothing returns nothing
local trigger t
local group g
local unit u
call PolledWait(.01)
if Az then
set t=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(t,Al[0],EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
call TriggerRegisterPlayerUnitEvent(t,AL[0],EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER,null)
call TriggerAddCondition(t,Condition(function Ih))
call TriggerAddAction(t,function IH)
set t=CreateTrigger()
set g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,Al[0],null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
if GetUnitAcquireRange(u)!=0 then
call TriggerRegisterUnitInRange(t,u,600,null)
endif
endloop
call DestroyGroup(g)
set g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,AL[0],null)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
if GetUnitAcquireRange(u)!=0 and IsUnitType(u,UNIT_TYPE_STRUCTURE)then
call TriggerRegisterUnitInRange(t,u,600,null)
endif
endloop
call DestroyGroup(g)
call TriggerAddCondition(t,Condition(function Ij))
call TriggerAddAction(t,function IJ)
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function If))
call TriggerAddAction(t,function IF)
endif
endfunction
function IK takes nothing returns boolean
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) and not IsUnitIllusion(GetTriggerUnit())then
if not Ie(GetTriggerUnit())then
return true
endif
endif
return false
endfunction
function Il takes nothing returns nothing
call IE(GetTriggerUnit())
endfunction
function IL takes nothing returns boolean
return iy(GetTriggerUnit())
endfunction
function Im takes nothing returns nothing
if iY(GetTriggerUnit())then
call SetUnitAbilityLevel(GetTriggerUnit(),Aw,5)
else
call SetUnitAbilityLevel(GetTriggerUnit(),Aw,1)
endif
if(iz(GetTriggerUnit())==null)then
call iZ(GetTriggerUnit())
endif
endfunction
function IM takes nothing returns boolean
if(j[GetPlayerId(GetTriggerPlayer())])then
return false
endif
if(a2[GetPlayerId(GetTriggerPlayer())]==null)then
return false
endif
if(F)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Too late to repick.")
return false
endif
if(GetPlayerState(GetTriggerPlayer(),PLAYER_STATE_RESOURCE_GOLD)<ae)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Not enough gold to repick.")
return false
endif
return true
endfunction
function In takes nothing returns nothing
if(IsUnitType(GetEnumUnit(),UNIT_TYPE_HERO))then
if(GetUnitTypeId(GetEnumUnit())=='U006')then
call ExecuteFunc("Gn")
endif
call DisplayTimedTextToForce(GetPlayersEnemies(GetTriggerPlayer()),10.,"An enemy player has repicked "+GetUnitName(GetEnumUnit())+".")
call RemoveUnit(GetEnumUnit())
endif
if(GetUnitTypeId(GetEnumUnit())=='n004')then
call RemoveUnit(GetEnumUnit())
endif
if(GetUnitTypeId(GetEnumUnit())=='n018')then
call RemoveUnit(GetEnumUnit())
endif
if(GetUnitTypeId(GetEnumUnit())=='n01C')then
call RemoveUnit(GetEnumUnit())
endif
if(GetUnitTypeId(GetEnumUnit())=='n01G')then
call RemoveUnit(GetEnumUnit())
endif
endfunction
function IN takes nothing returns nothing
local player e3=GetTriggerPlayer()
local group fB=GetUnitsInRectOfPlayer(GetWorldBounds(),e3)
local integer Io
local integer IO
local location id
local unit RepickedUnit
local integer Eg
if(eZ(e3))then
set Io=V
set IO=W
set id=GetRectCenter(bC)
else
set Io=X
set IO=Y
set id=GetRectCenter(bc)
endif
if((T) or (s))then
if(GetRandomInt(1,2)==1)then
set Io=V
set IO=W
else
set Io=X
set IO=Y
endif
endif
call AdjustPlayerStateBJ(-1*ae,e3,PLAYER_STATE_RESOURCE_GOLD)
set j[GetPlayerId(e3)]=true
call ForGroup(fB,function In)
set a2[GetPlayerId(GetTriggerPlayer())]=null
loop
call PolledWait(.01)
set Eg=GetRandomInt(Io,IO)
if(B[Eg]==false)then
set B[Eg]=true
set a2[GetPlayerId(e3)]=CreateUnitAtLoc(e3,k[Eg],id,bj_UNIT_FACING)
call e8(k[Eg])
endif
exitwhen a2[GetPlayerId(GetTriggerPlayer())]!=null
endloop
call DestroyGroup(fB)
call RemoveLocation(id)
endfunction
function Ip takes nothing returns boolean
if(ad[GetPlayerId(GetTriggerPlayer())])then
return false
endif
if(H==false)then
return false
endif
if(a2[GetPlayerId(GetTriggerPlayer())]!=null)then
return false
endif
return true
endfunction
function IP takes nothing returns nothing
local player e3=GetTriggerPlayer()
local integer Io
local integer IO
local location id
local integer Eg
if(eZ(e3))then
set Io=V
set IO=W
set id=GetRectCenter(bC)
else
set Io=X
set IO=Y
set id=GetRectCenter(bc)
endif
if((T) or (s))then
if(GetRandomInt(1,2)==1)then
set Io=V
set IO=W
else
set Io=X
set IO=Y
endif
endif
set ad[GetPlayerId(e3)]=true
call Ea(e3)
if(a2[GetPlayerId(e3)]==null)then
loop
call PolledWait(.01)
set Eg=GetRandomInt(Io,IO)
if((B[Eg]==false) and a2[GetPlayerId(e3)]==null)then
call e9(k[Eg])
call PolledWait(.01)
if(B[Eg]==false)then
set B[Eg]=true
set a2[GetPlayerId(e3)]=CreateUnitAtLoc(e3,k[Eg],id,bj_UNIT_FACING)
endif
endif
exitwhen a2[GetPlayerId(e3)]!=null
endloop
endif
call RemoveLocation(id)
endfunction
function Iq takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function IQ takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='n00C')
endfunction
function Ir takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function IR takes nothing returns nothing
local location Is=GetRectCenter(bI)
local location IS=GetRectCenter(bj)
local group fB
set T=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Allpick mode.  You may pick heroes from any tavern for the next two minutes.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(ac,("Allpick"+v))
call CreateUnitAtLoc(Al[1],'n00C',IS,bj_UNIT_FACING)
call CreateUnitAtLoc(Al[2],'n00C',IS,bj_UNIT_FACING)
call CreateUnitAtLoc(Al[3],'n00C',IS,bj_UNIT_FACING)
call CreateUnitAtLoc(Al[4],'n00C',IS,bj_UNIT_FACING)
call CreateUnitAtLoc(Al[5],'n00C',IS,bj_UNIT_FACING)
call CreateUnitAtLoc(AL[1],'n00C',Is,bj_UNIT_FACING)
call CreateUnitAtLoc(AL[2],'n00C',Is,bj_UNIT_FACING)
call CreateUnitAtLoc(AL[3],'n00C',Is,bj_UNIT_FACING)
call CreateUnitAtLoc(AL[4],'n00C',Is,bj_UNIT_FACING)
call CreateUnitAtLoc(AL[5],'n00C',Is,bj_UNIT_FACING)
call DisableTrigger(ct)
call DisableTrigger(cV)
call DisableTrigger(cT)
call DisableTrigger(c4)
call DisableTrigger(c3)
call PolledWait(120.)
if(R==false)then
set fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function IQ))
call ForGroupBJ(fB,function Ir)
call DestroyGroup(fB)
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function fI takes nothing returns nothing
set ct=CreateTrigger()
call TriggerRegisterPlayerChatEvent(ct,AQ,"-allpick",true)
call TriggerRegisterPlayerChatEvent(ct,AQ,"-ap",true)
call TriggerAddCondition(ct,Condition(function Iq))
call TriggerAddAction(ct,function IR)
endfunction
function It takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function IT takes nothing returns nothing
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
local location Iu=GetRectCenter(A9)
local location IU=GetRectCenter(A2)
local integer EA=1
local integer Eb=5
local integer Eg
call DisableTrigger(cS)
call DisableTrigger(cV)
call DisableTrigger(ct)
call DisableTrigger(cw)
call DisableTrigger(cu)
call DisableTrigger(cT)
call DisableTrigger(c5)
call DisableTrigger(c3)
call DisableTrigger(c4)
call EB()
set s=true
set ae=400
if(R==false)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Allrandom mode.  Each player is given a random hero, and you may repick for "+I2S(ae)+" gold.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(ac,"Allrandom"+v)
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"Deathmatch Allrandom has been enabled.  Play begins normally, but if you die, that hero is lost forever. You will then be given another hero.  If your team loses "+I2S(IMinBJ(W,Y-X+1))+" heroes, you lose.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(ac,"Deathmatch Allrandom"+v)
endif
call PanCameraToTimedLocForPlayer(Al[1],Iu,0)
call PanCameraToTimedLocForPlayer(Al[2],Iu,0)
call PanCameraToTimedLocForPlayer(Al[3],Iu,0)
call PanCameraToTimedLocForPlayer(Al[4],Iu,0)
call PanCameraToTimedLocForPlayer(Al[5],Iu,0)
call PanCameraToTimedLocForPlayer(AL[1],IU,0)
call PanCameraToTimedLocForPlayer(AL[2],IU,0)
call PanCameraToTimedLocForPlayer(AL[3],IU,0)
call PanCameraToTimedLocForPlayer(AL[4],IU,0)
call PanCameraToTimedLocForPlayer(AL[5],IU,0)
call DisableTrigger(cs)
loop
exitwhen EA>Eb
set a2[GetPlayerId(Al[EA])]=null
if(e2(Al[EA]))then
loop
set Eg=EF()
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
set a2[GetPlayerId(Al[EA])]=CreateUnitAtLoc(Al[EA],k[Eg],Is,bj_UNIT_FACING)
endif
exitwhen(a2[GetPlayerId(Al[EA])]!=null)
endloop
endif
set EA=EA+1
endloop
set EA=1
set Eb=5
loop
exitwhen EA>Eb
set a2[GetPlayerId(AL[EA])]=null
if(e2(AL[EA]))then
loop
set Eg=EF()
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
set a2[GetPlayerId(AL[EA])]=CreateUnitAtLoc(AL[EA],k[Eg],IS,bj_UNIT_FACING)
endif
exitwhen(a2[GetPlayerId(AL[EA])]!=null)
endloop
endif
set EA=EA+1
endloop
if(R==false)then
call EnableTrigger(cs)
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
call RemoveLocation(Iu)
call RemoveLocation(IU)
endfunction
function fj takes nothing returns nothing
set cT=CreateTrigger()
call TriggerRegisterPlayerChatEvent(cT,AQ,"-allrandom",true)
call TriggerRegisterPlayerChatEvent(cT,AQ,"-ar",true)
call TriggerAddCondition(cT,Condition(function It))
call TriggerAddAction(cT,function IT)
endfunction
function Iv takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function IV takes nothing returns nothing
local integer array Iw
if(e2(Player(1)) and e2(Player(2)) and e2(Player(3)) and e2(Player(4)) and e2(Player(5)) and e2(Player(7)) and e2(Player(8)) and e2(Player(9)) and e2(Player(10)) and e2(Player(11)))then
call e8('E01B')
call e8('E01A')
set a3=true
call DisableTrigger(cs)
call DisableTrigger(cS)
call DisableTrigger(ct)
call DisableTrigger(cT)
call DisableTrigger(cV)
call DisableTrigger(c6)
call DisableTrigger(c7)
call DisableTrigger(c9)
call DisableTrigger(Ca)
call DisableTrigger(c4)
call DisableTrigger(cw)
call DisableTrigger(cu)
call DisableTrigger(c5)
call DisableTrigger(c3)
call DisableTrigger(cU)
call DisableTrigger(BC)
set Iw[1]=GetPlayerState(Al[1],PLAYER_STATE_RESOURCE_GOLD)
set Iw[2]=GetPlayerState(Al[2],PLAYER_STATE_RESOURCE_GOLD)
set Iw[3]=GetPlayerState(Al[3],PLAYER_STATE_RESOURCE_GOLD)
set Iw[4]=GetPlayerState(Al[4],PLAYER_STATE_RESOURCE_GOLD)
set Iw[5]=GetPlayerState(Al[5],PLAYER_STATE_RESOURCE_GOLD)
set Iw[7]=GetPlayerState(AL[1],PLAYER_STATE_RESOURCE_GOLD)
set Iw[8]=GetPlayerState(AL[2],PLAYER_STATE_RESOURCE_GOLD)
set Iw[9]=GetPlayerState(AL[3],PLAYER_STATE_RESOURCE_GOLD)
set Iw[10]=GetPlayerState(AL[4],PLAYER_STATE_RESOURCE_GOLD)
set Iw[11]=GetPlayerState(AL[5],PLAYER_STATE_RESOURCE_GOLD)
call SetPlayerState(Al[1],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(Al[2],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(Al[3],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(Al[4],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(Al[5],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(AL[1],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(AL[2],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(AL[3],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(AL[4],PLAYER_STATE_RESOURCE_GOLD,0)
call SetPlayerState(AL[5],PLAYER_STATE_RESOURCE_GOLD,0)
if(T==false)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen League mode.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(ac,("League Mode"+v))
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Allpick League mode.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(ac,("Allpick League Mode"+v))
endif
call PolledWait(15.-TimerGetElapsed(n))
call SuspendTimeOfDay(true)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(Al[1])]+GetPlayerName(Al[1])+"|r"+" has 20 seconds to pick a hero.")
call SetPlayerState(Al[1],PLAYER_STATE_RESOURCE_GOLD,Iw[1])
call PolledWait(20.)
call Ea(Al[1])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(AL[1])]+GetPlayerName(AL[1])+"|r"+" has 20 seconds to pick a hero.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(AL[2])]+GetPlayerName(AL[2])+"|r"+" has 20 seconds to pick a hero.")
call SetPlayerState(AL[1],PLAYER_STATE_RESOURCE_GOLD,Iw[7])
call SetPlayerState(AL[2],PLAYER_STATE_RESOURCE_GOLD,Iw[8])
call PolledWait(20.)
call Ea(AL[1])
call Ea(AL[2])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(Al[2])]+GetPlayerName(Al[2])+"|r"+" has 20 seconds to pick a hero.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(Al[3])]+GetPlayerName(Al[3])+"|r"+" has 20 seconds to pick a hero.")
call SetPlayerState(Al[2],PLAYER_STATE_RESOURCE_GOLD,Iw[2])
call SetPlayerState(Al[3],PLAYER_STATE_RESOURCE_GOLD,Iw[3])
call PolledWait(20.)
call Ea(Al[2])
call Ea(Al[3])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(AL[3])]+GetPlayerName(AL[3])+"|r"+" has 20 seconds to pick a hero.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(AL[4])]+GetPlayerName(AL[4])+"|r"+" has 20 seconds to pick a hero.")
call SetPlayerState(AL[3],PLAYER_STATE_RESOURCE_GOLD,Iw[9])
call SetPlayerState(AL[4],PLAYER_STATE_RESOURCE_GOLD,Iw[10])
call PolledWait(20.)
call Ea(AL[3])
call Ea(AL[4])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(Al[4])]+GetPlayerName(Al[4])+"|r"+" has 20 seconds to pick a hero.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(Al[5])]+GetPlayerName(Al[5])+"|r"+" has 20 seconds to pick a hero.")
call SetPlayerState(Al[4],PLAYER_STATE_RESOURCE_GOLD,Iw[4])
call SetPlayerState(Al[5],PLAYER_STATE_RESOURCE_GOLD,Iw[5])
call PolledWait(20.)
call Ea(Al[4])
call Ea(Al[5])
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,I[GetPlayerId(AL[5])]+GetPlayerName(AL[5])+"|r"+" has 20 seconds to pick a hero.")
call SetPlayerState(AL[5],PLAYER_STATE_RESOURCE_GOLD,Iw[11])
call PolledWait(20.)
call Ea(AL[5])
call EnableTrigger(BC)
call DestroyQuest(a4)
call QuestSetEnabled(a5,true)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15.,"|c001e90ffMap Info has been updated with the League Rules. Have fun!.|r")
call SuspendTimeOfDay(false)
call PolledWait(30.)
set Aa=true
else
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15,I[GetPlayerId(Al[0])]+"The game must be 5v5 in order to activate League Mode.|r")
endif
endfunction
function fk takes nothing returns nothing
set cu=CreateTrigger()
call TriggerRegisterPlayerChatEvent(cu,AQ,"-leaguemode",true)
call TriggerRegisterPlayerChatEvent(cu,AQ,"-lm",true)
call TriggerAddCondition(cu,Condition(function Iv))
call TriggerAddAction(cu,function IV)
endfunction
function IW takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function Ix takes nothing returns nothing
local integer fe=e5(Ak)
local integer fD=e5(AK)
if fe!=fD then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15,I[GetPlayerId(Al[0])]+"The game must have an even number of players to activate Mirror Mode.|r")
else
call DisableTrigger(cu)
call DisableTrigger(cw)
call DisableTrigger(cU)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Mirror Mode.  At the one minute mark, five heroes will be chosen at random and the same ones assigned to both teams.")
call MultiboardSetTitleText(bj_lastCreatedMultiboard,("Mirrormode"+v))
call EnableTrigger(cv)
endif
endfunction
function fJ takes nothing returns nothing
set cU=CreateTrigger()
call TriggerRegisterPlayerChatEvent(cU,AQ,"-mirrormode",true)
call TriggerRegisterPlayerChatEvent(cU,AQ,"-mm",true)
call TriggerAddCondition(cU,Condition(function IW))
call TriggerAddAction(cU,function Ix)
endfunction
function IX takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function Iy takes unit fS returns nothing
local integer IY=GetPlayerId(GetOwningPlayer(fS))
set As[IY]=UnitItemInSlot(fS,0)
set AS[IY]=UnitItemInSlot(fS,1)
set At[IY]=UnitItemInSlot(fS,2)
set AT[IY]=UnitItemInSlot(fS,3)
set Au[IY]=UnitItemInSlot(fS,4)
set AU[IY]=UnitItemInSlot(fS,5)
endfunction
function Iz takes player IZ,player I0 returns integer
local unit I1=a2[GetPlayerId(IZ)]
local unit I2=a2[GetPlayerId(I0)]
if I1==null and I2==null then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15,I[GetPlayerId(Al[0])]+GetPlayerName(IZ)+" and "+GetPlayerName(I0)+" did not pick a hero so they have no hero to be assigned.|r")
elseif I1==null and GetUnitTypeId(I2)=='E01B'then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15,I[GetPlayerId(Al[0])]+GetPlayerName(IZ)+" did not pick a hero. A hero must be picked for proper Mirror Mode functionality.|r")
elseif I2==null and GetUnitTypeId(I1)=='E01B'then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15,I[GetPlayerId(Al[0])]+GetPlayerName(I0)+" did not pick a hero. A hero must be picked for proper Mirror Mode functionality.|r")
elseif GetUnitTypeId(I1)=='E01B'then
return GetUnitTypeId(I2)
elseif GetUnitTypeId(I2)=='E01B'then
return GetUnitTypeId(I1)
elseif GetRandomInt(1,2)==1 then
if(I1!=null)then
return GetUnitTypeId(I1)
else
return GetUnitTypeId(I2)
endif
else
if(I2!=null)then
return GetUnitTypeId(I2)
else
return GetUnitTypeId(I1)
endif
endif
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,15,I[GetPlayerId(Al[0])]+GetPlayerName(IZ)+" and "+GetPlayerName(I0)+" have not picked a hero. They will be given Rhasta!")
return'Orkn'
endfunction
function I3 takes nothing returns nothing
if(GetUnitTypeId(GetEnumUnit())=='n004')then
call RemoveUnit(GetEnumUnit())
endif
if(GetUnitTypeId(GetEnumUnit())=='o003')then
call RemoveUnit(GetEnumUnit())
endif
endfunction
function I4 takes nothing returns nothing
local integer EA
local group I5=CreateGroup()
local unit RandUnit
local location Iu=GetRectCenter(A9)
local location IU=GetRectCenter(A2)
local integer I6=e5(Ak)
local player array I7
local player array I8
local integer x
local integer y
local real I9
local real ja
local real jA
local integer jb
local group fB=GetUnitsInRectMatching(GetWorldBounds(),null)
call EB()
call PolledWait(.1)
call ForGroup(fB,function I3)
call DestroyGroup(fB)
set EA=1
set x=1
set y=1
loop
exitwhen EA>5
if(e2(Al[EA]))then
call Iy(a2[GetPlayerId(Al[EA])])
call GroupAddUnit(I5,a2[GetPlayerId(Al[EA])])
set I7[x]=Al[EA]
set x=x+1
endif
if(e2(AL[EA]))then
call Iy(a2[GetPlayerId(AL[EA])])
call GroupAddUnit(I5,a2[GetPlayerId(AL[EA])])
set I8[y]=AL[EA]
set y=y+1
endif
set EA=EA+1
endloop
set x=1
loop
exitwhen x>I6
set jb=Iz(I7[x],I8[x])
if(a2[GetPlayerId(I7[x])]==null)then
set I9=GetLocationX(Iu)+GetRandomReal(1,40)
set ja=GetLocationY(Iu)+GetRandomReal(1,40)
set jA=270
else
set I9=GetUnitX(a2[GetPlayerId(I7[x])])
set ja=GetUnitY(a2[GetPlayerId(I7[x])])
set jA=GetUnitFacing(a2[GetPlayerId(I7[x])])
call SetUnitPathing(a2[GetPlayerId(I7[x])],false)
endif
set a2[GetPlayerId(I7[x])]=CreateUnit(I7[x],jb,I9,ja,jA)
call SetUnitPathing(a2[GetPlayerId(I7[x])],false)
call SetUnitPosition(a2[GetPlayerId(I7[x])],I9,ja)
call UnitAddItem(a2[GetPlayerId(I7[x])],As[GetPlayerId(I7[x])])
call UnitAddItem(a2[GetPlayerId(I7[x])],AS[GetPlayerId(I7[x])])
call UnitAddItem(a2[GetPlayerId(I7[x])],At[GetPlayerId(I7[x])])
call UnitAddItem(a2[GetPlayerId(I7[x])],AT[GetPlayerId(I7[x])])
call UnitAddItem(a2[GetPlayerId(I7[x])],Au[GetPlayerId(I7[x])])
call UnitAddItem(a2[GetPlayerId(I7[x])],AU[GetPlayerId(I7[x])])
call ClearSelectionForPlayer(I7[x])
call SelectUnitAddForPlayer(a2[GetPlayerId(I7[x])],I7[x])
call PanCameraToTimedForPlayer(I7[x],I9,ja,0)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Awaken\\Awaken.mdl",I9,ja))
if(a2[GetPlayerId(I8[x])]==null)then
set I9=GetLocationX(IU)
set ja=GetLocationY(IU)
set jA=270
else
set I9=GetUnitX(a2[GetPlayerId(I8[x])])
set ja=GetUnitY(a2[GetPlayerId(I8[x])])
set jA=GetUnitFacing(a2[GetPlayerId(I8[x])])
call SetUnitPathing(a2[GetPlayerId(I8[x])],false)
endif
set a2[GetPlayerId(I8[x])]=CreateUnit(I8[x],jb,I9,ja,jA)
call SetUnitPathing(a2[GetPlayerId(I8[x])],false)
call SetUnitPosition(a2[GetPlayerId(I8[x])],I9,ja)
call UnitAddItem(a2[GetPlayerId(I8[x])],As[GetPlayerId(I8[x])])
call UnitAddItem(a2[GetPlayerId(I8[x])],AS[GetPlayerId(I8[x])])
call UnitAddItem(a2[GetPlayerId(I8[x])],At[GetPlayerId(I8[x])])
call UnitAddItem(a2[GetPlayerId(I8[x])],AT[GetPlayerId(I8[x])])
call UnitAddItem(a2[GetPlayerId(I8[x])],Au[GetPlayerId(I8[x])])
call UnitAddItem(a2[GetPlayerId(I8[x])],AU[GetPlayerId(I8[x])])
call ClearSelectionForPlayer(I8[x])
call SelectUnitAddForPlayer(a2[GetPlayerId(I8[x])],I8[x])
call PanCameraToTimedForPlayer(I8[x],I9,ja,0)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Awaken\\Awaken.mdl",I9,ja))
set x=x+1
endloop
call ForGroup(I5,function IX)
call DestroyGroup(I5)
set x=1
loop
exitwhen x>I6
call SetUnitPathing(a2[GetPlayerId(I7[x])],true)
call SetUnitPathing(a2[GetPlayerId(I8[x])],true)
set x=x+1
endloop
call RemoveLocation(Iu)
call RemoveLocation(IU)
endfunction
function jB takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function jc takes nothing returns nothing
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
local location Iu=GetRectCenter(A9)
local location IU=GetRectCenter(A2)
local integer EA
local integer Eb
local integer Eg
call DisableTrigger(cV)
call DisableTrigger(cS)
call DisableTrigger(cT)
call DisableTrigger(ct)
call DisableTrigger(cw)
call DisableTrigger(cu)
call DisableTrigger(c5)
call DisableTrigger(c3)
call DisableTrigger(c4)
call EB()
set S=true
set ae=400
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Teamrandom mode.  Each player is given a random hero from their team, and you may repick for "+I2S(ae)+" gold.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(bj_lastCreatedMultiboard,("Teamrandom"+v))
call PanCameraToTimedLocForPlayer(Al[1],Iu,0)
call PanCameraToTimedLocForPlayer(Al[2],Iu,0)
call PanCameraToTimedLocForPlayer(Al[3],Iu,0)
call PanCameraToTimedLocForPlayer(Al[4],Iu,0)
call PanCameraToTimedLocForPlayer(Al[5],Iu,0)
call PanCameraToTimedLocForPlayer(AL[1],IU,0)
call PanCameraToTimedLocForPlayer(AL[2],IU,0)
call PanCameraToTimedLocForPlayer(AL[3],IU,0)
call PanCameraToTimedLocForPlayer(AL[4],IU,0)
call PanCameraToTimedLocForPlayer(AL[5],IU,0)
call DisableTrigger(cs)
set EA=1
set Eb=5
loop
exitwhen EA>Eb
set a2[GetPlayerId(Al[EA])]=null
if(e2(Al[EA]))then
loop
set Eg=GetRandomInt(V,W)
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
set a2[GetPlayerId(Al[EA])]=CreateUnitAtLoc(Al[EA],k[Eg],Is,bj_UNIT_FACING)
endif
exitwhen(a2[GetPlayerId(Al[EA])]!=null)
endloop
endif
set EA=EA+1
endloop
set EA=1
set Eb=5
loop
exitwhen EA>Eb
set a2[GetPlayerId(AL[EA])]=null
if(e2(AL[EA]))then
loop
set Eg=GetRandomInt(X,Y)
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
set a2[GetPlayerId(AL[EA])]=CreateUnitAtLoc(AL[EA],k[Eg],IS,bj_UNIT_FACING)
endif
exitwhen(a2[GetPlayerId(AL[EA])]!=null)
endloop
endif
set EA=EA+1
endloop
call EnableTrigger(cs)
call RemoveLocation(Is)
call RemoveLocation(IS)
call RemoveLocation(Iu)
call RemoveLocation(IU)
endfunction
function fK takes nothing returns nothing
set cV=CreateTrigger()
call TriggerRegisterPlayerChatEvent(cV,AQ,"-teamrandom",true)
call TriggerRegisterPlayerChatEvent(cV,AQ,"-tr",true)
call TriggerAddCondition(cV,Condition(function jB))
call TriggerAddAction(cV,function jc)
endfunction
function jC takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function jd takes nothing returns nothing
local location fr
local real jD
set R=true
call TriggerRegisterTimerExpireEvent(cW,L[GetPlayerId(Al[1])])
call TriggerRegisterTimerExpireEvent(cx,L[GetPlayerId(Al[2])])
call TriggerRegisterTimerExpireEvent(cX,L[GetPlayerId(Al[3])])
call TriggerRegisterTimerExpireEvent(cy,L[GetPlayerId(Al[4])])
call TriggerRegisterTimerExpireEvent(cY,L[GetPlayerId(Al[5])])
call TriggerRegisterTimerExpireEvent(cz,L[GetPlayerId(AL[1])])
call TriggerRegisterTimerExpireEvent(cZ,L[GetPlayerId(AL[2])])
call TriggerRegisterTimerExpireEvent(c0,L[GetPlayerId(AL[3])])
call TriggerRegisterTimerExpireEvent(c1,L[GetPlayerId(AL[4])])
call TriggerRegisterTimerExpireEvent(c2,L[GetPlayerId(AL[5])])
call DisableTrigger(cs)
call DisableTrigger(cS)
call DisableTrigger(cV)
call DisableTrigger(cw)
call DisableTrigger(cu)
call DisableTrigger(c5)
call DisableTrigger(c4)
call DisableTrigger(c3)
call DisableTrigger(cU)
set fr=GetUnitLoc(DX)
set jD=GetUnitFacing(DX)
call RemoveUnit(DX)
call SetUnitColor(CreateUnit(Al[0],'n001',GetLocationX(fr),GetLocationY(fr),jD),ConvertPlayerColor(15))
call RemoveLocation(fr)
set fr=GetUnitLoc(D8)
set jD=GetUnitFacing(D8)
call RemoveUnit(D8)
call SetUnitColor(CreateUnit(AL[0],'n001',GetLocationX(fr),GetLocationY(fr),jD),ConvertPlayerColor(15))
call RemoveLocation(fr)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Deathmatch mode.  Play begins normally, but if you die, that hero is lost forever, and you may choose another hero.  If your team runs out of heroes, you lose.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call MultiboardSetTitleText(bj_lastCreatedMultiboard,("Deathmatch"+v))
call UnitRemoveAbility(Dq,'Aawa')
call UnitRemoveAbility(DL,'Aawa')
call UnitRemoveAbility(DR,'Aawa')
call UnitRemoveAbility(DV,'Aawa')
call UnitRemoveAbility(DU,'Aawa')
call UnitRemoveAbility(Dv,'Aawa')
call UnitRemoveAbility(ez,'Aawa')
call UnitRemoveAbility(Dn,'Aawa')
call EnableTrigger(cW)
call EnableTrigger(cx)
call EnableTrigger(cX)
call EnableTrigger(cy)
call EnableTrigger(cY)
call EnableTrigger(cz)
call EnableTrigger(cZ)
call EnableTrigger(c0)
call EnableTrigger(c1)
call EnableTrigger(c2)
endfunction
function fl takes nothing returns nothing
set cw=CreateTrigger()
call TriggerRegisterPlayerChatEvent(cw,AQ,"-deathmatch",true)
call TriggerRegisterPlayerChatEvent(cw,AQ,"-dm",true)
call TriggerAddCondition(cw,Condition(function jC))
call TriggerAddAction(cw,function jd)
endfunction
function je takes nothing returns nothing
local integer jE=GetPlayerId(Al[1])
local integer EA=V
local integer Eb=W
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[0]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jf takes nothing returns nothing
local integer jE=GetPlayerId(Al[2])
local integer EA=V
local integer Eb=W
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[0]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jF takes nothing returns nothing
local integer jE=GetPlayerId(Al[3])
local integer EA=V
local integer Eb=W
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[0]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jg takes nothing returns nothing
local integer jE=GetPlayerId(Al[4])
local integer EA=V
local integer Eb=W
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[0]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jG takes nothing returns nothing
local integer jE=GetPlayerId(Al[5])
local integer EA=V
local integer Eb=W
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=X
set Eb=Y
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[0]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jh takes nothing returns nothing
local integer jE=GetPlayerId(AL[1])
local integer EA=X
local integer Eb=Y
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=V
set Eb=W
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[1]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jH takes nothing returns nothing
local integer jE=GetPlayerId(AL[2])
local integer EA=X
local integer Eb=Y
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=V
set Eb=W
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[1]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function ji takes nothing returns nothing
local integer jE=GetPlayerId(AL[3])
local integer EA=X
local integer Eb=Y
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=V
set Eb=W
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[1]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jI takes nothing returns nothing
local integer jE=GetPlayerId(AL[4])
local integer EA=X
local integer Eb=Y
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=V
set Eb=W
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[1]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jj takes nothing returns nothing
local integer jE=GetPlayerId(AL[5])
local integer EA=X
local integer Eb=Y
local integer Eg
local location Is=GetRectCenter(bC)
local location IS=GetRectCenter(bc)
if(s==false)then
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
if T then
set EA=V
set Eb=W
loop
exitwhen EA>Eb
if(B[EA]==false)then
call SetPlayerTechMaxAllowedSwap(k[EA],1,Player(jE))
endif
set EA=EA+1
endloop
endif
if(GetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD)<250)then
call SetPlayerState(Player(jE),PLAYER_STATE_RESOURCE_GOLD,250)
endif
elseif(Ab[1]<IMinBJ(W,Y-X+1))then
set a2[jE]=null
if(e2(Player(jE)))then
loop
if(GetRandomInt(1,2)==1)then
set Eg=GetRandomInt(V,W)
else
set Eg=GetRandomInt(X,Y)
endif
if(B[Eg]==false)then
set B[Eg]=true
call SetPlayerStateBJ(Player(jE),PLAYER_STATE_RESOURCE_FOOD_CAP,6)
call PolledWait(.01)
if(eZ(Player(jE)))then
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],Is,bj_UNIT_FACING)
else
set a2[jE]=CreateUnitAtLoc(Player(jE),k[Eg],IS,bj_UNIT_FACING)
endif
endif
exitwhen(a2[jE]!=null)
endloop
endif
endif
call RemoveLocation(Is)
call RemoveLocation(IS)
endfunction
function jJ takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function jk takes nothing returns nothing
local integer jK=GetRandomInt(1,4)
call DisableTrigger(c4)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Mode Random mode.  A random mode will now be activated.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
if(jK==1)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"AP has been randomly selected as your mode!")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call TriggerExecute(ct)
endif
if(jK==2)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"AR has been randomly selected as your mode!")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call TriggerExecute(cT)
endif
if(jK==3)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"TR has been randomly selected as your mode!")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call TriggerExecute(cV)
endif
if(jK==4)then
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,"Normal has been randomly selected as your mode!")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
endif
set H=true
endfunction
function fL takes nothing returns nothing
set c3=CreateTrigger()
call TriggerRegisterPlayerChatEvent(c3,AQ,"-mr",true)
call TriggerRegisterPlayerChatEvent(c3,AQ,"-moderandom",true)
call TriggerAddCondition(c3,Condition(function jJ))
call TriggerAddAction(c3,function jk)
endfunction
function jl takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function jL takes nothing returns nothing
local integer fe=e5(Ak)
local integer fD=e5(AK)
local integer jm=fe+fD
local integer EA
local integer jM
local integer x
local integer y
local integer z
local player array jn
local player array jN
local integer w
local integer jo
local integer jO
local location Iu=GetRectCenter(A9)
local location IU=GetRectCenter(A2)
call DisableTrigger(c4)
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Shuffle Players mode.  All the players will now be shuffled.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
set jo=GetPlayerState(Al[1],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(Al[2],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(Al[3],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(Al[4],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(Al[5],PLAYER_STATE_RESOURCE_GOLD)
set jO=GetPlayerState(AL[1],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(AL[2],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(AL[3],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(AL[4],PLAYER_STATE_RESOURCE_GOLD)+GetPlayerState(AL[5],PLAYER_STATE_RESOURCE_GOLD)
set jn[1]=null
set jn[2]=null
set jn[3]=null
set jn[4]=null
set jn[5]=null
set jn[6]=null
set jn[7]=null
set jn[8]=null
set jn[9]=null
set jn[10]=null
set z=1
set w=1
set EA=1
loop
exitwhen EA>5
if(e2(Al[EA]))then
set jn[w]=Al[EA]
set w=w+1
else
set jN[z]=Al[EA]
set z=z+1
endif
set EA=EA+1
endloop
set EA=1
loop
exitwhen EA>5
if(e2(AL[EA]))then
set jn[w]=AL[EA]
set w=w+1
else
set jN[z]=AL[EA]
set z=z+1
endif
set EA=EA+1
endloop
set Al[1]=null
set Al[2]=null
set Al[3]=null
set Al[4]=null
set Al[5]=null
set AL[1]=null
set AL[2]=null
set AL[3]=null
set AL[4]=null
set AL[5]=null
set EA=1
loop
exitwhen EA>(jm/2)
set jM=GetRandomInt(1,jm)
if(jn[jM]!=null)then
set Al[EA]=jn[jM]
set jn[jM]=null
set EA=EA+1
endif
endloop
set x=EA
set EA=1
loop
exitwhen EA>jm-x+1
set jM=GetRandomInt(1,jm)
if(jn[jM]!=null)then
set AL[EA]=jn[jM]
set jn[jM]=null
set EA=EA+1
endif
endloop
set z=EA
set EA=x
set y=1
loop
exitwhen EA>5
set Al[EA]=jN[y]
set y=y+1
set EA=EA+1
endloop
set EA=z
loop
exitwhen EA>5
set AL[EA]=jN[y]
set y=y+1
set EA=EA+1
endloop
set EA=0
loop
exitwhen EA>5
set EA=EA+1
endloop
call SetPlayerTeam(Al[0],0)
call SetPlayerTeam(Al[1],0)
call SetPlayerTeam(Al[2],0)
call SetPlayerTeam(Al[3],0)
call SetPlayerTeam(Al[4],0)
call SetPlayerTeam(Al[5],0)
call SetPlayerTeam(AL[0],1)
call SetPlayerTeam(AL[1],1)
call SetPlayerTeam(AL[2],1)
call SetPlayerTeam(AL[3],1)
call SetPlayerTeam(AL[4],1)
call SetPlayerTeam(AL[5],1)
call fC()
set x=0
set y=0
loop
exitwhen x>5
loop
exitwhen y>5
call SetPlayerAllianceStateBJ(Al[x],Al[y],3)
call SetPlayerAllianceStateBJ(AL[x],AL[y],3)
call SetPlayerAllianceStateBJ(Al[x],AL[y],0)
call SetPlayerAllianceStateBJ(AL[x],Al[y],0)
set y=y+1
endloop
set y=0
set x=x+1
endloop
call ForceClear(Ak)
call ForceClear(AK)
call ForceAddPlayer(Ak,Al[0])
call ForceAddPlayer(Ak,Al[1])
call ForceAddPlayer(Ak,Al[2])
call ForceAddPlayer(Ak,Al[3])
call ForceAddPlayer(Ak,Al[4])
call ForceAddPlayer(Ak,Al[5])
call ForceAddPlayer(AK,AL[0])
call ForceAddPlayer(AK,AL[1])
call ForceAddPlayer(AK,AL[2])
call ForceAddPlayer(AK,AL[3])
call ForceAddPlayer(AK,AL[4])
call ForceAddPlayer(AK,AL[5])
call ExecuteFunc("E9")
call MultiboardClear(ac)
call TriggerExecute(BV)
set AM=true
set fe=e5(Ak)
set fD=e5(AK)
set EA=1
loop
exitwhen EA>5
if(e2(Al[EA]))then
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_GOLD,(3500/fe))
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_LUMBER,0)
call SetPlayerStateBJ(Al[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,5)
endif
if(e2(AL[EA]))then
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_GOLD,(3500/fD))
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_LUMBER,0)
call SetPlayerStateBJ(AL[EA],PLAYER_STATE_RESOURCE_FOOD_CAP,5)
endif
set EA=EA+1
endloop
call PanCameraToTimedLocForPlayer(Al[1],Iu,0)
call PanCameraToTimedLocForPlayer(Al[2],Iu,0)
call PanCameraToTimedLocForPlayer(Al[3],Iu,0)
call PanCameraToTimedLocForPlayer(Al[4],Iu,0)
call PanCameraToTimedLocForPlayer(Al[5],Iu,0)
call PanCameraToTimedLocForPlayer(AL[1],IU,0)
call PanCameraToTimedLocForPlayer(AL[2],IU,0)
call PanCameraToTimedLocForPlayer(AL[3],IU,0)
call PanCameraToTimedLocForPlayer(AL[4],IU,0)
call PanCameraToTimedLocForPlayer(AL[5],IU,0)
call DestroyFogModifier(CreateFogModifierRectBJ(true,Al[1],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,Al[2],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,Al[3],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,Al[4],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,Al[5],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,AL[1],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,AL[2],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,AL[3],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,AL[4],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
call DestroyFogModifier(CreateFogModifierRectBJ(true,AL[5],FOG_OF_WAR_MASKED,bj_mapInitialPlayableArea))
endfunction
function fm takes nothing returns nothing
set c4=CreateTrigger()
call TriggerRegisterPlayerChatEvent(c4,AQ,"-shuffleplayers",true)
call TriggerRegisterPlayerChatEvent(c4,AQ,"-sp",true)
call TriggerAddCondition(c4,Condition(function jl))
call TriggerAddAction(c4,function jL)
endfunction
function jp takes nothing returns boolean
if(H)then
return false
endif
return true
endfunction
function jP takes nothing returns nothing
local integer EA=1
local integer Eb=Ae
loop
exitwhen EA>Eb
call e8(Ac[EA])
set EA=EA+1
endloop
endfunction
function jq takes nothing returns nothing
local integer EA=1
local integer Eb=Ad
loop
exitwhen EA>Eb
call e8(AB[EA])
set EA=EA+1
endloop
endfunction
function jQ takes nothing returns nothing
local integer EA=1
local integer Eb=AD
loop
exitwhen EA>Eb
call e8(AC[EA])
set EA=EA+1
endloop
endfunction
function jr takes nothing returns nothing
if(GetEventPlayerChatString()=="-allagi" or GetEventPlayerChatString()=="-aa")then
call jP()
call jQ()
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen AllAgi mode.  Only Agility heroes are allowed.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
endif
if(GetEventPlayerChatString()=="-allint" or GetEventPlayerChatString()=="-ai")then
call jq()
call jQ()
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen AllInt mode.  Only Intelligence heroes are allowed.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
endif
if(GetEventPlayerChatString()=="-allstr" or GetEventPlayerChatString()=="-as")then
call jq()
call jP()
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen AllStr mode.  Only Strength heroes are allowed.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
endif
call DisableTrigger(c3)
call DisableTrigger(cu)
call DisableTrigger(c5)
call DisableTrigger(cw)
call DisableTrigger(c4)
set AE=true
endfunction
function fM takes nothing returns nothing
set c5=CreateTrigger()
call TriggerRegisterPlayerChatEvent(c5,AQ,"-allagi",true)
call TriggerRegisterPlayerChatEvent(c5,AQ,"-allstr",true)
call TriggerRegisterPlayerChatEvent(c5,AQ,"-allint",true)
call TriggerRegisterPlayerChatEvent(c5,AQ,"-aa",true)
call TriggerRegisterPlayerChatEvent(c5,AQ,"-as",true)
call TriggerRegisterPlayerChatEvent(c5,AQ,"-ai",true)
call TriggerAddCondition(c5,Condition(function jp))
call TriggerAddAction(c5,function jr)
endfunction
function jR takes nothing returns boolean
if(H)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Too late to do Item Drop.")
return false
endif
return true
endfunction
function js takes nothing returns nothing
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen ItemDrop mode.  Whenever a hero dies, that hero drops an item from a random slot instead of losing money.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
set U=true
call DisableTrigger(c6)
call DisableTrigger(cw)
call DisableTrigger(cu)
call DisableTrigger(c4)
endfunction
function fn takes nothing returns nothing
set c6=CreateTrigger()
call TriggerRegisterPlayerChatEvent(c6,AQ,"-itemdrops",true)
call TriggerRegisterPlayerChatEvent(c6,AQ,"-id",true)
call TriggerAddCondition(c6,Condition(function jR))
call TriggerAddAction(c6,function js)
endfunction
function jS takes nothing returns boolean
if(H)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Too late to do Short Mode.")
return false
endif
return true
endfunction
function jt takes nothing returns nothing
call SetPlayerHandicapXPBJ(GetEnumPlayer(),150.)
endfunction
function jT takes nothing returns nothing
set aE=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Short mode.  All towers are weaker, and heroes gain more experience and gold.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call SetPlayerTechResearchedSwap('R004',1,Al[0])
call SetPlayerTechResearchedSwap('R004',1,AL[0])
call DisableTrigger(BC)
call EnableTrigger(c8)
call ForForce(bj_FORCE_ALL_PLAYERS,function jt)
call DisableTrigger(c7)
call DisableTrigger(cu)
call DisableTrigger(c4)
endfunction
function fN takes nothing returns nothing
set c7=CreateTrigger()
call TriggerRegisterPlayerChatEvent(c7,AQ,"-shortmode",true)
call TriggerRegisterPlayerChatEvent(c7,AQ,"-sm",true)
call TriggerAddCondition(c7,Condition(function jS))
call TriggerAddAction(c7,function jT)
endfunction
function ju takes nothing returns nothing
call AdjustPlayerStateBJ(16,Al[1],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,Al[2],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,Al[3],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,Al[4],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,Al[5],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,AL[1],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,AL[2],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,AL[3],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,AL[4],PLAYER_STATE_RESOURCE_GOLD)
call AdjustPlayerStateBJ(16,AL[5],PLAYER_STATE_RESOURCE_GOLD)
endfunction
function jU takes nothing returns boolean
if(H)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Too late to do No Powerup.")
return false
endif
return true
endfunction
function jv takes nothing returns nothing
set af=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,10.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has |c00008000disabled|r Item powerups.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call DisableTrigger(co)
call DisableTrigger(c9)
call DisableTrigger(c4)
call DisableTrigger(cu)
endfunction
function fo takes nothing returns nothing
set c9=CreateTrigger()
call TriggerRegisterPlayerChatEvent(c9,AQ,"-nopowerups",true)
call TriggerRegisterPlayerChatEvent(c9,AQ,"-np",true)
call TriggerAddCondition(c9,Condition(function jU))
call TriggerAddAction(c9,function jv)
endfunction
function jV takes nothing returns boolean
if(H)then
call DisplayTimedTextToPlayer(GetTriggerPlayer(),0,0,10,"Too late to do Super Creeps.")
return false
endif
return true
endfunction
function jw takes nothing returns nothing
set aF=true
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.,I[GetPlayerId(AQ)]+GetPlayerName(AQ)+"|r"+" has chosen Supercreeps mode.  Siege Golems, Scary Fish, and Ancient Hydras can spawn randomly with creep spawns.")
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,20.," ")
call EnableTrigger(cJ)
call DisableTrigger(Ca)
call DisableTrigger(cu)
call DisableTrigger(c4)
endfunction
function fO takes nothing returns nothing
set Ca=CreateTrigger()
call TriggerRegisterPlayerChatEvent(Ca,AQ,"-supercreeps",true)
call TriggerRegisterPlayerChatEvent(Ca,AQ,"-sc",true)
call TriggerAddCondition(Ca,Condition(function jV))
call TriggerAddAction(Ca,function jw)
endfunction
function jW takes nothing returns nothing
call DisableTrigger(cs)
call DisableTrigger(cS)
call DisableTrigger(ct)
call DisableTrigger(cT)
call DisableTrigger(cV)
call DisableTrigger(cu)
call DisableTrigger(cw)
call DisableTrigger(c6)
call DisableTrigger(c7)
call DisableTrigger(c9)
call DisableTrigger(Ca)
call DisableTrigger(c5)
call DisableTrigger(c4)
call DisableTrigger(c3)
call DisableTrigger(cU)
if(aE==false)then
call DisableTrigger(c8)
endif
if(aF==false)then
call DisableTrigger(cJ)
endif
if(R==false)then
call DisableTrigger(cW)
call DisableTrigger(cx)
call DisableTrigger(cX)
call DisableTrigger(cy)
call DisableTrigger(cY)
call DisableTrigger(cz)
call DisableTrigger(cZ)
call DisableTrigger(c0)
call DisableTrigger(c1)
call DisableTrigger(c2)
endif
call DisableTrigger(CA)
endfunction
function jx takes nothing returns boolean
return GetSpellAbilityId()=='A0E3'
endfunction
function jX takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local integer jy=GetUnitAbilityLevel(EN,'A0E3')
local real jY=(jy*.25+.35)*(GetUnitState(h3,UNIT_STATE_MAX_MANA)-GetUnitState(h3,UNIT_STATE_MANA))
call UnitDamageTargetBJ(EN,h3,jY,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endfunction
function fU takes nothing returns nothing
set Cb=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cb,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cb,Condition(function jx))
call TriggerAddAction(Cb,function jX)
endfunction
function jz takes nothing returns integer
return'A0O0'
endfunction
function jZ takes nothing returns integer
return'A0NZ'
endfunction
function j0 takes integer j1 returns integer
local integer array j2
set j2[1]=4
set j2[2]=3
set j2[3]=2
set j2[4]=1
return j2[j1]
endfunction
function j3 takes nothing returns real
return 2.
endfunction
function j4 takes nothing returns boolean
local string j5=EQ(GetTriggeringTrigger())
local unit Ig=Ew(j5,"attacker")
if(GetEventDamageSource()==Ig)then
return true
else
return false
endif
endfunction
function j6 takes nothing returns nothing
local string j5=EQ(GetTriggeringTrigger())
local unit Ig=Ew(j5,"attacker")
local unit Ek=GetTriggerUnit()
local string Go=EQ(Ig)
local unit j7=Ew(Go,"BR_Prey")
local integer j8=E0(Go,"BR_Acont")+1
local integer j1=GetUnitAbilityLevel(Ig,jz())
call DisableTrigger(GetTriggeringTrigger())
if(j7!=null)then
call ET(Go,"BR_Acont",j8)
if((ModuloInteger(j8,j0(j1))==0) and (GetUnitAbilityLevel(Ig,jZ())!=11))then
call SetUnitAbilityLevel(Ig,jZ(),GetUnitAbilityLevel(Ig,jZ())+1)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\LordofFlameMissile\\LordofFlameMissile.mdl",Ig,"head"))
endif
endif
endfunction
function j9 takes nothing returns boolean
return(GetUnitAbilityLevel(GetAttacker(),jz())>0)
endfunction
function Ja takes nothing returns nothing
local unit Ig=GetAttacker()
local unit JA=GetTriggerUnit()
local string Go=EQ(Ig)
local unit j7=Ew(Go,"BR_Prey")
local integer ec=GetTriggerExecCount(GetTriggeringTrigger())
local integer j8=E0(Go,"BR_Acont")
if(j7!=null)then
return
endif
call TriggerSleepAction(j3())
loop
exitwhen(ec==GetTriggerExecCount(GetTriggeringTrigger()))
set ec=GetTriggerExecCount(GetTriggeringTrigger())
call TriggerSleepAction(j3())
endloop
call Es(Go,"BR_Prey",null)
call UnitRemoveAbility(Ig,jZ())
endfunction
function Jb takes nothing returns boolean
return(GetUnitAbilityLevel(GetAttacker(),jz())>0 and IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction
function JB takes nothing returns nothing
local unit Ig=GetAttacker()
local unit JA=GetTriggerUnit()
local string Go=EQ(Ig)
local trigger Jc=CreateTrigger()
local string j5=EQ(Jc)
local triggeraction JC
local triggercondition Jd
local unit j7=Ew(Go,"BR_Prey")
local integer i=1
if(j7!=JA)then
call Es(Go,"BR_Prey",JA)
call ET(Go,"BR_Acont",0)
if(GetUnitAbilityLevel(Ig,jZ())==0)then
call UnitAddAbility(Ig,jZ())
else
call UnitRemoveAbility(Ig,jZ())
call UnitAddAbility(Ig,jZ())
endif
endif
call Es(j5,"attacker",Ig)
call TriggerRegisterUnitEvent(Jc,JA,EVENT_UNIT_DAMAGED)
set Jd=TriggerAddCondition(Jc,Condition(function j4))
set JC=TriggerAddAction(Jc,function j6)
loop
exitwhen(GetTriggerExecCount(Jc)>0) or (i>=10)
call TriggerSleepAction(.1)
set i=i+1
endloop
call PolledWait(1)
call Er(j5)
call TriggerRemoveAction(Jc,JC)
call TriggerRemoveCondition(Jc,Jd)
call DestroyTrigger(Jc)
endfunction
function fv takes nothing returns nothing
local trigger JD=CreateTrigger()
set CB=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(JD,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(JD,Condition(function j9))
call TriggerAddAction(JD,function Ja)
call TriggerRegisterAnyUnitEventBJ(CB,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(CB,Condition(function Jb))
call TriggerAddAction(CB,function JB)
endfunction
function Je takes nothing returns boolean
return GetSpellAbilityId()=='A0OO'
endfunction
function JE takes nothing returns nothing
if(GetUnitTypeId(GetEnumUnit())=='n01Q' or GetUnitTypeId(GetEnumUnit())=='n01M' or GetUnitTypeId(GetEnumUnit())=='n01R' or GetUnitTypeId(GetEnumUnit())=='n01S')then
call KillUnit(GetEnumUnit())
endif
endfunction
function Jf takes nothing returns nothing
local unit EN=GetTriggerUnit()
local player e3=GetOwningPlayer(EN)
local integer jy=GetUnitAbilityLevel(EN,'A0OO')
local real x=GetUnitX(EN)
local real y=GetUnitY(EN)
local group fB=CreateGroup()
call GroupEnumUnitsOfPlayer(fB,e3,null)
call ForGroup(fB,function JE)
call DestroyGroup(fB)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl",x,y))
if(jy==1)then
call UnitApplyTimedLife(CreateUnit(e3,'n01Q',x,y,270),'BTLF',60)
elseif(jy==2)then
call UnitApplyTimedLife(CreateUnit(e3,'n01Q',x,y,270),'BTLF',70)
call UnitApplyTimedLife(CreateUnit(e3,'n01M',x,y,270),'BTLF',70)
elseif(jy==3)then
call UnitApplyTimedLife(CreateUnit(e3,'n01R',x,y,270),'BTLF',80)
call UnitApplyTimedLife(CreateUnit(e3,'n01M',x,y,270),'BTLF',80)
elseif(jy==4)then
call UnitApplyTimedLife(CreateUnit(e3,'n01R',x,y,270),'BTLF',90)
call UnitApplyTimedLife(CreateUnit(e3,'n01S',x,y,270),'BTLF',90)
endif
endfunction
function fW takes nothing returns nothing
set Cc=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cc,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cc,Condition(function Je))
call TriggerAddAction(Cc,function Jf)
endfunction
function JF takes nothing returns integer
return'A0O2'
endfunction
function Jg takes nothing returns integer
return'o00Y'
endfunction
function JG takes nothing returns integer
return'A0NY'
endfunction
function Jh takes nothing returns string
return"thunderclap"
endfunction
function JH takes nothing returns real
return 250.
endfunction
function Ji takes nothing returns boolean
return(GetSpellAbilityId()==JF())
endfunction
function JI takes nothing returns boolean
local unit Jj=GetFilterUnit()
if((IsUnitType(Jj,UNIT_TYPE_STRUCTURE)==false) and (IsUnitType(Jj,UNIT_TYPE_DEAD)==false) and (IsUnitType(Jj,UNIT_TYPE_FLYING)==false) and (Jj!=GetSpellTargetUnit()) and (Jj!=GetTriggerUnit()))then
if(GetUnitAbilityLevel(Jj,'A04R')==0)then
set Jj=null
return true
endif
endif
set Jj=null
return false
endfunction
function JJ takes nothing returns nothing
local string Go=EQ(GetExpiredTimer())
local group Jk=Ey(Go,"pbgroup")
local group g=CreateGroup()
local location JK=Ez(Go,"castloc")
local real Jl=E2(Go,"castangle")
local unit JL
local location Jm
local real JM
local location Jn
local effect e
call GroupAddGroup(Jk,g)
set JL=FirstOfGroup(g)
loop
exitwhen JL==null
set Jm=GetUnitLoc(JL)
set JM=AngleBetweenPoints(JK,Jm)
if(SinBJ(JM-Jl)<0)then
set Jn=PolarProjectionBJ(Jm,20,Jl-90)
call SetUnitPositionLoc(JL,Jn)
call SetUnitFacingTimed(JL,Jl+90,.3)
else
set Jn=PolarProjectionBJ(Jm,20,Jl+90)
call SetUnitPositionLoc(JL,Jn)
call SetUnitFacingTimed(JL,Jl-90,.3)
endif
set e=AddSpecialEffectTarget("Abilities\\Weapons\\AncientProtectorMissile\\AncientProtectorMissile.mdl",JL,"origin")
call DestroyEffect(e)
call RemoveLocation(Jm)
call RemoveLocation(Jn)
call GroupRemoveUnit(g,JL)
set JL=FirstOfGroup(g)
endloop
call DestroyGroup(g)
endfunction
function JN takes nothing returns nothing
call UnitDamageTarget(Ar,GetEnumUnit(),AR,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS)
endfunction
function Jo takes nothing returns nothing
local unit JO=GetTriggerUnit()
local integer j1=GetUnitAbilityLevel(JO,JF())
local location JK=GetUnitLoc(JO)
local unit Ek=GetSpellTargetUnit()
local location Jp=GetUnitLoc(Ek)
local real JP=AngleBetweenPoints(JK,Jp)
local location Jq=PolarProjectionBJ(JK,50,JP)
local unit JQ=CreateUnitAtLoc(GetOwningPlayer(JO),Jg(),Jq,JP)
local location Jr=PolarProjectionBJ(JK,250,JP)
local unit JR=CreateUnitAtLoc(GetOwningPlayer(JO),Jg(),Jr,JP)
local location Js=PolarProjectionBJ(JK,450,JP)
local unit JS=CreateUnitAtLoc(GetOwningPlayer(JO),Jg(),Js,JP)
local group g=GetUnitsInRangeOfLocMatching(JH(),Jq,Condition(function JI))
local group Jt=GetUnitsInRangeOfLocMatching(JH(),Jr,Condition(function JI))
local group DamagedGroup=CreateGroup()
local timer t=CreateTimer()
local string Go=EQ(t)
call GroupAddGroup(Jt,g)
call GroupClear(Jt)
set Jt=GetUnitsInRangeOfLocMatching(JH(),Js,Condition(function JI))
call GroupAddGroup(Jt,g)
call Es(Go,"pbgroup",g)
call Ev(Go,"castangle",JP)
call Es(Go,"castloc",JK)
set AR='d'*j1
set Ar=JO
call ForGroup(g,function JN)
call TimerStart(t,.05,true,function JJ)
call SetUnitAbilityLevel(JQ,JG(),j1)
call SetUnitAbilityLevel(JR,JG(),j1)
call SetUnitAbilityLevel(JS,JG(),j1)
call IssueImmediateOrder(JQ,Jh())
call IssueImmediateOrder(JR,Jh())
call IssueImmediateOrder(JS,Jh())
call TriggerSleepAction(.375)
call PauseTimer(t)
call Er(Go)
call TriggerSleepAction(.625)
call DestroyTimer(t)
call KillUnit(JQ)
call KillUnit(JR)
call KillUnit(JS)
call DestroyGroup(g)
call DestroyGroup(Jt)
call RemoveLocation(JK)
call RemoveLocation(Jp)
call RemoveLocation(Jq)
call RemoveLocation(Jr)
call RemoveLocation(Js)
endfunction
function fV takes nothing returns nothing
set CC=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CC,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CC,Condition(function Ji))
call TriggerAddAction(CC,function Jo)
endfunction
function JT takes nothing returns boolean
if(GetSpellAbilityId()=='A0O1')then
return true
endif
return false
endfunction
function Ju takes nothing returns nothing
call KillDestructable(GetEnumDestructable())
endfunction
function JU takes unit EN,real x,real y,group Jv returns nothing
local group fB=CreateGroup()
local unit fT
local rect JV=Rect(x-150,y-150,x+150,y+150)
call GroupEnumUnitsInRange(fB,x,y,150,null)
loop
set fT=FirstOfGroup(fB)
exitwhen fT==null
if(IsUnitInGroup(fT,Jv)==false and IsUnitEnemy(fT,GetOwningPlayer(EN)) and IsUnitVisible(fT,GetOwningPlayer(EN)))then
if(GetUnitAbilityLevel(fT,'A04R')!=1 and GetUnitState(fT,UNIT_STATE_LIFE)>0 and IsUnitType(fT,UNIT_TYPE_STRUCTURE)==false)then
call GroupAddUnit(Jv,fT)
call UnitDamageTarget(EN,fT,60+GetUnitAbilityLevel(EN,'A0O1')*30,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_METAL_HEAVY_SLICE)
call AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",fT,"overhead")
endif
endif
call GroupRemoveUnit(fB,fT)
endloop
call EnumDestructablesInRect(JV,null,function Ju)
call RemoveRect(JV)
call DestroyGroup(fB)
endfunction
function Jw takes nothing returns nothing
local string Go=EQ(GetExpiredTimer())
local unit JW=Ew(Go,"Axe")
local unit fS=Ew(Go,"Hero")
local real Ax=E2(Go,"Ax")
local real Ay=E2(Go,"Ay")
local real Cx=E2(Go,"Cx")
local real Cy=E2(Go,"Cy")
local real Bx=E2(Go,"Bx")
local real By=E2(Go,"By")
local real a=E2(Go,"a")
local real b=1-a
local boolean Jx=E3(Go,"FirstPass")
local group Jv=Ey(Go,"AlreadyDamaged")
call SetUnitX(JW,E4(Ax*a*a+Bx*2*a*b+Cx*b*b))
call SetUnitY(JW,E6(Ay*a*a+By*2*a*b+Cy*b*b))
call JU(fS,GetUnitX(JW),GetUnitY(JW),Jv)
if(Jx)then
call Ev(Go,"a",a-.02)
else
call Ev(Go,"a",a+.02)
call Ev(Go,"Ax",GetUnitX(fS))
call Ev(Go,"Ay",GetUnitY(fS))
endif
if(a<0 and Jx)then
call EV(Go,"FirstPass",false)
call Ev(Go,"Bx",Ax+300*Cos(Atan2(Cy-Ay,Cx-Ax)+E2(Go,"AngleOffset")))
call Ev(Go,"By",Ay+300*Sin(Atan2(Cy-Ay,Cx-Ax)+E2(Go,"AngleOffset")))
endif
if(a>1 and Jx==false)then
call PauseTimer(GetExpiredTimer())
call DestroyGroup(Jv)
call Er(Go)
call RemoveUnit(JW)
call PolledWait(.1)
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function JX takes nothing returns nothing
local unit EN=GetTriggerUnit()
local real Ax=GetUnitX(EN)
local real Ay=GetUnitY(EN)
local real Cx=GetLocationX(GetSpellTargetLoc())
local real Cy=GetLocationY(GetSpellTargetLoc())
local unit Jy=CreateUnit(GetOwningPlayer(EN),'e01T',Ax,Ay,270.)
local unit JY=CreateUnit(GetOwningPlayer(EN),'e01T',Ax,Ay,270.)
local string Jz
local string JZ
local timer J0=CreateTimer()
local timer J1=CreateTimer()
call UnitAddAbility(Jy,'Amrf')
call UnitRemoveAbility(Jy,'Amrf')
call SetUnitFlyHeight(Jy,150,0)
call UnitAddAbility(JY,'Amrf')
call UnitRemoveAbility(JY,'Amrf')
call SetUnitFlyHeight(JY,150,0)
set Jz=EQ(J0)
call Es(Jz,"Hero",EN)
call Es(Jz,"Axe",Jy)
call Es(Jz,"AlreadyDamaged",CreateGroup())
call Ev(Jz,"Ax",Ax)
call Ev(Jz,"Ay",Ay)
call Ev(Jz,"Cx",Cx)
call Ev(Jz,"Cy",Cy)
call Ev(Jz,"Bx",Ax+300*Cos(Atan2(Cy-Ay,Cx-Ax)+45))
call Ev(Jz,"By",Ay+300*Sin(Atan2(Cy-Ay,Cx-Ax)+45))
call Ev(Jz,"a",1)
call Ev(Jz,"AngleOffset",-45)
call EV(Jz,"FirstPass",true)
set JZ=EQ(J1)
call Es(JZ,"Hero",EN)
call Es(JZ,"Axe",JY)
call Es(JZ,"AlreadyDamaged",CreateGroup())
call Ev(JZ,"Ax",Ax)
call Ev(JZ,"Ay",Ay)
call Ev(JZ,"Cx",Cx)
call Ev(JZ,"Cy",Cy)
call Ev(JZ,"Bx",Ax+300*Cos(Atan2(Cy-Ay,Cx-Ax)-45))
call Ev(JZ,"By",Ay+300*Sin(Atan2(Cy-Ay,Cx-Ax)-45))
call Ev(JZ,"a",1)
call Ev(JZ,"AngleOffset",45)
call EV(JZ,"FirstPass",true)
call TimerStart(J0,.035,true,function Jw)
call TimerStart(J1,.035,true,function Jw)
endfunction
function fw takes nothing returns nothing
set Cd=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cd,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cd,Condition(function JT))
call TriggerAddAction(Cd,function JX)
endfunction
function J2 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0B4'))then
return false
endif
return true
endfunction
function J3 takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0M8')
call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetTriggerUnit())
call RemoveLocation(fr)
endfunction
function fZ takes nothing returns nothing
set CD=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CD,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CD,Condition(function J2))
call TriggerAddAction(CD,function J3)
endfunction
function J4 takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0B4',GetKillingUnit())>0))then
return false
endif
if(not (IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO)))then
return false
endif
return true
endfunction
function J5 takes nothing returns nothing
local texttag g
call SetPlayerStateBJ(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(GetKillingUnit()),PLAYER_STATE_RESOURCE_GOLD)+(50*GetUnitAbilityLevelSwapped('A0B4',GetKillingUnit()))))
set g=CreateTextTagUnitBJ(("+"+I2S((GetUnitAbilityLevelSwapped('A0B4',GetKillingUnit())*50))),GetDyingUnit(),0,10,90.,84.,.0,0)
call SetTextTagVelocityBJ(g,64,90)
call PolledWait(2.)
call DestroyTextTag(g)
endfunction
function f0 takes nothing returns nothing
set Ce=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Ce,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Ce,Condition(function J4))
call TriggerAddAction(Ce,function J5)
endfunction
function J6 takes nothing returns boolean
if(not (IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false))then
return false
endif
if(not (GetRandomInt(1,10)<=GetUnitAbilityLevelSwapped('A0FV',GetAttacker())))then
return false
endif
if(not (GetUnitAbilityLevelSwapped('A0FV',GetAttacker())>0))then
return false
endif
if(not (UnitHasBuffBJ(GetAttacker(),'B04M')==false))then
return false
endif
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))then
return false
endif
return true
endfunction
function J7 takes nothing returns nothing
local location fr=GetUnitLoc(GetAttacker())
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetAttacker()),fr,fr)
call UnitAddAbility(bj_lastCreatedUnit,'A0G0')
call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetAttacker())
call RemoveLocation(fr)
endfunction
function f1 takes nothing returns nothing
set CE=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CE,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(CE,Condition(function J6))
call TriggerAddAction(CE,function J7)
endfunction
function J8 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0FW'))then
return false
endif
return true
endfunction
function Trig_Goo_Func001Func001001002 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='e00E')
endfunction
function J9 takes nothing returns nothing
call KillUnit(GetEnumUnit())
endfunction
function ka takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='e00E')
endfunction
function kA takes nothing returns boolean
if(not (GetUnitUserData(GetEnumUnit())==4))then
return false
endif
return true
endfunction
function kb takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
call SetUnitPositionLoc(GetEnumUnit(),fr)
if(kA())then
call IssueTargetOrderById(GetEnumUnit(),852662,GetSpellTargetUnit())
else
call IncUnitAbilityLevel(GetEnumUnit(),'A0FZ')
call IssueTargetOrderById(GetEnumUnit(),852662,GetSpellTargetUnit())
call SetUnitUserData(GetEnumUnit(),(GetUnitUserData(GetEnumUnit())+1))
endif
call RemoveLocation(fr)
endfunction
function kB takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local location fR=GetUnitLoc(GetSpellTargetUnit())
local group kc
if(UnitHasBuffBJ(GetSpellTargetUnit(),'B02U'))then
set kc=GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellTargetUnit()),Condition(function ka))
call ForGroupBJ(kc,function kb)
else
set kc=GetUnitsOfPlayerMatching(GetOwningPlayer(GetSpellTargetUnit()),Condition(function ka))
call ForGroupBJ(kc,function J9)
call DisableTrigger(Bv)
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetSpellTargetUnit()),fr,fR)
call EnableTrigger(Bv)
call UnitAddAbility(bj_lastCreatedUnit,'A0FZ')
call SetUnitAbilityLevelSwapped('A0FZ',bj_lastCreatedUnit,((GetUnitAbilityLevelSwapped('A0FW',GetTriggerUnit())*4)-3))
call IssueTargetOrderById(bj_lastCreatedUnit,852662,GetSpellTargetUnit())
call SetUnitUserData(bj_lastCreatedUnit,1)
endif
call DestroyGroup(kc)
call RemoveLocation(fr)
call RemoveLocation(fR)
endfunction
function f2 takes nothing returns nothing
set Cf=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cf,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cf,Condition(function J8))
call TriggerAddAction(Cf,function kB)
endfunction
function kC takes nothing returns boolean
return GetLearnedSkill()=='A0M3' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function kd takes nothing returns boolean
if(IsUnitType(GetEventDamageSource(),UNIT_TYPE_STRUCTURE))then
return false
endif
return true
endfunction
function kD takes nothing returns nothing
local unit ke=GetTriggerUnit()
local unit i9=GetEventDamageSource()
local real kE=GetUnitFacing(i9)
local real kf=GetUnitFacing(ke)
local real kF
local real kg
local real kG
local real jY=GetEventDamage()
if(GetEventDamage()>10)then
set kg=GetUnitState(ke,UNIT_STATE_LIFE)
if((kf-kE)<(-180.))then
set kF=(kf-kE+360)
else
if((kf-kE)>180.)then
set kF=(kf-kE-360)
else
set kF=(kf-kE)
endif
endif
if(RAbsBJ(kF)<=60)then
set kG=kg+(GetUnitAbilityLevel(ke,'A0M3')*.15*GetEventDamage())
call SetWidgetLife(ke,kG)
endif
endif
endfunction
function kh takes nothing returns nothing
local trigger t
if GetUnitAbilityLevel(GetTriggerUnit(),'A0M3')==1 then
set t=CreateTrigger()
call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddCondition(t,Condition(function kd))
call TriggerAddAction(t,function kD)
endif
endfunction
function f3 takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function kC))
call TriggerAddAction(t,function kh)
endfunction
function kH takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0FX'))then
return false
endif
return true
endfunction
function ki takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(),'A0G1')
call SetUnitAbilityLevelSwapped('A0G1',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0FX',GetTriggerUnit()))
call UnitAddAbility(GetTriggerUnit(),'A0G2')
call SetUnitAbilityLevelSwapped('A0G2',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0FX',GetTriggerUnit()))
call PolledWait(6.)
call UnitRemoveAbility(GetTriggerUnit(),'A0G1')
call UnitRemoveAbility(GetTriggerUnit(),'A0G2')
endfunction
function f4 takes nothing returns nothing
set Cg=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cg,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cg,Condition(function kH))
call TriggerAddAction(Cg,function ki)
endfunction
function kI takes nothing returns boolean
if(not (GetSpellAbilityId()=='A00L'))then
return false
endif
return true
endfunction
function kj takes nothing returns nothing
if(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())>=(100.*I2R(GetUnitAbilityLevelSwapped('A00L',GetTriggerUnit()))))then
call SetWidgetLife(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-(100.*I2R(GetUnitAbilityLevelSwapped('A00L',GetTriggerUnit())))))
else
call SetWidgetLife(GetTriggerUnit(),1.)
endif
endfunction
function f5 takes nothing returns nothing
set CG=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CG,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CG,Condition(function kI))
call TriggerAddAction(CG,function kj)
endfunction
function kJ takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A00V',GetTriggerUnit())>0))then
return false
endif
return true
endfunction
function kk takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetAttacker(),(5.*I2R(GetUnitAbilityLevelSwapped('A00V',GetTriggerUnit()))),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
endfunction
function f6 takes nothing returns nothing
set Ch=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Ch,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Ch,Condition(function kJ))
call TriggerAddAction(Ch,function kk)
endfunction
function kK takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0KM'))then
return false
endif
return true
endfunction
function kl takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local unit i9=GetEventDamageSource()
local unit kL=GetTriggerUnit()
local unit km=Ew(EQ(t),"Chen")
local real kM=GetEventDamage()*.07*GetUnitAbilityLevel(km,'A0KM')
if(GetEventDamage()>10)then
call DisableTrigger(t)
call UnitDamageTargetBJ(i9,kL,kM,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
call EnableTrigger(t)
endif
endfunction
function kn takes nothing returns nothing
local trigger kN=CreateTrigger()
local effect fx
local unit EN=GetTriggerUnit()
call TriggerRegisterUnitEvent(kN,GetSpellTargetUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddAction(kN,function kl)
call Es(EQ(kN),"Chen",EN)
set fx=AddSpecialEffectTargetUnitBJ("chest",EN,"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
call DestroyEffect(fx)
call PolledWait(7.)
call DisableTrigger(kN)
endfunction
function f7 takes nothing returns nothing
set CH=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CH,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CH,Condition(function kK))
call TriggerAddAction(CH,function kn)
endfunction
function ko takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0LT'))then
return false
endif
return true
endfunction
function kO takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))then
return true
endif
return false
endfunction
function kp takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer j1=GetUnitAbilityLevel(EN,'A0LT')
local group fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function kO))
local unit kP
loop
set kP=FirstOfGroup(fB)
exitwhen kP==null
if(IsUnitAlly(kP,GetOwningPlayer(EN)))then
call SetWidgetLife(kP,(GetUnitStateSwap(UNIT_STATE_LIFE,kP)+'d'+('d'*j1)))
call DestroyEffect(AddSpecialEffectTargetUnitBJ("chest",kP,"Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl"))
endif
call GroupRemoveUnit(fB,kP)
endloop
call DestroyGroup(fB)
set fB=GetUnitsInRectOfPlayer(bj_mapInitialPlayableArea,GetOwningPlayer(EN))
loop
set kP=FirstOfGroup(fB)
exitwhen kP==null
if(IsUnitType(kP,UNIT_TYPE_HERO)==false)then
call SetUnitLifePercentBJ(kP,'d')
call DestroyEffect(AddSpecialEffectTargetUnitBJ("chest",kP,"Abilities\\Spells\\Human\\Resurrect\\ResurrectTarget.mdl"))
endif
call GroupRemoveUnit(fB,kP)
endloop
call DestroyGroup(fB)
endfunction
function f8 takes nothing returns nothing
set Ci=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Ci,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Ci,Condition(function ko))
call TriggerAddAction(Ci,function kp)
endfunction
function kq takes nothing returns boolean
if(not (GetSpellAbilityId()=='A069'))then
return false
endif
return true
endfunction
function kQ takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)then
if(IsUnitAliveBJ(GetFilterUnit()))then
if(GetUnitTypeId(GetFilterUnit())!='n00I')then
if(GetUnitTypeId(GetFilterUnit())!='ncop')then
if(GetUnitAbilityLevel(GetFilterUnit(),'Aeth')==1)then
if((GetUnitAbilityLevel(GetFilterUnit(),'A0KO')==1) or (GetUnitAbilityLevel(GetFilterUnit(),'A0KQ')==1) or (GetUnitAbilityLevel(GetFilterUnit(),'A0KR')==1) or (GetUnitAbilityLevel(GetFilterUnit(),'A0KP')==1))then
return true
endif
endif
endif
endif
endif
endif
return false
endfunction
function kr takes nothing returns nothing
local unit kR=GetSpellTargetUnit()
local unit km=GetTriggerUnit()
local integer j1=GetUnitAbilityLevel(km,'A069')
local integer ks=1
local unit kP
local integer playerid=GetPlayerId(GetOwningPlayer(km))
local group fB
if(j1==1)then
call UnitAddAbility(kR,'A0KO')
endif
if(j1==2)then
call UnitAddAbility(kR,'A0KQ')
endif
if(j1==3)then
set ks=2
call UnitAddAbility(kR,'A0KR')
endif
if(j1==4)then
set ks=3
call UnitAddAbility(kR,'A0KP')
endif
call UnitAddAbility(kR,'Aeth')
call PolledWait (.01)
set fB=GetUnitsOfPlayerMatching(GetOwningPlayer(km),Condition(function kQ))
loop
exitwhen(CountUnitsInGroup(fB)<=ks)
set kP=GroupPickRandomUnit(fB)
call GroupRemoveUnit(fB,kP)
call RemoveUnit(kP)
endloop
call DestroyGroup(fB)
endfunction
function f9 takes nothing returns nothing
set CI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CI,Condition(function kq))
call TriggerAddAction(CI,function kr)
endfunction
function kS takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0LV'))then
return false
endif
return true
endfunction
function kt takes nothing returns nothing
local unit h3=GetSpellTargetUnit()
local unit km=GetTriggerUnit()
local location fr=GetUnitLoc(km)
local unit h2
local integer j1=GetUnitAbilityLevel(km,'A0LV')
local location kT
local effect fx
if(eZ(GetOwningPlayer(km)))then
set kT=GetRectCenter(A9)
else
set kT=GetRectCenter(A2)
endif
if(IsUnitAlly(h3,GetOwningPlayer(km))==false)then
call UnitDamageTargetBJ(km,h3,GetRandomInt(50*j1,'d'*j1),ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
set fx=AddSpecialEffectTargetUnitBJ("chest",h3,"Abilities\\Spells\\Human\\HolyBolt\\HolyBoltSpecialArt.mdl")
call DestroyEffect(fx)
else
if(IsUnitType(h3,UNIT_TYPE_HERO))then
if(aD[GetPlayerId(GetOwningPlayer(h3))]==false)then
set fx=AddSpecialEffectTargetUnitBJ("origin",h3,"Abilities\\Spells\\NightElf\\Starfall\\StarfallCaster.mdl")
call PolledWait(7-j1)
call DestroyEffect(fx)
call SetUnitPositionLoc(h3,kT)
endif
elseif(IsUnitOwnedByPlayer(h3,GetOwningPlayer(km)))then
call SetUnitPositionLoc(h3,kT)
endif
endif
call RemoveLocation(fr)
call RemoveLocation(kT)
endfunction
function Fa takes nothing returns nothing
set Cj=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cj,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cj,Condition(function kS))
call TriggerAddAction(Cj,function kt)
endfunction
function ku takes nothing returns boolean
if(GetSpellAbilityId()=='A03R' or GetSpellAbilityId()=='A0AV')then
return true
endif
return false
endfunction
function kU takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local string Go=EQ(t)
local unit EN
local unit h2
local integer jy
if(GetTriggerEventId()==EVENT_UNIT_SPELL_ENDCAST)then
if(GetSpellAbilityId()=='A03R' or GetSpellAbilityId()=='A0AV')then
call DisableTrigger(t)
call PolledWait(1)
call TriggerRemoveAction(t,EZ(Go,"TriggerAction"))
call Er(Go)
call DestroyTrigger(t)
endif
else
set jy=E1(Go,"Level")
set EN=Ew(Go,"UnitVar")
set h2=CreateUnit(GetOwningPlayer(EN),'e00C',GetUnitX(EN)+GetRandomReal('}',635)*Cos(GetRandomReal(0,360)),GetUnitY(EN)+GetRandomReal('}',635)*Sin(GetRandomReal(0,360)),270)
call UnitAddAbility(h2,'A03X')
call SetUnitAbilityLevel(h2,'A03X',jy)
call SetUnitPathing(h2,false)
call IssueTargetOrderById(h2,852226,h2)
call UnitApplyTimedLife(h2,'BTLF',.25)
endif
endfunction
function kv takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t=CreateTrigger()
local string Go=EQ(t)
local integer jy
if(GetSpellAbilityId()=='A03R')then
set jy=GetUnitAbilityLevel(EN,'A03R')
else
set jy=GetUnitAbilityLevel(EN,'A0AV')
endif
call TriggerRegisterTimerEvent(t,.1,true)
call TriggerRegisterUnitEvent(t,EN,EVENT_UNIT_SPELL_ENDCAST)
call Es(Go,"TriggerAction",TriggerAddAction(t,function kU))
call Es(Go,"UnitVar",EN)
call EU(Go,"Level",jy)
endfunction
function FA takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function ku))
call TriggerAddAction(t,function kv)
endfunction
function kV takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0DH'))then
return false
endif
return true
endfunction
function kw takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function kW takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction
function kx takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=1)
endfunction
function kX takes nothing returns boolean
return GetBooleanAnd(kW(),kx())
endfunction
function ky takes nothing returns boolean
return GetBooleanAnd(kw(),kX())
endfunction
function kY takes nothing returns nothing
local location kc=GetUnitLoc(GetEnumUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call SetUnitScalePercent(bj_lastCreatedUnit,25.,25.,25.)
call UnitAddAbility(bj_lastCreatedUnit,'A0DM')
call SetUnitAbilityLevelSwapped('A0DM',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0DH',GetTriggerUnit()))
call IssueImmediateOrderById(bj_lastCreatedUnit,852526)
call RemoveLocation(kc)
endfunction
function kz takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
local group kZ=GetUnitsInRangeOfLocMatching(500.,kc,Condition(function ky))
call PolledWait(.3)
call ForGroupBJ(kZ,function kY)
call RemoveLocation(kc)
call DestroyGroup(kZ)
endfunction
function Fb takes nothing returns nothing
set CJ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CJ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CJ,Condition(function kV))
call TriggerAddAction(CJ,function kz)
endfunction
function k0 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0M0'))then
return false
endif
return true
endfunction
function k1 takes nothing returns nothing
local location kT=GetSpellTargetLoc()
local location k2=GetUnitLoc(GetTriggerUnit())
local location fr
local effect fx
local destructable array k3
local player e3=GetOwningPlayer(GetTriggerUnit())
local real k4=AngleBetweenPoints(k2,kT)
local integer iu=20
local integer k5=R2I(1200/iu)
local integer EA=1
local integer Eb=iu
loop
exitwhen EA>Eb
set fr=PolarProjectionBJ(k2,EA*k5,k4)
set k3[EA]=CreateDestructableLoc('B000',fr,GetRandomReal(0,360),.5,GetRandomInt(0,2))
set fx=AddSpecialEffectLoc("Abilities\\Spells\\Other\\Volcano\\VolcanoDeath.mdl",fr)
call RemoveLocation(fr)
call DestroyEffect(fx)
set EA=EA+1
endloop
call PolledWait(8.)
set EA=1
loop
exitwhen EA>Eb
call RemoveDestructable(k3[EA])
set EA=EA+1
endloop
call RemoveLocation(kT)
call RemoveLocation(k2)
endfunction
function FB takes nothing returns nothing
set Ck=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Ck,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Ck,Condition(function k0))
call TriggerAddAction(Ck,function k1)
endfunction
function k6 takes nothing returns boolean
if((GetSpellAbilityId()=='A0M0'))then
return true
endif
if((GetSpellAbilityId()=='A0DL'))then
return true
endif
if((GetSpellAbilityId()=='A0DH'))then
return true
endif
return false
endfunction
function k7 takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0DJ',GetSpellAbilityUnit())>0))then
return false
endif
if(not k6())then
return false
endif
return true
endfunction
function k8 takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0DI')
call SetUnitAbilityLevelSwapped('A0DI',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0DJ',GetSpellAbilityUnit()))
call IssueImmediateOrderById(bj_lastCreatedUnit,852127)
call RemoveLocation(kc)
endfunction
function Fc takes nothing returns nothing
set CK=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CK,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CK,Condition(function k7))
call TriggerAddAction(CK,function k8)
endfunction
function k9 takes nothing returns boolean
if(GetItemTypeId(GetManipulatedItem())=='pnvu')then
if(GetUnitTypeId(GetTriggerUnit())=='Otch')then
return true
endif
endif
return false
endfunction
function Ka takes nothing returns nothing
local unit KA=GetTriggerUnit()
local unit h2
local location Kb=GetUnitLoc(KA)
call UnitRemoveAbility(KA,'B01P')
call PolledWait(.1)
set h2=CreateUnitAtLoc(GetOwningPlayer(KA),'e00E',Kb,bj_UNIT_FACING)
call UnitAddAbility(h2,'AIrr')
call IssueImmediateOrderById(h2,852164)
call RemoveLocation(Kb)
endfunction
function FC takes nothing returns nothing
set Cl=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cl,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(Cl,Condition(function k9))
call TriggerAddAction(Cl,function Ka)
endfunction
function KB takes nothing returns boolean
if(not (UnitHasBuffBJ(GetAttacker(),'Broa')))then
return false
endif
return true
endfunction
function Kc takes nothing returns nothing
call PolledWait(.35)
call UnitRemoveAbility(GetAttacker(),'Broa')
endfunction
function Fd takes nothing returns nothing
set CL=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CL,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(CL,Condition(function KB))
call TriggerAddAction(CL,function Kc)
endfunction
function KC takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0DX'))then
return false
endif
return true
endfunction
function Kd takes nothing returns boolean
if(not (IsUnitType(GetSpellTargetUnit(),UNIT_TYPE_HERO)==false))then
return false
endif
if(not (IsUnitType(GetSpellTargetUnit(),UNIT_TYPE_ANCIENT)==false))then
return false
endif
if(GetUnitTypeId(GetSpellTargetUnit())=='n01E')then
return false
endif
if(GetUnitTypeId(GetSpellTargetUnit())=='n019')then
return false
endif
return true
endfunction
function KD takes nothing returns boolean
return(GetOwningPlayer(GetFilterUnit())==GetOwningPlayer(GetTriggerUnit()))
endfunction
function Ke takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'Bslo'))
endfunction
function KE takes nothing returns boolean
return GetBooleanAnd(KD(),Ke())
endfunction
function Kf takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'Bslo')
endfunction
function KF takes nothing returns nothing
local group kc=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function KE))
if(Kd())then
call UnitRemoveAbility(GetSpellTargetUnit(),'Bslo')
call SetUnitOwner(GetSpellTargetUnit(),GetOwningPlayer(GetSpellAbilityUnit()),true)
call UnitApplyTimedLifeBJ(30.,'BTLF',GetSpellTargetUnit())
call UnitRemoveAbility(GetSpellTargetUnit(),'Bslo')
endif
call PolledWait(.5)
call ForGroupBJ(kc,function Kf)
call DestroyGroup(kc)
endfunction
function FD takes nothing returns nothing
set Cm=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cm,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cm,Condition(function KC))
call TriggerAddAction(Cm,function KF)
endfunction
function Kg takes nothing returns boolean
if(not (GetSpellAbilityId()=='A01B'))then
return false
endif
return true
endfunction
function KG takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitLifePercent(GetFilterUnit())=='d')then
return false
endif
if(IsUnitAliveBJ(GetFilterUnit())==false)then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())>0)then
return false
endif
if(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==false)then
return false
endif
return true
endfunction
function Kh takes nothing returns nothing
local location fr
local group fB
local integer EA=1
local integer Eb=10
local integer KH
local integer Ki=1+2*GetUnitAbilityLevel(GetTriggerUnit(),'A01B')
local unit KI
loop
exitwhen EA>Eb
set fr=GetUnitLoc(GetTriggerUnit())
set fB=GetUnitsInRangeOfLocMatching(350.,fr,Condition(function KG))
set KH=1
loop
exitwhen KH>Ki
set KI=GroupPickRandomUnit(fB)
if(KI!=null)then
call SetWidgetLife(KI,GetUnitState(KI,UNIT_STATE_LIFE)+10)
endif
set KH=KH+1
endloop
call PolledWait(1.)
call DestroyGroup(fB)
call RemoveLocation(fr)
set EA=EA+1
endloop
endfunction
function Fe takes nothing returns nothing
set CM=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CM,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CM,Condition(function Kg))
call TriggerAddAction(CM,function Kh)
endfunction
function Kj takes nothing returns boolean
if(GetLearnedSkill()!='A0DY' and IsUnitIllusion(GetTriggerUnit())==false)then
return false
endif
return true
endfunction
function KJ takes nothing returns nothing
local texttag g
local real d
if UnitHasBuffBJ(GetTriggerUnit(),'B03U') and GetUnitAbilityLevel(GetEventDamageSource(),'A0DY')>0 then
call DisableTrigger(GetTriggeringTrigger())
set d=.04*I2R(GetUnitAbilityLevel(GetEventDamageSource(),'A0DY'))*Ec(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),GetUnitX(GetEventDamageSource()),GetUnitY(GetEventDamageSource()))
if(d>400)then
set d=400
endif
set g=CreateTextTagUnitBJ("+"+I2S(R2I(d)),GetTriggerUnit(),64,10,1,85,86,15)
call SetTextTagVelocityBJ(g,64,90)
call UnitDamageTargetBJ(GetEventDamageSource(),GetTriggerUnit(),d,ATTACK_TYPE_HERO,DAMAGE_TYPE_DIVINE)
call PolledWait(1)
call DestroyTextTag(g)
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function Kk takes nothing returns boolean
if GetTriggerEventId()==EVENT_PLAYER_UNIT_ATTACKED then
if GetUnitAbilityLevel(GetAttacker(),'A0DY')==0 then
return false
elseif E3(EQ(GetTriggeringTrigger()),"OrbOn")then
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false then
return true
endif
else
return false
endif
elseif GetTriggerEventId()==EVENT_UNIT_ISSUED_ORDER then
if GetIssuedOrderId()==852255then
call EV(EQ(GetTriggeringTrigger()),"OrbOn",true)
elseif GetIssuedOrderId()==852256then
call EV(EQ(GetTriggeringTrigger()),"OrbOn",false)
endif
elseif GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT then
if GetSpellAbilityId()=='A0DY'then
return true
else
return false
endif
endif
return false
endfunction
function KK takes nothing returns nothing
local trigger r=CreateTrigger()
local unit t
if GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT then
set t=GetSpellTargetUnit()
else
set t=GetTriggerUnit()
endif
call TriggerRegisterUnitEvent(r,t,EVENT_UNIT_DAMAGED)
call TriggerAddAction(r,function KJ)
call PolledWait(2)
call DisableTrigger(r)
endfunction
function Kl takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t
local integer jy=GetUnitAbilityLevel(EN,'A0DY')
if(jy==1)then
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerRegisterUnitEvent(t,EN,EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(t,EN,EVENT_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t,Condition(function Kk))
call TriggerAddAction(t,function KK)
endif
endfunction
function FE takes nothing returns nothing
set Cn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cn,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(Cn,Condition(function Kj))
call TriggerAddAction(Cn,function Kl)
endfunction
function KL takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0DW',GetTriggerUnit())>0))then
return false
endif
return true
endfunction
function Km takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
local location kZ=GetUnitLoc(GetAttacker())
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,kZ)
call UnitAddAbility(bj_lastCreatedUnit,'A0B0')
call SetUnitAbilityLevelSwapped('A0B0',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0DW',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852662,GetAttacker())
call RemoveLocation(kc)
call RemoveLocation(kZ)
endfunction
function Ff takes nothing returns nothing
set CN=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CN,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(CN,Condition(function KL))
call TriggerAddAction(CN,function Km)
endfunction
function KM takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit())=='u004'
endfunction
function Kn takes nothing returns boolean
return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false and IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT)==false and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(Ew(EQ(GetTriggeringTrigger()),"FF")))
endfunction
function KN takes nothing returns nothing
local location Ko=GetUnitLoc(GetEnumUnit())
local location KO=GetUnitLoc(Ew(EQ(GetTriggeringTrigger()),"FF"))
local location Kp=PolarProjectionBJ(KO,DistanceBetweenPoints(KO,Ko)-2,AngleBetweenPoints(KO,Ko))
call SetUnitPositionLoc(GetEnumUnit(),Kp)
call RemoveLocation(Ko)
call RemoveLocation(KO)
call RemoveLocation(Kp)
endfunction
function KP takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local group fB
local unit FF
local string Go=EQ(t)
if GetTriggerEventId()==EVENT_UNIT_DEATH then
call DisableTrigger(t)
call PolledWait(1)
call TriggerRemoveAction(t,EZ(Go,"TriggerAction"))
call Er(Go)
call DestroyTrigger(t)
else
set FF=Ew(Go,"FF")
set fB=CreateGroup()
call GroupEnumUnitsInRange(fB,GetUnitX(FF),GetUnitY(FF),400,Condition(function Kn))
call ForGroup(fB,function KN)
call DestroyGroup(fB)
endif
endfunction
function Kq takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit FF=GetSummonedUnit()
local trigger t=CreateTrigger()
local string Go=EQ(t)
call Es(Go,"FF",FF)
call TriggerRegisterUnitEvent(t,FF,EVENT_UNIT_DEATH)
call TriggerRegisterTimerEvent(t,.05,true)
call Es(Go,"TriggerAction",TriggerAddAction(t,function KP))
call SetUnitAbilityLevel(FF,'A0C0',GetUnitAbilityLevel(EN,'A0BY'))
endfunction
function FF takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddAction(t,function Kq)
call TriggerAddCondition(t,Condition(function KM))
endfunction
function KQ takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0B3'))then
return false
endif
return true
endfunction
function Kr takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
local unit Fg=GetSpellTargetUnit()
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A01A')
call IssueTargetOrderById(bj_lastCreatedUnit,852095,Fg)
call PolledWait(2)
call RemoveLocation(kc)
set kc=GetUnitLoc(Fg)
if(GetUnitAbilityLevelSwapped('A0B3',GetTriggerUnit())>1)then
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A01A')
call IssueTargetOrderById(bj_lastCreatedUnit,852095,Fg)
call PolledWait(2)
endif
call RemoveLocation(kc)
set kc=GetUnitLoc(Fg)
if(GetUnitAbilityLevelSwapped('A0B3',GetTriggerUnit())>3)then
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A01A')
call IssueTargetOrderById(bj_lastCreatedUnit,852095,Fg)
call PolledWait(2)
endif
call RemoveLocation(kc)
endfunction
function Fg takes nothing returns nothing
set Co=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Co,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Co,Condition(function KQ))
call TriggerAddAction(Co,function Kr)
endfunction
function KR takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0B1'))then
return false
endif
return true
endfunction
function Ks takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
local location kZ=GetSpellTargetLoc()
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,kZ)
call ShowUnitHide(bj_lastCreatedUnit)
call UnitApplyTimedLifeBJ(8.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0B2')
call SetUnitAbilityLevelSwapped('A0B2',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0B1',GetTriggerUnit()))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852221,kZ)
call RemoveLocation(kc)
call RemoveLocation(kZ)
endfunction
function FG takes nothing returns nothing
set CO=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CO,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CO,Condition(function KR))
call TriggerAddAction(CO,function Ks)
endfunction
function KS takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0B7'))then
return false
endif
return true
endfunction
function Kt takes nothing returns nothing
local integer j1=GetUnitAbilityLevelSwapped('A0B7',GetTriggerUnit())
local location fr=GetUnitLoc(GetSpellTargetUnit())
local integer ir
if(j1==1)then
set ir='hwat'
endif
if(j1==2)then
set ir='hwt2'
endif
if(j1==3)then
set ir='hwt3'
endif
if(j1==4)then
set ir='h006'
endif
call RemoveUnit(GetSpellTargetUnit())
call UnitApplyTimedLifeBJ(30,'BTLF',CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),ir,fr,bj_UNIT_FACING))
call UnitApplyTimedLifeBJ(30,'BTLF',CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),ir,fr,bj_UNIT_FACING))
call UnitApplyTimedLifeBJ(30,'BTLF',CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()),ir,fr,bj_UNIT_FACING))
call RemoveLocation(fr)
endfunction
function Fh takes nothing returns nothing
set Cp=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cp,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cp,Condition(function KS))
call TriggerAddAction(Cp,function Kt)
endfunction
function KT takes nothing returns boolean
if(not (GetSpellAbilityId()=='A06Q'))then
return false
endif
return true
endfunction
function Ku takes nothing returns nothing
local destructable array dx
local integer EA
local integer Eb
local fogmodifier KU
local unit h2=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local location kT=GetUnitLoc(h3)
set KU=CreateFogModifierRadiusLocBJ(true,GetOwningPlayer(h2),FOG_OF_WAR_VISIBLE,kT,1000.)
set EA=1
set Eb=8
loop
exitwhen EA>Eb
set dx[EA]=CreateDestructableLoc('LTlt',PolarProjectionBJ(kT,150.,(I2R(EA)*45.)),GetRandomReal(0,360),1,0)
set EA=EA+1
endloop
call PolledWait((2.25+(.75*I2R(GetUnitAbilityLevelSwapped('A06Q',h2)))))
set EA=1
set Eb=8
loop
exitwhen EA>Eb
call KillDestructable(dx[EA])
set EA=EA+1
endloop
call DestroyFogModifier(KU)
call PolledWait(4.)
set EA=1
set Eb=8
loop
exitwhen EA>Eb
call RemoveDestructable(dx[EA])
set dx[EA]=null
set EA=EA+1
endloop
call RemoveLocation(kT)
endfunction
function FH takes nothing returns nothing
set CP=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CP,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CP,Condition(function KT))
call TriggerAddAction(CP,function Ku)
endfunction
function Kv takes nothing returns integer
return'A0O7'
endfunction
function KV takes nothing returns integer
return'A0OB'
endfunction
function Kw takes nothing returns integer
return'A0OC'
endfunction
function KW takes nothing returns integer
return'A0OA'
endfunction
function Kx takes nothing returns real
return 200.
endfunction
function KX takes nothing returns real
return 400.
endfunction
function Ky takes nothing returns real
return 600.
endfunction
function KY takes real x1,real y1,real x2,real y2,real x3,real y3,real x,real y returns boolean
local real Kz=(y-y1)*(x2-x1)-(x-x1)*(y2-y1)
local real KZ=(y-y3)*(x1-x3)-(x-x3)*(y1-y3)
local real K0=(y-y2)*(x3-x2)-(x-x2)*(y3-y2)
return(Kz*KZ>0) and (K0*KZ>0)
endfunction
function K1 takes nothing returns boolean
return GetSpellAbilityId()==Kv()
endfunction
function K2 takes nothing returns boolean
local unit fu=GetFilterUnit()
local location l=GetUnitLoc(fu)
if(IsUnitType(fu,UNIT_TYPE_MAGIC_IMMUNE)==false) and KY(Aq[1],Aq[2],Aq[3],Aq[4],Aq[5],Aq[6],GetLocationX(l),GetLocationY(l)) and IsUnitEnemy(fu,GetOwningPlayer(GetTriggerUnit()))then
call RemoveLocation(l)
return true
else
call RemoveLocation(l)
return false
endif
endfunction
function K3 takes nothing returns nothing
local unit K4=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()),270)
call UnitAddAbility(K4,KW())
call IssueTargetOrderById(K4,852226,GetEnumUnit())
endfunction
function K5 takes real K6,real K7,real K8,real K9,real la,real lA returns nothing
local real lb=Asin((K9-K8)/K7)
local real x=K8/Sin(lb)
local real y=(K7+K9+x)*Tan(lb)
set Aq[1]=la+x*Cos((K6-180)*bj_DEGTORAD)
set Aq[2]=lA+x*Sin((K6-180)*bj_DEGTORAD)
set Aq[7]=la+(K7+K9)*Cos(K6*bj_DEGTORAD)
set Aq[8]=lA+(K7+K9)*Sin(K6*bj_DEGTORAD)
set Aq[3]=Aq[7]+y*Cos((K6-90)*bj_DEGTORAD)
set Aq[4]=Aq[8]+y*Sin((K6-90)*bj_DEGTORAD)
set Aq[5]=Aq[7]+y*Cos((K6+90)*bj_DEGTORAD)
set Aq[6]=Aq[8]+y*Sin((K6+90)*bj_DEGTORAD)
endfunction
function lB takes nothing returns nothing
local unit u=GetTriggerUnit()
local group g
local location l=GetUnitLoc(GetTriggerUnit())
local location p=GetSpellTargetLoc()
local real f=AngleBetweenPoints(l,p)
local integer j1=GetUnitAbilityLevel(u,Kv())
local unit K4
call K5(f,Ky(),Kx(),KX(),GetLocationX(l),GetLocationY(l))
set K4=CreateUnit(GetOwningPlayer(u),'e00E',GetUnitX(u),GetUnitY(u),270)
call UnitAddAbility(K4,KV())
call SetUnitAbilityLevel(K4,KV(),j1)
call IssuePointOrderById(K4,852580,GetLocationX(p),GetLocationY(p))
set g=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function K2))
call PolledWait(.2)
call SetUnitAnimation(u,"spell")
call ForGroup(g,function K3)
set K4=CreateUnit(GetOwningPlayer(u),'e00E',GetUnitX(u)+50*Cos(Atan2(GetLocationY(p)-GetUnitY(u),GetLocationX(p)-GetUnitX(u))),GetUnitY(u)+50*Sin(Atan2(GetLocationY(p)-GetUnitY(u),GetLocationX(p)-GetUnitX(u))),270)
call UnitAddAbility(K4,Kw())
call SetUnitAbilityLevel(K4,Kw(),j1)
call IssuePointOrderById(K4,852560,GetLocationX(p),GetLocationY(p))
call PolledWait(.1)
call ResetUnitAnimation(u)
call DestroyGroup(g)
call RemoveLocation(p)
call RemoveLocation(l)
endfunction
function fX takes nothing returns nothing
set Cq=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cq,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cq,Condition(function K1))
call TriggerAddAction(Cq,function lB)
call E7(KV())
call E7(Kw())
call E7(KW())
endfunction
function lc takes nothing returns integer
return'A0O6'
endfunction
function lC takes nothing returns integer
return'A0OF'
endfunction
function ld takes nothing returns boolean
return((IsUnitType(GetFilterUnit(),UNIT_TYPE_MAGIC_IMMUNE)==false) and (IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetDyingUnit()))) and (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false) and (GetUnitAbilityLevel(GetFilterUnit(),'A04R')==0))
endfunction
function lD takes nothing returns boolean
return GetUnitTypeId(GetDyingUnit())=='e01U'
endfunction
function le takes nothing returns nothing
local unit u=GetDyingUnit()
local integer j1=GetUnitUserData(u)
local group g
local unit lE
local unit lf
set g=CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(u),GetUnitY(u),150,Filter(function ld))
loop
set lf=FirstOfGroup(g)
exitwhen(lf==null)
call GroupRemoveUnit(g,lf)
set lE=CreateUnit(GetOwningPlayer(u),'e00E',GetUnitX(lf),GetUnitY(lf),0)
call UnitAddAbility(lE,lC())
call SetUnitAbilityLevel(lE,lC(),j1)
call IssueTargetOrderById(lE,852095,lf)
call UnitApplyTimedLife(lE,'BTLF',1)
call UnitAddAbility(lE,'Aloc')
endloop
call DestroyGroup(g)
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathMissile.mdl",GetUnitX(u),GetUnitY(u)))
endfunction
function lF takes nothing returns nothing
local string Go=EQ(GetExpiredTimer())
local unit fS=Ew(Go,"Hero")
local integer jy=GetUnitAbilityLevel(fS,lc())
local real x=E2(Go,"IcePathX")
local real y=E2(Go,"IcePathY")
local real lg=E2(Go,"IcePathAngle")
local unit lE
set x=x+'d'*Cos(lg*bj_DEGTORAD)
set y=y+'d'*Sin(lg*bj_DEGTORAD)
call Ev(Go,"IcePathX",x)
call Ev(Go,"IcePathY",y)
set lE=CreateUnit(GetOwningPlayer(fS),'e01U',x,y,GetRandomReal(0,359))
call UnitApplyTimedLife(lE,'BTLF',1)
call SetUnitUserData(lE,jy)
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl",x,y))
endfunction
function lG takes nothing returns boolean
return GetSpellAbilityId()==lc()
endfunction
function lh takes nothing returns nothing
local timer t=CreateTimer()
local unit fS=GetTriggerUnit()
local location kT=GetSpellTargetLoc()
local location lH=GetUnitLoc(fS)
local string Go=EQ(t)
call Es(Go,"Hero",fS)
call Ev(Go,"IcePathX",GetUnitX(fS))
call Ev(Go,"IcePathY",GetUnitY(fS))
call Ev(Go,"IcePathAngle",AngleBetweenPoints(lH,kT))
call RemoveLocation(lH)
call RemoveLocation(kT)
call TimerStart(t,.05,true,function lF)
call TriggerSleepAction(.5)
call PauseTimer(t)
call TriggerSleepAction(1)
call Er(Go)
call DestroyTimer(t)
endfunction
function fY takes nothing returns nothing
local trigger li=CreateTrigger()
set CQ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(li,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(li,Condition(function lD))
call TriggerAddAction(li,function le)
call TriggerRegisterAnyUnitEventBJ(CQ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CQ,Condition(function lG))
call TriggerAddAction(CQ,function lh)
endfunction
function lI takes nothing returns integer
return'A0O8'
endfunction
function lj takes nothing returns integer
return'A0OD'
endfunction
function lJ takes integer j1 returns real
local real array lk
set lk[1]=25
set lk[2]=30
set lk[3]=35
set lk[4]=40
return lk[j1]
endfunction
function lK takes nothing returns real
return 800.
endfunction
function ll takes nothing returns boolean
local unit fu=GetFilterUnit()
local unit Ig=GetAttacker()
local location lL=GetUnitLoc(fu)
local location lm=GetUnitLoc(Ig)
local real k4=AngleBetweenPoints(lm,lL)
local real K6=GetUnitFacing(Ig)
local real lM=RAbsBJ(K6-(k4+180))
call RemoveLocation(lL)
call RemoveLocation(lm)
set lL=null
set lm=null
if((lM>=155) and (lM<=205) and (IsUnitType(fu,UNIT_TYPE_MAGIC_IMMUNE)==false) and (IsUnitEnemy(fu,GetOwningPlayer(Ig))) and (IsUnitType(fu,UNIT_TYPE_GROUND)) and (IsUnitType(fu,UNIT_TYPE_STRUCTURE)==false))then
set fu=null
set Ig=null
return true
else
set fu=null
set Ig=null
return false
endif
endfunction
function ln takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),lI())>0 and (IsUnitEnemy(GetAttacker(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function lN takes nothing returns nothing
local unit Ig=GetAttacker()
local location lm=GetUnitLoc(Ig)
local real K6=GetUnitFacing(Ig)
local unit Ek
local group g=GetUnitsInRangeOfLocMatching(lK(),lm,Condition(function ll))
local group lo
local unit lO
local integer j1=GetUnitAbilityLevel(Ig,lI())
if GetRandomReal(1,'d')<=lJ(j1) and CountUnitsInGroup(g)>0then
set lo=GetRandomSubGroup(1,g)
set Ek=FirstOfGroup(lo)
set lO=CreateUnit(GetOwningPlayer(Ig),'e01V',GetLocationX(lm)+'d'*Cos((K6+20)*bj_DEGTORAD),GetLocationY(lm)+'d'*Sin((K6+20)*bj_DEGTORAD),K6)
call UnitAddAbility(lO,lj())
call SetUnitAbilityLevel(lO,lj(),j1)
call IssueTargetOrderById(lO,851983,Ek)
call UnitApplyTimedLife(lO,'BTLF',10)
call DestroyGroup(lo)
call DisableTrigger(GetTriggeringTrigger())
call PolledWait(.5)
call UnitAddAbility(lO,'Abun')
call EnableTrigger(GetTriggeringTrigger())
endif
call DisableTrigger(GetTriggeringTrigger())
call PolledWait(.75)
call EnableTrigger(GetTriggeringTrigger())
call DestroyGroup(g)
call RemoveLocation(lm)
endfunction
function fy takes nothing returns nothing
set Cr=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cr,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Cr,Condition(function ln))
call TriggerAddAction(Cr,function lN)
endfunction
function lp takes nothing returns integer
return'A0O5'
endfunction
function lP takes nothing returns integer
return'A0OE'
endfunction
function lq takes integer j1 returns real
local real array K7
set K7[1]=600
set K7[2]=750
set K7[3]=900
return K7[j1]
endfunction
function lQ takes integer j1 returns real
local real array lr
set lr[1]=150
set lr[2]=150
set lr[3]=150
return lr[j1]
endfunction
function lR takes nothing returns boolean
return GetSpellAbilityId()==lp()
endfunction
function ls takes nothing returns nothing
local unit JO=GetTriggerUnit()
local location Jp=GetSpellTargetLoc()
local location JK=GetUnitLoc(JO)
local real K6=AngleBetweenPoints(JK,Jp)
local location lS
local integer j1=GetUnitAbilityLevel(JO,lp())
local integer lt=R2I(lq(j1)/lQ(j1))
local real lT=0
local unit K4
call SetUnitAnimation(JO,"spell")
loop
exitwhen(lt==0) or (GetUnitState(JO,UNIT_STATE_LIFE)==0)
call QueueUnitAnimation(JO,"spell")
set lT=lT+lQ(j1)
set lS=PolarProjectionBJ(JK,lT,K6)
set K4=CreateUnit(GetOwningPlayer(JO),'e00E',GetLocationX(lS),GetLocationY(lS),270)
call UnitAddAbility(K4,lP())
call SetUnitAbilityLevel(K4,lP(),j1)
call IssuePointOrderById(K4,852488,GetLocationX(lS),GetLocationY(lS))
call RemoveLocation(lS)
set lt=lt-1
call PolledWait(.25)
endloop
call SetUnitAnimation(JO,"stand")
call RemoveLocation(JK)
call RemoveLocation(Jp)
endfunction
function fz takes nothing returns nothing
set CR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CR,Condition(function lR))
call TriggerAddAction(CR,function ls)
endfunction
function lu takes nothing returns boolean
if(not (GetUnitTypeId(GetSummonedUnit())=='o00C'))then
return false
endif
return true
endfunction
function lU takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A058',GetSummonedUnit(),GetUnitAbilityLevelSwapped('A047',GetSummoningUnit()))
endfunction
function Fi takes nothing returns nothing
set Cs=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cs,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(Cs,Condition(function lu))
call TriggerAddAction(Cs,function lU)
endfunction
function lv takes nothing returns boolean
if(GetSpellAbilityId()=='A0M1')then
return true
endif
return false
endfunction
function lV takes nothing returns boolean
if(GetUnitTypeId(GetTriggerUnit())=='Nbbc')then
return true
endif
return false
endfunction
function lw takes nothing returns nothing
call SelectUnitRemoveForPlayer(GetTriggerUnit(),GetOwningPlayer(GetTriggerUnit()))
endfunction
function lW takes unit lx,unit h3 returns nothing
local location kT=GetUnitLoc(h3)
local location lX=GetUnitLoc(lx)
local location fr=PolarProjectionBJ(kT,50,GetRandomReal(0,360))
local effect fx
call SetUnitPositionLocFacingBJ(lx,fr,AngleBetweenPoints(lX,kT))
call SetUnitAnimation(lx,"Attack")
call UnitDamageTargetBJ(lx,h3,GetRandomReal(150,250),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
set fx=AddSpecialEffectTargetUnitBJ("chest",lx,"Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl")
call RemoveLocation(kT)
call RemoveLocation(lX)
call RemoveLocation(fr)
call DestroyEffect(fx)
endfunction
function ly takes nothing returns boolean
if(GetUnitTypeId(GetFilterUnit())!='o003')then
if(GetUnitTypeId(GetFilterUnit())!='e00C')then
if(IsUnitAliveBJ(GetFilterUnit()))then
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)then
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=1)then
return true
endif
endif
endif
endif
endif
return false
endfunction
function lY takes unit lx returns unit
local player lz=GetOwningPlayer(lx)
local unit h3
local group fB
local location lX=GetUnitLoc(lx)
local boolean lZ=false
set fB=GetUnitsInRangeOfLocMatching(575,lX,Condition(function ly))
loop
exitwhen lZ
set h3=GroupPickRandomUnit(fB)
if(IsUnitVisible(h3,lz))then
if(IsUnitEnemy(h3,lz))then
set lZ=true
endif
endif
call GroupRemoveUnit(fB,h3)
if(IsUnitGroupEmptyBJ(fB))then
if(lZ==false)then
set h3=null
endif
set lZ=true
endif
endloop
call RemoveLocation(lX)
call DestroyGroup(fB)
return h3
endfunction
function l0 takes nothing returns nothing
local trigger l1=CreateTrigger()
local unit lx=GetTriggerUnit()
local player lz=GetOwningPlayer(lx)
local unit h3=GetSpellTargetUnit()
local integer j1=GetUnitAbilityLevel(lx,'A0M1')
local integer EA=2
local integer Eb=3
local integer l2=GetUnitAbilityLevel(lx,'A05G')
if(j1==2)then
set Eb=5
endif
if(j1==3)then
set Eb=8
endif
if(l2>0)then
call SetPlayerAbilityAvailable(lz,'A05G',false)
endif
call SelectUnitRemoveForPlayer(lx,lz)
call SetUnitVertexColorBJ(lx,'d','d','d',50)
call SetUnitPathing(lx,false)
call SetUnitInvulnerable(lx,true)
call PolledWait(.01)
call TriggerRegisterPlayerSelectionEventBJ(l1,lz,true)
call TriggerAddCondition(l1,Condition(function lV))
call TriggerAddAction(l1,function lw)
if(IsUnitAliveBJ(lx))then
call lW(lx,h3)
call PolledWait(.25)
loop
exitwhen EA>Eb
set h3=lY(lx)
if(h3!=null)then
if(IsUnitAliveBJ(lx))then
call lW(lx,h3)
call PolledWait(.25)
endif
else
set EA=Eb+1
endif
set EA=EA+1
endloop
endif
call DisableTrigger(l1)
call SetUnitPathing(lx,true)
call SetUnitInvulnerable(lx,false)
call SetUnitScalePercent(lx,100.,100.,100.)
call SetUnitVertexColorBJ(lx,'d','d','d',.0)
call SelectUnitAddForPlayer(lx,lz)
if(l2>0)then
call UnitAddAbility(lx,'A05G')
call SetUnitAbilityLevel(lx,'A05G',l2)
endif
call PolledWait(.01)
if(l2>0)then
call SetPlayerAbilityAvailable(lz,'A05G',true)
endif
endfunction
function FI takes nothing returns nothing
set CS=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CS,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CS,Condition(function lv))
call TriggerAddAction(CS,function l0)
endfunction
function l3 takes nothing returns boolean
return GetSpellAbilityId()=='A07Y'
endfunction
function l4 takes nothing returns nothing
call ET(EQ(GetSpellTargetUnit()),"ManaLeakLevel",GetUnitAbilityLevel(GetTriggerUnit(),'A07Y'))
endfunction
function Fj takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function l3))
call TriggerAddAction(t,function l4)
endfunction
function l5 takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'B03V')>0
endfunction
function l6 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer jy=E0(EQ(EN),"ManaLeakLevel")
call SetUnitManaBJ(GetTriggerUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetTriggerUnit())*(.2*(5.-I2R(jy)))))
endfunction
function FJ takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function l5))
call TriggerAddAction(t,function l6)
endfunction
function l7 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A07N'))then
return false
endif
return true
endfunction
function l8 takes nothing returns nothing
local unit h2=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
call PolledWait(.01)
call SetUnitManaBJ(h3,(GetUnitStateSwap(UNIT_STATE_MANA,h3)+(75.*I2R(GetUnitAbilityLevelSwapped('A07N',h2)))))
endfunction
function Fk takes nothing returns nothing
set Ct=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Ct,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Ct,Condition(function l7))
call TriggerAddAction(Ct,function l8)
endfunction
function l9 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A085'))then
return false
endif
return true
endfunction
function La takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local integer LA=E0(Go,"Stage")
local integer Lb=E0(Go,"MaxStage")
local unit h2=Ew(Go,"Caster")
set LA=LA+1
if(LA>Lb)then
set LA=Lb
endif
call SetUnitScalePercent(h2,(100.+(15.*I2R(LA))),(100.+(15.*I2R(LA))),(100.+(15.*I2R(LA))))
call ET(Go,"Stage",LA)
endfunction
function LB takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local timer t=Ex(Go,"Timer")
local string Lc=EQ(t)
local unit h2=Ew(Lc,"Caster")
local integer LA=E0(Lc,"Stage")
local real LC=E2(Lc,"Direction")
local location fr=GetUnitLoc(h2)
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(h2),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A087')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A087',LA)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852580,PolarProjectionBJ(fr,200.,LC))
call KillUnit(h2)
call RemoveLocation(fr)
call PauseTimer(t)
call TriggerRemoveAction(GetTriggeringTrigger(),EZ(Go,"TriggerAction"))
call Er(Go)
call Er(Lc)
call PolledWait(1)
call DestroyTimer(t)
call DestroyTrigger(GetTriggeringTrigger())
endfunction
function Ld takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local timer t=CreateTimer()
local real LD=.5
local trigger Le=CreateTrigger()
local string Go=EQ(t)
call TriggerRegisterUnitEvent(Le,GetTriggerUnit(),EVENT_UNIT_SPELL_ENDCAST)
call Es(EQ(Le),"TriggerAction",TriggerAddAction(Le,function LB))
call CreateNUnitsAtLoc(1,'u00J',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(fr,150.,GetUnitFacing(GetTriggerUnit())),GetUnitFacing(GetTriggerUnit()))
call RemoveLocation(fr)
call Es(Go,"LB",Le)
call ET(Go,"Stage",0)
call ET(Go,"MaxStage",2+GetUnitAbilityLevel(GetTriggerUnit(),'A085')*2)
call Ev(Go,"Direction",GetUnitFacing(GetTriggerUnit()))
call Es(Go,"Caster",bj_lastCreatedUnit)
call Es(EQ(Le),"Timer",t)
call TimerStart(t,LD,true,function La)
endfunction
function FK takes nothing returns nothing
set CT=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CT,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CT,Condition(function l9))
call TriggerAddAction(CT,function Ld)
endfunction
function LE takes nothing returns boolean
if(GetSpellAbilityId()=='A054')then
return true
endif
if(GetSpellAbilityId()=='A00U')then
return true
endif
return false
endfunction
function Lf takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)then
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=1)then
if(IsUnitDeadBJ(GetFilterUnit())==false)then
if(GetUnitTypeId(GetFilterUnit())!='o003')then
if(GetUnitTypeId(GetFilterUnit())!='e00C')then
return true
endif
endif
endif
endif
endif
return false
endfunction
function LF takes unit Lg,integer LG,integer Lh returns nothing
local player LH=GetOwningPlayer(Lg)
local unit h3=null
local group fB
local location Li=GetUnitLoc(Lg)
local boolean lZ=false
local unit h2
set fB=GetUnitsInRangeOfLocMatching(700,Li,Condition(function Lf))
loop
exitwhen lZ
set h3=GroupPickRandomUnit(fB)
if(IsUnitVisible(h3,LH))then
if(IsUnitEnemy(h3,LH))then
if(GetUnitUserData(h3)<LG)then
call SetUnitUserData(h3,GetUnitUserData(h3)+1)
set lZ=true
endif
endif
endif
call GroupRemoveUnit(fB,h3)
if(IsUnitGroupEmptyBJ(fB))then
if(lZ==false)then
set h3=null
endif
set lZ=true
endif
endloop
if(h3!=null)then
set h2=CreateUnitAtLoc(LH,'e00C',Li,bj_UNIT_FACING)
call UnitAddAbility(h2,Lh)
call IssueTargetOrderById(h2,852231,h3)
call UnitApplyTimedLife(h2,'BTLF',2.)
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
endif
call DestroyGroup(fB)
call RemoveLocation(Li)
endfunction
function LI takes nothing returns nothing
local unit Lg=GetTriggerUnit()
local player LH=GetOwningPlayer(Lg)
local unit h3
local integer LG
local integer Lj=GetUnitAbilityLevel(Lg,'A042')
local integer Lh='A05O'
local integer LJ=GetSpellAbilityId()
local integer j1=GetUnitAbilityLevel(Lg,LJ)
local integer EA=1
local integer Eb
local group fB
local unit fT
if(GetSpellAbilityId()=='A054')then
set LG=4
else
set LG=5
endif
if(Lj==2)then
set Lh='A031'
endif
if(Lj==3)then
set Lh='A032'
endif
if(Lj==4)then
set Lh='A033'
endif
if(LJ=='A054')then
set Eb=1+(3*j1)
else
set Eb=4*j1
endif
loop
exitwhen EA>Eb
call LF(Lg,LG,Lh)
set EA=EA+1
call PolledWait(.05)
endloop
set fB=GetUnitsInRectAll(bj_mapInitialPlayableArea)
set fT=FirstOfGroup(fB)
loop
exitwhen IsUnitGroupEmptyBJ(fB)
if(IsUnitAlly(fT,LH)==false)then
call SetUnitUserData(fT,0)
endif
set fT=FirstOfGroup(fB)
call GroupRemoveUnit(fB,fT)
endloop
call PolledWait(.5)
call DestroyGroup(fB)
endfunction
function Fl takes nothing returns nothing
set Cu=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cu,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cu,Condition(function LE))
call TriggerAddAction(Cu,function LI)
endfunction
function Lk takes nothing returns boolean
if(not (GetLearnedSkill()=='A041'))then
return false
endif
return true
endfunction
function LK takes nothing returns nothing
local unit Lg=GetTriggerUnit()
local player LH=GetOwningPlayer(Lg)
local integer j1=GetUnitAbilityLevelSwapped('A041',GetTriggerUnit())
call SetPlayerTechResearchedSwap('Remg',j1,LH)
endfunction
function FL takes nothing returns nothing
set CU=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CU,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(CU,Condition(function Lk))
call TriggerAddAction(CU,function LK)
endfunction
function Ll takes nothing returns nothing
local unit EN=Ew(EQ(GetTriggeringTrigger()),"Morphling")
if(GetUnitState(EN,UNIT_STATE_LIFE)>0)then
call SetUnitVertexColorBJ(EN,GetRandomReal(.0,255.),GetRandomReal(.0,255.),GetRandomReal(.0,255.),GetRandomReal(.0,10.))
endif
endfunction
function LL takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='O00P' or GetUnitTypeId(GetTriggerUnit())=='O00D' or GetUnitTypeId(GetTriggerUnit())=='O00E') and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function Lm takes nothing returns nothing
local trigger t
if(E3(EQ(GetTriggerUnit()),"HasMorphling")==false)then
set t=CreateTrigger()
call Es(EQ(t),"Morphling",GetTriggerUnit())
call Es(EQ(GetTriggerUnit()),"ColorTrigger",t)
call TriggerAddAction(t,function Ll)
call TriggerRegisterTimerEvent(t,2.,true)
call EV(EQ(GetOwningPlayer(GetTriggerUnit())),"HasMorphling",true)
endif
endfunction
function Fm takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterEnterRectSimple(t,bj_mapInitialPlayableArea)
call TriggerAddCondition(t,Condition(function LL))
call TriggerAddAction(t,function Lm)
endfunction
function LM takes nothing returns boolean
if(not (GetSpellAbilityId()=='A06J'))then
return false
endif
return true
endfunction
function Ln takes nothing returns nothing
local unit FM=GetTriggerUnit()
local location LN=GetSpellTargetLoc()
local location kc=GetUnitLoc(GetTriggerUnit())
local real Waveformdistance=DistanceBetweenPoints(kc,LN)
call PolledWait(.01)
call SetUnitPositionLoc(FM,LN)
call RemoveLocation(LN)
call RemoveLocation(kc)
endfunction
function FM takes nothing returns nothing
set Cv=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cv,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cv,Condition(function LM))
call TriggerAddAction(Cv,function Ln)
endfunction
function Lo takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0FM'))then
return false
endif
return true
endfunction
function LO takes nothing returns nothing
local integer Lp=R2I((1.+.4*GetUnitAbilityLevelSwapped('A0FM',GetTriggerUnit()))*GetHeroAgi(GetTriggerUnit(),true)+30)
call UnitDamageTargetBJ(GetTriggerUnit(),GetSpellTargetUnit(),Lp,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
endfunction
function Fn takes nothing returns nothing
set CV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CV,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CV,Condition(function Lo))
call TriggerAddAction(CV,function LO)
endfunction
function LP takes nothing returns boolean
if(not (GetSpellAbilityId()=='A08J'))then
return false
endif
if(GetUnitTypeId(GetSpellTargetUnit())=='n00L')then
return false
endif
return true
endfunction
function Lq takes nothing returns nothing
local unit JO=GetTriggerUnit()
local unit Ek=GetSpellTargetUnit()
local location kc=GetUnitLoc(JO)
local location kZ=GetUnitLoc(Ek)
local location LQ=PolarProjectionBJ(kZ,200.,AngleBetweenPoints(kc,kZ))
call SetUnitPositionLoc(Ek,LQ)
call EnumDestructablesInCircleBJ(300,LQ,function EC)
call RemoveLocation (kc)
call RemoveLocation (kZ)
call RemoveLocation (LQ)
endfunction
function FN takes nothing returns nothing
set Cw=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cw,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cw,Condition(function LP))
call TriggerAddAction(Cw,function Lq)
endfunction
function Lr takes nothing returns boolean
return GetSpellAbilityId()=='A0F4'
endfunction
function LR takes nothing returns nothing
local integer EA
local integer Eb
local unit Ls=GetTriggerUnit()
local unit hU
local integer LS=GetUnitTypeId(Ls)
local real x=GetUnitX(Ls)
local real y=GetUnitY(Ls)
if(LS=='O00P')then
set hU=CreateUnit(GetOwningPlayer(Ls),'O00D',GetUnitX(Ls),GetUnitY(Ls),GetUnitFacing(Ls))
endif
if(LS=='O00D')then
set hU=CreateUnit(GetOwningPlayer(Ls),'O00E',GetUnitX(Ls),GetUnitY(Ls),GetUnitFacing(Ls))
endif
if(LS=='O00E')then
set hU=CreateUnit(GetOwningPlayer(Ls),'O00P',GetUnitX(Ls),GetUnitY(Ls),GetUnitFacing(Ls))
endif
call AddSpecialEffect("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",GetUnitX(Ls),GetUnitY(Ls))
call SetHeroXP(hU,GetHeroXP(Ls),false)
call ModifyHeroStat(0,hU,2,GetHeroStatBJ(0,Ls,false))
call ModifyHeroStat(1,hU,2,GetHeroStatBJ(1,Ls,false))
call ModifyHeroStat(2,hU,2,GetHeroStatBJ(2,Ls,false))
call SetUnitState(hU,UNIT_STATE_LIFE,GetUnitState(Ls,UNIT_STATE_LIFE))
call SetUnitState(hU,UNIT_STATE_MANA,GetUnitState(Ls,UNIT_STATE_MANA))
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A0NR')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A0NR')
set EA=EA+1
endloop
set EA=1
set Eb=6
loop
exitwhen EA>Eb
call UnitAddItem(hU,UnitItemInSlotBJ(Ls,EA))
set EA=EA+1
endloop
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A0F4')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A0F4')
set EA=EA+1
endloop
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A0KX')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A0KX')
set EA=EA+1
endloop
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A06J')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A06J')
set EA=EA+1
endloop
if(LS=='O00P')then
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A0FM')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A08J')
set EA=EA+1
endloop
endif
if(LS=='O00D')then
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A08J')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A0F6')
set EA=EA+1
endloop
endif
if(LS=='O00E')then
set EA=1
set Eb=GetUnitAbilityLevel(Ls,'A0F6')
loop
exitwhen EA>Eb
call SelectHeroSkill(hU,'A0FM')
set EA=EA+1
endloop
endif
call Es(EQ(EX(EQ(Ls),"ColorTrigger")),"Morphling",hU)
call Er(EQ(Ls))
set a2[GetPlayerId(GetOwningPlayer(hU))]=hU
call SelectUnitForPlayerSingle(hU,GetOwningPlayer(Ls))
call RemoveUnit(Ls)
call SetUnitPosition(hU,x,y)
endfunction
function Fo takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(t,Condition(function Lr))
call TriggerAddAction(t,function LR)
endfunction
function Lt takes nothing returns nothing
local unit LT=Ew(EQ(GetTriggeringTrigger()),"Morphling")
if(GetHeroStatBJ(1,LT,false)>2*GetUnitAbilityLevel(LT,'A0KX') and GetUnitState(LT,UNIT_STATE_MANA)>=20.)then
call SetUnitManaBJ(LT,GetUnitState(LT,UNIT_STATE_MANA)-20)
call ModifyHeroStat(1,LT,1,2*GetUnitAbilityLevel(LT,'A0KX'))
call ModifyHeroStat(0,LT,0,2*GetUnitAbilityLevel(LT,'A0KX'))
endif
endfunction
function Lu takes nothing returns nothing
local unit LT=Ew(EQ(GetTriggeringTrigger()),"Morphling")
if(GetHeroStatBJ(0,LT,false)>2*GetUnitAbilityLevel(LT,'A0KX') and GetUnitState(LT,UNIT_STATE_MANA)>=20.)then
call SetUnitManaBJ(LT,GetUnitState(LT,UNIT_STATE_MANA)-20)
call ModifyHeroStat(0,LT,1,2*GetUnitAbilityLevel(LT,'A0KX'))
call ModifyHeroStat(1,LT,0,2*GetUnitAbilityLevel(LT,'A0KX'))
endif
endfunction
function LU takes nothing returns boolean
if GetIssuedOrderId()==852550 or GetIssuedOrderId()==852547then
if GetTriggerUnit()==Ew(EQ(GetTriggeringTrigger()),"Morphling")then
return true
endif
endif
return false
endfunction
function Lv takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local trigger LV=EX(Go,"MorphStr")
local trigger Lw=EX(Go,"MorphAgi")
if(GetIssuedOrderId()==852547)then
call DisableTrigger(LV)
endif
if(GetIssuedOrderId()==852550)then
call DisableTrigger(Lw)
endif
endfunction
function LW takes nothing returns boolean
if GetIssuedOrderId()==852549 or GetIssuedOrderId()==852546then
if GetTriggerUnit()==Ew(EQ(GetTriggeringTrigger()),"Morphling")then
return true
endif
endif
return false
endfunction
function Lx takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local trigger LV=EX(Go,"MorphStr")
local trigger Lw=EX(Go,"MorphAgi")
if(GetIssuedOrderId()==852546)then
call EnableTrigger(LV)
call DisableTrigger(Lw)
endif
if(GetIssuedOrderId()==852549)then
call DisableTrigger(LV)
call EnableTrigger(Lw)
endif
endfunction
function LX takes nothing returns boolean
return GetLearnedSkill()=='A0KX' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function Ly takes nothing returns nothing
local unit LT=GetTriggerUnit()
local trigger LY
local trigger Lz
local trigger LV
local trigger Lw
if(GetUnitAbilityLevel(LT,'A0KX')==1)then
call UnitAddAbility(LT,'A0KW')
set Lw=CreateTrigger()
call DisableTrigger(Lw)
call TriggerRegisterTimerEventPeriodic(Lw,1.)
call TriggerAddAction(Lw,function Lu)
call Es(EQ(Lw),"Morphling",LT)
set LV=CreateTrigger()
call DisableTrigger(LV)
call TriggerRegisterTimerEventPeriodic(LV,1.)
call TriggerAddAction(LV,function Lt)
call Es(EQ(LV),"Morphling",LT)
set LY=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(LY,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(LY,Condition(function LW))
call TriggerAddAction(LY,function Lx)
call Es(EQ(LY),"MorphAgi",Lw)
call Es(EQ(LY),"MorphStr",LV)
call Es(EQ(LY),"Morphling",LT)
set Lz=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Lz,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(Lz,Condition(function LU))
call TriggerAddAction(Lz,function Lv)
call Es(EQ(Lz),"MorphAgi",Lw)
call Es(EQ(Lz),"MorphStr",LV)
call Es(EQ(Lz),"Morphling",LT)
else
call SetUnitAbilityLevel(LT,'A0KW',GetUnitAbilityLevel(LT,'A0KX'))
endif
endfunction
function FO takes nothing returns nothing
set CW=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CW,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(CW,Condition(function LX))
call TriggerAddAction(CW,function Ly)
endfunction
function LZ takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h2=CreateUnit(GetOwningPlayer(EN),'e00C',GetUnitX(EN),GetUnitY(EN),270)
call UnitAddAbility(h2,'A07T')
call SetUnitAbilityLevel(h2,'A07T',GetUnitAbilityLevel(EN,'A07U'))
call UnitApplyTimedLife(h2,'BTLF',1.)
call IssueTargetOrderById(h2,852227,GetEnumUnit())
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
endfunction
function L0 takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())) and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false
endfunction
function L1 takes nothing returns boolean
return GetSpellAbilityId()=='A07U'
endfunction
function L2 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer jy=GetUnitAbilityLevel(EN,'A07U')
local group fB=CreateGroup()
local boolexpr L3=Condition(function L0)
call GroupEnumUnitsInRange(fB,GetUnitX(EN),GetUnitY(EN),500+500*jy,L3)
call ForGroup(fB,function LZ)
call DestroyGroup(fB)
call DestroyBoolExpr(L3)
endfunction
function Fp takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function L1))
call TriggerAddAction(t,function L2)
endfunction
function L4 takes nothing returns boolean
return GetLearnedSkill()=='A088' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function L5 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local player e3=GetOwningPlayer(EN)
local string Go=EQ(e3)
call ET(Go,"MulticastLevel",E0(Go,"MulticastLevel")+1)
endfunction
function FP takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function L4))
call TriggerAddAction(t,function L5)
endfunction
function L6 takes nothing returns boolean
local unit L7=GetFilterUnit()
local unit EN=GetTriggerUnit()
if IsUnitAlly(L7,GetOwningPlayer(EN)) and GetUnitState(L7,UNIT_STATE_LIFE)>0 and GetUnitAbilityLevel(L7,'Bblo')==0 then
if(GetOwningPlayer(L7)==Al[0] or GetOwningPlayer(L7)==AL[0])then
if(GetUnitTypeId(L7)=='ugho' or GetUnitTypeId(L7)=='u001' or GetUnitTypeId(L7)=='unec' or GetUnitTypeId(L7)=='u002')then
return true
endif
if(GetUnitTypeId(L7)=='esen' or GetUnitTypeId(L7)=='e00V' or GetUnitTypeId(L7)=='edry' or GetUnitTypeId(L7)=='e00W')then
return true
endif
return false
elseif IsUnitType(L7,UNIT_TYPE_HERO) then
return true
endif
endif
return false
endfunction
function L8 takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A088')>0 and (GetSpellAbilityId()=='A083' or GetSpellAbilityId()=='A08I' or GetSpellAbilityId()=='A08G' or GetSpellAbilityId()=='A08F')then
if GetRandomInt(1,'d')<20 or (GetRandomInt(1,'d')<30 and GetUnitAbilityLevel(GetTriggerUnit(),'A088')<E0(EQ(GetOwningPlayer(GetTriggerUnit())),"MulticastLevel"))then
return true
endif
endif
return false
endfunction
function L9 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer jy=E0(EQ(GetOwningPlayer(EN)),"MulticastLevel")
local texttag x
local group fB=CreateGroup()
local boolexpr ma=Condition(function L6)
local unit h2
local unit fT
local integer mA=GetSpellAbilityId()
local integer EA=1
set x=CreateTextTagUnitBJ("MULTICAST!",GetTriggerUnit(),5.,10,100.,.0,.0,25.)
call SetTextTagVelocityBJ(x,64,90)
call GroupEnumUnitsInRange(fB,GetUnitX(EN),GetUnitY(EN),600,ma)
if EN!=GetSpellTargetUnit()then
call GroupAddUnit(fB,EN)
endif
call DestroyBoolExpr(ma)
loop
exitwhen EA>jy
set EA=EA+1
set h2=CreateUnit(GetOwningPlayer(EN),'e00C',GetUnitX(EN),GetUnitY(EN),270)
call UnitAddAbility(h2,mA)
call SetUnitAbilityLevel(h2,mA,GetUnitAbilityLevel(EN,mA))
call UnitApplyTimedLife(h2,'BTLF',1.)
set fT=GroupPickRandomUnit(fB)
call IssueTargetOrderById(h2,852101,fT)
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
call GroupRemoveUnit(fB,fT)
endloop
call DestroyGroup(fB)
call PolledWait(1.5)
call DestroyTextTag(x)
endfunction
function Fq takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function L8))
call TriggerAddAction(t,function L9)
endfunction
function mb takes nothing returns boolean
if GetUnitAbilityLevel(GetTriggerUnit(),'A088')>0 and (GetSpellAbilityId()=='A04W' or GetSpellAbilityId()=='A08D' or GetSpellAbilityId()=='A08A' or GetSpellAbilityId()=='A089')then
if GetRandomInt(1,'d')<20 or (GetRandomInt(1,'d')<30 and GetUnitAbilityLevel(GetTriggerUnit(),'A088')<E0(EQ(GetOwningPlayer(GetTriggerUnit())),"MulticastLevel"))then
return true
endif
endif
return false
endfunction
function mB takes nothing returns nothing
local texttag x
local location fr
local integer mc=GetSpellAbilityId()
local unit mC=GetSpellTargetUnit()
local integer jy=E0(EQ(GetOwningPlayer(GetTriggerUnit())),"MulticastLevel")
set x=CreateTextTagUnitBJ("MULTICAST!",GetTriggerUnit(),5.,10,100.,.0,.0,25.)
call SetTextTagVelocityBJ(x,64,90)
set fr=GetUnitLoc(mC)
call PolledWait(.05)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,mc)
call SetUnitAbilityLevelSwapped(mc,bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(mc,GetTriggerUnit()))
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,mC)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
if(jy>1)then
call PolledWait(.05)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,mc)
call SetUnitAbilityLevelSwapped(mc,bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(mc,GetTriggerUnit()))
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,mC)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
endif
if(jy>2)then
call PolledWait(.05)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,mc)
call SetUnitAbilityLevelSwapped(mc,bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(mc,GetTriggerUnit()))
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,mC)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
endif
if(jy>3)then
call PolledWait(.05)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,mc)
call SetUnitAbilityLevelSwapped(mc,bj_lastCreatedUnit,GetUnitAbilityLevelSwapped(mc,GetTriggerUnit()))
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,mC)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
endif
call PolledWait(1.5)
call DestroyTextTag(x)
call RemoveLocation(fr)
endfunction
function FQ takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function mb))
call TriggerAddAction(t,function mB)
endfunction
function md takes nothing returns boolean
if(not (GetSpellAbilityId()=='A08N'))then
return false
endif
return true
endfunction
function mD takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction
function me takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=1)
endfunction
function mE takes nothing returns boolean
return GetBooleanAnd(mD(),me())
endfunction
function mf takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function mF takes nothing returns boolean
return GetBooleanAnd(mE(),mf())
endfunction
function mg takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(90.*I2R(GetUnitAbilityLevelSwapped('A08N',GetTriggerUnit()))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
endfunction
function mG takes nothing returns nothing
local location fr=GetUnitLoc(GetSpellTargetUnit())
local group fB=GetUnitsInRangeOfLocMatching(250.,fr,Condition(function mF))
call SetWidgetLife(GetSpellTargetUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetSpellTargetUnit())+(90.*I2R(GetUnitAbilityLevelSwapped('A08N',GetTriggerUnit())))))
call ForGroupBJ(fB,function mg)
call DestroyGroup(fB)
call RemoveLocation(fr)
endfunction
function Fr takes nothing returns nothing
set CX=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CX,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CX,Condition(function md))
call TriggerAddAction(CX,function mG)
endfunction
function mh takes nothing returns boolean
if(not (UnitHasBuffBJ(GetTriggerUnit(),'B03A')))then
return false
endif
return true
endfunction
function mH takes nothing returns nothing
local location fr=GetUnitLoc(a2[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))])
call SetUnitPositionLoc(GetTriggerUnit(),fr)
call RemoveLocation(fr)
endfunction
function FR takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterEnterRectSimple(t,bj_mapInitialPlayableArea)
call TriggerAddCondition(t,Condition(function mh))
call TriggerAddAction(t,function mH)
endfunction
function mi takes nothing returns boolean
if(not (IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetAttacker()))))then
return false
endif
if(not (IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false))then
return false
endif
if(not (UnitHasBuffBJ(GetAttacker(),'B03B')))then
return false
endif
if(not (IsUnitType(GetTriggerUnit(),UNIT_TYPE_ANCIENT)==false))then
return false
endif
return true
endfunction
function mI takes nothing returns boolean
return GetUnitAbilityLevel(GetFilterUnit(),'B03B')>0
endfunction
function mj takes nothing returns nothing
local unit EN=GetAttacker()
local group fB=CreateGroup()
local boolexpr ma=Condition(function mI)
local integer mJ=GetRandomInt(1,'d')
local integer mk=GetUnitAbilityLevel(EN,'A0DB')
local integer mK=GetUnitAbilityLevel(EN,'A0D9')
call GroupEnumUnitsOfPlayer(fB,GetOwningPlayer(EN),ma)
call DestroyBoolExpr(ma)
if(CountUnitsInGroup(fB)<7)then
if(IsUnitIllusion(EN)==false and mJ<=(3*mk+2*mK))then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(EN),'e00E',GetUnitX(EN),GetUnitY(EN),270)
set bj_lastCreatedItem=UnitAddItemById(bj_lastCreatedUnit,'I023')
call UnitUseItemTarget(bj_lastCreatedUnit,bj_lastCreatedItem,EN)
endif
if(IsUnitIllusion(EN) and mJ<=(1+2*mK))then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(EN),'e00E',GetUnitX(EN),GetUnitY(EN),270)
set bj_lastCreatedItem=UnitAddItemById(bj_lastCreatedUnit,'I023')
call UnitUseItemTarget(bj_lastCreatedUnit,bj_lastCreatedItem,EN)
endif
endif
call DestroyGroup(fB)
endfunction
function Fs takes nothing returns nothing
set CY=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CY,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(CY,Condition(function mi))
call TriggerAddAction(CY,function mj)
endfunction
function ml takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0DA'))then
return false
endif
return true
endfunction
function mL takes nothing returns nothing
local location fr=GetUnitLoc(GetSpellTargetUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0D1')
call SetUnitAbilityLevelSwapped('A0D1',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0DA',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetSpellTargetUnit())
call RemoveLocation(fr)
endfunction
function FS takes nothing returns nothing
set Cz=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Cz,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Cz,Condition(function ml))
call TriggerAddAction(Cz,function mL)
endfunction
function mm takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0D7'))then
return false
endif
return true
endfunction
function mM takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,kc)
call UnitAddItemByIdSwapped('I010',bj_lastCreatedUnit)
call UnitUseItemTarget(bj_lastCreatedUnit,bj_lastCreatedItem,GetTriggerUnit())
call RemoveLocation(kc)
endfunction
function DW takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function mm))
call TriggerAddAction(t,function mM)
endfunction
function mn takes nothing returns boolean
return GetSpellAbilityId()=='A07Z'
endfunction
function mN takes nothing returns boolean
return IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())) and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0
endfunction
function mo takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h2=CreateUnit(GetOwningPlayer(EN),'e00E',GetUnitX(EN),GetUnitY(EN),270)
call UnitAddAbility(h2,'A06T')
call SetUnitAbilityLevel(h2,'A06T',GetUnitAbilityLevel(EN,'A07Z'))
call IssueTargetOrderById(h2,852171,GetEnumUnit())
endfunction
function mO takes nothing returns nothing
local unit EN=GetTriggerUnit()
local group fB=CreateGroup()
local boolexpr ma=Condition (function mN)
call GroupEnumUnitsInRange(fB,GetUnitX(EN),GetUnitY(EN),750,ma)
call ForGroup(fB,function mo)
call DestroyBoolExpr(ma)
call DestroyGroup(fB)
endfunction
function Ft takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function mn))
call TriggerAddAction(t,function mO)
endfunction
function mp takes nothing returns boolean
return GetSpellAbilityId()=='A01Z'
endfunction
function mP takes nothing returns boolean
if((GetDestructableTypeId(GetEnumDestructable())=='WTst'))then
set Av=true
return true
endif
if((GetDestructableTypeId(GetEnumDestructable())=='ITtc'))then
set Av=true
return true
endif
if((GetDestructableTypeId(GetEnumDestructable())=='ITtw'))then
set Av=true
return true
endif
if((GetDestructableTypeId(GetEnumDestructable())=='NTtw'))then
set Av=true
return true
endif
if((GetDestructableTypeId(GetEnumDestructable())=='ATtr'))then
set Av=true
return true
endif
return false
endfunction
function mq takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit h3=Ew(Go,"Target")
local location fr=GetUnitLoc(h3)
set Av=false
call EnumDestructablesInCircleBJ(375,fr,function mP)
call RemoveLocation(fr)
if(Av==false)then
call UnitRemoveAbility(h3,'B021')
call PauseTimer(t)
call PolledWait(1)
call Er(Go)
call DestroyTimer(t)
endif
endfunction
function mQ takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local timer t=CreateTimer()
call Es(EQ(t),"Target",h3)
call TimerStart(t,1.,true,function mq)
endfunction
function FT takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function mp))
call TriggerAddAction(t,function mQ)
endfunction
function mr takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0KD'))then
return false
endif
return true
endfunction
function mR takes nothing returns nothing
if(GetSpellAbilityId()!='A0AT')then
if(GetSpellAbilityId()!='AIpl')then
call UnitRemoveAbility(GetTriggerUnit(),'B05D')
call UnitRemoveAbility(GetTriggerUnit(),'B05M')
call UnitRemoveAbility(GetTriggerUnit(),'B05N')
call UnitRemoveAbility(GetTriggerUnit(),'B05O')
call DestroyTrigger(GetTriggeringTrigger())
endif
endif
endfunction
function ms takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit EN=Ew(Go,"CurseTarget")
local real mS=0
if(UnitHasBuffBJ(EN,'B05D'))then
set mS=5.
endif
if(UnitHasBuffBJ(EN,'B05M'))then
set mS=10.
endif
if(UnitHasBuffBJ(EN,'B05N'))then
set mS=15.
endif
if(UnitHasBuffBJ(EN,'B05O'))then
set mS=20.
endif
call SetUnitManaBJ(EN,GetUnitState(EN,UNIT_STATE_MANA)-mS)
if(mS==.0)then
call PauseTimer(t)
call Er(Go)
call PolledWait(.01)
call DestroyTimer(t)
endif
endfunction
function mt takes nothing returns nothing
local timer t=CreateTimer()
local trigger mT=CreateTrigger()
local unit EN=GetSpellTargetUnit()
call Es(EQ(t),"CurseTarget",EN)
call TimerStart(t,1.,true,function ms)
call TriggerRegisterUnitEvent(mT,EN,EVENT_UNIT_SPELL_EFFECT)
call TriggerAddAction(mT,function mR)
endfunction
function Fu takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function mr))
call TriggerAddAction(t,function mt)
endfunction
function mu takes nothing returns boolean
return GetLearnedSkill()=='A0LZ' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function mU takes nothing returns nothing
local texttag g
local real d
if(UnitHasBuffBJ(GetTriggerUnit(),'B05X') and GetUnitAbilityLevel(GetEventDamageSource(),'A0LZ')>0)then
call DisableTrigger(GetTriggeringTrigger())
set d=.15*I2R(GetUnitAbilityLevel(GetEventDamageSource(),'A0LZ')*GetHeroInt(GetEventDamageSource(),true))
set g=CreateTextTagUnitBJ("+"+I2S(R2I(d)),GetTriggerUnit(),64,10,1,85,86,15)
call SetTextTagVelocityBJ(g,64,90)
call UnitDamageTargetBJ(GetEventDamageSource(),GetTriggerUnit(),d,ATTACK_TYPE_HERO,DAMAGE_TYPE_DIVINE)
call PolledWait(1)
call DestroyTextTag(g)
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function mv takes nothing returns boolean
if(GetTriggerEventId()==EVENT_PLAYER_UNIT_ATTACKED)then
if(GetUnitAbilityLevel(GetAttacker(),'A0LZ')==0)then
return false
elseif(E3(EQ(GetTriggeringTrigger()),"OrbOn"))then
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false)then
return true
endif
else
return false
endif
elseif(GetTriggerEventId()==EVENT_UNIT_ISSUED_ORDER)then
if(GetIssuedOrderId()==852255)then
call EV(EQ(GetTriggeringTrigger()),"OrbOn",true)
elseif(GetIssuedOrderId()==852256)then
call EV(EQ(GetTriggeringTrigger()),"OrbOn",false)
endif
elseif(GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)then
if(GetSpellAbilityId()=='A0LZ')then
return true
else
return false
endif
endif
return false
endfunction
function mV takes nothing returns nothing
local trigger r=CreateTrigger()
local unit t
if(GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)then
set t=GetSpellTargetUnit()
else
set t=GetTriggerUnit()
endif
call TriggerRegisterUnitEvent(r,t,EVENT_UNIT_DAMAGED)
call TriggerAddAction(r,function mU)
call PolledWait(2)
call DisableTrigger(r)
endfunction
function mw takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t
if GetUnitAbilityLevel(EN,'A0LZ')==1 then
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerRegisterUnitEvent(t,GetLearningUnit(),EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(t,GetLearningUnit(),EVENT_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t,Condition(function mv))
call TriggerAddAction(t,function mV)
endif
endfunction
function Fv takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function mu))
call TriggerAddAction(t,function mw)
endfunction
function mW takes nothing returns boolean
return IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO) and GetUnitAbilityLevel(GetKillingUnit(),'A0LZ')>0
endfunction
function mx takes nothing returns nothing
local texttag g1
local texttag g2
call SetHeroInt(GetDyingUnit(),GetHeroInt(GetDyingUnit(),false)-1,true)
call SetHeroInt(GetKillingUnit(),GetHeroInt(GetKillingUnit(),false)+1,true)
set g1=CreateTextTagUnitBJ("+1 Int",GetKillingUnit(),'d',10,255,0,0,10)
call SetTextTagVelocityBJ(g1,64,90)
set g2=CreateTextTagUnitBJ("-1 Int",GetDyingUnit(),'d',10,255,0,0,10)
call SetTextTagVelocityBJ(g2,64,90)
call PolledWait(3.)
call DestroyTextTag(g1)
call DestroyTextTag(g2)
endfunction
function FU takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function mW))
call TriggerAddAction(t,function mx)
endfunction
function mX takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0L3'))then
return false
endif
return true
endfunction
function my takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call ShowUnitHide(bj_lastCreatedUnit)
call UnitApplyTimedLifeBJ(5.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0L2')
call SetUnitAbilityLevelSwapped('A0L2',bj_lastCreatedUnit,GetUnitAbilityLevel(GetTriggerUnit(),'A0L3'))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852592,fr)
call PolledWait(GetUnitAbilityLevel(GetTriggerUnit(),'A0L3')+3)
call RemoveLocation(fr)
endfunction
function GS takes nothing returns nothing
set CZ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(CZ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(CZ,Condition(function mX))
call TriggerAddAction(CZ,function my)
endfunction
function mY takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'B05V')>0 and GetSpellAbilityId()!='AIbk' and GetSpellAbilityId()!='A05Z'
endfunction
function mz takes nothing returns nothing
local unit h3=GetTriggerUnit()
local unit mZ=Ew(EQ(GetTriggeringTrigger()),"Silencer")
local unit h2=CreateUnit(GetOwningPlayer(mZ),'e00E',GetUnitX(h3),GetUnitY(h3),0)
call UnitAddAbility(h2,'A0LS')
call SetUnitAbilityLevel(h2,'A0LS',GetUnitAbilityLevel(mZ,'A0LR'))
call IssueTargetOrderById(h2,852668,h3)
endfunction
function m0 takes nothing returns boolean
return GetLearnedSkill()=='A0LR' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function m1 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t
if GetUnitAbilityLevel(EN,'A0LR')==1 then
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(t,Condition(function mY))
call TriggerAddAction(t,function mz)
call Es(EQ(t),"Silencer",EN)
endif
endfunction
function FV takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function m0))
call TriggerAddAction(t,function m1)
endfunction
function m2 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A064'))then
return false
endif
return true
endfunction
function m3 takes nothing returns nothing
local location l=GetSpellTargetLoc()
local location m
local location u=GetUnitLoc(GetTriggerUnit())
local integer c=4+4*GetUnitAbilityLevelSwapped('A064',GetTriggerUnit())
local unit t=GetTriggerUnit()
local unit p
loop
exitwhen c<=0
set p=CreateUnit(GetOwningPlayer(t),'e00J',GetUnitX(t),GetUnitY(t),90)
set m=PolarProjectionBJ(l,GetRandomReal(0,360),GetRandomReal(0,360))
call IssuePointOrderByIdLoc(p,851984,m)
call UnitApplyTimedLifeBJ(.5,'BTLF',p)
call RemoveLocation(m)
set c=c-1
endloop
call RemoveLocation(u)
call RemoveLocation(l)
endfunction
function SS takes nothing returns nothing
set C0=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C0,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(C0,Condition(function m2))
call TriggerAddAction(C0,function m3)
endfunction
function m4 takes nothing returns boolean
if(not (GetUnitTypeId(GetOrderedUnit())=='Usyl'))then
return false
endif
if(not (GetIssuedOrderId()==852095))then
return false
endif
return true
endfunction
function m5 takes nothing returns nothing
local player e3=GetOwningPlayer(GetOrderedUnit())
local unit EN=GetOrderTargetUnit()
local unit m6
call UnitShareVision(EN,e3,true)
set m6=CreateUnit(GetOwningPlayer(GetOrderTargetUnit()),'e01R',0,0,bj_UNIT_FACING)
call UnitAddAbility(m6,'A0NI')
call PolledWait(3.)
call UnitShareVision(EN,e3,false)
call RemoveUnit(m6)
call UnitRemoveAbility(EN,'B06H')
endfunction
function Fw takes nothing returns nothing
set C1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C1,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddCondition(C1,Condition(function m4))
call TriggerAddAction(C1,function m5)
endfunction
function m7 takes nothing returns boolean
if(not (GetLearnedSkill()=='A03U'))then
return false
endif
return true
endfunction
function m8 takes nothing returns nothing
call SetPlayerTechResearchedSwap('R005',GetUnitAbilityLevelSwapped('A03U',GetTriggerUnit()),GetOwningPlayer(GetLearningUnit()))
endfunction
function FW takes nothing returns nothing
set C2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C2,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(C2,Condition(function m7))
call TriggerAddAction(C2,function m8)
endfunction
function m9 takes nothing returns boolean
if(GetLearnedSkill()!='A00J')then
return false
endif
return true
endfunction
function Ma takes nothing returns nothing
if(GetUnitAbilityLevel(GetTriggerUnit(),'A0MB')==0)then
call UnitAddAbility(GetTriggerUnit(),'A0MB')
endif
call SetUnitAbilityLevel(GetTriggerUnit(),'A0MB',GetUnitAbilityLevel(GetTriggerUnit(),'A00J'))
endfunction
function II takes nothing returns nothing
set C3=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C3,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(C3,Condition(function m9))
call TriggerAddAction(C3,function Ma)
endfunction
function MA takes nothing returns boolean
if((RAbsBJ((GetUnitFacing(GetTriggerUnit())-GetUnitFacing(GetAttacker())))<=105.))then
return true
endif
return false
endfunction
function Mb takes nothing returns boolean
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))then
return false
endif
if(not (GetUnitAbilityLevelSwapped('A0DZ',GetAttacker())>0))then
return false
endif
if(not (IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false))then
return false
endif
if(not MA())then
return false
endif
return true
endfunction
function MB takes nothing returns nothing
local effect ip=AddSpecialEffectTargetUnitBJ("chest",GetTriggerUnit(),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
call UnitDamageTargetBJ(GetAttacker(),GetTriggerUnit(),((.25*I2R(GetUnitAbilityLevelSwapped('A0DZ',GetAttacker())))*I2R(GetHeroStatBJ(1,GetAttacker(),true))),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
call DestroyEffect(ip)
endfunction
function Fx takes nothing returns nothing
set C4=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C4,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(C4,Condition(function Mb))
call TriggerAddAction(C4,function MB)
endfunction
function Mc takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit())=='e003'
endfunction
function MC takes nothing returns nothing
local unit EN=GetSummonedUnit()
local player e3=GetOwningPlayer(EN)
local integer jy=GetUnitAbilityLevel(GetSummoningUnit(),'A0E6')
local real Md=(83+17*jy)*.01
call SetUnitScale(EN,Md,Md,Md)
if e1(e3)then
call UnitAddAbility(EN,'A019')
call SetUnitAbilityLevel(EN,'A019',jy)
else
call UnitAddAbility(EN,'A0E7')
call SetUnitAbilityLevel(EN,'A0E7',jy)
endif
call IssuePointOrderById(EN,852473,GetUnitX(EN),GetUnitY(EN))
endfunction
function FX takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(t,Condition(function Mc))
call TriggerAddAction(t,function MC)
endfunction
function MD takes nothing returns boolean
return GetSpellAbilityId()=='A0A5'
endfunction
function ME takes nothing returns boolean
if((GetUnitTypeId(GetFilterUnit())=='n01G'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n01C'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n018'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n004'))then
return true
endif
return false
endfunction
function Mf takes nothing returns nothing
local string Go=EQ(GetOwningPlayer(GetTriggerUnit()))
local unit GO=Ew(Go,"BearItemHolder")
local unit MF=Ew(Go,"MyBear")
if GO!=null then
call UnitAddItem(MF,UnitRemoveItemFromSlot(GO,0))
call UnitAddItem(MF,UnitRemoveItemFromSlot(GO,1))
call UnitAddItem(MF,UnitRemoveItemFromSlot(GO,2))
call UnitAddItem(MF,UnitRemoveItemFromSlot(GO,3))
call UnitAddItem(MF,UnitRemoveItemFromSlot(GO,4))
call UnitAddItem(MF,UnitRemoveItemFromSlot(GO,5))
endif
endfunction
function Mg takes nothing returns nothing
local unit EN=GetTriggerUnit()
local player e3=GetOwningPlayer(EN)
local location fr=GetUnitLoc(EN)
local boolexpr ma=Condition(function ME)
local group fB=CreateGroup()
local integer jy=GetUnitAbilityLevel(EN,'A0A5')
local string Go=EQ(e3)
local boolean MG
call GroupEnumUnitsOfPlayer(fB,GetOwningPlayer(EN),ma)
call DestroyBoolExpr(ma)
set MG=CountUnitsInGroup(fB)==0
if(jy==1 and MG)then
call CreateNUnitsAtLoc(1,'n004',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call Es(Go,"MyBear",bj_lastCreatedUnit)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
elseif(jy==2 and MG)then
call CreateNUnitsAtLoc(1,'n018',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call Es(Go,"MyBear",bj_lastCreatedUnit)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
elseif(jy==3 and MG)then
call CreateNUnitsAtLoc(1,'n01C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call Es(Go,"MyBear",bj_lastCreatedUnit)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
elseif(jy==4 and MG)then
call CreateNUnitsAtLoc(1,'n01G',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call Es(Go,"MyBear",bj_lastCreatedUnit)
call Mf()
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
endif
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A09Y',jy)
call DestroyGroup(fB)
call RemoveLocation(fr)
endfunction
function FY takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function MD))
call TriggerAddAction(t,function Mg)
endfunction
function Mh takes nothing returns boolean
return GetLearnedSkill()=='A0A5' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function MH takes nothing returns boolean
if((GetUnitTypeId(GetFilterUnit())=='n01C'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n018'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n004'))then
return true
endif
return false
endfunction
function Mi takes nothing returns nothing
local unit EN=GetTriggerUnit()
local player e3=GetOwningPlayer(EN)
local location fr=GetUnitLoc(EN)
local boolexpr ma=Condition(function MH)
local group fB=CreateGroup()
local integer jy=GetUnitAbilityLevel(EN,'A0A5')
local string Go=EQ(e3)
local integer MI
local unit MF
local real Mj
call GroupEnumUnitsOfPlayer(fB,GetOwningPlayer(EN),ma)
call DestroyBoolExpr(ma)
set MI=CountUnitsInGroup(fB)
if(MI>1)then
call BJDebugMsg("Bug with learn bear")
elseif(MI==1)then
set MF=FirstOfGroup(fB)
set Mj=GetUnitLifePercent(MF)
set fr=GetUnitLoc(MF)
call RemoveUnit(MF)
if(jy==2)then
call CreateNUnitsAtLoc(1,'n018',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
elseif(jy==3)then
call CreateNUnitsAtLoc(1,'n01C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
elseif(jy==4)then
call CreateNUnitsAtLoc(1,'n01G',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call AddSpecialEffectTargetUnitBJ("chest",bj_lastCreatedUnit,"Abilities\\Spells\\Orc\\FeralSpirit\\feralspiritdone.mdl")
endif
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A09Y',jy)
call SetUnitLifePercentBJ(bj_lastCreatedUnit,Mj)
call Es(Go,"MyBear",bj_lastCreatedUnit)
endif
call DestroyGroup(fB)
endfunction
function FZ takes nothing returns nothing
set C5=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C5,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(C5,Condition(function Mh))
call TriggerAddAction(C5,function Mi)
endfunction
function MJ takes nothing returns boolean
return GetUnitTypeId(GetAttacker())=='n01G' or GetUnitTypeId(GetAttacker())=='n01C' or GetUnitTypeId(GetAttacker())=='n018' or GetUnitTypeId(GetAttacker())=='n004'
endfunction
function Mk takes nothing returns nothing
local unit MF=GetAttacker()
local unit MK=a2[GetPlayerId(GetOwningPlayer(MF))]
if((GetUnitX(MK)-GetUnitX(MF))*(GetUnitX(MK)-GetUnitX(MF))+(GetUnitY(MK)-GetUnitY(MF))*(GetUnitY(MK)-GetUnitY(MF))>=2250000)then
call SetUnitX(MF,GetUnitX(MK)+GetRandomReal(25,50)*Cos(GetRandomReal(0,360)))
call SetUnitY(MF,GetUnitY(MK)+GetRandomReal(25,50)*Sin(GetRandomReal(0,360)))
endif
endfunction
function Fy takes nothing returns nothing
set C6=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C6,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(C6,Condition(function MJ))
call TriggerAddAction(C6,function Mk)
endfunction
function Ml takes nothing returns boolean
return GetSpellAbilityId()=='A0A7'
endfunction
function ML takes nothing returns nothing
local unit MF=GetTriggerUnit()
local unit MK=a2[GetPlayerId(GetOwningPlayer(MF))]
call SetUnitX(MF,GetUnitX(MK)+GetRandomReal(25,50)*Cos(GetRandomReal(0,360)))
call SetUnitY(MF,GetUnitY(MK)+GetRandomReal(25,50)*Sin(GetRandomReal(0,360)))
endfunction
function Fz takes nothing returns nothing
set C7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C7,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(C7,Condition(function Ml))
call TriggerAddAction(C7,function ML)
endfunction
function Mm takes nothing returns boolean
return GetLearnedSkill()=='A0A8' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function MM takes nothing returns nothing
call SetPlayerTechResearched(GetOwningPlayer(GetTriggerUnit()),'R000',GetPlayerTechCount(GetOwningPlayer(GetTriggerUnit()),'R000',true)+1)
call SetPlayerTechResearched(GetOwningPlayer(GetTriggerUnit()),'R001',GetPlayerTechCount(GetOwningPlayer(GetTriggerUnit()),'R001',true)+1)
endfunction
function F0 takes nothing returns nothing
set C8=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C8,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(C8,Condition(function Mm))
call TriggerAddAction(C8,function MM)
endfunction
function Mn takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='n01G' or GetUnitTypeId(GetTriggerUnit())=='n01C' or GetUnitTypeId(GetTriggerUnit())=='n018' or GetUnitTypeId(GetTriggerUnit())=='n004') and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function MN takes nothing returns nothing
local string Go=EQ(GetOwningPlayer(GetTriggerUnit()))
local unit GO=Ew(Go,"BearItemHolder")
local unit MF=Ew(Go,"MyBear")
if GO==null then
set GO=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e01F',0,0,0)
call Es(Go,"BearItemHolder",GO)
endif
if(GetItemTypeId(GetEnumItem())!='pspd' and GetItemTypeId(GetEnumItem())!='oflg')then
call UnitAddItem(GO,GetEnumItem())
endif
endfunction
function Mo takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local rect JV=RectFromCenterSizeBJ(fr,150.,150.)
local unit MK=a2[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]
call SetHeroXP(MK,(GetHeroXP(MK)-(GetHeroXP(MK)/('}'-(25*GetUnitAbilityLevel(MK,'A0A5'))))),false)
call UnitDamageTargetBJ(GetKillingUnit(),MK,(100.*I2R(GetUnitAbilityLevel(MK,'A0A5'))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
call EnumItemsInRectBJ(JV,function MN)
call RemoveLocation(fr)
call RemoveRect(JV)
endfunction
function F1 takes nothing returns nothing
set C9=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(C9,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(C9,Condition(function Mn))
call TriggerAddAction(C9,function Mo)
endfunction
function MO takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='N013' or GetUnitTypeId(GetTriggerUnit())=='N01O' or GetUnitTypeId(GetTriggerUnit())=='N015' or GetUnitTypeId(GetTriggerUnit())=='N014') and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function Mp takes nothing returns nothing
local unit MF=Ew(EQ(GetOwningPlayer(GetTriggerUnit())),"MyBear")
call KillUnit(MF)
endfunction
function F2 takes nothing returns nothing
set da=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(da,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(da,Condition(function MO))
call TriggerAddAction(da,function Mp)
endfunction
function MP takes nothing returns boolean
return GetLearnedSkill()=='A0AK' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function Mq takes nothing returns nothing
if(GetUnitAbilityLevel(GetTriggerUnit(),'A0AK')==1)then
call UnitAddAbility(GetTriggerUnit(),'A02T')
endif
endfunction
function F3 takes nothing returns nothing
set dA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dA,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(dA,Condition(function MP))
call TriggerAddAction(dA,function Mq)
endfunction
function MQ takes nothing returns boolean
if(GetSpellAbilityId()=='A0AM' or GetSpellAbilityId()=='A0A3' or GetSpellAbilityId()=='A0A4' or GetSpellAbilityId()=='A02T')then
return true
endif
return false
endfunction
function Mr takes nothing returns boolean
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)then
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())==0)then
return true
endif
endif
endif
return false
endfunction
function MR takes nothing returns nothing
call IssueImmediateOrderById(GetEnumUnit(),852556)
endfunction
function Ms takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),300.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE)
endfunction
function MS takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),450.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE)
endfunction
function Mt takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),600.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE)
endfunction
function MT takes nothing returns nothing
local group fB
local location fr=GetUnitLoc(GetTriggerUnit())
local effect fx
if(GetSpellAbilityId()=='A0AM')then
set fB=GetUnitsInRangeOfLocMatching(425.,fr,Condition(function Mr))
call ForGroupBJ(fB,function Ms)
set fx=AddSpecialEffectLocBJ(fr,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl")
call KillUnit(GetTriggerUnit())
call DestroyGroup(fB)
endif
if(GetSpellAbilityId()=='A0A3')then
set fB=GetUnitsInRangeOfLocMatching(435.,fr,Condition(function Mr))
call ForGroupBJ(fB,function MS)
set fx=AddSpecialEffectLocBJ(fr,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl")
call KillUnit(GetTriggerUnit())
call DestroyGroup(fB)
endif
if(GetSpellAbilityId()=='A0A4')then
set fB=GetUnitsInRangeOfLocMatching(450.,fr,Condition(function Mr))
call ForGroupBJ(fB,function Mt)
set fx=AddSpecialEffectLocBJ(fr,"Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl")
call KillUnit(GetTriggerUnit())
call DestroyGroup(fB)
endif
if(GetSpellAbilityId()=='A02T')then
set fB=GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()),'o018')
call ForGroupBJ(fB,function MR)
call DestroyGroup(fB)
set fB=GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()),'o002')
call ForGroupBJ(fB,function MR)
call DestroyGroup(fB)
set fB=GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetTriggerUnit()),'o00B')
call ForGroupBJ(fB,function MR)
call DestroyGroup(fB)
endif
call PolledWait(5.01)
call DestroyEffect(fx)
call RemoveLocation(fr)
endfunction
function F4 takes nothing returns nothing
set db=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(db,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddAction(db,function MT)
call TriggerAddCondition(db,Condition(function MQ))
endfunction
function Mu takes nothing returns boolean
if((GetUnitTypeId(GetTriggerUnit())=='n00O'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='n00P'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='n00Q'))then
return true
endif
if((GetUnitTypeId(GetTriggerUnit())=='n00N'))then
return true
endif
return false
endfunction
function MU takes nothing returns boolean
if GetOwningPlayer(GetFilterUnit())==GetOwningPlayer(GetTriggerUnit())then
if((GetUnitTypeId(GetFilterUnit())=='n00O'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n00P'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n00Q'))then
return true
endif
if((GetUnitTypeId(GetFilterUnit())=='n00N'))then
return true
endif
endif
return false
endfunction
function Mv takes nothing returns nothing
local string Go=EQ(GetOwningPlayer(GetTriggerUnit()))
local group fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function MU))
local integer MV=E0(Go,"GMCount")
local integer Mw=0
local unit MW
local integer Mx
local unit fT
local integer MX
local integer EA
local integer Eb
set MV=(MV+1)
call StartTimerBJ(Ex(Go,"MineTimer"+I2S(MV)),false,15000.)
call Es(Go,"GMUnit"+I2S(MV),GetTriggerUnit())
set Mw=CountUnitsInGroup(fB)
if(Mw>15)then
set Mx=99999
set EA=1
set Eb=MV
loop
exitwhen EA>Eb
set fT=Ew(Go,"GMUnit"+I2S(EA))
set MX=R2I(TimerGetRemaining(Ex(Go,"MineTimer"+I2S(EA))))
if(GetUnitState(fT,UNIT_STATE_LIFE)>0 and MX<Mx)then
set MW=fT
set Mx=MX
endif
set EA=EA+1
endloop
call ExplodeUnitBJ(MW)
endif
call ET(Go,"GMCount",MV)
call DestroyGroup(fB)
endfunction
function F5 takes nothing returns nothing
set dB=CreateTrigger()
call TriggerRegisterEnterRectSimple(dB,GetWorldBounds())
call TriggerAddCondition(dB,Condition(function Mu))
call TriggerAddAction(dB,function Mv)
endfunction
function My takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0BQ'))then
return false
endif
return true
endfunction
function MY takes nothing returns nothing
local location lo=GetUnitLoc(GetTriggerUnit())
local location kZ=GetSpellTargetLoc()
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetTriggerUnit()),lo,kZ)
call UnitAddAbility(bj_lastCreatedUnit,'A05F')
call SetUnitAbilityLevelSwapped('A05F',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0BQ',GetTriggerUnit()))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852593,kZ)
call RemoveLocation (lo)
call RemoveLocation (kZ)
endfunction
function F6 takes nothing returns nothing
set dc=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dc,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dc,Condition(function My))
call TriggerAddAction(dc,function MY)
endfunction
function Mz takes nothing returns boolean
if(not (GetSpellAbilityId()=='A049'))then
return false
endif
return true
endfunction
function MZ takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetSpellTargetUnit(),(I2R(GetUnitAbilityLevelSwapped('A049',GetTriggerUnit()))*80.),ATTACK_TYPE_MELEE,DAMAGE_TYPE_UNKNOWN)
endfunction
function F7 takes nothing returns nothing
set dC=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dC,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dC,Condition(function Mz))
call TriggerAddAction(dC,function MZ)
endfunction
function M0 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A065'))then
return false
endif
return true
endfunction
function M1 takes nothing returns nothing
local integer EA=0
local integer Eb=5
local integer array M2
set M2[0]=0
set M2[1]=0
set M2[2]=0
set M2[3]=0
set M2[4]=0
set M2[5]=0
loop
exitwhen EA>Eb
if(GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))=='rots' or GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))=='ches' or GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))=='pdiv' or GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))=='I002' or GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))=='I001' or GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))=='oven')then
set M2[EA]=GetItemTypeId(UnitItemInSlot(GetTriggerUnit(),EA))
call RemoveItem(UnitItemInSlot(GetTriggerUnit(),EA))
endif
set EA=EA+1
endloop
call UnitResetCooldown(GetTriggerUnit())
set EA=0
set Eb=5
loop
exitwhen EA>Eb
call UnitAddItemToSlotById(GetTriggerUnit(),M2[EA],EA)
set EA=EA+1
endloop
endfunction
function F8 takes nothing returns nothing
set dd=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dd,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(dd,Condition(function M0))
call TriggerAddAction(dd,function M1)
endfunction
function M3 takes nothing returns boolean
if(not (GetLearnedSkill()=='A0CY'))then
return false
endif
if((IsUnitIllusion(GetTriggerUnit())))then
return false
endif
return true
endfunction
function M4 takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='Ucrl')
endfunction
function M5 takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='Hhkl')
endfunction
function M6 takes nothing returns boolean
return(GetUnitTypeId(GetTriggerUnit())=='Hpb1')
endfunction
function M7 takes nothing returns nothing
local integer M8=1
local integer M9=6
local location kc=GetUnitLoc(GetTriggerUnit())
call DisableTrigger(GetTriggeringTrigger())
if(M4())then
call CreateNUnitsAtLoc(1,'Hhkl',GetOwningPlayer(GetTriggerUnit()),kc,GetUnitFacing(GetTriggerUnit()))
endif
if(M5())then
call CreateNUnitsAtLoc(1,'Hpb1',GetOwningPlayer(GetTriggerUnit()),kc,GetUnitFacing(GetTriggerUnit()))
endif
if(M6())then
call CreateNUnitsAtLoc(1,'Hapm',GetOwningPlayer(GetTriggerUnit()),kc,GetUnitFacing(GetTriggerUnit()))
endif
call SetHeroXP(bj_lastCreatedUnit,GetHeroXP(GetTriggerUnit()),false)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=GetUnitAbilityLevelSwapped('Aamk',GetTriggerUnit())
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SelectHeroSkill(bj_lastCreatedUnit,'Aamk')
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call SetWidgetLife(bj_lastCreatedUnit,GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit()))
call SetUnitManaBJ(bj_lastCreatedUnit,GetUnitStateSwap(UNIT_STATE_MANA,GetTriggerUnit()))
call ModifyHeroStat(0,bj_lastCreatedUnit,2,GetHeroStatBJ(0,GetTriggerUnit(),false))
call ModifyHeroStat(1,bj_lastCreatedUnit,2,GetHeroStatBJ(1,GetTriggerUnit(),false))
call ModifyHeroStat(2,bj_lastCreatedUnit,2,GetHeroStatBJ(2,GetTriggerUnit(),false))
set M8=1
set M9=6
loop
exitwhen M8>M9
call UnitAddItem(bj_lastCreatedUnit,UnitItemInSlotBJ(GetTriggerUnit(),M8))
set M8=M8+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=GetUnitAbilityLevelSwapped('A0LL',GetTriggerUnit())
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SelectHeroSkill(bj_lastCreatedUnit,'A0LL')
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=GetUnitAbilityLevelSwapped('A0BZ',GetTriggerUnit())
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SelectHeroSkill(bj_lastCreatedUnit,'A0BZ')
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=GetUnitAbilityLevelSwapped('A0BU',GetTriggerUnit())
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SelectHeroSkill(bj_lastCreatedUnit,'A0BU')
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=GetUnitAbilityLevelSwapped('A0CY',GetTriggerUnit())
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call SelectHeroSkill(bj_lastCreatedUnit,'A0CY')
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call SelectUnitForPlayerSingle(bj_lastCreatedUnit,GetOwningPlayer(GetTriggerUnit()))
call RemoveUnit(GetTriggerUnit())
call SetUnitPositionLoc(bj_lastCreatedUnit,kc)
set a2[GetPlayerId(GetOwningPlayer(bj_lastCreatedUnit))]=bj_lastCreatedUnit
call EnableTrigger(GetTriggeringTrigger())
call RemoveLocation(kc)
endfunction
function F9 takes nothing returns nothing
set dD=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dD,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(dD,Condition(function M3))
call TriggerAddAction(dD,function M7)
endfunction
function na takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0LL'))then
return false
endif
return true
endfunction
function nA takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call RemoveLocation(fr)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call ShowUnitHide(bj_lastCreatedUnit)
call UnitApplyTimedLifeBJ(10.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0KG')
call SetUnitAbilityLevelSwapped('A0KG',bj_lastCreatedUnit,GetUnitAbilityLevel(GetTriggerUnit(),'A0LL'))
set fr=GetSpellTargetLoc()
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852652,fr)
call RemoveLocation(fr)
endfunction
function ga takes nothing returns nothing
set de=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(de,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(de,Condition(function na))
call TriggerAddAction(de,function nA)
endfunction
function nb takes nothing returns boolean
if(GetSpellAbilityId()!='A0BZ')then
return false
endif
if(GetUnitTypeId(GetSpellTargetUnit())=='n00I')then
return false
endif
if(GetOwningPlayer(GetSpellTargetUnit())==GetOwningPlayer(GetTriggerUnit()))then
return false
endif
return true
endfunction
function nB takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT))then
return false
endif
if IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) then
return false
elseif IsUnitType(GetFilterUnit(),UNIT_TYPE_FLYING) then
return false
elseif GetFilterUnit()==GetSpellAbilityUnit()then
return false
elseif IsUnitDeadBJ(GetFilterUnit())then
return false
elseif IsUnitType(GetTriggerUnit(),UNIT_TYPE_ANCIENT) then
return false
elseif GetUnitTypeId(GetFilterUnit())=='n00L'then
return false
elseif IsUnitType(GetTriggerUnit(),UNIT_TYPE_GIANT) then
return false
elseif IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetSpellAbilityUnit()))==false then
return false
elseif GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=0 then
return false
elseif(GetUnitTypeId(GetFilterUnit())=='H00F' or GetUnitTypeId(GetFilterUnit())=='H00E' or GetUnitTypeId(GetFilterUnit())=='H00G')then
return false
endif
return true
endfunction
function nc takes unit h,real x,real y,real r,real d,integer ID returns nothing
local group g=CreateGroup()
local unit m
local location l
call GroupEnumUnitsInRange(g,x,y,r,null)
loop
set m=FirstOfGroup(g)
exitwhen m==null
if IsUnitEnemy(m,GetOwningPlayer(h)) and IsUnitDeadBJ(m)==false then
if(IsUnitType(m,UNIT_TYPE_STRUCTURE)==false)then
call UnitDamageTargetBJ(h,m,d,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEMOLITION)
else
call UnitDamageTargetBJ(h,m,d/3,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEMOLITION)
endif
set l=GetUnitLoc(m)
call DestroyEffect(AddSpellEffectByIdLoc(ID,EFFECT_TYPE_CASTER,l))
call DestroyEffect(AddSpellEffectByIdLoc(ID,EFFECT_TYPE_CASTER,l))
call DestroyEffect(AddSpellEffectByIdLoc(ID,EFFECT_TYPE_CASTER,l))
call RemoveLocation(l)
call GroupRemoveUnit(g,m)
else
call GroupRemoveUnit(g,m)
endif
endloop
call GroupClear(g)
call DestroyGroup(g)
endfunction
function nC takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local integer nd=E0(Go,"TossCounter")
local real nD=E2(Go,"TossDistance")
local real ne=E2(Go,"TossAngle")
local location nE=Ez(Go,"TossTargetLoc")
local location nf=Ez(Go,"TossSourceLoc")
local unit nF=Ew(Go,"Tiny")
local unit ng=Ew(Go,"TossSource")
local real y=(nd-25)*(nd-25)
local real x=nD*nd/50-nD
local location nG=PolarProjectionBJ(nE,x,ne)
if(nd<51)then
call SetUnitPositionLoc(ng,nG)
call SetUnitFlyHeight(ng,775-y,0)
set nd=nd+1
if(GetRandomInt(1,4)==2)then
call DestroyEffect(AddSpecialEffectTargetUnitBJ("origin",ng,"Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl"))
endif
endif
if(nd>50)then
call SetUnitFlyHeight(ng,GetUnitDefaultFlyHeight(ng),0)
call PauseUnit(ng,false)
call SetUnitPathing(ng,true)
call TerrainDeformationRippleBJ(.2,true,nE,1.,300.,96.,1,64.)
call UnitDamageTargetBJ(nF,ng,38.*I2R(GetUnitAbilityLevelSwapped('A0BZ',nF)),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEMOLITION)
call nc(nF,GetLocationX(nE),GetLocationY(nE),300,75.*I2R(GetUnitAbilityLevelSwapped('A0BZ',nF)),'A0BZ')
call EnumDestructablesInCircleBJ(300,nE,function EC)
call PauseTimer(GetExpiredTimer())
call PolledWait(.01)
call Er(Go)
call DestroyTimer(GetExpiredTimer())
call RemoveLocation(nE)
call RemoveLocation(nf)
endif
call ET(Go,"TossCounter",nd)
call RemoveLocation(nG)
endfunction
function nh takes nothing returns nothing
local group fB=CreateGroup()
local timer t
local unit nF=GetTriggerUnit()
local unit ng
local location nE
local location nf
local integer nd
local real nD
local real ne
local string Go
call GroupEnumUnitsInRange(fB,GetUnitX(nF),GetUnitY(nF),275,Condition(function nB))
set ng=GroupPickRandomUnit(fB)
call DestroyGroup(fB)
set nE=GetUnitLoc(GetSpellTargetUnit())
set nf=GetUnitLoc(ng)
set nd=1
set nD=DistanceBetweenPoints(nf,nE)
set ne=AngleBetweenPoints(nf,nE)
if(ng!=null and GetUnitTypeId(ng)!='n00I' and GetOwningPlayer(GetSpellTargetUnit())!=GetOwningPlayer(nF))then
call SetUnitAnimationByIndex(nF,4)
call PauseUnit(ng,true)
call SetUnitPathing(ng,false)
call UnitAddAbility(ng,'AEme')
call UnitRemoveAbility(ng,'AEme')
set t=CreateTimer()
set Go=EQ(t)
call Es(Go,"Tiny",nF)
call Es(Go,"TossSource",ng)
call Es(Go,"TossTargetLoc",nE)
call Es(Go,"TossSourceLoc",nf)
call ET(Go,"TossCounter",nd)
call Ev(Go,"TossDistance",nD)
call Ev(Go,"TossAngle",ne)
call TimerStart(t,.02,true,function nC)
endif
endfunction
function gA takes nothing returns nothing
set dE=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dE,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dE,Condition(function nb))
call TriggerAddAction(dE,function nh)
endfunction
function nH takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0BU',GetTriggerUnit())>0))then
return false
endif
if(not (IsUnitType(GetAttacker(),UNIT_TYPE_MELEE_ATTACKER)))then
return false
endif
return true
endfunction
function ni takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
if(GetRandomInt(1,'d')<=(GetUnitAbilityLevelSwapped('A0BU',GetTriggerUnit())*6))then
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,GetUnitLoc(GetAttacker()))
call UnitAddAbility(bj_lastCreatedUnit,'A0BV')
call SetUnitAbilityLevelSwapped('A0BV',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0BU',GetTriggerUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetAttacker())
endif
call RemoveLocation(fr)
endfunction
function gb takes nothing returns nothing
set df=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(df,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(df,Condition(function nH))
call TriggerAddAction(df,function ni)
endfunction
function nI takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0BE'))then
return false
endif
return true
endfunction
function nj takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A09E',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0BE',GetTriggerUnit()))
endfunction
function gf takes nothing returns nothing
set dF=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dF,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerRegisterAnyUnitEventBJ(dF,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dF,Condition(function nI))
call TriggerAddAction(dF,function nj)
endfunction
function nJ takes nothing returns boolean
if(not (GetLearnedSkill()=='A0BE'))then
return false
endif
return true
endfunction
function nk takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A09E',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0BE',GetTriggerUnit()))
endfunction
function gF takes nothing returns nothing
set dg=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dg,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(dg,Condition(function nJ))
call TriggerAddAction(dg,function nk)
endfunction
function nK takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),'B02O')>0
endfunction
function nl takes nothing returns nothing
set q[GetPlayerId(GetOwningPlayer(GetDyingUnit()))]=0
set q[GetPlayerId(GetOwningPlayer(GetAttacker()))]=(q[GetPlayerId(GetOwningPlayer(GetAttacker()))]+1)
if(q[GetPlayerId(GetOwningPlayer(GetAttacker()))]>=5)then
call UnitRemoveAbility(GetAttacker(),'B02O')
set q[GetPlayerId(GetOwningPlayer(GetAttacker()))]=0
endif
endfunction
function gB takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function nK))
call TriggerAddAction(t,function nl)
endfunction
function nL takes nothing returns boolean
return GetSpellAbilityId()=='A059'
endfunction
function nm takes nothing returns nothing
set q[GetPlayerId(GetOwningPlayer(GetTriggerUnit()))]=0
endfunction
function gc takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function nL))
call TriggerAddAction(t,function nm)
endfunction
function nM takes nothing returns boolean
if(UnitHasBuffBJ(GetAttacker(),'B02H')==false)then
return false
endif
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))then
return false
endif
return true
endfunction
function nn takes nothing returns nothing
local real nN=(GetUnitStateSwap(UNIT_STATE_LIFE,GetAttacker())*(.03+(.01*I2R(GetUnitAbilityLevelSwapped('A0LC',GetAttacker())))))
call UnitDamageTargetBJ(GetAttacker(),GetTriggerUnit(),nN,ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
endfunction
function gC takes nothing returns nothing
set dG=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dG,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(dG,Condition(function nM))
call TriggerAddAction(dG,function nn)
endfunction
function no takes nothing returns boolean
if(GetSpellAbilityId()=='A00G')then
return true
endif
return false
endfunction
function nO takes nothing returns nothing
if(IsTerrainPathable(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),PATHING_TYPE_WALKABILITY))then
call En(GetTriggerUnit())
call Eh(GetOwningPlayer(GetTriggerUnit()),"Cannot use nether swap here")
endif
endfunction
function np takes nothing returns nothing
local unit nP=GetSpellAbilityUnit()
local unit nq=GetSpellTargetUnit()
local location nQ=GetUnitLoc(nP)
local location nr=GetUnitLoc(nq)
call PolledWait(.01)
call SetUnitPositionLoc(nP,nr)
call SetUnitPositionLoc(nq,nQ)
call EnumDestructablesInCircleBJ(300,nQ,function EC)
call RemoveLocation(nr)
call RemoveLocation(nQ)
endfunction
function gd takes nothing returns nothing
local trigger t=CreateTrigger()
set dh=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dh,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dh,Condition(function no))
call TriggerAddAction(dh,function np)
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(t,Condition(function no))
call TriggerAddAction(t,function nO)
endfunction
function nR takes nothing returns boolean
if(GetSpellAbilityId()=='A020' or GetSpellAbilityId()=='A006' or GetSpellAbilityId()=='A07C')then
return true
endif
return false
endfunction
function ns takes nothing returns nothing
call SetWidgetLife(GetEnumUnit(),(GetUnitStateSwap(UNIT_STATE_LIFE,GetEnumUnit())*(.97-(.02*I2R(GetUnitAbilityLevelSwapped('A0N5',GetTriggerUnit()))))))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\Bolt\\BoltImpact.mdl",GetEnumUnit(),"origin"))
endfunction
function nS takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)then
return false
endif
if(IsUnitAlly(GetFilterUnit(),bj_groupEnumOwningPlayer))then
return false
endif
return true
endfunction
function nt takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local group fB
set bj_groupEnumOwningPlayer=GetOwningPlayer(GetTriggerUnit())
set fB=GetUnitsInRangeOfLocMatching(600.,fr,Condition(function nS))
call ForGroupBJ(fB,function ns)
call RemoveLocation(fr)
call DestroyGroup(fB)
endfunction
function gD takes nothing returns nothing
set dH=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dH,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dH,Condition(function nR))
call TriggerAddAction(dH,function nt)
endfunction
function nT takes nothing returns boolean
if((GetSpellAbilityId()=='A07C'))then
return true
endif
if((GetSpellAbilityId()=='A06L'))then
return true
endif
return false
endfunction
function nu takes nothing returns boolean
if(not nT())then
return false
endif
return true
endfunction
function nU takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)!=null)
endfunction
function nv takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function nV takes nothing returns boolean
return GetBooleanAnd(nU(),nv())
endfunction
function nw takes nothing returns boolean
if(not (GetSpellAbilityId()=='A07C'))then
return false
endif
return true
endfunction
function nW takes nothing returns nothing
local location fr=GetUnitLoc(GetEnumUnit())
if(nw())then
call CreateNUnitsAtLoc(1,'e000',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A05S')
call SetUnitAbilityLevelSwapped('A05S',bj_lastCreatedUnit,(4+GetUnitAbilityLevelSwapped('A07C',GetTriggerUnit())))
call IssueTargetOrderById(bj_lastCreatedUnit,852119,GetEnumUnit())
call UnitApplyTimedLifeBJ(3.,'BTLF',bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
else
call CreateNUnitsAtLoc(1,'e000',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A05S')
call SetUnitAbilityLevelSwapped('A05S',bj_lastCreatedUnit,(5+GetUnitAbilityLevelSwapped('A06L',GetTriggerUnit())))
call IssueTargetOrderById(bj_lastCreatedUnit,852119,GetEnumUnit())
call UnitApplyTimedLifeBJ(3.,'BTLF',bj_lastCreatedUnit)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
endif
call RemoveLocation(fr)
endfunction
function nx takes nothing returns nothing
local group fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function nV))
call ForGroupBJ(fB,function nW)
call DestroyGroup(fB)
endfunction
function ge takes nothing returns nothing
set di=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(di,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(di,Condition(function nu))
call TriggerAddAction(di,function nx)
endfunction
function nX takes nothing returns boolean
if(not (GetSpellAbilityId()=='A006'))then
return false
endif
return true
endfunction
function ny takes nothing returns nothing
local unit K4=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e000',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()),bj_UNIT_FACING)
call UnitAddAbility(K4,'A05S')
call SetUnitAbilityLevelSwapped('A05S',K4,GetUnitAbilityLevelSwapped('A006',GetTriggerUnit()))
call IssueTargetOrderById(K4,852119,GetSpellTargetUnit())
call UnitApplyTimedLifeBJ(3.,'BTLF',K4)
call SetUnitPathing(K4,false)
call SetUnitInvulnerable(K4,true)
call UnitAddAbility(K4,'Aloc')
endfunction
function gE takes nothing returns nothing
set dI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dI,Condition(function nX))
call TriggerAddAction(dI,function ny)
endfunction
function nY takes nothing returns boolean
return GetLearnedSkill()=='A0NS' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function nz takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local timer nZ=CreateTimer()
call StartTimerBJ(nZ,false,45)
loop
exitwhen TimerGetRemaining(nZ)<=.0
call PolledWait(.5)
endloop
call EV(Go,"BTOn",false)
call PauseTimer(nZ)
call PolledWait(1)
call DestroyTimer(nZ)
endfunction
function EndDuration3 takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
call PolledWait(3)
call EV(Go,"BTDuration",false)
call DestroyEffect(EY(Go,"BTFX"))
endfunction
function EndDuration4 takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
call PolledWait(4)
call EV(Go,"BTDuration",false)
call DestroyEffect(EY(Go,"BTFX"))
endfunction
function EndDuration5 takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
call PolledWait(5)
call EV(Go,"BTDuration",false)
call DestroyEffect(EY(Go,"BTFX"))
endfunction
function n0 takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local boolean n1=E3(Go,"BTOn")
local boolean n2=E3(Go,"BTDuration")
if(n2)then
call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+GetEventDamage())
elseif(n1==false and ((GetTriggerEventId()==EVENT_UNIT_DAMAGED and GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<400) or (GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)))then
if(GetTriggerEventId()==EVENT_UNIT_DAMAGED)then
call DisableTrigger(GetTriggeringTrigger())
call IssueImmediateOrderById(GetTriggerUnit(),852129)
call EnableTrigger(GetTriggeringTrigger())
endif
set n1=true
set n2=true
call EV(Go,"BTOn",n1)
call EV(Go,"BTDuration",n2)
call UnitRemoveBuffsBJ(1,GetTriggerUnit())
call Es(Go,"BTFX",AddSpecialEffectTarget("Abilities\\Spells\\Undead\\Unsummon\\UnsummonTarget.mdl",GetTriggerUnit(),"origin"))
call ExecuteFunc("EndDuration"+I2S(2+GetUnitAbilityLevel(GetTriggerUnit(),'A0NS')))
call ExecuteFunc("nz")
endif
endfunction
function n3 takes nothing returns boolean
if(GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT)then
if(GetSpellAbilityId()=='A0NS')then
return true
endif
endif
if(GetTriggerEventId()==EVENT_UNIT_DAMAGED)then
if GetEventDamage()>1 then
return true
endif
endif
return false
endfunction
function n4 takes nothing returns nothing
local trigger t
if(GetUnitAbilityLevel(GetTriggerUnit(),'A0NS')==1)then
set t=CreateTrigger()
call EV(EQ(t),"BTOn",false)
call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_SPELL_EFFECT)
call TriggerAddAction(t,function n0)
call TriggerAddCondition(t,Condition(function n3))
endif
endfunction
function GF takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function nY))
call TriggerAddAction(t,function n4)
endfunction
function n5 takes nothing returns boolean
if(GetSpellAbilityId()!='A0MF')then
return false
endif
return true
endfunction
function n6 takes nothing returns boolean
if(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=0)then
return false
endif
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
return true
endfunction
function n7 takes nothing returns nothing
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Ar),'e00E',GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0MJ')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A0MJ',GetUnitAbilityLevel(Ar,'A0MF'))
call IssueTargetOrderById(bj_lastCreatedUnit,852587,GetEnumUnit())
endfunction
function n8 takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local group fB=GetUnitsInRangeOfLocMatching(500,fr,Condition(function n6))
call ForGroup(fB,function n7)
call DestroyGroup(fB)
call RemoveLocation(fr)
endfunction
function n9 takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local real Na=E2(Go,"AphoticLife")
if(Na<GetEventDamage())then
call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+Na)
call DestroyEffect(EY(Go,"AphoticFX"))
call DisableTrigger(GetTriggeringTrigger())
call EV(Go,"AphoticDone",true)
set Ar=Ew(Go,"AphoticOwner")
call n8()
elseif(GetEventDamage()>0)then
call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+GetEventDamage())
call Ev(Go,"AphoticLife",Na-GetEventDamage())
endif
endfunction
function NA takes nothing returns nothing
local trigger t=CreateTrigger()
local string Go=EQ(t)
local triggeraction ta=TriggerAddAction(t,function n9)
call TriggerRegisterUnitEvent(t,GetSpellTargetUnit(),EVENT_UNIT_DAMAGED)
call UnitRemoveBuffsBJ(1,GetSpellTargetUnit())
call Ev(Go,"AphoticLife",50+50*GetUnitAbilityLevel(GetTriggerUnit(),'A0MF'))
call Es(Go,"AphoticFX",AddSpecialEffectTarget("war3mapImported\\Defensive Barrier big.mdx",GetSpellTargetUnit(),"chest"))
call Es(Go,"AphoticOwner",GetTriggerUnit())
call EV(Go,"AphoticDone",false)
call PolledWait(20)
if(E3(Go,"AphoticDone")==false)then
call DestroyEffect(EY(Go,"AphoticFX"))
endif
call Er(Go)
call TriggerRemoveAction(t,ta)
call DestroyTrigger(t)
endfunction
function Gf takes nothing returns nothing
set dj=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dj,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dj,Condition(function n5))
call TriggerAddAction(dj,function NA)
endfunction
function Nb takes nothing returns boolean
if(GetSpellAbilityId()!='A0MI')then
return false
endif
return true
endfunction
function NB takes nothing returns nothing
if(IsUnitEnemy(GetAttacker(),GetOwningPlayer(GetTriggerUnit())))then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(GetAttacker()),GetUnitY(GetAttacker()),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0MH')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A0MH',E0(EQ(GetTriggeringTrigger()),"MarkLevel"))
call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetAttacker())
endif
endfunction
function Nc takes nothing returns nothing
local trigger t=CreateTrigger()
local effect ip=AddSpecialEffectTargetUnitBJ("chest",GetSpellTargetUnit(),"Abilities\\Spells\\Undead\\Cripple\\CrippleTarget.mdl")
call TriggerRegisterUnitEvent(t,GetSpellTargetUnit(),EVENT_UNIT_ATTACKED)
call TriggerAddAction(t,function NB)
call ET(EQ(t),"MarkLevel",GetUnitAbilityLevel(GetTriggerUnit(),'A0MI'))
call PolledWait(20)
call DestroyEffect(ip)
call DisableTrigger(t)
endfunction
function GE takes nothing returns nothing
set dJ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dJ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dJ,Condition(function Nb))
call TriggerAddAction(dJ,function Nc)
endfunction
function NC takes nothing returns boolean
if(not (UnitHasBuffBJ(GetKillingUnit(),'B03O')))then
return false
endif
return true
endfunction
function Nd takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'B03O')
endfunction
function ND takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A04R',GetKillingUnit())>0))then
return false
endif
return true
endfunction
function Ne takes nothing returns nothing
local group fB=GetUnitsOfPlayerAll(GetOwningPlayer(GetKillingUnit()))
if(NC())then
call UnitRemoveAbility(GetKillingUnit(),'B03O')
endif
if(ND())then
call ForGroupBJ(fB,function Nd)
endif
call DestroyGroup(fB)
endfunction
function gg takes nothing returns nothing
set dk=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dk,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(dk,function Ne)
endfunction
function NE takes nothing returns boolean
if(not (UnitHasBuffBJ(GetTriggerUnit(),'B03P')))then
return false
endif
if(not (IsUnitType(GetAttacker(),UNIT_TYPE_STRUCTURE)==false))then
return false
endif
if(not (IsUnitType(GetAttacker(),UNIT_TYPE_MECHANICAL)==false))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetAttacker())!=0)then
return false
endif
if(IsUnitAlly(GetAttacker(),GetTriggerPlayer()))then
return false
endif
return true
endfunction
function Nf takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(IsUnitDeadBJ(GetFilterUnit()))then
return false
endif
if(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=0)then
return false
endif
if(UnitHasBuffBJ(GetFilterUnit(),'B02J'))then
return false
endif
return true
endfunction
function NF takes nothing returns nothing
local effect ip=AddSpecialEffectTargetUnitBJ("origin",GetEnumUnit(),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
call DestroyEffect(ip)
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),I2R(75+(25*GetUnitAbilityLevelSwapped('A0C6',GetTriggerUnit()))),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
endfunction
function Ng takes nothing returns boolean
if(GetRandomReal(0,100.)<15.)then
return true
endif
return false
endfunction
function NG takes nothing returns nothing
local group fB
local location fr
if(Ng())then
set fr=GetUnitLoc(GetTriggerUnit())
set fB=GetUnitsInRangeOfLocMatching(300.,fr,Condition(function Nf))
call ForGroupBJ(fB,function NF)
call SetUnitAnimation(GetTriggerUnit(),"spin")
call DisableTrigger(GetTriggeringTrigger())
call PolledWait(.6)
call ResetUnitAnimation(GetTriggerUnit())
call EnableTrigger(GetTriggeringTrigger())
call DestroyGroup(fB)
call RemoveLocation(fr)
endif
endfunction
function gG takes nothing returns nothing
set dK=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dK,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(dK,Condition(function NE))
call TriggerAddAction(dK,function NG)
endfunction
function Nh takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0C7'))then
return false
endif
return true
endfunction
function NH takes nothing returns boolean
if(UnitHasBuffBJ(GetFilterUnit(),'BHwe'))then
if((UnitHasBuffBJ(GetFilterUnit(),'B008')==false) or (UnitHasBuffBJ(GetFilterUnit(),'Bcyc')==false))then
return true
endif
endif
return false
endfunction
function Ni takes nothing returns nothing
call IssueTargetOrderById(GetEnumUnit(),851983,Ar)
endfunction
function NI takes nothing returns boolean
return(UnitHasBuffBJ(GetFilterUnit(),'BHwe'))
endfunction
function Nj takes nothing returns boolean
return GetOwningPlayer(GetFilterUnit())==Al[0] or GetOwningPlayer(GetFilterUnit())==AL[0]
endfunction
function NJ takes nothing returns boolean
return GetBooleanAnd(NI(),Nj())
endfunction
function Nk takes nothing returns nothing
if(GetOwningPlayer(GetEnumUnit())==Al[0])then
call UnitRemoveAbility(GetEnumUnit(),'BHwe')
call IssuePointOrderByIdLoc(GetEnumUnit(),851983,GetRectCenter(bl))
endif
if(GetOwningPlayer(GetEnumUnit())==AL[0])then
call UnitRemoveAbility(GetEnumUnit(),'BHwe')
call IssuePointOrderByIdLoc(GetEnumUnit(),851983,GetRectCenter(bK))
endif
endfunction
function NK takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'BHwe')>0
endfunction
function Nl takes nothing returns nothing
local unit JW=Ew(EQ(GetTriggeringTrigger()),"Axe")
if GetUnitState(JW,UNIT_STATE_LIFE)>0 then
call DisableTrigger(GetTriggeringTrigger())
call IssueTargetOrderById(GetTriggerUnit(),851983,JW)
call EnableTrigger(GetTriggeringTrigger())
endif
endfunction
function Nm takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local group fB
local trigger t=CreateTrigger()
local unit NM=GetSpellAbilityUnit()
call Es(EQ(t),"Axe",GetTriggerUnit())
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t,Condition(function NK))
call TriggerAddAction(t,function Nl)
call PolledWait(.2)
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,fr)
call RemoveLocation(fr)
call UnitAddAbility(bj_lastCreatedUnit,'A0E1')
call SetUnitAbilityLevelSwapped('A0E1',bj_lastCreatedUnit,GetUnitAbilityLevel(NM,'A0C7'))
call IssueTargetOrderById(bj_lastCreatedUnit,852066,GetTriggerUnit())
set fr=GetUnitLoc(NM)
set fB=GetUnitsInRangeOfLocMatching(550.,fr,Condition(function NH))
set Ar=NM
call ForGroupBJ(fB,function Ni)
call RemoveLocation(fr)
call DestroyGroup(fB)
call PolledWait(1+.5*GetUnitAbilityLevel(NM,'A0C7'))
set fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function NJ))
call ForGroupBJ(fB,function Nk)
call DestroyGroup(fB)
call Er(EQ(t))
call TriggerClearActions(t)
call DestroyTrigger(t)
endfunction
function gh takes nothing returns nothing
set dl=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dl,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dl,Condition(function Nh))
call TriggerAddAction(dl,function Nm)
endfunction
function Nn takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0E2'))then
return false
endif
return true
endfunction
function NN takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0E2',GetSpellAbilityUnit())==1))then
return false
endif
if(not (GetUnitStateSwap(UNIT_STATE_LIFE,GetSpellTargetUnit())<=300.))then
return false
endif
return true
endfunction
function No takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0E2',GetSpellAbilityUnit())==2))then
return false
endif
if(not (GetUnitStateSwap(UNIT_STATE_LIFE,GetSpellTargetUnit())<=450.))then
return false
endif
return true
endfunction
function NO takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A0E2',GetSpellAbilityUnit())==3))then
return false
endif
if(not (GetUnitStateSwap(UNIT_STATE_LIFE,GetSpellTargetUnit())<=625.))then
return false
endif
return true
endfunction
function Np takes nothing returns nothing
local location kc=GetUnitLoc(GetTriggerUnit())
if(NN())then
call UnitRemoveBuffsBJ(2,GetSpellTargetUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitDamageTargetBJ(bj_lastCreatedUnit,GetSpellTargetUnit(),100000000.,ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endif
if(No())then
call UnitRemoveBuffsBJ(2,GetSpellTargetUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitDamageTargetBJ(bj_lastCreatedUnit,GetSpellTargetUnit(),100000000.,ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endif
if(NO())then
call UnitRemoveBuffsBJ(2,GetSpellTargetUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitDamageTargetBJ(bj_lastCreatedUnit,GetSpellTargetUnit(),100000000.,ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
endif
call RemoveLocation(kc)
endfunction
function gH takes nothing returns nothing
set dL=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dL,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dL,Condition(function Nn))
call TriggerAddAction(dL,function Np)
endfunction
function NP takes nothing returns boolean
if(GetSpellAbilityId()=='A0GK')then
return true
endif
return false
endfunction
function Nq takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetSpellTargetUnit(),75*GetUnitAbilityLevel(GetTriggerUnit(),'A0GK'),ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+75*GetUnitAbilityLevel(GetTriggerUnit(),'A0GK'))
endfunction
function NQ takes nothing returns boolean
return GetSpellAbilityId()=='A04Y' and GetUnitTypeId(GetSpellTargetUnit())!='n00I'
endfunction
function Nr takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'B02F')>0
endfunction
function NR takes nothing returns nothing
local unit EN=Ew(EQ(GetTriggeringTrigger()),"UnitVar")
local integer jy=GetUnitAbilityLevel(EN,'A04Y')
local unit h2=CreateUnit(GetOwningPlayer(EN),'e00C',GetUnitX(EN),GetUnitY(EN),270)
call UnitRemoveAbility(GetTriggerUnit(),'B02F')
call UnitApplyTimedLife(h2,'BTLF',10.)
call UnitAddAbility(h2,'A04Y')
call SetUnitAbilityLevel(h2,'A04Y',jy)
call IssueTargetOrderById(h2,852227,GetAttacker())
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
endfunction
function Ns takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit h3=Ew(Go,"Target")
local unit EN=Ew(Go,"UnitVar")
if GetUnitAbilityLevel(h3,'B02F')>0 then
if(GetUnitState(h3,UNIT_STATE_LIFE)>20)then
call SetUnitState(h3,UNIT_STATE_LIFE,RMaxBJ(0,GetUnitState(h3,UNIT_STATE_LIFE)-20))
else
call UnitDamageTargetBJ(EN,h3,50,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endif
else
call PauseTimer(t)
call Er(EQ(EX(Go,"Trigger")))
call DestroyTrigger(EX(Go,"Trigger"))
call PolledWait(1)
call Er(Go)
call DestroyTimer(t)
endif
endfunction
function NS takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local timer t=CreateTimer()
local string Go=EQ(t)
local trigger Nt=CreateTrigger()
call Es(Go,"Target",h3)
call Es(Go,"UnitVar",EN)
call Es(Go,"Trigger",Nt)
call TimerStart(t,1.,true,function Ns)
call Es(EQ(Nt),"UnitVar",EN)
call TriggerRegisterAnyUnitEventBJ(Nt,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Nt,Condition(function Nr))
call TriggerAddAction(Nt,function NR)
call UnitDamageTargetBJ(EN,h3,5.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endfunction
function gi takes nothing returns nothing
set dM=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dM,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dM,Condition(function NQ))
call TriggerAddAction(dM,function NS)
endfunction
function NT takes nothing returns boolean
return GetSpellAbilityId()=='A02Q'
endfunction
function Nu takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local string Go=EQ(t)
local unit EN=Ew(EQ(t),"UnitVar")
if(GetTriggerEventId()==EVENT_UNIT_SPELL_ENDCAST or GetUnitState(EN,UNIT_STATE_MANA)<=20.)then
call DisableTrigger(t)
call PolledWait(1)
call TriggerRemoveAction(t,EZ(Go,"TriggerAction"))
call Er(Go)
call DestroyTrigger(t)
else
call SetUnitManaBJ(EN,GetUnitState(EN,UNIT_STATE_MANA)-4-4*GetUnitAbilityLevel(EN,'A02Q'))
call UnitDamageTargetBJ(EN,EN,4+4*GetUnitAbilityLevel(EN,'A02Q'),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MIND)
endif
endfunction
function NU takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t=CreateTrigger()
local string Go=EQ(t)
call TriggerRegisterTimerEvent(t,.2,true)
call TriggerRegisterUnitEvent(t,EN,EVENT_UNIT_SPELL_ENDCAST)
call Es(Go,"TriggerAction",TriggerAddAction(t,function Nu))
call Es(Go,"UnitVar",EN)
endfunction
function gI takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function NT))
call TriggerAddAction(t,function NU)
endfunction
function Nv takes nothing returns boolean
if(GetUnitTypeId(GetDyingUnit())=='n00L')then
return false
endif
if(IsUnitType(GetDyingUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitAbilityLevel(GetKillingUnit(),'A0LE')>0)then
return true
endif
return false
endfunction
function NV takes nothing returns nothing
local real Nw=.05
local real Nx
local effect fx
if(IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO))then
set Nw=.1
endif
set Nx=GetUnitAbilityLevel(GetKillingUnit(),'A0LE')*Nw*GetUnitState(GetDyingUnit(),UNIT_STATE_MAX_LIFE)
call SetWidgetLife(GetKillingUnit(),GetUnitState(GetKillingUnit(),UNIT_STATE_LIFE)+Nx)
set fx=AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\HeroBloodElfBlood.mdl",GetKillingUnit(),"overhead")
call PolledWait(1.)
call DestroyEffect(fx)
endfunction
function gj takes nothing returns nothing
set dn=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dn,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(dn,Condition(function Nv))
call TriggerAddAction(dn,function NV)
endfunction
function NX takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0LH'))then
return false
endif
return true
endfunction
function Ny takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit NY=Ew(Go,"RuptureCaster")
local unit Nz=Ew(Go,"RuptureTarget")
local location NZ=Ez(Go,"RuptureOldLoc")
local location N0=GetUnitLoc(Nz)
local real nN=.2*GetUnitAbilityLevel(NY,'A0LH')*DistanceBetweenPoints(NZ,N0)
if(nN>200)then
set nN=0
endif
if(nN>5)then
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl",Nz,"origin"))
endif
if(nN>0)then
call UnitDamageTargetBJ(NY,Nz,nN,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
endif
call RemoveLocation(NZ)
call Es(Go,"RuptureOldLoc",N0)
endfunction
function N1 takes nothing returns nothing
local unit NY=GetTriggerUnit()
local unit Nz=GetSpellTargetUnit()
local location N2=GetUnitLoc(Nz)
local integer jy=GetUnitAbilityLevel(NY,'A0LH')
local timer t=CreateTimer()
local string Go=EQ(t)
local unit m6
call UnitDamageTargetBJ(NY,Nz,50+'d'*jy,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
call Es(Go,"RuptureCaster",NY)
call Es(Go,"RuptureTarget",Nz)
call Es(Go,"RuptureOldLoc",N2)
call TimerStart(t,.25,true,function Ny)
set m6=CreateUnit(GetOwningPlayer(Nz),'e01R',0,0,bj_UNIT_FACING)
call UnitAddAbility(m6,'A0NH')
call PolledWait(3+(2*jy))
call RemoveUnit(m6)
call UnitRemoveAbility(Nz,'B067')
call PauseTimer(t)
call PolledWait(1)
call Er(Go)
call DestroyTimer(t)
endfunction
function gJ takes nothing returns nothing
set dN=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dN,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dN,Condition(function NX))
call TriggerAddAction(dN,function N1)
endfunction
function N3 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0LF'))then
return false
endif
return true
endfunction
function N4 takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))then
if(IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer()))then
if(GetUnitLifePercent(GetFilterUnit())<50.)then
return true
endif
endif
endif
return false
endfunction
function N5 takes nothing returns nothing
call UnitShareVision(GetEnumUnit(),GetTriggerPlayer(),true)
endfunction
function N6 takes nothing returns nothing
call UnitShareVision(GetEnumUnit(),GetTriggerPlayer(),false)
endfunction
function N7 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local player e3=GetOwningPlayer(EN)
local location fr=GetUnitLoc(EN)
local group fB=GetUnitsInRectMatching(bj_mapInitialPlayableArea,Condition(function N4))
if(IsUnitGroupEmptyBJ(fB)==false)then
call ForGroupBJ(fB,function N5)
call CreateNUnitsAtLoc(1,'e00E',e3,fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0LG')
call SetUnitAbilityLevelSwapped('A0LG',bj_lastCreatedUnit,GetUnitAbilityLevel(EN,'A0LF'))
call IssueTargetOrderById(bj_lastCreatedUnit,852101,EN)
call PolledWait(30.)
call ForGroupBJ(fB,function N6)
endif
call DestroyGroup (fB)
call RemoveLocation(fr)
endfunction
function gk takes nothing returns nothing
set do=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(do,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(do,Condition(function N3))
call TriggerAddAction(do,function N7)
endfunction
function N8 takes nothing returns boolean
return GetUnitTypeId(GetSummonedUnit())=='o003'
endfunction
function N9 takes nothing returns nothing
local unit oa=GetSummonedUnit()
local unit oA=GetSummoningUnit()
local string Go=EQ(oA)
local integer jy=GetUnitAbilityLevel(oA,'A0BG')
local integer ob=E0(Go,"TotalWebs")
local unit oB=Ew(Go,"Web1")
local integer x=1
set ob=ob+1
call SetUnitVertexColorBJ(oa,'d','d','d',70)
call PolledWait(.1)
call UnitAddAbility(oa,'Aloc')
call Es(Go,"Web"+I2S(ob),oa)
if(ob>jy*2)then
call KillUnit(oB)
loop
exitwhen x==ob
call Es(Go,"Web"+I2S(x),Ew(Go,"Web"+I2S(x+1)))
set x=x+1
endloop
set ob=ob-1
endif
call ET(Go,"TotalWebs",ob)
endfunction
function gK takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(t,Condition(function N8))
call TriggerAddAction(t,function N9)
endfunction
function oc takes nothing returns boolean
return GetLearnedSkill()=='A0BG' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function oC takes nothing returns nothing
local unit oA=Ew(EQ(GetTriggeringTrigger()),"Spider")
if GetUnitAbilityLevel(oA,'B01C')>0 then
call UnitAddAbility(oA,'A021')
else
call UnitRemoveAbility(oA,'A021')
endif
endfunction
function od takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t
if(GetUnitAbilityLevel(EN,'A0BG')==1)then
set t=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(t,1.5)
call TriggerAddAction(t,function oC)
call Es(EQ(t),"Spider",EN)
endif
endfunction
function gl takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function oc))
call TriggerAddAction(t,function od)
endfunction
function oD takes nothing returns boolean
if(not (GetSpellAbilityId()=='A055'))then
return false
endif
return true
endfunction
function oe takes nothing returns nothing
local location fr=GetUnitLoc(GetSpellTargetUnit())
local integer oE=GetRandomInt(1,GetUnitAbilityLevel(GetTriggerUnit(),'A055'))
local unit EN=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
if(GetUnitAbilityLevel(EN,'A055')==4)then
set oE=GetRandomInt(2,4)
endif
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(EN),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A04U')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A04U',oE)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,h3)
call UnitDamageTargetBJ(EN,h3,GetRandomReal(1,200),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
endfunction
function gL takes nothing returns nothing
set dO=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dO,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dO,Condition(function oD))
call TriggerAddAction(dO,function oe)
endfunction
function of takes nothing returns boolean
return GetLearnedSkill()!='AHfa' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function oF takes nothing returns nothing
if(UnitHasBuffBJ(GetTriggerUnit(),'BOwk'))then
call UnitRemoveAbility(GetTriggerUnit(),'BOwk')
endif
call DisableTrigger(dp)
endfunction
function Ge takes nothing returns nothing
set dp=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dp,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(dp,Condition(function of))
call TriggerAddAction(dp,function oF)
endfunction
function og takes nothing returns boolean
return(GetLearnedSkill()=='A0OG') and (IsUnitIllusion(GetTriggerUnit())==false)
endfunction
function oG takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'B06X')>0 and GetSpellAbilityId()!='AIpl' and GetSpellAbilityId()!='A06K' and GetSpellAbilityId()!='A0KW' and GetSpellAbilityId()!='A0KX' and GetSpellAbilityId()!='A0DY'
endfunction
function oh takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local unit EN=GetTriggerUnit()
local unit oH=Ew(Go,"Destroyer")
local integer j1=GetUnitAbilityLevel(oH,'A0OG')
if(GetRandomInt(1,'d')<j1*10)then
call SetUnitState(EN,UNIT_STATE_MANA,GetUnitState(EN,UNIT_STATE_MANA)+.25*GetUnitState(EN,UNIT_STATE_MAX_MANA))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCasterOverhead.mdl",EN,"overhead"))
endif
endfunction
function oi takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer j1=GetUnitAbilityLevel(EN,'A0OG')
local trigger t
if(j1==1)then
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function oG))
call TriggerAddAction(t,function oh)
call Es(EQ(t),"Destroyer",EN)
endif
if(j1==1)then
call UnitAddAbility(EN,'A0OL')
elseif(j1==2)then
call UnitAddAbility(EN,'A0OM')
elseif(j1==3)then
call UnitAddAbility(EN,'A0ON')
elseif(j1==4)then
call UnitAddAbility(EN,'A0OH')
endif
endfunction
function Gj takes nothing returns nothing
set dP=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dP,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(dP,Condition(function og))
call TriggerAddAction(dP,function oi)
endfunction
function oI takes nothing returns boolean
return GetLearnedSkill()=='A0OI'
endfunction
function oj takes nothing returns nothing
local texttag g
local real d
local effect fx
local unit EN
local unit h3=GetTriggerUnit()
if UnitHasBuffBJ(h3,'B06Y') and GetUnitAbilityLevel(GetEventDamageSource(),'A0OI')>0 then
call DisableTrigger(GetTriggeringTrigger())
set EN=GetEventDamageSource()
set d=.01*(5+GetUnitAbilityLevel(EN,'A0OI'))*(GetUnitState(EN,UNIT_STATE_MANA)+'d')
if(IsUnitType(h3,UNIT_TYPE_SUMMONED) or IsUnitIllusion(h3))then
set d=d+'d'*GetUnitAbilityLevel(EN,'A0OI')
endif
set g=CreateTextTagUnitBJ("+"+I2S(R2I(d)),h3,64,10,75,25,'d',15)
call SetTextTagVelocityBJ(g,64,90)
call UnitDamageTargetBJ(EN,h3,d,ATTACK_TYPE_HERO,DAMAGE_TYPE_DIVINE)
if((GetRandomInt(1,'d')<GetUnitAbilityLevel(EN,'A0OG')*5) and (E3(EQ(GetTriggeringTrigger()),"DoneViaSpell")==false))then
call SetUnitState(EN,UNIT_STATE_MANA,GetUnitState(EN,UNIT_STATE_MANA)+.25*GetUnitState(EN,UNIT_STATE_MAX_MANA))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\ReplenishMana\\ReplenishManaCasterOverhead.mdl",EN,"overhead"))
endif
call PolledWait(1)
call DestroyTextTag(g)
call DisableTrigger(GetTriggeringTrigger())
endif
endfunction
function oJ takes nothing returns boolean
if GetTriggerEventId()==EVENT_PLAYER_UNIT_ATTACKED then
if GetUnitAbilityLevel(GetAttacker(),'A0OI')==0 then
return false
elseif E3(EQ(GetTriggeringTrigger()),"OrbOn")then
if IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false then
return true
endif
else
return false
endif
elseif GetTriggerEventId()==EVENT_UNIT_ISSUED_ORDER then
if GetIssuedOrderId()==852255then
call EV(EQ(GetTriggeringTrigger()),"OrbOn",true)
elseif GetIssuedOrderId()==852256then
call EV(EQ(GetTriggeringTrigger()),"OrbOn",false)
endif
elseif GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT then
if GetSpellAbilityId()=='A0OI'then
return true
else
return false
endif
endif
return false
endfunction
function ok takes nothing returns nothing
local trigger r=CreateTrigger()
local unit t
if GetTriggerEventId()==EVENT_UNIT_SPELL_EFFECT then
call EV(EQ(r),"DoneViaSpell",true)
set t=GetSpellTargetUnit()
else
call EV(EQ(r),"DoneViaSpell",false)
set t=GetTriggerUnit()
endif
call TriggerRegisterUnitEvent(r,t,EVENT_UNIT_DAMAGED)
call TriggerAddAction(r,function oj)
call PolledWait(2)
call DisableTrigger(r)
endfunction
function oK takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer j1=GetUnitAbilityLevel(EN,'A0OI')
local trigger t
if(j1==1)then
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerRegisterUnitEvent(t,GetLearningUnit(),EVENT_UNIT_SPELL_EFFECT)
call TriggerRegisterUnitEvent(t,GetLearningUnit(),EVENT_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t,Condition(function oJ))
call TriggerAddAction(t,function ok)
call Es(EQ(t),"Destroyer",EN)
endif
endfunction
function GJ takes nothing returns nothing
set dq=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dq,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(dq,Condition(function oI))
call TriggerAddAction(dq,function oK)
endfunction
function ol takes nothing returns boolean
return GetSpellAbilityId()=='A0OJ'
endfunction
function oL takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local integer j1=GetUnitAbilityLevel(EN,'A0OJ')
local integer om=IMinBJ(GetHeroInt(h3,false),j1*2)
local integer EA=1
local effect fx=AddSpecialEffect("Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl",GetUnitX(h3),GetUnitY(h3))
if(IsUnitEnemy(h3,GetOwningPlayer(EN)))then
call SetHeroInt(h3,GetHeroInt(h3,false)-om,true)
endif
call SelectUnitRemoveForPlayer(h3,GetOwningPlayer(h3))
call SetUnitInvulnerable(h3,true)
call PauseUnit(h3,true)
call ShowUnit(h3,false)
if(GetHeroInt(h3,false)<j1*2)then
call SetHeroInt(EN,GetHeroInt(EN,false)+om,true)
call PolledWait(j1)
else
loop
exitwhen EA>j1
if(IsUnitEnemy(h3,GetOwningPlayer(EN)))then
call SetHeroInt(EN,GetHeroInt(EN,false)+(om/j1),true)
endif
set EA=EA+1
call PolledWait(1)
endloop
endif
call DestroyEffect(fx)
call SetUnitInvulnerable(h3,false)
call PauseUnit(h3,false)
call ShowUnit(h3,true)
call ClearSelectionForPlayer(GetOwningPlayer(h3))
call SelectUnitAddForPlayer(h3,GetOwningPlayer(h3))
if(IsUnitEnemy(h3,GetOwningPlayer(EN)))then
call PolledWait(60)
call SetHeroInt(h3,GetHeroInt(h3,false)+om,true)
call SetHeroInt(EN,GetHeroInt(EN,false)-om,true)
endif
endfunction
function Gk takes nothing returns nothing
set dQ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dQ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dQ,Condition(function ol))
call TriggerAddAction(dQ,function oL)
endfunction
function oM takes nothing returns boolean
return GetSpellAbilityId()=='A0OK'
endfunction
function on takes nothing returns nothing
local unit h3=GetEnumUnit()
local unit oH=GetTriggerUnit()
local integer oN=GetHeroInt(oH,true)-GetHeroInt(h3,true)
local integer array oo
set oo[1]=10
set oo[2]=25
set oo[3]=40
if(oN>0)then
call UnitDamageTarget(oH,h3,oN*10,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
if(oN<oo[GetUnitAbilityLevel(oH,'A0OK')])then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Human\\Feedback\\SpellBreakerAttack.mdl",h3,"overhead"))
call SetUnitState(h3,UNIT_STATE_MANA,GetUnitState(h3,UNIT_STATE_MANA)*.25)
endif
endif
endfunction
function oO takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO))then
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then
return true
endif
endif
return false
endfunction
function op takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer j1=GetUnitAbilityLevel(EN,'A0OK')
local real x=GetLocationX(GetSpellTargetLoc())
local real y=GetLocationY(GetSpellTargetLoc())
local boolexpr oP=Condition(function oO)
local group fB=CreateGroup()
local integer oq=0
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl",x,y))
loop
exitwhen oq>=360
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl",x+(200+j1*50)*Cos(oq*bj_DEGTORAD),y+(200+j1*50)*Sin(oq*bj_DEGTORAD)))
set oq=oq+45
endloop
call GroupEnumUnitsInRange(fB,x,y,325+j1,oP)
call PolledWait(.2)
call ForGroup(fB,function on)
call PolledWait(1)
call DestroyGroup(fB)
call DestroyBoolExpr(oP)
endfunction
function GK takes nothing returns nothing
set dr=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dr,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dr,Condition(function oM))
call TriggerAddAction(dr,function op)
endfunction
function oQ takes nothing returns boolean
return GetSpellAbilityId()=='A0LK'
endfunction
function oR takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit EN=Ew(Go,"TimeWalkUnit")
local real os=GetUnitX(EN)
local real oS=GetUnitY(EN)
local real ot=E2(Go,"TimeWalkTargetX")
local real oT=E2(Go,"TimeWalkTargetY")
local real ou=E2(Go,"TimeWalkDistance")
local real lg=E2(Go,"Angle")
local real oU=E2(Go,"TimeWalkElapsed")
call SetUnitPosition(EN,os+ou/40*Cos(lg),oS+ou/40*Sin(lg))
call Ev(Go,"TimeWalkElapsed",oU)
if((os-ot)*(os-ot)+(oS-oT)*(oS-oT)<25 or oU>1)then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(EN),'e00E',GetUnitX(EN),GetUnitY(EN),270)
call UnitAddAbility(bj_lastCreatedUnit,'A0LA')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A0LA',GetUnitAbilityLevel(EN,'A0LK'))
call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF',2.)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
call SetUnitPathing(EN,true)
call SetUnitAnimation(EN,"stand")
call SetUnitInvulnerable(EN,false)
call SetUnitVertexColorBJ(EN,0,255,150,.0)
call ClearSelectionForPlayer(GetOwningPlayer(EN))
call SelectUnitAddForPlayer(EN,GetOwningPlayer(EN))
call PauseTimer(t)
endif
endfunction
function ov takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location kT=GetSpellTargetLoc()
local location oV=GetUnitLoc(EN)
local timer t=CreateTimer()
local string Go=EQ(t)
if((EN!=null) and (kT!=null) and (oV!=null))then
call SetUnitAnimationByIndex(EN,0)
call SetUnitPathing(EN,false)
call SetUnitInvulnerable(EN,true)
call SetUnitVertexColorBJ(EN,0,0,0,25.)
call Ev(Go,"TimeWalkDistance",DistanceBetweenPoints(oV,kT))
call Es(Go,"TimeWalkUnit",EN)
call Ev(Go,"TimeWalkTargetX",GetLocationX(kT))
call Ev(Go,"TimeWalkTargetY",GetLocationY(kT))
call Ev(Go,"TimeWalkElapsed",0)
call Ev(Go,"Angle",AngleBetweenPoints(oV,kT)*bj_DEGTORAD)
call TimerStart(t,.01,true,function oR)
endif
call PolledWait(2.)
call PauseTimer(t)
call SetUnitPathing(EN,true)
call ResetUnitAnimation(EN)
call SetUnitInvulnerable(EN,false)
call SetUnitVertexColorBJ(EN,0,255,150,.0)
call ClearSelectionForPlayer(GetOwningPlayer(EN))
call SelectUnitAddForPlayer(EN,GetOwningPlayer(EN))
call PolledWait(1)
call Er(Go)
call DestroyTimer(t)
call RemoveLocation(kT)
call RemoveLocation(oV)
endfunction
function gm takes nothing returns nothing
set dR=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dR,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dR,Condition(function oQ))
call TriggerAddAction(dR,function ov)
endfunction
function ow takes nothing returns boolean
return GetLearnedSkill()=='A0CZ' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function oW takes nothing returns nothing
local unit EN=GetTriggerUnit()
local real jY=GetEventDamage()
if(jY>0)then
if(GetRandomInt(1,'d')<(5+(5*GetUnitAbilityLevel(EN,'A0CZ'))))then
call SetUnitState(EN,UNIT_STATE_LIFE,GetUnitState(EN,UNIT_STATE_LIFE)+jY)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl",EN,"hand,left"))
endif
endif
endfunction
function ox takes nothing returns nothing
local trigger t
if GetUnitAbilityLevel(GetTriggerUnit(),'A0CZ')==1 then
set t=CreateTrigger()
call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddAction(t,function oW)
endif
endfunction
function gM takes nothing returns nothing
set ds=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ds,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(ds,Condition(function ow))
call TriggerAddAction(ds,function ox)
endfunction
function oX takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0J1'))then
return false
endif
return true
endfunction
function oy takes nothing returns nothing
if(GetUnitTypeId(GetEnumUnit())!='EC45')then
call PauseUnit(GetEnumUnit(),true)
call SetUnitTimeScalePercent(GetEnumUnit(),.0)
call UnitRemoveAbility(GetEnumUnit(),'BUsl')
call UnitRemoveAbility(GetEnumUnit(),'BUsp')
call UnitRemoveAbility(GetEnumUnit(),'BUst')
endif
endfunction
function oY takes nothing returns nothing
call PauseUnit(GetEnumUnit(),false)
call SetUnitTimeScalePercent(GetEnumUnit(),100.)
endfunction
function oz takes nothing returns nothing
local integer j1=GetUnitAbilityLevel(GetTriggerUnit(),'A0J1')
local unit oZ
local real Eb=1.5+(j1*1.5)
local timer o0
local location o1=GetSpellTargetLoc()
local group o2
local group fB
call CreateNUnitsAtLoc(1,'u00L',GetOwningPlayer(GetSpellAbilityUnit()),o1,bj_UNIT_FACING)
set oZ=bj_lastCreatedUnit
call PolledWait(.5)
call SetUnitTimeScalePercent(oZ,.0)
set o2=GetUnitsInRangeOfLocAll(425.,o1)
set o0=CreateTimer()
call StartTimerBJ(o0,false,Eb)
call ForGroup(o2,function oy)
loop
exitwhen TimerGetRemaining(o0)<=.0
set fB=GetUnitsInRangeOfLocAll(425.,o1)
call GroupAddGroup(fB,o2)
call DestroyGroup(fB)
call ForGroup(o2,function oy)
if(TimerGetRemaining(o0)<.8)then
call PolledWait(.1)
else
call PolledWait(.5)
endif
endloop
call RemoveUnit(oZ)
call ForGroupBJ(o2,function oY)
call DestroyGroup(o2)
call PauseTimer(o0)
call PolledWait(.01)
call DestroyTimer(o0)
call RemoveLocation(o1)
endfunction
function gn takes nothing returns nothing
set dS=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dS,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dS,Condition(function oX))
call TriggerAddAction(dS,function oz)
endfunction
function o3 takes nothing returns boolean
return GetSpellAbilityId()=='A035'
endfunction
function o4 takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(Ar)) and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0
endfunction
function o5 takes nothing returns nothing
local unit o6=Ew(EQ(GetExpiredTimer()),"Leshrac")
local group fB=CreateGroup()
local boolexpr ma=Condition(function o4)
local unit o7
set Ar=o6
call GroupEnumUnitsInRange(fB,GetUnitX(o6),GetUnitY(o6),500,ma)
set o7=GroupPickRandomUnit(fB)
call AddSpecialEffectTarget("Abilities\\Weapons\\SteamTank\\SteamTankImpact.mdl",o7,"chest")
call UnitDamageTargetBJ(o6,o7,12.5*GetUnitAbilityLevel(o6,'A035'),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
call DestroyBoolExpr(ma)
call DestroyGroup(fB)
endfunction
function o8 takes nothing returns nothing
local timer t=CreateTimer()
local string Go=EQ(t)
call Es(Go,"Leshrac",GetTriggerUnit())
call TimerStart(t,.25,true,function o5)
call PolledWait(8.)
call PauseTimer(t)
call PolledWait(1)
call Er(Go)
call DestroyTimer(t)
endfunction
function gN takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function o3))
call TriggerAddAction(t,function o8)
endfunction
function o9 takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())==1)then
return false
endif
if(IsUnitAliveBJ(GetFilterUnit())==false)then
return false
endif
if(GetUnitTypeId(GetFilterUnit())=='o003')then
return false
endif
return true
endfunction
function Oa takes nothing returns boolean
if((GetSpellAbilityId()=='A05T'))then
return true
endif
if((GetSpellAbilityId()=='A08H'))then
return true
endif
return false
endfunction
function OA takes nothing returns boolean
if(not Oa())then
return false
endif
return true
endfunction
function Ob takes nothing returns boolean
if(not (GetSpellAbilityId()=='A05T'))then
return false
endif
return true
endfunction
function OB takes nothing returns nothing
local player Oc=GetOwningPlayer(GetTriggerUnit())
local integer OC=0
local integer Od
local unit OD
local unit Oe
local unit K4
local integer EA
local integer Eb
local group OE=CreateGroup()
local group Of=CreateGroup()
local unit kP
local location OF
local location Og
local location kc=GetUnitLoc(GetSpellAbilityUnit())
if(Ob())then
set Od=GetUnitAbilityLevelSwapped('A05T',GetTriggerUnit())
else
set Od=(GetUnitAbilityLevelSwapped('A08H',GetTriggerUnit())+1)
endif
set OD=GetSpellTargetUnit()
set OF=GetUnitLoc(OD)
set Oe=CreateUnitAtLoc(Oc,'e009',kc,bj_UNIT_FACING)
call IssuePointOrderByIdLoc(Oe,851986,OF)
call SetUnitPathing(Oe,false)
call UnitAddAbility(Oe,'Aloc')
call SetUnitInvulnerable(Oe,true)
set Og=GetUnitLoc(Oe)
call PolledWait(((DistanceBetweenPoints(Og,OF)-90.)/575.))
loop
exitwhen OC>5
set OC=(OC+1)
call RemoveLocation (OF)
set OF=GetUnitLoc(OD)
set K4=CreateUnitAtLoc(Oc,'e00C',OF,bj_UNIT_FACING)
call UnitAddAbility(K4,'A091')
call SetUnitAbilityLevelSwapped('A091',K4,Od)
call IssueTargetOrderById(K4,852226,OD)
call SetUnitInvulnerable(K4,true)
call SetUnitPathing(K4,false)
call UnitAddAbility(K4,'Aloc')
call UnitApplyTimedLifeBJ(2.,'BTLF',K4)
call RemoveUnit(Oe)
if(OC<6)then
call GroupClear(OE)
call DestroyGroup(Of)
set Of=GetUnitsInRangeOfLocMatching(600.,OF,Condition(function o9))
loop
set kP=FirstOfGroup(Of)
exitwhen kP==null
if(IsUnitEnemy(kP,Oc))then
if(kP!=OD)then
if(IsUnitVisible(kP,Oc))then
call GroupAddUnit(OE,kP)
endif
endif
endif
call GroupRemoveUnit(Of,kP)
endloop
if(IsUnitGroupEmptyBJ(OE)==false)then
call RemoveLocation (OF)
set OF=GetUnitLoc(OD)
set Oe=CreateUnitAtLoc(Oc,'e009',OF,bj_UNIT_FACING)
call RemoveLocation(Og)
set Og=GetUnitLoc(Oe)
call RemoveLocation(OF)
set OD=GroupPickRandomUnit(OE)
set OF=GetUnitLoc(OD)
call IssuePointOrderByIdLoc(Oe,851986,OF)
call SetUnitPathing(Oe,false)
call UnitAddAbility(Oe,'Aloc')
call SetUnitInvulnerable(Oe,true)
call PolledWait(((DistanceBetweenPoints(Og,OF)-90.)/575.))
else
set OC=99
endif
endif
endloop
call RemoveLocation(Og)
call RemoveLocation(OF)
call RemoveLocation (kc)
call DestroyGroup(OE)
call DestroyGroup(Of)
endfunction
function CF takes nothing returns nothing
set dt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dt,Condition(function OA))
call TriggerAddAction(dt,function OB)
endfunction
function OG takes nothing returns boolean
if(not (GetSpellAbilityId()=='A094'))then
return false
endif
return true
endfunction
function Oh takes nothing returns boolean
if(not (ModuloReal(I2R(GetHeroLevel(GetSpellTargetUnit())),(7.-I2R(GetUnitAbilityLevelSwapped('A094',GetTriggerUnit()))))==.0))then
return false
endif
return true
endfunction
function OH takes nothing returns nothing
if(Oh())then
call UnitDamageTargetBJ(GetTriggerUnit(),GetSpellTargetUnit(),250.,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
endif
endfunction
function go takes nothing returns nothing
set dT=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dT,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dT,Condition(function OG))
call TriggerAddAction(dT,function OH)
endfunction
function Oi takes nothing returns boolean
if(not (GetUnitTypeId(GetTransportUnit())=='UC42'))then
return false
endif
return true
endfunction
function OI takes nothing returns boolean
if(not (IsUnitInTransport(GetTriggerUnit(),GetTransportUnit())))then
return false
endif
return true
endfunction
function Oj takes nothing returns nothing
local texttag g
call PolledWait(((GetUnitStateSwap(UNIT_STATE_LIFE,GetTriggerUnit())-20.)/20.))
if(OI())then
call SetPlayerStateBJ(GetOwningPlayer(GetTransportUnit()),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(GetTransportUnit()),PLAYER_STATE_RESOURCE_GOLD)+(10*GetUnitAbilityLevelSwapped('A05Y',GetTransportUnit()))))
set g=CreateTextTagUnitBJ(("+"+I2S((GetUnitAbilityLevelSwapped('A05Y',GetTransportUnit())*10))),GetTransportUnit(),0,10,90.,84.,.0,0)
call SetTextTagVelocityBJ(g,64,90)
call PolledWait(2.)
call DestroyTextTag(g)
endif
endfunction
function gO takes nothing returns nothing
set du=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(du,EVENT_PLAYER_UNIT_LOADED)
call TriggerAddCondition(du,Condition(function Oi))
call TriggerAddAction(du,function Oj)
endfunction
function OJ takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0FE'))then
return false
endif
return true
endfunction
function Ok takes nothing returns nothing
local location fr=GetSpellTargetLoc()
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call ShowUnitHide(bj_lastCreatedUnit)
call UnitApplyTimedLifeBJ(20.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0FF')
call SetUnitAbilityLevelSwapped('A0FF',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0FE',GetTriggerUnit()))
call UnitAddAbility(bj_lastCreatedUnit,'A0FG')
call SetUnitAbilityLevelSwapped('A0FG',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0FE',GetTriggerUnit()))
call RemoveLocation(fr)
endfunction
function gp takes nothing returns nothing
set dU=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dU,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dU,Condition(function OJ))
call TriggerAddAction(dU,function Ok)
endfunction
function OK takes nothing returns boolean
if(not (GetSpellAbilityId()=='A06F'))then
return false
endif
return true
endfunction
function Ol takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)then
if(GetUnitTypeId(GetFilterUnit())!='n00L')then
return true
endif
endif
return false
endfunction
function OL takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())!=1)
endfunction
function Om takes nothing returns boolean
return GetBooleanAnd(Ol(),OL())
endfunction
function OM takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function On takes nothing returns boolean
return(IsUnitDeadBJ(GetFilterUnit())==false)
endfunction
function ON takes nothing returns boolean
return GetBooleanAnd(OM(),On())
endfunction
function Oo takes nothing returns boolean
return GetBooleanAnd(Om(),ON())
endfunction
function OO takes nothing returns nothing
local location fr=GetUnitLoc(GetSpellAbilityUnit())
local location fR=PolarProjectionBJ(fr,GetRandomReal(20.,70.),GetRandomReal(0,360))
call SetUnitPositionLoc(GetEnumUnit(),fR)
call RemoveLocation(fr)
call RemoveLocation(fR)
endfunction
function Op takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local group fB=GetUnitsInRangeOfLocMatching(480.,fr,Condition(function Oo))
call ForGroupBJ(fB,function OO)
call DestroyGroup(fB)
call RemoveLocation(fr)
endfunction
function RP takes nothing returns nothing
set dv=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dv,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dv,Condition(function OK))
call TriggerAddAction(dv,function Op)
endfunction
function OP takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A012',GetDyingUnit())>0))then
return false
endif
return true
endfunction
function Oq takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A012',GetTriggerUnit())>0))then
return false
endif
if(not (GetIssuedOrderId()==852055))then
return false
endif
return true
endfunction
function OQ takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A012',GetTriggerUnit())>0))then
return false
endif
if(not (GetIssuedOrderId()==852056))then
return false
endif
return true
endfunction
function OR takes nothing returns nothing
if(OP())then
call UnitRemoveAbility(GetDyingUnit(),'A09J')
endif
if(Oq())then
call UnitAddAbility(GetTriggerUnit(),'A09J')
endif
if(OQ())then
call UnitRemoveAbility(GetTriggerUnit(),'A09J')
endif
endfunction
function gP takes nothing returns nothing
set dV=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dV,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerRegisterAnyUnitEventBJ(dV,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(dV,function OR)
endfunction
function Os takes nothing returns boolean
if(not (UnitHasBuffBJ(GetKillingUnit(),'B02R')))then
return false
endif
return true
endfunction
function OS takes nothing returns nothing
call SetUnitManaBJ(GetKillingUnit(),(GetUnitStateSwap(UNIT_STATE_MANA,GetKillingUnit())+(12.*I2R(GetUnitAbilityLevelSwapped('A060',GetKillingUnit())))))
endfunction
function gq takes nothing returns nothing
set dw=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dw,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(dw,Condition(function Os))
call TriggerAddAction(dw,function OS)
endfunction
function Ot takes nothing returns boolean
if(not (GetSpellAbilityId()=='A05V'))then
return false
endif
return true
endfunction
function OT takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call RemoveLocation(fr)
call UnitAddAbility(bj_lastCreatedUnit,'A05W')
call SetUnitAbilityLevelSwapped('A05W',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A05V',GetTriggerUnit()))
call IssueImmediateOrderById(bj_lastCreatedUnit,852526)
endfunction
function gQ takes nothing returns nothing
set dW=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dW,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dW,Condition(function Ot))
call TriggerAddAction(dW,function OT)
endfunction
function Ou takes nothing returns boolean
return(GetSpellAbilityId()=='A067')
endfunction
function OU takes nothing returns boolean
return(GetSpellAbilityId()=='A08P')
endfunction
function Ov takes nothing returns boolean
if(not GetBooleanOr(Ou(),OU()))then
return false
endif
return true
endfunction
function OV takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A067',GetTriggerUnit())==1))then
return false
endif
return true
endfunction
function Ow takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A067',GetTriggerUnit())==2)
endfunction
function OW takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A08P',GetTriggerUnit())==1)
endfunction
function Ox takes nothing returns boolean
if(not GetBooleanOr(Ow(),OW()))then
return false
endif
return true
endfunction
function OX takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A067',GetTriggerUnit())==3)
endfunction
function Oy takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A08P',GetTriggerUnit())==2)
endfunction
function OY takes nothing returns boolean
if(not GetBooleanOr(OX(),Oy()))then
return false
endif
return true
endfunction
function Oz takes nothing returns boolean
if(not (GetUnitAbilityLevelSwapped('A08P',GetTriggerUnit())==3))then
return false
endif
return true
endfunction
function OZ takes nothing returns nothing
if(OV())then
set AR=.4
endif
if(Ox())then
set AR=.6
endif
if(OY())then
set AR=.9
endif
if(Oz())then
set AR=1.1
endif
call UnitDamageTargetBJ(GetTriggerUnit(),GetSpellTargetUnit(),(AR*(GetUnitStateSwap(UNIT_STATE_MAX_LIFE,GetSpellTargetUnit())-GetUnitStateSwap(UNIT_STATE_LIFE,GetSpellTargetUnit()))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_FIRE)
endfunction
function gr takes nothing returns nothing
set dX=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dX,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dX,Condition(function Ov))
call TriggerAddAction(dX,function OZ)
endfunction
function O0 takes nothing returns boolean
if((GetUnitTypeId(GetKillingUnit())=='Nfir'))then
return true
endif
if((GetUnitTypeId(GetDyingUnit())=='Nfir'))then
return true
endif
if((GetUnitTypeId(GetKillingUnit())=='e00F'))then
return true
endif
return false
endfunction
function O1 takes nothing returns boolean
if(not O0())then
return false
endif
return true
endfunction
function O2 takes nothing returns nothing
call KillUnit(GetEnumUnit())
endfunction
function O3 takes nothing returns boolean
if(not (GetUnitTypeId(GetDyingUnit())=='Nfir'))then
return false
endif
return true
endfunction
function O4 takes nothing returns boolean
if(not (IsUnitIllusion(GetDyingUnit())==false))then
return false
endif
if(not ((GetUnitAbilityLevelSwapped('A0CQ',GetKillingUnit())-1)<(7.5*GetUnitAbilityLevelSwapped('A0BR',GetKillingUnit()))))then
return false
endif
if(not (GetUnitTypeId(GetKillingUnit())=='Nfir'))then
return false
endif
return true
endfunction
function O5 takes nothing returns boolean
if(not ((GetUnitAbilityLevelSwapped('A0CQ',GetEnumUnit())+1)<(7.5*GetUnitAbilityLevelSwapped('A0BR',GetEnumUnit()))))then
return false
endif
return true
endfunction
function O6 takes nothing returns nothing
if(O5())then
call SetUnitAbilityLevelSwapped('A0CQ',GetEnumUnit(),(GetUnitAbilityLevelSwapped('A0CQ',GetEnumUnit())+1))
endif
endfunction
function O7 takes nothing returns boolean
if(not (IsUnitIllusion(GetDyingUnit())==false))then
return false
endif
if(not (GetUnitTypeId(GetKillingUnit())=='e00F'))then
return false
endif
return true
endfunction
function O8 takes nothing returns nothing
local group fB
if(O3())then
call SetUnitAbilityLevelSwapped('A0CQ',GetDyingUnit(),1+R2I((.5*I2R(GetUnitAbilityLevelSwapped('A0CQ',GetDyingUnit())))))
set fB=GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetDyingUnit()),'e007')
call ForGroupBJ(fB,function O2)
call DestroyGroup(fB)
endif
if(O4())then
call SetUnitAbilityLevelSwapped('A0CQ',GetKillingUnit(),(GetUnitAbilityLevelSwapped('A0CQ',GetKillingUnit())+1))
endif
if(O7())then
set fB=GetUnitsOfPlayerAndTypeId(GetOwningPlayer(GetKillingUnit()),'Nfir')
call ForGroupBJ(fB,function O6)
call DestroyGroup(fB)
endif
endfunction
function gR takes nothing returns nothing
set dy=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dy,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(dy,Condition(function O1))
call TriggerAddAction(dy,function O8)
endfunction
function O9 takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction
function pa takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function pA takes nothing returns boolean
return('BNab'=='BNab')
endfunction
function pb takes nothing returns boolean
return GetBooleanAnd(pa(),pA())
endfunction
function pB takes nothing returns boolean
return GetBooleanAnd(O9(),pb())
endfunction
function pc takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(75.*I2R(GetUnitAbilityLevelSwapped('A0EY',GetTriggerUnit()))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
endfunction
function pC takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0EY'))then
return false
endif
return true
endfunction
function pd takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction
function pD takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function pe takes nothing returns boolean
return('BNab'=='BNab')
endfunction
function pE takes nothing returns boolean
return GetBooleanAnd(pD(),pe())
endfunction
function pf takes nothing returns boolean
return GetBooleanAnd(pd(),pE())
endfunction
function pF takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(75.*I2R(GetUnitAbilityLevelSwapped('A0EY',GetTriggerUnit()))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
endfunction
function pg takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0FH'))then
return false
endif
return true
endfunction
function pG takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)
endfunction
function ph takes nothing returns boolean
return(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))
endfunction
function pH takes nothing returns boolean
return('BNab'=='BNab')
endfunction
function pi takes nothing returns boolean
return GetBooleanAnd(ph(),pH())
endfunction
function pI takes nothing returns boolean
return GetBooleanAnd(pG(),pi())
endfunction
function pj takes nothing returns nothing
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),(75.*I2R(GetUnitAbilityLevelSwapped('A0EY',GetTriggerUnit()))),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_DEATH)
endfunction
function pJ takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0F0'))then
return false
endif
return true
endfunction
function pk takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local location fR
local location kc=PolarProjectionBJ(fr,200.,GetUnitFacing(GetTriggerUnit()))
local group kZ
if(pC())then
call CreateNUnitsAtLoc(1,'e006',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
set fR=GetUnitLoc(bj_lastCreatedUnit)
set kZ=GetUnitsInRangeOfLocMatching(250.,fR,Condition(function pB))
call ForGroupBJ(kZ,function pc)
call DestroyGroup(kZ)
call RemoveLocation(fR)
endif
call RemoveLocation(kc)
set kc=PolarProjectionBJ(fr,450.,GetUnitFacing(GetTriggerUnit()))
if(pg())then
call CreateNUnitsAtLoc(1,'e006',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
set fR=GetUnitLoc(bj_lastCreatedUnit)
set kZ=GetUnitsInRangeOfLocMatching(250.,fR,Condition(function pf))
call ForGroupBJ(kZ,function pF)
call DestroyGroup(kZ)
call RemoveLocation(fR)
endif
call RemoveLocation(kc)
set kc=PolarProjectionBJ(fr,700.,GetUnitFacing(GetTriggerUnit()))
if(pJ())then
call CreateNUnitsAtLoc(1,'e006',GetOwningPlayer(GetTriggerUnit()),kc,bj_UNIT_FACING)
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
set fR=GetUnitLoc(bj_lastCreatedUnit)
set kZ=GetUnitsInRangeOfLocMatching(250.,fR,Condition(function pI))
call ForGroupBJ(kZ,function pj)
call DestroyGroup(kZ)
call RemoveLocation(fR)
endif
call RemoveLocation(kc)
call RemoveLocation(fr)
endfunction
function gs takes nothing returns nothing
set dY=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dY,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddAction(dY,function pk)
endfunction
function pK takes nothing returns nothing
if(GetLearnedSkill()=='A0EY')then
if(GetUnitAbilityLevelSwapped('A0EY',GetTriggerUnit())==1)then
call UnitAddAbility(GetTriggerUnit(),'A0F0')
call UnitAddAbility(GetTriggerUnit(),'A0FH')
else
call SetUnitAbilityLevelSwapped('A0F0',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0EY',GetTriggerUnit()))
call SetUnitAbilityLevelSwapped('A0FH',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0EY',GetTriggerUnit()))
endif
endif
if(GetLearnedSkill()=='A0BR')then
if(GetUnitAbilityLevelSwapped('A0BR',GetTriggerUnit())==1)then
call UnitAddAbility(GetTriggerUnit(),'A0CQ')
endif
endif
endfunction
function NL takes nothing returns nothing
set dz=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dz,EVENT_PLAYER_HERO_SKILL)
call TriggerAddAction(dz,function pK)
endfunction
function pl takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0HE'))then
return false
endif
return true
endfunction
function pL takes nothing returns nothing
local integer pm=GetUnitAbilityLevelSwapped('A0CQ',GetTriggerUnit())
local integer pM
local integer Eb
local unit EN=GetTriggerUnit()
local location fr=GetUnitLoc(GetTriggerUnit())
local location fR
set pm=pm/2
set pM=1
set Eb=pm
loop
exitwhen pM>Eb
set fR=PolarProjectionBJ(fr,50.,(I2R(pM)*(360/pm)))
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(EN),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0HG')
call SetUnitAbilityLevelSwapped('A0HG',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0HE',GetTriggerUnit()))
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852218,fR)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(fR)
set pM=pM+1
endloop
call RemoveLocation(fr)
endfunction
function gS takes nothing returns nothing
set dZ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(dZ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dZ,Condition(function pl))
call TriggerAddAction(dZ,function pL)
endfunction
function pn takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0HE'))then
return false
endif
return true
endfunction
function pN takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())==1)then
return false
endif
if(IsUnitAliveBJ(GetFilterUnit())==false)then
return false
endif
if(GetUnitTypeId(GetFilterUnit())=='o003')then
return false
endif
if(IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer())==false)then
return false
endif
if(GetTriggerUnit()==GetFilterUnit())then
return false
endif
if(IsUnitVisible(GetFilterUnit(),GetTriggerPlayer())==false)then
return false
endif
return true
endfunction
function po takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location fr=GetUnitLoc(EN)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(EN),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0HH')
call SetUnitAbilityLevelSwapped('A0HH',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0HE',GetTriggerUnit()))
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetEnumUnit())
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(fr)
endfunction
function pO takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location fr=GetUnitLoc(EN)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(EN),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0HH')
call SetUnitAbilityLevelSwapped('A0HJ',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0HE',GetTriggerUnit()))
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetEnumUnit())
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(fr)
endfunction
function pp takes nothing returns nothing
local unit EN=GetTriggerUnit()
local location fr=GetUnitLoc(EN)
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(EN),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0HH')
call SetUnitAbilityLevelSwapped('A0HI',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0HE',GetTriggerUnit()))
call UnitApplyTimedLifeBJ(2.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,852189,GetEnumUnit())
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(fr)
endfunction
function pP takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local unit EN=GetTriggerUnit()
local group fB
set fB=GetUnitsInRangeOfLocMatching(700,fr,Condition(function pN))
call ForGroup(fB,function po)
set fB=GetUnitsInRangeOfLocMatching(400,fr,Condition(function pN))
call ForGroup(fB,function pO)
set fB=GetUnitsInRangeOfLocMatching(200,fr,Condition(function pN))
call ForGroup(fB,function pp)
call RemoveLocation(fr)
call DestroyGroup(fB)
endfunction
function gt takes nothing returns nothing
set d0=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d0,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(d0,Condition(function pn))
call TriggerAddAction(d0,function pP)
endfunction
function pq takes nothing returns boolean
if(GetSpellAbilityId()=='A02H')then
return true
endif
return false
endfunction
function pQ takes nothing returns nothing
local unit h2
if(Eo()==false)then
set h2=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit()),bj_UNIT_FACING)
call UnitAddAbility(h2,'A02R')
call IssueTargetOrderById(h2,852075,GetSpellTargetUnit())
endif
endfunction
function gu takes nothing returns nothing
set d1=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d1,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(d1,Condition(function pq))
call TriggerAddAction(d1,function pQ)
endfunction
function pr takes nothing returns boolean
return(GetLearnedSkill()=='A086' or GetLearnedSkill()=='A08E') and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function pR takes nothing returns nothing
local unit ps=Ew(EQ(GetTriggeringTrigger()),"NightStalker")
if(ps!=null and Eo() and GetUnitState(ps,UNIT_STATE_LIFE)>1)then
call SetUnitAbilityLevel(ps,'S00A',5)
call SetUnitAbilityLevel(ps,'A08C',5)
elseif(ps!=null and Eo()==false and GetUnitState(ps,UNIT_STATE_LIFE)>1)then
call SetUnitAbilityLevel(ps,'S00A',GetUnitAbilityLevel(ps,'A086'))
call SetUnitAbilityLevel(ps,'A08C',GetUnitAbilityLevel(ps,'A08E'))
endif
endfunction
function pS takes nothing returns nothing
local string Go=EQ(GetOwningPlayer(GetTriggerUnit()))
local trigger t
if(E3(Go,"NightStalkerAlreadyLearned")==false)then
call EV(Go,"NightStalkerAlreadyLearned",true)
set t=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(t,2.)
call TriggerRegisterGameStateEventTimeOfDay(t,LESS_THAN,6.)
call TriggerRegisterGameStateEventTimeOfDay(t,GREATER_THAN,18.)
call TriggerAddAction(t,function pR)
call Es(EQ(t),"NightStalker",GetTriggerUnit())
endif
if(GetLearnedSkill()=='A086')then
call UnitAddAbility(GetTriggerUnit(),'S00A')
if(Eo())then
call SetUnitAbilityLevel(GetTriggerUnit(),'S00A',5)
else
call SetUnitAbilityLevel(GetTriggerUnit(),'S00A',GetUnitAbilityLevel(GetTriggerUnit(),'A086'))
endif
endif
if(GetLearnedSkill()=='A08E')then
call UnitAddAbility(GetTriggerUnit(),'A08C')
if(Eo())then
call SetUnitAbilityLevel(GetTriggerUnit(),'A08C',5)
else
call SetUnitAbilityLevel(GetTriggerUnit(),'A08C',GetUnitAbilityLevel(GetTriggerUnit(),'A08E'))
endif
endif
endfunction
function gT takes nothing returns nothing
set d2=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d2,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(d2,Condition(function pr))
call TriggerAddAction(d2,function pS)
endfunction
function pt takes nothing returns nothing
local unit pT=Ew(EQ(GetTriggeringTrigger()),"PhantomAssassin")
local integer j1=GetUnitAbilityLevel(pT,'A03P')
if(GetUnitState(pT,UNIT_STATE_LIFE)>1)then
if(j1==1)then
call SetUnitVertexColorBJ(pT,'d','d','d',40.)
endif
if(j1==2)then
call SetUnitVertexColorBJ(pT,'d','d','d',60.)
endif
if(j1==3)then
call SetUnitVertexColorBJ(pT,'d','d','d',80.)
endif
if(j1==4)then
call SetUnitVertexColorBJ(pT,'d','d','d',98.)
endif
endif
endfunction
function pu takes nothing returns boolean
return GetLearnedSkill()=='A03P' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function pU takes nothing returns nothing
local integer j1=GetUnitAbilityLevelSwapped('A03P',GetTriggerUnit())
local trigger t
local unit pT=GetTriggerUnit()
if(j1==1)then
call SetUnitVertexColorBJ(pT,'d','d','d',40.)
set t=CreateTrigger()
call TriggerAddAction(t,function pt)
call TriggerRegisterTimerEventPeriodic(t,2.)
call Es(EQ(t),"PhantomAssassin",pT)
endif
if(j1==2)then
call SetUnitVertexColorBJ(pT,'d','d','d',60.)
endif
if(j1==3)then
call SetUnitVertexColorBJ(pT,'d','d','d',80.)
endif
if(j1==4)then
call SetUnitVertexColorBJ(pT,'d','d','d',98.)
endif
endfunction
function gU takes nothing returns nothing
set d3=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d3,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(d3,Condition(function pu))
call TriggerAddAction(d3,function pU)
endfunction
function pv takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'A06K')>0
endfunction
function pV takes nothing returns nothing
if(GetIssuedOrderId()==852177)then
call UnitAddAbility(GetTriggerUnit(),'A0AZ')
endif
if(GetIssuedOrderId()==852178)then
call UnitRemoveAbility(GetTriggerUnit(),'A0AZ')
endif
endfunction
function gv takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(t,Condition(function pv))
call TriggerAddAction(t,function pV)
endfunction
function pw takes nothing returns boolean
return GetUnitAbilityLevel(GetKillingUnit(),'A06D')>0
endfunction
function pW takes nothing returns nothing
local string Go=EQ(GetKillingUnit())
local real px=E2(Go,"FleshHeap")
if(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO))then
set px=px+.3*GetUnitAbilityLevel(GetKillingUnit(),'A06D')
else
set px=px+.03*GetUnitAbilityLevel(GetKillingUnit(),'A06D')
endif
if(px>=1.)then
set px=px-1
call ModifyHeroStat(0,GetKillingUnit(),0,1)
endif
call Ev(Go,"FleshHeap",px)
endfunction
function gV takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t,Condition(function pw))
call TriggerAddAction(t,function pW)
endfunction
function pX takes nothing returns boolean
return GetSpellAbilityId()=='A06I'
endfunction
function py takes nothing returns nothing
local timer t=GetExpiredTimer()
local timer pY=Ex(EQ(t),"ExtendCache")
local string Go=EQ(pY)
local integer pz=E0(Go,"ChainLinkNumber")
local unit h3=Ew(Go,"Target")
local unit fT=Ew(Go,"ChainLinks"+I2S(pz))
if(h3!=null)then
call SetUnitX(h3,GetUnitX(fT))
call SetUnitY(h3,GetUnitY(fT))
endif
call RemoveUnit(fT)
call ET(Go,"ChainLinkNumber",pz-1)
if(pz==1)then
call PauseTimer(t)
call Er(Go)
call Er(EQ(t))
call PolledWait(1)
call DestroyTimer(t)
call DestroyTimer(pY)
endif
endfunction
function pZ takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE) or GetUnitAbilityLevel(GetFilterUnit(),'A04R')==1) or GetFilterUnit()==Ar then
return false
endif
if GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)<=0 or GetUnitTypeId(GetFilterUnit())=='u00H' or GetUnitTypeId(GetFilterUnit())=='u00F' or IsUnitType(GetFilterUnit(),UNIT_TYPE_ANCIENT) then
return false
endif
return true
endfunction
function p0 takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local integer pz=E0(Go,"ChainLinkNumber")
local unit p1=Ew(Go,"Pudge")
local real lg=E2(Go,"Angle")
local integer jy=GetUnitAbilityLevel(p1,'A06I')
local unit fT
local group fB
local real x
local real y
local boolexpr p2
local timer p3
local string j5
if(pz<5+6*jy)then
set pz=pz+1
set x=GetUnitX(p1)+pz*40*Cos(lg*bj_DEGTORAD)
set y=GetUnitY(p1)+pz*40*Sin(lg*bj_DEGTORAD)
set fT=CreateUnit(GetOwningPlayer(p1),'u00H',x,y,lg)
call Es(Go,"ChainLinks"+I2S(pz),fT)
call ET(Go,"ChainLinkNumber",pz)
set fB=CreateGroup()
set Ar=p1
set p2=Condition(function pZ)
call GroupEnumUnitsInRange(fB,x,y,'s',p2)
call DestroyBoolExpr(p2)
set fT=FirstOfGroup(fB)
call DestroyGroup(fB)
if(fT!=null)then
call Es(Go,"Target",fT)
if IsUnitEnemy(fT,GetOwningPlayer(p1))then
call UnitDamageTargetBJ(p1,fT,jy*'d',ATTACK_TYPE_NORMAL,DAMAGE_TYPE_ENHANCED)
endif
call PauseTimer(t)
set p3=CreateTimer()
call Es(EQ(p3),"ExtendCache",t)
call TimerStart(p3,.03,true,function py)
endif
else
call PauseTimer(t)
set p3=CreateTimer()
call Es(EQ(p3),"ExtendCache",t)
call TimerStart(p3,.03,true,function py)
endif
endfunction
function p4 takes nothing returns nothing
local location p5=GetUnitLoc(GetSpellAbilityUnit())
local location fR=GetSpellTargetLoc()
local timer t=CreateTimer()
local unit p1=GetTriggerUnit()
local real lg=AngleBetweenPoints(p5,fR)
local string Go=EQ(t)
call Es(Go,"Pudge",p1)
call Ev(Go,"Angle",lg)
call TimerStart(t,.03,true,function p0)
call RemoveLocation(p5)
call RemoveLocation(fR)
endfunction
function gw takes nothing returns nothing
set d4=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d4,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(d4,Condition(function pX))
call TriggerAddAction(d4,function p4)
endfunction
function p6 takes nothing returns boolean
if(GetUnitTypeId(GetSummonedUnit())=='o00L')then
return true
endif
if(GetUnitTypeId(GetSummonedUnit())=='o00M')then
return true
endif
if(GetUnitTypeId(GetSummonedUnit())=='o00N')then
return true
endif
if(GetUnitTypeId(GetSummonedUnit())=='o00O')then
return true
endif
return false
endfunction
function p7 takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A08T',GetSummonedUnit(),GetUnitAbilityLevelSwapped('A09D',GetSummoningUnit()))
call SetUnitAbilityLevelSwapped('A0CF',GetSummonedUnit(),GetUnitAbilityLevelSwapped('A09D',GetSummoningUnit()))
call IssueImmediateOrderById(GetSummonedUnit(),852512)
endfunction
function NW takes nothing returns nothing
set d5=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d5,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(d5,Condition(function p6))
call TriggerAddAction(d5,function p7)
endfunction
function p8 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A06O'))then
return false
endif
if(GetUnitTypeId(GetTriggerUnit())=='U00I')then
return false
endif
return true
endfunction
function p9 takes nothing returns nothing
local unit Pa=GetTriggerUnit()
local location PA=GetUnitLoc(Pa)
local location fr=GetSpellTargetLoc()
local real lg=AngleBetweenPoints(PA,fr)
local integer j1=GetUnitAbilityLevelSwapped('A06O',GetTriggerUnit())
if(j1==1)then
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(PA,-100.,lg),GetUnitFacing(GetTriggerUnit()))
call UnitAddAbility(bj_lastCreatedUnit,'A075')
call SetUnitAbilityLevelSwapped('A075',bj_lastCreatedUnit,(R2I(DistanceBetweenPoints(PA,fr))/'d'))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852555,fr)
call PolledWait((DistanceBetweenPoints(PA,fr)/4000.))
call SetUnitPositionLoc(Pa,fr)
call SetUnitAnimation(Pa,"morph ALTERNATE")
endif
if(j1==2)then
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(PA,-100.,lg),GetUnitFacing(GetTriggerUnit()))
call UnitAddAbility(bj_lastCreatedUnit,'A070')
call SetUnitAbilityLevelSwapped('A070',bj_lastCreatedUnit,(R2I(DistanceBetweenPoints(PA,fr))/'d'))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852555,fr)
call PolledWait((DistanceBetweenPoints(PA,fr)/4000.))
call SetUnitPositionLoc(Pa,fr)
call SetUnitAnimation(Pa,"morph ALTERNATE")
endif
if(j1==3)then
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(PA,-100.,lg),GetUnitFacing(GetTriggerUnit()))
call UnitAddAbility(bj_lastCreatedUnit,'A06Z')
call SetUnitAbilityLevelSwapped('A06Z',bj_lastCreatedUnit,(R2I(DistanceBetweenPoints(PA,fr))/'d'))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852555,fr)
call PolledWait((DistanceBetweenPoints(PA,fr)/4000.))
call SetUnitPositionLoc(Pa,fr)
call SetUnitAnimation(Pa,"morph ALTERNATE")
endif
if(j1==4)then
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),PolarProjectionBJ(PA,-100.,lg),GetUnitFacing(GetTriggerUnit()))
call UnitAddAbility(bj_lastCreatedUnit,'A077')
call SetUnitAbilityLevelSwapped('A077',bj_lastCreatedUnit,(R2I(DistanceBetweenPoints(PA,fr))/'d'))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852555,fr)
call PolledWait((DistanceBetweenPoints(PA,fr)/4000.))
call SetUnitPositionLoc(Pa,fr)
call SetUnitAnimation(Pa,"morph ALTERNATE")
endif
call RemoveLocation(PA)
call RemoveLocation(fr)
endfunction
function gW takes nothing returns nothing
set d6=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d6,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(d6,Condition(function p8))
call TriggerAddAction(d6,function p9)
endfunction
function Pb takes nothing returns boolean
if(not (GetSpellAbilityId()=='A06R'))then
return false
endif
if(GetUnitTypeId(GetTriggerUnit())=='U00I')then
return false
endif
return true
endfunction
function PB takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function Pc takes nothing returns nothing
local location fr
local unit EN
local group fB=CreateGroup()
local integer PC=1
local integer Pd=(4+(GetUnitAbilityLevelSwapped('A06R',GetTriggerUnit())*2))
loop
exitwhen PC>Pd
set fr=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00C',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call RemoveLocation(fr)
set EN=bj_lastCreatedUnit
call GroupAddUnit(fB,EN)
call ShowUnitHide(EN)
call UnitAddAbility(EN,'A07L')
call SetUnitAbilityLevelSwapped('A07L',EN,PC)
call IssueImmediateOrderById(EN,852096)
call PolledWait(.05)
set fr=GetUnitLoc(EN)
call TerrainDeformationRippleBJ(.03,false,fr,(150.+(100.*I2R(PC))),(150.+(100.*I2R(PC))),72.,.03,512)
call RemoveLocation(fr)
set PC=PC+1
endloop
call PolledWait(2)
call ForGroupBJ(fB,function PB)
call RemoveLocation(fr)
call DestroyGroup(fB)
endfunction
function gx takes nothing returns nothing
set d7=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d7,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(d7,Condition(function Pb))
call TriggerAddAction(d7,function Pc)
endfunction
function PD takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0H0'))then
return false
endif
return true
endfunction
function Pe takes nothing returns nothing
local unit PE
local unit Pf=GetTriggerUnit()
local unit array PF
local integer Pg
call EnableTrigger(d9)
set PE=CreateUnit(GetOwningPlayer(Pf),'e00Q',GetUnitX(Pf),GetUnitY(Pf),bj_UNIT_FACING)
call SetUnitPathing(PE,false)
call SetUnitInvulnerable(PE,true)
call UnitAddAbility(PE,'Aloc')
call UnitAddAbility(PE,'A0HM')
call UnitAddAbility(PE,'A0HO')
call PolledWait(.25)
call SetUnitAbilityLevelSwapped('A0HM',PE,GetUnitAbilityLevelSwapped('A0H0',Pf))
call SetUnitAbilityLevelSwapped('A0HO',PE,GetUnitAbilityLevelSwapped('A0H0',Pf))
call IssueImmediateOrderById(PE,852177)
call IssueTargetOrderById(PE,852069,Pf)
set Pg=1
set PF[Pg]=CreateUnit(GetOwningPlayer(Pf),'e00Q',GetUnitX(Pf)+150,GetUnitY(Pf)+150,bj_UNIT_FACING)
call SetUnitTimeScalePercent(PF[Pg],.0)
call SetUnitPathing(PF[Pg],false)
call SetUnitInvulnerable(PF[Pg],true)
call UnitAddAbility(PF[Pg],'Aloc')
set Pg=2
set PF[Pg]=CreateUnit(GetOwningPlayer(Pf),'e00Q',GetUnitX(Pf)+150,GetUnitY(Pf)-150,bj_UNIT_FACING)
call SetUnitTimeScalePercent(PF[Pg],.0)
call SetUnitPathing(PF[Pg],false)
call SetUnitInvulnerable(PF[Pg],true)
call UnitAddAbility(PF[Pg],'Aloc')
set Pg=3
set PF[Pg]=CreateUnit(GetOwningPlayer(Pf),'e00Q',GetUnitX(Pf)-150,GetUnitY(Pf)+150,bj_UNIT_FACING)
call SetUnitTimeScalePercent(PF[Pg],.0)
call SetUnitPathing(PF[Pg],false)
call SetUnitInvulnerable(PF[Pg],true)
call UnitAddAbility(PF[Pg],'Aloc')
set Pg=4
set PF[Pg]=CreateUnit(GetOwningPlayer(Pf),'e00Q',GetUnitX(Pf)-150,GetUnitY(Pf)-150,bj_UNIT_FACING)
call SetUnitTimeScalePercent(PF[Pg],.0)
call SetUnitPathing(PF[Pg],false)
call SetUnitInvulnerable(PF[Pg],true)
call UnitAddAbility(PF[Pg],'Aloc')
call PolledWait(20*GetUnitAbilityLevel(Pf,'A0H0'))
if(PF[1]!=null)then
call RemoveUnit(PF[1])
endif
if(PF[2]!=null)then
call RemoveUnit(PF[2])
endif
if(PF[3]!=null)then
call RemoveUnit(PF[3])
endif
if(PF[4]!=null)then
call RemoveUnit(PF[4])
endif
endfunction
function gX takes nothing returns nothing
set d8=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(d8,EVENT_PLAYER_UNIT_SPELL_CHANNEL)
call TriggerAddCondition(d8,Condition(function PD))
call TriggerAddAction(d8,function Pe)
endfunction
function PG takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0H0'))then
return false
endif
return true
endfunction
function Ph takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='e00Q')
endfunction
function PH takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
function Trig_Sand_Storm_Turn_Off_Func005001002 takes nothing returns boolean
return(GetUnitTypeId(GetFilterUnit())=='U00K')
endfunction
function Trig_Sand_Storm_Turn_Off_Func005A takes nothing returns nothing
call UnitRemoveAbility(GetEnumUnit(),'B04R')
endfunction
function Pi takes nothing returns nothing
local unit Pf=GetTriggerUnit()
local group fB
call PolledWait(GetUnitAbilityLevel(Pf,'A0H0')*.3)
set fB=GetUnitsOfPlayerMatching(GetOwningPlayer(Pf),Condition(function Ph))
call ForGroupBJ(fB,function PH)
call UnitRemoveAbility(Pf,'B04R')
call DestroyGroup(fB)
endfunction
function gy takes nothing returns nothing
set d9=CreateTrigger()
call DisableTrigger(d9)
call TriggerRegisterAnyUnitEventBJ(d9,EVENT_PLAYER_UNIT_SPELL_ENDCAST)
call TriggerAddCondition(d9,Condition(function PG))
call TriggerAddAction(d9,function Pi)
endfunction
function PI takes nothing returns boolean
if(not (GetSpellAbilityId()=='A01W'))then
return false
endif
return true
endfunction
function Pj takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0M9')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A0M9',GetUnitAbilityLevel(GetTriggerUnit(),'A01W'))
call IssueImmediateOrderById(bj_lastCreatedUnit,852096)
call RemoveLocation(fr)
endfunction
function gY takes nothing returns nothing
set Da=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Da,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Da,Condition(function PI))
call TriggerAddAction(Da,function Pj)
endfunction
function PJ takes nothing returns boolean
return GetSpellAbilityId()=='A0ML'
endfunction
function Pk takes nothing returns boolean
if(GetTriggerEventId()==EVENT_UNIT_DEATH)then
return true
endif
if(GetOrderedUnit()==Ew(EQ(GetTriggeringTrigger()),"Spiritbreaker"))then
return true
endif
return false
endfunction
function PK takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local string Go=EQ(t)
local unit Pl=Ew(Go,"Spiritbreaker")
local unit h3=Ew(Go,"Target")
local unit h2=Ew(Go,"Caster")
local trigger PL=EX(Go,"TrigAttack")
local trigger Pm=EX(Go,"TrigAccelerate")
call DisableTrigger(PL)
call DisableTrigger(Pm)
call DisableTrigger(t)
call RemoveUnit(h2)
call UnitRemoveAbility(Pl,'B01Z')
call UnitRemoveAbility(h3,'B01Y')
call SetUnitPathing(Pl,true)
call SetUnitVertexColorBJ(Pl,'d','d','d',0)
call PolledWait(1)
call Er(EQ(PL))
call DestroyTrigger(PL)
call Er(EQ(Pm))
call DestroyTrigger(Pm)
call Er(Go)
call DestroyTrigger(t)
endfunction
function PM takes nothing returns boolean
return Ew(EQ(GetTriggeringTrigger()),"Spiritbreaker")==GetAttacker()
endfunction
function Pn takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local string Go=EQ(t)
local unit Pl=Ew(Go,"Spiritbreaker")
local unit h3=Ew(Go,"Target")
local unit h2=Ew(Go,"Caster")
local integer jy=GetUnitAbilityLevel(Pl,'A0ML')
local unit Po=CreateUnit(GetOwningPlayer(Pl),'e00E',GetUnitX(Pl),GetUnitY(Pl),0)
local trigger PO=EX(Go,"TrigOff")
local trigger Pm=EX(Go,"TrigAccelerate")
call DisableTrigger(t)
call DisableTrigger(PO)
call DisableTrigger(Pm)
call UnitAddAbility(Po,'A0GS')
call SetUnitAbilityLevel(Po,'A0GS',jy)
call IssueTargetOrderById(Po,852095,h3)
call RemoveUnit(h2)
call UnitRemoveAbility(Pl,'B01Z')
call UnitRemoveAbility(h3,'B01Y')
call SetUnitPathing(Pl,true)
call SetUnitVertexColorBJ(Pl,'d','d','d',0)
call PolledWait(1)
call Er(EQ(PO))
call DestroyTrigger(PO)
call Er(EQ(Pm))
call DestroyTrigger(Pm)
call Er(Go)
call DestroyTrigger(t)
endfunction
function Pp takes nothing returns nothing
local string Go=EQ(GetTriggeringTrigger())
local unit Pl=Ew(Go,"Spiritbreaker")
local unit h3=Ew(Go,"Target")
local unit h2=Ew(Go,"Caster")
local integer PP=E0(Go,"Ability")
local integer Pq=GetTriggerExecCount(GetTriggeringTrigger())
local integer PQ=GetUnitAbilityLevel(Pl,'A0ML')
local trigger PO=EX(Go,"TrigOff")
local trigger PL=EX(Go,"TrigAttack")
call SetUnitVertexColorBJ(Pl,'d','d','d',PQ*Pq)
if ModuloInteger(Pq,4)==0 then
call SetUnitAbilityLevel(h2,PP,GetUnitAbilityLevel(h2,PP)+1)
endif
call DisableTrigger(PO)
call DisableTrigger(PL)
call IssueTargetOrderById(Pl,851983,h3)
call EnableTrigger(PO)
call EnableTrigger(PL)
endfunction
function Pr takes nothing returns nothing
local unit Pl=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local integer jy=GetUnitAbilityLevel(Pl,'A0ML')
local integer PP
local location fr=GetUnitLoc(Pl)
local unit h2
local trigger Pm=CreateTrigger()
local trigger PO=CreateTrigger()
local trigger PL=CreateTrigger()
call UnitShareVision(h3,GetOwningPlayer(Pl),true)
set h2=CreateUnit(GetOwningPlayer(Pl),'e00C',GetUnitX(Pl),GetUnitY(Pl),0)
call SetUnitPathing(h2,false)
call UnitAddAbility(h2,'Aloc')
call SetUnitInvulnerable(h2,true)
if(jy==1)then
call UnitAddAbility(h2,'A0GE')
set PP='A0GE'
elseif(jy==2)then
call UnitAddAbility(h2,'A0GF')
set PP='A0GF'
elseif(jy==3)then
call UnitAddAbility(h2,'A0GG')
set PP='A0GG'
elseif(jy==4)then
call UnitAddAbility(h2,'A0GH')
set PP='A0GH'
endif
call PolledWait(.1)
call UnitAddAbility(h2,'A0GJ')
call IssueTargetOrderById(h2,852149,h3)
call IssueTargetOrderById(Pl,851983,h3)
call SetUnitPathing(Pl,false)
call TriggerRegisterTimerEvent(Pm,1.,true)
call TriggerAddAction(Pm,function Pp)
call Es(EQ(Pm),"TrigOff",PO)
call Es(EQ(Pm),"TrigAttack",PL)
call Es(EQ(Pm),"Spiritbreaker",Pl)
call Es(EQ(Pm),"Caster",h2)
call Es(EQ(Pm),"Target",h3)
call ET(EQ(Pm),"Ability",PP)
call TriggerRegisterAnyUnitEventBJ(PL,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(PL,Condition(function PM))
call TriggerAddAction(PL,function Pn)
call Es(EQ(PL),"TrigOff",PO)
call Es(EQ(PL),"TrigAccelerate",Pm)
call Es(EQ(PL),"Spiritbreaker",Pl)
call Es(EQ(PL),"Caster",h2)
call Es(EQ(PL),"Target",h3)
call TriggerRegisterAnyUnitEventBJ(PO,EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerRegisterAnyUnitEventBJ(PO,EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER)
call TriggerRegisterAnyUnitEventBJ(PO,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerRegisterUnitEvent(PO,Pl,EVENT_UNIT_DEATH)
call TriggerRegisterUnitEvent(PO,h3,EVENT_UNIT_DEATH)
call TriggerAddCondition(PO,Condition(function Pk))
call TriggerAddAction(PO,function PK)
call Es(EQ(PO),"TrigAttack",PL)
call Es(EQ(PO),"TrigAccelerate",Pm)
call Es(EQ(PO),"Spiritbreaker",Pl)
call Es(EQ(PO),"Caster",h2)
call Es(EQ(PO),"Target",h3)
call PolledWait(.1)
call UnitShareVision(h3,GetOwningPlayer(Pl),false)
endfunction
function gz takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function PJ))
call TriggerAddAction(t,function Pr)
endfunction
function PR takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),'A0ES')>0 and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetAttacker()))
endfunction
function Ps takes nothing returns nothing
local unit i9=GetAttacker()
local unit ke=GetTriggerUnit()
local real jY=GetUnitMoveSpeed(i9)*.04*GetUnitAbilityLevel(i9,'A0ES')
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetBJ(i9,ke,jY,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_NORMAL)
call PolledWait(.5)
call EnableTrigger(GetTriggeringTrigger())
endfunction
function gZ takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function PR))
call TriggerAddAction(t,function Ps)
endfunction
function PS takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),'A0G5')>0 and IsUnitIllusion(GetAttacker())==false and IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false and GetUnitTypeId(GetTriggerUnit())!='n00L' and IsUnitEnemy(GetTriggerUnit(),GetOwningPlayer(GetAttacker())) and GetRandomInt(1,'d')<17
endfunction
function Pt takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit ke=Ew(Go,"Defender")
local real lg=E2(Go,"Angle")
local integer PT=E0(Go,"Brake")
local real Pu=E2(Go,"Movement")
local location PU
if PT==1 then
call Ev(Go,"Movement",Pu*.98)
endif
if(GetUnitState(ke,UNIT_STATE_LIFE)>0)then
set PU=GetUnitLoc(ke)
call EnumDestructablesInCircleBJ(150.,PU,function EC)
call DestroyEffect(AddSpellEffectByIdLoc('A0G5',EFFECT_TYPE_SPECIAL,PU))
call RemoveLocation(PU)
call SetUnitPosition(ke,GetUnitX(ke)+Pu*Cos(lg),GetUnitY(ke)+Pu*Sin(lg))
endif
endfunction
function Pv takes nothing returns nothing
local timer t=CreateTimer()
local string Go=EQ(t)
local unit ke=GetTriggerUnit()
local unit i9=GetAttacker()
local real lg=Atan2(GetUnitY(ke)-GetUnitY(i9),GetUnitX(ke)-GetUnitX(i9))
local integer jy=GetUnitAbilityLevel(i9,'A0G5')
call DestroyEffect(AddSpecialEffectTargetUnitBJ("weapon",i9,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl"))
call DisableTrigger(GetTriggeringTrigger())
call Es(Go,"Defender",ke)
call Ev(Go,"Angle",lg)
call Ev(Go,"Movement",2)
call ET(Go,"Brake",0)
call UnitDamageTargetBJ(i9,ke,25*jy,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNKNOWN)
call TimerStart(t,.01,true,function Pt)
call PolledWait(.1)
call ET(Go,"Brake",1)
call PolledWait(.4+jy*.2)
call PauseTimer(t)
call PolledWait(1.25)
call EnableTrigger(GetTriggeringTrigger())
call Er(Go)
call DestroyTimer(t)
endfunction
function g0 takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(t,Condition(function PS))
call TriggerAddAction(t,function Pv)
endfunction
function PV takes nothing returns boolean
return GetSpellAbilityId()=='A0G4'
endfunction
function Pw takes nothing returns nothing
local timer t=GetExpiredTimer()
local string Go=EQ(t)
local unit ke=Ew(Go,"Defender")
local real lg=E2(Go,"Angle")
local integer PT=E0(Go,"Brake")
local real Pu=E2(Go,"Movement")
local location PU
if PT==1 then
call Ev(Go,"Movement",Pu*.98)
endif
if(GetUnitState(ke,UNIT_STATE_LIFE)>0)then
set PU=GetUnitLoc(ke)
call EnumDestructablesInCircleBJ(150.,PU,function EC)
call DestroyEffect(AddSpellEffectByIdLoc('A0G5',EFFECT_TYPE_SPECIAL,PU))
call RemoveLocation(PU)
call SetUnitPosition(ke,GetUnitX(ke)+Pu*Cos(lg),GetUnitY(ke)+Pu*Sin(lg))
endif
endfunction
function PW takes nothing returns nothing
local timer t=CreateTimer()
local string Go=EQ(t)
local unit i9=Ar
local unit ke=AX
local real lg=Atan2(GetUnitY(ke)-GetUnitY(i9),GetUnitX(ke)-GetUnitX(i9))
local integer jy=GetUnitAbilityLevel(i9,'A0G5')
call DestroyEffect(AddSpecialEffectTargetUnitBJ("weapon",i9,"Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl"))
call Es(Go,"Defender",ke)
call Ev(Go,"Angle",lg)
call Ev(Go,"Movement",2)
call ET(Go,"Brake",0)
call UnitDamageTargetBJ(i9,ke,25*jy,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_UNKNOWN)
call TimerStart(t,.01,true,function Pw)
call PolledWait(.1)
call ET(Go,"Brake",1)
call PolledWait(.4+jy*.2)
call PauseTimer(t)
call PolledWait(1)
call Er(Go)
call DestroyTimer(t)
endfunction
function Px takes nothing returns nothing
local unit JO=Ew(EQ(GetTriggeringTrigger()),"caster")
if(GetEventDamageSource()==JO)then
call DisableTrigger(GetTriggeringTrigger())
call UnitDamageTargetBJ(JO,GetTriggerUnit(),'d'*I2R(GetUnitAbilityLevel(JO,'A0G4')),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL)
endif
endfunction
function PX takes nothing returns nothing
local string Go=EQ(GetExpiredTimer())
local integer Py=E0(Go,"Fade")
call SetUnitVertexColorBJ(Ew(Go,"caster"),'d','d','d',Py)
call ET(Go,"Fade",Py+1)
endfunction
function PY takes nothing returns nothing
local string Go=EQ(GetExpiredTimer())
local integer Py=E0(Go,"Fade")
call SetUnitVertexColorBJ(Ew(Go,"caster"),'d','d','d',Py)
call ET(Go,"Fade",Py-1)
endfunction
function Pz takes nothing returns nothing
local unit JO=GetTriggerUnit()
local unit Ek=GetSpellTargetUnit()
local timer t1=CreateTimer()
local timer t2=CreateTimer()
local location fr
local location fR
local trigger PZ=CreateTrigger()
call UnitShareVision(Ek,GetOwningPlayer(JO),true)
call IssueImmediateOrder(JO,"halt")
call ET(EQ(t1),"Fade",0)
call Es(EQ(t1),"caster",JO)
call TimerStart(t1,.01,true,function PX)
call PolledWait(1)
call PauseTimer(t1)
set fr=GetUnitLoc(Ek)
set fR=GetUnitLoc(JO)
call SetUnitPositionLocFacingLocBJ(JO,PolarProjectionBJ(fr,80.,AngleBetweenPoints(fR,fr)),fr)
set Ar=JO
set AX=Ek
call ExecuteFunc("PW")
call SetUnitAnimation(JO,"attack")
call IssueTargetOrderById(JO,851983,Ek)
call TriggerRegisterUnitEvent(PZ,Ek,EVENT_UNIT_DAMAGED)
call TriggerAddAction(PZ,function Px)
call Es(EQ(PZ),"caster",JO)
call ET(EQ(t2),"Fade",'d')
call Es(EQ(t2),"caster",JO)
call TimerStart(t2,.01,true,function PY)
call PolledWait(1)
call PauseTimer(t2)
call SetUnitVertexColorBJ(JO,'d','d','d',0)
call UnitShareVision(Ek,GetOwningPlayer(JO),false)
call PolledWait(.01)
call DestroyTimer(t1)
call DestroyTimer(t2)
call RemoveLocation(fr)
call RemoveLocation(fR)
endfunction
function g3 takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function PV))
call TriggerAddAction(t,function Pz)
endfunction
function P0 takes nothing returns boolean
return GetSpellAbilityId()=='A0H4'
endfunction
function P1 takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer jy=GetUnitAbilityLevel(EN,'A0H4')
local unit h2=CreateUnit(GetOwningPlayer(EN),'e00E',GetUnitX(EN),GetUnitY(EN),0)
call UnitAddAbility(h2,'A08Q')
call SetUnitAbilityLevel(h2,'A08Q',jy)
call IssueTargetOrderById(h2,852274,EN)
endfunction
function g5 takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function P0))
call TriggerAddAction(t,function P1)
endfunction
function P2 takes nothing returns boolean
return GetSpellAbilityId()=='A07Q'
endfunction
function P3 takes nothing returns boolean
return GetSpellAbilityId()=='A07R'
endfunction
function P4 takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local string Go=EQ(t)
local unit P5=Ew(Go,"Source")
local unit h3=Ew(Go,"Target")
local real P6=E2(Go,"SourceLifePercent")
local real P7=E2(Go,"TargetLifePercent")
local integer jy=GetUnitAbilityLevel(P5,'A07Q')
if GetSpellTargetUnit()==P5 then
call SetUnitLifePercentBJ(P5,P7)
endif
if GetSpellTargetUnit()==h3 then
call SetUnitLifePercentBJ(h3,P6)
if GetUnitLifePercent(h3)<33. and jy==1 then
call SetUnitLifePercentBJ(h3,33.)
endif
if GetUnitLifePercent(h3)<28. and jy==2 then
call SetUnitLifePercentBJ(h3,28.)
endif
if GetUnitLifePercent(h3)<23. and jy==3 then
call SetUnitLifePercentBJ(h3,23.)
endif
endif
if GetTriggerExecCount(t)==2 then
call DisableTrigger(t)
call PolledWait(1)
call Er(Go)
call DestroyTrigger(t)
endif
endfunction
function P8 takes nothing returns nothing
local trigger t=CreateTrigger()
local string Go=EQ(t)
local unit P5=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local unit h2
call Es(Go,"Source",P5)
call Es(Go,"Target",h3)
call Ev(Go,"SourceLifePercent",GetUnitLifePercent(P5))
call Ev(Go,"TargetLifePercent",GetUnitLifePercent(h3))
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function P3))
call TriggerAddAction(t,function P4)
set h2=CreateUnit(GetOwningPlayer(h3),'e00E',GetUnitX(h3),GetUnitY(h3),0)
call UnitAddAbility(h2,'A07R')
call IssueTargetOrderById(h2,852095,P5)
set h2=CreateUnit(GetOwningPlayer(P5),'e00E',GetUnitX(P5),GetUnitY(P5),0)
call UnitAddAbility(h2,'A07R')
call IssueTargetOrderById(h2,852095,h3)
endfunction
function g4 takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function P2))
call TriggerAddAction(t,function P8)
endfunction
function P9 takes nothing returns nothing
call UnitRemoveBuffsBJ(1,Ew(EQ(GetTriggeringTrigger()),"UnitVar"))
endfunction
function qa takes nothing returns boolean
return GetLearnedSkill()=='A04E' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function qA takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer jy=GetUnitAbilityLevel(EN,'A04E')
local trigger t
if(jy==1)then
set t=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(t,10.)
call TriggerAddAction(t,function P9)
call Es(EQ(t),"UnitVar",EN)
endif
endfunction
function g6 takes nothing returns nothing
set DA=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DA,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(DA,Condition(function qa))
call TriggerAddAction(DA,function qA)
endfunction
function qb takes nothing returns boolean
if(not (GetSpellAbilityId()=='A046'))then
return false
endif
return true
endfunction
function qB takes nothing returns nothing
local unit t=GetSpellTargetUnit()
local real qc=(60.+(50.*I2R(GetUnitAbilityLevelSwapped('A046',GetTriggerUnit()))))
local effect ip=AddSpecialEffectTargetUnitBJ("chest",t,"Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl")
call UnitDamageTargetBJ(GetTriggerUnit(),t,qc,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_COLD)
call PolledWait(.1)
call DestroyEffect(ip)
endfunction
function g7 takes nothing returns nothing
set Db=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Db,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Db,Condition(function qb))
call TriggerAddAction(Db,function qB)
endfunction
function qC takes nothing returns boolean
if(not (GetSpellAbilityId()=='A03Z'))then
return false
endif
return true
endfunction
function qd takes nothing returns nothing
local location fr=GetUnitLoc(GetTriggerUnit())
local location fR
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=16
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A084')
call SetUnitAbilityLevelSwapped('A084',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A03Z',GetTriggerUnit()))
set fR=PolarProjectionBJ(fr,100.,(22.5*I2R(bj_forLoopAIndex)))
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,852555,fR)
call RemoveLocation(fR)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call RemoveLocation(fr)
endfunction
function g8 takes nothing returns nothing
set DB=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DB,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(DB,Condition(function qC))
call TriggerAddAction(DB,function qd)
endfunction
function qD takes nothing returns boolean
if(GetSpellAbilityId()=='A0N6')then
return true
endif
return false
endfunction
function qe takes unit EN,integer qE returns boolean
if(GetItemTypeId(UnitItemInSlotBJ(EN,qE))=='pspd')then
return true
endif
if(GetItemTypeId(UnitItemInSlotBJ(EN,qE))=='oflg')then
return true
endif
return false
endfunction
function qf takes nothing returns nothing
local location fr
local unit EN=GetTriggerUnit()
local timer qF=CreateTimer()
local item array ItemArray
local integer EA=1
loop
exitwhen EA>6
if(qe(EN,EA))then
call SetItemDropOnDeath(UnitItemInSlotBJ(EN,EA),false)
endif
set EA=EA+1
endloop
call StartTimerBJ(qF,false,5+GetUnitAbilityLevel(EN,'A0N6')*5)
call SetUnitPathing(EN,false)
call SetUnitVertexColorBJ(EN,'d','d','d',87.)
loop
exitwhen TimerGetRemaining(qF)<=.0
call PolledWait(.5)
call SetUnitPathing(EN,false)
endloop
call SetUnitPathing(EN,true)
call SetUnitVertexColorBJ(EN,'d','d','d',.0)
call PauseTimer(qF)
call PolledWait(1)
set EA=1
loop
exitwhen EA>6
if(qe(EN,EA))then
call SetItemDropOnDeath(UnitItemInSlotBJ(EN,EA),true)
endif
set EA=EA+1
endloop
call DestroyTimer(qF)
endfunction
function Gg takes nothing returns nothing
set Dc=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Dc,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Dc,Condition(function qD))
call TriggerAddAction(Dc,function qf)
endfunction
function qg takes nothing returns boolean
if((GetUnitAbilityLevel(GetTriggerUnit(),'A0NA')>0) and (GetRandomInt(1,'d')<(GetUnitAbilityLevel(GetTriggerUnit(),'A0NA')*4)))then
if(GetEventDamage()>1)then
return true
endif
endif
return false
endfunction
function qG takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)then
if(GetUnitAbilityLevel(GetFilterUnit(),'A04R')!=1)then
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then
return true
endif
endif
endif
return false
endfunction
function qh takes nothing returns nothing
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(Ag),GetUnitY(Ag),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0NN')
call IssueTargetOrderById(bj_lastCreatedUnit,852095,GetEnumUnit())
call UnitDamageTarget(Ag,GetEnumUnit(),AH,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
endfunction
function qH takes nothing returns nothing
local unit EN
local location fr=GetUnitLoc(GetTriggerUnit())
local group fB=GetUnitsInRangeOfLocMatching(400,fr,Condition (function qG))
local effect fx
set AH=RMinBJ(GetEventDamage(),GetUnitState(GetTriggerUnit(),UNIT_STATE_MAX_LIFE))
call SetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE,GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)+AH)
call ForGroup(fB,function qh)
call RemoveLocation (fr)
call DestroyGroup(fB)
set EN=CreateUnit(GetOwningPlayer(Ag),'e01Q',GetUnitX(Ag),GetUnitY(Ag),bj_UNIT_FACING)
call SetUnitPathing(EN,false)
call SetUnitInvulnerable(EN,true)
call SetUnitAnimation(EN,"Death")
call TriggerSleepAction(2.)
call RemoveUnit(EN)
endfunction
function GH takes nothing returns nothing
set DC=CreateTrigger()
call TriggerRegisterUnitEvent(DC,Ag,EVENT_UNIT_DAMAGED)
call TriggerAddCondition(DC,Condition(function qg))
call TriggerAddAction(DC,function qH)
endfunction
function qi takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0N7'))then
return false
endif
return true
endfunction
function qI takes unit h3 returns nothing
local unit h2
local boolean qj
if(IsUnitVisible(Ag,GetOwningPlayer(h3)))then
set qj=false
else
set qj=true
endif
if(AJ==false)then
set h2=CreateUnit(GetOwningPlayer(Ag),'e00E',GetUnitX(h3),GetUnitY(h3),bj_UNIT_FACING)
call UnitAddAbility(h2,'A0N8')
if(qj)then
call SetUnitAbilityLevel(h2,'A0N8',2)
else
call SetUnitAbilityLevel(h2,'A0N8',1)
endif
call IssueTargetOrderById(h2,852095,h3)
if(Ah)then
call SetUnitPosition(Ag,GetUnitX(h3),GetUnitY(h3))
call IssueTargetOrderById(Ag,851983,h3)
call PanCameraToTimedForPlayer(GetOwningPlayer(Ag),GetUnitX(Ag),GetUnitY(Ag),0)
set Ah=false
set AJ=true
if(qj)then
call PolledWait(1.6)
else
call PolledWait(.6)
endif
else
call PauseUnit(AG,false)
call SetUnitPathing(AG,false)
call SetUnitPosition(AG,GetUnitX(h3),GetUnitY(h3))
call ShowUnit(AG,true)
call IssueTargetOrderById(AG,851983,h3)
if(qj)then
call PolledWait(1.6)
else
call PolledWait(.6)
endif
call ShowUnit(AG,false)
call PauseUnit(AG,true)
endif
endif
endfunction
function qJ takes nothing returns boolean
if(IsUnitIllusion(GetFilterUnit()))then
if(GetUnitTypeId(GetFilterUnit())==GetUnitTypeId(Ag))then
if(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(Ag)))then
if(UnitHasBuffBJ(GetFilterUnit(),'B06L'))then
return true
endif
endif
endif
endif
return false
endfunction
function qk takes nothing returns nothing
local unit h3=GetSpellTargetUnit()
local unit h2
local location fr=GetUnitLoc(Ag)
local group fB
local integer EA=1
local integer Eb=IMinBJ(2+GetUnitAbilityLevel(Ag,'A0N7'),5)
local unit m6=CreateUnit(GetOwningPlayer(h3),'e01R',0,0,bj_UNIT_FACING)
call UnitAddAbility(m6,'A0NW')
set h2=CreateUnit(GetOwningPlayer(Ag),'e00C',GetUnitX(Ag),GetUnitY(Ag),bj_UNIT_FACING)
call UnitAddAbility(h2,'A0N9')
call UnitApplyTimedLifeBJ(2.,'BTLF',h2)
call IssueTargetOrderById(h2,852274,Ag)
call SetUnitPathing(h2,false)
call SetUnitInvulnerable(h2,true)
call UnitAddAbility(h2,'Aloc')
set fB=GetUnitsInRangeOfLocMatching(1000.,fr,Condition(function qJ))
set AG=FirstOfGroup(fB)
call DestroyGroup(fB)
call RemoveLocation (fr)
call ShowUnit(AG,false)
call SetUnitPathing(AG,false)
call PauseUnit(AG,true)
set AJ=false
loop
exitwhen EA>Eb
if((IsUnitAliveBJ(Ag)) and (IsUnitAliveBJ(h3)))then
call qI(h3)
else
set EA=Eb+1
endif
set EA=EA+1
call PolledWait(GetRandomInt(4,7))
endloop
call RemoveUnit(m6)
call UnitRemoveAbility(h3,'B06O')
call RemoveUnit(AG)
endfunction
function GG takes nothing returns nothing
set Dd=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Dd,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Dd,Condition(function qi))
call TriggerAddAction(Dd,function qk)
endfunction
function qK takes nothing returns boolean
return GetLearnedSkill()=='A0N7' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function ql takes nothing returns nothing
if(GetUnitAbilityLevel(GetTriggerUnit(),'A0N7')==4)then
call UnitAddAbility(GetTriggerUnit(),'A0NB')
endif
endfunction
function HL takes nothing returns nothing
set DD=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DD,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(DD,Condition(function qK))
call TriggerAddAction(DD,function ql)
endfunction
function qL takes nothing returns boolean
if(GetSpellAbilityId()=='A0NB')then
return true
endif
return false
endfunction
function qm takes nothing returns nothing
set Ah=true
endfunction
function HS takes nothing returns nothing
set De=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(De,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(De,Condition(function qL))
call TriggerAddAction(De,function qm)
endfunction
function qM takes nothing returns boolean
if(GetLearnedSkill()=='A0NF')then
return true
endif
return false
endfunction
function qn takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(),'A0ND')
call EnableTrigger(DF)
call DisableTrigger(DE)
endfunction
function VL takes nothing returns nothing
set DE=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DE,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(DE,Condition(function qM))
call TriggerAddAction(DE,function qn)
endfunction
function qN takes nothing returns boolean
if(GetSpellAbilityId()=='A0ND')then
return true
endif
return false
endfunction
function qo takes nothing returns nothing
local effect fx=AddSpecialEffectTarget("Abilities\\Spells\\Undead\\Curse\\CurseTarget.mdl",GetSpellTargetUnit(),"overhead")
local timer qO=CreateTimer()
local unit m6=CreateUnit(GetOwningPlayer(GetSpellTargetUnit()),'e01R',0,0,bj_UNIT_FACING)
call UnitAddAbility(m6,'A0NV')
set Ai=GetSpellTargetUnit()
call StartTimerBJ(qO,false,30)
loop
exitwhen(TimerGetRemaining(qO)<=.0) or (IsUnitAliveBJ(Ai)==false)
call PolledWait(.5)
endloop
call RemoveUnit(m6)
call UnitRemoveAbility(Ai,'B06N')
call DestroyEffect(fx)
set Ai=null
call PauseTimer(qO)
call PolledWait(1)
call DestroyTimer(qO)
endfunction
function TV takes nothing returns nothing
set Df=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Df,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Df,Condition(function qN))
call TriggerAddAction(Df,function qo)
endfunction
function qp takes nothing returns boolean
if(GetUnitState(Ag,UNIT_STATE_LIFE)>1)then
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(Ag)))then
if(IsUnitEnemy(GetKillingUnit(),GetOwningPlayer(Ag)))then
if(GetUnitAbilityLevel(GetTriggerUnit(),'A04R')!=1)then
if(GetUnitTypeId(GetTriggerUnit())!='o00S' and GetUnitTypeId(GetTriggerUnit())!='e00E' and GetUnitTypeId(GetTriggerUnit())!='e00C' and GetUnitTypeId(GetTriggerUnit())!='u00I' and GetUnitTypeId(GetTriggerUnit())!='e01V' and GetUnitTypeId(GetTriggerUnit())!='e01U')then
if(((GetUnitX(GetTriggerUnit())-GetUnitX(Ag))*(GetUnitX(GetTriggerUnit())-GetUnitX(Ag))+(GetUnitY(GetTriggerUnit())-GetUnitY(Ag))*(GetUnitY(GetTriggerUnit())-GetUnitY(Ag)))<0xF4240)then
return true
endif
endif
endif
endif
endif
endif
return false
endfunction
function qP takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)then
if(GetUnitAbilityLevel(GetFilterUnit(),'A04R')!=1)then
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))then
if((IsUnitAliveBJ(GetFilterUnit())) and (IsUnitVisible(GetFilterUnit(),GetOwningPlayer(Ag))))then
return true
endif
endif
endif
endif
return false
endfunction
function qq takes nothing returns nothing
local location fr
local unit h3
local group fB
local integer jy
if(IsUnitType(GetDyingUnit(),UNIT_TYPE_HERO))then
set jy=3+GetUnitAbilityLevel(Ag,'A0NF')
else
set jy=GetUnitAbilityLevel(Ag,'A0NF')
endif
if((IsUnitAliveBJ(Ai)) and (Ai!=null) and (IsUnitVisible(Ai,GetOwningPlayer(Ag))))then
set h3=Ai
else
set fr=GetUnitLoc(GetDyingUnit())
set fB=GetUnitsInRangeOfLocMatching(1000,fr,Condition (function qP))
set h3=GroupPickRandomUnit(fB)
call DestroyGroup(fB)
call RemoveLocation(fr)
endif
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Ag),'e00E',GetUnitX(GetDyingUnit()),GetUnitY(GetDyingUnit()),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0NC')
call SetUnitAbilityLevel(bj_lastCreatedUnit,'A0NC',jy)
call IssueTargetOrderById(bj_lastCreatedUnit,852095,h3)
endfunction
function Gh takes nothing returns nothing
set DF=CreateTrigger()
call DisableTrigger(DF)
call TriggerRegisterAnyUnitEventBJ(DF,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(DF,Condition(function qp))
call TriggerAddAction(DF,function qq)
endfunction
function qQ takes nothing returns boolean
return GetBooleanAnd(GetBooleanAnd((IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false),(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit())))),GetBooleanAnd(GetBooleanAnd((UnitHasBuffBJ(GetFilterUnit(),'B027')==false),(UnitHasBuffBJ(GetFilterUnit(),'B028')==false)),(IsUnitAliveBJ(GetFilterUnit()))))
endfunction
function qr takes nothing returns boolean
if((GetSpellAbilityId()=='A013'))then
return true
endif
if((GetSpellAbilityId()=='A0A6'))then
return true
endif
return false
endfunction
function qR takes nothing returns nothing
local integer qs
local integer EA
local integer Eb
local integer qS=200
local real array PN
local unit array qt
local unit qT=GetTriggerUnit()
local unit kP
local location qu=GetUnitLoc(GetTriggerUnit())
local location qU
local location qv
local group qV
if(GetSpellAbilityId()=='A013')then
set qs=GetUnitAbilityLevelSwapped('A013',GetTriggerUnit())
else
set qs=(GetUnitAbilityLevelSwapped('A0A6',GetTriggerUnit())+1)
endif
set EA=1
set Eb=18
loop
exitwhen EA>Eb
set qU=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e017',GetOwningPlayer(qT),qU,PN[EA])
if(GetSpellAbilityId()=='A013')then
call SetUnitAbilityLevelSwapped('A057',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A013',GetSpellAbilityUnit()))
else
call SetUnitAbilityLevelSwapped('A057',bj_lastCreatedUnit,(GetUnitAbilityLevelSwapped('A0A6',GetSpellAbilityUnit())+1))
endif
set qt[EA]=bj_lastCreatedUnit
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,851986,PolarProjectionBJ(qU,675.,(I2R(EA)*20.)))
call RemoveLocation(qU)
set EA=EA+1
endloop
set EA=1
set Eb=5
loop
exitwhen EA>Eb
set qV=GetUnitsInRangeOfLocMatching(qS,qu,Condition(function qQ))
loop
set kP=FirstOfGroup(qV)
exitwhen kP==null
set qv=GetUnitLoc(kP)
call CreateNUnitsAtLoc(1,'o00I',GetOwningPlayer(qT),qv,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A057')
call SetUnitAbilityLevelSwapped('A057',bj_lastCreatedUnit,qs)
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,851983,kP)
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(qv)
call GroupRemoveUnit(qV,kP)
endloop
set qS=qS+200
call PolledWait(.18)
set EA=EA+1
endloop
set EA=1
set Eb=18
loop
exitwhen EA>Eb
call RemoveUnit(qt[EA])
set EA=EA+1
endloop
call RemoveLocation(qu)
call RemoveLocation(qU)
call DestroyGroup(qV)
endfunction
function g9 takes nothing returns nothing
set Dg=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Dg,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Dg,Condition(function qr))
call TriggerAddAction(Dg,function qR)
endfunction
function qw takes nothing returns boolean
if(GetUnitAbilityLevelSwapped('A0MM',GetTriggerUnit())>0)then
if(GetUnitAbilityLevelSwapped('A04R',GetAttacker())==0)then
if(IsUnitType(GetAttacker(),UNIT_TYPE_STRUCTURE)==false)then
if(IsUnitEnemy(GetAttacker(),GetTriggerPlayer()))then
return true
endif
endif
endif
endif
return false
endfunction
function qW takes nothing returns nothing
local location fr=GetUnitLoc(GetAttacker())
call CreateNUnitsAtLoc(1,'o00S',GetOwningPlayer(GetTriggerUnit()),fr,bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A0KI')
call SetUnitAbilityLevelSwapped('A0KI',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A0MM',GetTriggerUnit()))
call UnitApplyTimedLifeBJ(1.,'BTLF',bj_lastCreatedUnit)
call IssueTargetOrderById(bj_lastCreatedUnit,851983,GetAttacker())
call SetUnitPathing(bj_lastCreatedUnit,false)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call UnitAddAbility(bj_lastCreatedUnit,'Aloc')
call RemoveLocation(fr)
endfunction
function Ga takes nothing returns nothing
set DG=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DG,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(DG,Condition(function qw))
call TriggerAddAction(DG,function qW)
endfunction
function qx takes nothing returns boolean
if((GetUnitTypeId(GetSummonedUnit())=='u003'))then
return true
endif
if((GetUnitTypeId(GetSummonedUnit())=='u005'))then
return true
endif
if((GetUnitTypeId(GetSummonedUnit())=='u009'))then
return true
endif
return false
endfunction
function qX takes nothing returns boolean
if(not qx())then
return false
endif
return true
endfunction
function qy takes nothing returns nothing
call SetUnitAbilityLevelSwapped('A0E0',GetSummonedUnit(),GetUnitAbilityLevelSwapped('A07K',GetSummoningUnit()))
endfunction
function GA takes nothing returns nothing
set Dh=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Dh,EVENT_PLAYER_UNIT_SUMMON)
call TriggerAddCondition(Dh,Condition(function qX))
call TriggerAddAction(Dh,function qy)
endfunction
function qY takes nothing returns boolean
if(not (GetSpellAbilityId()=='A08X'))then
return false
endif
return true
endfunction
function qz takes nothing returns nothing
local location fr=GetUnitLoc(GetSpellAbilityUnit())
call CreateNUnitsAtLocFacingLocBJ(1,'e00E',GetOwningPlayer(GetSpellAbilityUnit()),fr,fr)
call RemoveLocation(fr)
call UnitAddAbility(bj_lastCreatedUnit,'A09C')
call SetUnitAbilityLevelSwapped('A09C',bj_lastCreatedUnit,GetUnitAbilityLevelSwapped('A08X',GetSpellAbilityUnit()))
call IssueTargetOrderById(bj_lastCreatedUnit,852101,GetSpellAbilityUnit())
endfunction
function Gb takes nothing returns nothing
set DH=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DH,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(DH,Condition(function qY))
call TriggerAddAction(DH,function qz)
endfunction
function qZ takes nothing returns boolean
if(not (GetUnitTypeId(GetEnteringUnit())=='ndr1'))then
return false
endif
return true
endfunction
function q0 takes nothing returns boolean
return(GetUnitAbilityLevelSwapped('A0C4',GetFilterUnit())!=0)
endfunction
function q1 takes nothing returns nothing
call SetWidgetLife(GetEnumUnit(),((10.*I2R(GetUnitAbilityLevelSwapped('A0C4',GetEnumUnit())))+GetUnitStateSwap(UNIT_STATE_LIFE,GetEnumUnit())))
endfunction
function q2 takes nothing returns nothing
local group kc=GetUnitsOfPlayerMatching(GetOwningPlayer(GetEnteringUnit()),Condition(function q0))
call ForGroupBJ(kc,function q1)
call DestroyGroup(kc)
endfunction
function GB takes nothing returns nothing
set Di=CreateTrigger()
call TriggerRegisterEnterRectSimple(Di,bj_mapInitialPlayableArea)
call TriggerAddCondition(Di,Condition(function qZ))
call TriggerAddAction(Di,function q2)
endfunction
function q3 takes nothing returns boolean
return GetLearnedSkill()=='A0MD' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function q4 takes nothing returns nothing
if GetUnitAbilityLevel(GetEnumUnit(),'B064')>0 and GetEventDamage()>10 and IsUnitEnemy(GetEnumUnit(),GetOwningPlayer(GetTriggerUnit()))then
call UnitDamageTargetBJ(GetTriggerUnit(),GetEnumUnit(),.07*(GetUnitAbilityLevel(GetTriggerUnit(),'A0MD'))*GetEventDamage(),ATTACK_TYPE_HERO,DAMAGE_TYPE_MAGIC)
endif
endfunction
function q5 takes nothing returns nothing
local group fB
local unit EN=GetTriggerUnit()
local location fr=GetUnitLoc(EN)
local real jY=.07*(GetUnitAbilityLevel(EN,'A0MD'))*GetEventDamage()
if(GetEventDamage()<1400)then
call SetWidgetLife(EN,GetUnitStateSwap(UNIT_STATE_LIFE,EN)+jY)
set fB=CreateGroup()
call GroupEnumUnitsInRange(fB,GetUnitX(EN),GetUnitY(EN),400,null)
call ForGroup(fB,function q4)
call DestroyGroup(fB)
endif
endfunction
function q6 takes nothing returns nothing
local trigger t
if GetUnitAbilityLevel(GetTriggerUnit(),'A0MD')==1 then
set t=CreateTrigger()
call TriggerRegisterUnitEvent(t,GetTriggerUnit(),EVENT_UNIT_DAMAGED)
call TriggerAddAction(t,function q5)
endif
endfunction
function Gc takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function q3))
call TriggerAddAction(t,function q6)
endfunction
function q7 takes nothing returns boolean
if(not (GetSpellAbilityId()=='A0CA'))then
return false
endif
return true
endfunction
function q8 takes nothing returns boolean
return(UnitHasBuffBJ(GetTriggerUnit(),'BHfs')==false)
endfunction
function q9 takes nothing returns nothing
call UnitAddAbility(GetTriggerUnit(),'A0C9')
call SetUnitAbilityLevelSwapped('A0C9',GetTriggerUnit(),GetUnitAbilityLevelSwapped('A0CA',GetTriggerUnit()))
call PolledWait(.1)
loop
exitwhen(q8())
call PolledWait(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL,.1))
endloop
call UnitRemoveAbility(GetTriggerUnit(),'A0C9')
endfunction
function GC takes nothing returns nothing
set DI=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DI,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(DI,Condition(function q7))
call TriggerAddAction(DI,function q9)
endfunction
function Qa takes nothing returns boolean
return GetSpellAbilityId()=='A0CT'
endfunction
function QA takes nothing returns nothing
local string Go=EQ(GetTriggerUnit())
local location kc=GetUnitLoc(GetTriggerUnit())
local real Qb=E2(Go,"TLLife1")
call PolledWait(.01)
call SetUnitPositionLoc(GetTriggerUnit(),Ez(Go,"TLPoint1"))
if Qb>0 then
call SetWidgetLife(GetTriggerUnit(),Qb)
call SetUnitManaBJ(GetTriggerUnit(),E2(Go,"TLMana1"))
call AddSpecialEffectLocBJ(kc,"Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl")
call UnitRemoveBuffsBJ(1,GetTriggerUnit())
endif
call RemoveLocation(kc)
endfunction
function Gd takes nothing returns nothing
set Dj=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Dj,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Dj,Condition(function Qa))
call TriggerAddAction(Dj,function QA)
endfunction
function QB takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local unit EN=Ew(EQ(t),"UnitVar")
local string Go=EQ(EN)
local integer EA=1
local integer Eb=10
call RemoveLocation(Ez(Go,"TLPoint0"))
loop
exitwhen EA>Eb
call Es(Go,"TLPoint"+I2S(EA-1),Ez(Go,"TLPoint"+I2S(EA)))
call Ev(Go,"TLLife"+I2S(EA-1),E2(Go,"TLLife"+I2S(EA)))
call Ev(Go,"TLMana"+I2S(EA-1),E2(Go,"TLMana"+I2S(EA)))
set EA=EA+1
endloop
call Es(Go,"TLPoint10",GetUnitLoc(EN))
call Ev(Go,"TLLife10",GetUnitState(EN,UNIT_STATE_LIFE))
call Ev(Go,"TLMana10",GetUnitState(EN,UNIT_STATE_MANA))
endfunction
function Qc takes nothing returns boolean
return GetLearnedSkill()=='A0CT' and IsUnitIllusion(GetTriggerUnit())==false
endfunction
function QC takes nothing returns nothing
local unit EN=GetTriggerUnit()
local integer jy=GetUnitAbilityLevel(EN,'A0CT')
local trigger t
if jy==1 then
set t=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(t,.5)
call TriggerAddAction(t,function QB)
call Es(EQ(t),"UnitVar",EN)
endif
endfunction
function GD takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(t,Condition(function Qc))
call TriggerAddAction(t,function QC)
endfunction
function Qd takes nothing returns boolean
if(GetSpellAbilityId()=='A0NM')then
return true
endif
return false
endfunction
function QD takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(GetUnitAbilityLevelSwapped('A04R',GetFilterUnit())==1)then
return false
endif
if(IsUnitAliveBJ(GetFilterUnit())==false)then
return false
endif
if(GetUnitTypeId(GetFilterUnit())=='o003')then
return false
endif
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==false)then
return false
endif
if(IsUnitVisible(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==false)then
return false
endif
return true
endfunction
function Qe takes nothing returns nothing
local integer jy=GetUnitAbilityLevelSwapped('A0NM',GetTriggerUnit())
local unit h3=GetSpellTargetUnit()
local unit h2
local unit QE
local unit Qf=GetTriggerUnit()
local integer EA
local integer Eb
local integer Pg=0
local group fB
local location kT
loop
exitwhen Pg>(jy*2)
set Pg=Pg+1
set h2=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(Qf),GetUnitY(Qf),bj_UNIT_FACING)
call UnitAddAbility(h2,'A0NL')
call IssueTargetOrderById(h2,852095,h3)
call PolledWait(((GetUnitX(h3)-GetUnitX(h2))*(GetUnitX(h3)-GetUnitX(h2))+(GetUnitY(h3)-GetUnitY(h2))*(GetUnitY(h3)-GetUnitY(h2)))/250000)
if(Pg<(jy*2+1))then
set kT=GetUnitLoc(h3)
set fB=GetUnitsInRangeOfLocMatching(600.,kT,Condition(function QD))
call RemoveLocation(kT)
loop
set QE=GroupPickRandomUnit(fB)
if(QE==null)then
set Pg='d'
call DestroyGroup(fB)
exitwhen 1==1
elseif(QE!=h3)then
set Qf=h3
set h3=QE
call DestroyGroup(fB)
exitwhen 1==1
endif
call GroupRemoveUnit(fB,QE)
endloop
endif
endloop
endfunction
function Gi takes nothing returns nothing
set DJ=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DJ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(DJ,Condition(function Qd))
call TriggerAddAction(DJ,function Qe)
endfunction
function QF takes unit EN,real Qg returns nothing
call SetUnitState(EN,UNIT_STATE_LIFE,RMaxBJ(0,GetUnitState(EN,UNIT_STATE_LIFE)+Qg))
endfunction
function QG takes nothing returns boolean
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE))then
return false
endif
if(IsUnitAlly(GetFilterUnit(),GetOwningPlayer(Ar))==false)then
return false
endif
return true
endfunction
function Qh takes nothing returns nothing
call QF(GetEnumUnit(),GetUnitAbilityLevel(Ar,'A0NE')*6)
endfunction
function QH takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local unit Qi=Ew(EQ(t),"WitchDoctor")
local group fB=CreateGroup()
if(GetUnitState(Qi,UNIT_STATE_MANA)<10)then
call DisableTrigger(t)
endif
set Ar=Qi
call GroupEnumUnitsInRange(fB,GetUnitX(Qi),GetUnitY(Qi),350,Condition(function QG))
call GroupAddUnit(fB,Qi)
call ForGroup(fB,function Qh)
call DestroyGroup(fB)
endfunction
function QI takes nothing returns boolean
if(GetIssuedOrderId()==852177 or GetIssuedOrderId()==852178)then
if(GetUnitTypeId(GetTriggerUnit())=='E01A')then
return true
endif
endif
return false
endfunction
function Qj takes nothing returns nothing
local unit EN=GetTriggerUnit()
local trigger t=EX(EQ(EN),"VoodooTrigger")
if(t==null)then
set t=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(t,1.)
call TriggerAddAction(t,function QH)
call Es(EQ(t),"WitchDoctor",EN)
call Es(EQ(EN),"VoodooTrigger",t)
endif
if(GetIssuedOrderId()==852177)then
call EnableTrigger(t)
else
call DisableTrigger(t)
endif
endfunction
function VR takes nothing returns nothing
set Dk=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(Dk,EVENT_PLAYER_UNIT_ISSUED_ORDER)
call TriggerAddCondition(Dk,Condition(function QI))
call TriggerAddAction(Dk,function Qj)
endfunction
function QJ takes nothing returns boolean
if(GetSpellAbilityId()=='A0NO')then
return true
endif
return false
endfunction
function Qk takes nothing returns boolean
if(IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(GetTriggerUnit()))==false)then
return false
endif
if(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false)then
return false
endif
return true
endfunction
function QK takes nothing returns nothing
local location fr=GetSpellTargetLoc()
local group fB=GetUnitsInRangeOfLocMatching(155,fr,Condition(function Qk))
local integer Ql=CountUnitsInGroup(fB)
local integer jy=GetUnitAbilityLevel(GetTriggerUnit(),'A0NO')
local real QL
local unit array Qm
local real array QM
local effect array Qn
local integer QN=1
local integer Qo=12
local integer EA=1
local integer Eb=Ql
local integer QO
loop
exitwhen EA>Eb
set Qm[EA]=FirstOfGroup(fB)
set QM[EA]=GetUnitState(Qm[EA],UNIT_STATE_LIFE)
call GroupRemoveUnit(fB,Qm[EA])
set Qn[EA]=AddSpecialEffectTarget("Abilities\\Spells\\Orc\\SpiritLink\\SpiritLinkTarget.mdl",Qm[EA],"overhead")
set EA=EA+1
endloop
loop
exitwhen QN>Qo
set EA=1
set Eb=Ql
loop
exitwhen EA>Eb
if(IsUnitAliveBJ(Qm[EA]))then
call UnitDamageTargetBJ(GetTriggerUnit(),Qm[EA],jy*5,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
if(ModuloInteger(QN,4)==0)then
set QL=RMaxBJ((QM[EA]-GetUnitState(Qm[EA],UNIT_STATE_LIFE)),0)
set QO=jy*10*R2I(QL/'d')
if(QO>0)then
call UnitDamageTargetBJ(GetTriggerUnit(),Qm[EA],jy*10*R2I(QL/'d'),ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC)
call Ej(I2S(R2I(jy*10*R2I(QL/'d')))+"!",Qm[EA],2.,218,165,32,255)
endif
endif
endif
set EA=EA+1
endloop
set QN=QN+1
call PolledWait(1)
endloop
set EA=1
set Eb=Ql
loop
exitwhen EA>Eb
call DestroyEffect(Qn[EA])
set EA=EA+1
endloop
call DestroyGroup(fB)
call RemoveLocation(fr)
endfunction
function GI takes nothing returns nothing
set DK=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(DK,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(DK,Condition(function QJ))
call TriggerAddAction(DK,function QK)
endfunction
function Qp takes nothing returns boolean
return GetSpellAbilityId()=='A0K9' or GetSpellAbilityId()=='A09F'
endfunction
function QP takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit h3=GetSpellTargetUnit()
local real jY=30*GetUnitAbilityLevel(EN,GetSpellAbilityId())
call SetUnitX(EN,GetUnitX(h3))
call SetUnitY(EN,GetUnitY(h3))
if IsUnitEnemy(h3,GetOwningPlayer(EN))then
call UnitDamageTargetBJ(EN,h3,jY,ATTACK_TYPE_MELEE,DAMAGE_TYPE_NORMAL)
call IssueTargetOrderById(EN,851983,h3)
endif
endfunction
function Qq takes nothing returns boolean
if(GetUnitTypeId(GetSpellTargetUnit())=='n00I')then
return false
endif
if(GetSpellAbilityId()=='A04Q')then
return true
endif
if(GetSpellAbilityId()=='A053')then
return true
endif
if(GetSpellAbilityId()=='A08L')then
return true
endif
return false
endfunction
function QQ takes nothing returns nothing
local unit EN=GetTriggerUnit()
local unit Qr=GetSpellTargetUnit()
if(GetSpellAbilityId()=='A04Q')then
call SetWidgetLife(EN,(GetUnitStateSwap(UNIT_STATE_LIFE,EN)+(GetUnitStateSwap(UNIT_STATE_LIFE,Qr)*(.15+(I2R(GetUnitAbilityLevelSwapped('A04Q',EN))*.4)))))
call KillUnit(Qr)
endif
if(GetSpellAbilityId()=='A053')then
call SetUnitManaBJ(EN,(GetUnitStateSwap(UNIT_STATE_MANA,EN)+(GetUnitStateSwap(UNIT_STATE_LIFE,Qr)*(I2R(GetUnitAbilityLevelSwapped('A053',EN))*.15))))
call KillUnit(Qr)
endif
if(GetSpellAbilityId()=='A08L')then
call SetWidgetLife(EN,(GetUnitStateSwap(UNIT_STATE_LIFE,EN)+(GetUnitStateSwap(UNIT_STATE_LIFE,Qr)*.85)))
call PolledWait(.01)
call SetUnitManaBJ(EN,(GetUnitStateSwap(UNIT_STATE_MANA,EN)+(GetUnitStateSwap(UNIT_STATE_LIFE,Qr)*.15)))
call KillUnit(Qr)
endif
endfunction
function HeroLevelUp takes nothing returns nothing
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,"Test")
call SetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())], GetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())])+3, true)
endfunction
function MoneyMaker takes nothing returns nothing
call SetPlayerStateBJ(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD, (GetPlayerState(GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD)+10000)) 
endfunction
// ===========================
function H2I takes handle h returns integer
    return h
    return 0
endfunction

// ===========================
function LocalVars takes nothing returns gamecache
    // Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
    return InitGameCache("jasslocalvars.w3v")
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
function ArrowKeyComboEventActions takes nothing returns nothing
    local eventid triggeringId = GetTriggerEventId()
    local trigger thisTrigger = GetTriggeringTrigger()

    local trigger comboTrigger = Handle2Trigger(GetHandleHandle(thisTrigger, "ComboTrigger"))
    local string Combo = GetHandleString(thisTrigger, "Combo")
    local integer comboLength = StringLength(Combo)

    local timer timeoutTimer = Handle2Timer(GetHandleHandle(thisTrigger, "timeoutTimer"))
    local real timeout = GetHandleReal(thisTrigger, "timeout")

    local integer keyIndex = GetHandleInteger(thisTrigger, "keyIndex")
    local string lastKey = null

    if(keyIndex == 0) then
        set keyIndex = 1
    endif

    //Reset if timeout reached
    if(timeoutTimer != null and TimerGetRemaining(timeoutTimer) == 0) then
        set keyIndex = 1
    endif

    if(timeoutTimer == null and comboLength > 0) then
        set timeoutTimer = CreateTimer()
        call SetHandleHandle(thisTrigger, "timeoutTimer", timeoutTimer)
    endif

    if(triggeringId == EVENT_PLAYER_ARROW_RIGHT_DOWN) then
        set lastKey = "R"
    elseif(triggeringId == EVENT_PLAYER_ARROW_LEFT_DOWN) then
        set lastKey = "L"
    elseif(triggeringId == EVENT_PLAYER_ARROW_UP_DOWN) then
        set lastKey = "U"
    elseif(triggeringId == EVENT_PLAYER_ARROW_DOWN_DOWN) then
        set lastKey = "D"
    elseif(triggeringId == EVENT_PLAYER_END_CINEMATIC) then
        set lastKey = "E"
    endif

    if(SubStringBJ(Combo, keyIndex, keyIndex) == lastKey) then
        if(keyIndex == comboLength) then
            set keyIndex = 1
            call SetHandleHandle(thisTrigger, "timeoutTimer", null)
            call DestroyTimer(timeoutTimer)
            call ConditionalTriggerExecute(comboTrigger)
        else
            set keyIndex = keyIndex + 1
            call TimerStart(timeoutTimer, timeout, false, null)
        endif
    else //Oops, they screwed up order
        set keyIndex = 1
        call SetHandleHandle(thisTrigger, "timeoutTimer", null)
        call DestroyTimer(timeoutTimer)
    endif

    call SetHandleInteger(thisTrigger, "keyIndex", keyIndex)
endfunction

function TriggerRegisterArrowKeyComboEvent takes trigger whichTrigger, player whichPlayer, string Combo, real timeout returns nothing
    local trigger ArrowKeyTrigger = null

    if(Combo == null or whichPlayer == null or whichTrigger == null) then
        return
    endif

    set ArrowKeyTrigger = CreateTrigger()
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_RIGHT_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_LEFT_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_UP_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_DOWN_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_END_CINEMATIC)
    call SetHandleHandle(ArrowKeyTrigger, "ComboTrigger", whichTrigger)
    call SetHandleString(ArrowKeyTrigger, "Combo", Combo)
    call SetHandleReal(ArrowKeyTrigger, "timeout", timeout)
    call TriggerAddAction(ArrowKeyTrigger, function ArrowKeyComboEventActions)
endfunction
function InitCustomTeams takes nothing returns nothing
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(7),1)
call SetPlayerTeam(Player(8),1)
call SetPlayerTeam(Player(9),1)
call SetPlayerTeam(Player(10),1)
call SetPlayerTeam(Player(11),1)
endfunction
function main takes nothing returns nothing
local weathereffect we
local player p
local unit u
local integer unitID
local trigger t
local real life
local integer i
call SetCameraBounds(-7424.+GetCameraMargin(CAMERA_MARGIN_LEFT),-7680.+GetCameraMargin(CAMERA_MARGIN_BOTTOM),7424.-GetCameraMargin(CAMERA_MARGIN_RIGHT),7168.-GetCameraMargin(CAMERA_MARGIN_TOP),-7424.+GetCameraMargin(CAMERA_MARGIN_LEFT),7168.-GetCameraMargin(CAMERA_MARGIN_TOP),7424.-GetCameraMargin(CAMERA_MARGIN_RIGHT),-7680.+GetCameraMargin(CAMERA_MARGIN_BOTTOM))
call SetDayNightModels("Environment\\DNC\\DNCFelwood\\DNCFelwoodTerrain\\DNCFelwoodTerrain.mdl","Environment\\DNC\\DNCFelwood\\DNCFelwoodUnit\\DNCFelwoodUnit.mdl")
call SetWaterBaseColor(0,0,255,255)
call NewSoundEnvironment("Default")
call SetAmbientDaySound("FelwoodDay")
call SetAmbientNightSound("FelwoodNight")
call SetMapMusic("Music",true,0)
set by=CreateSound("war3mapImported\\Dominating.mp3",false,false,false,10,10,"")
call SetSoundDuration(by,1802)
call SetSoundChannel(by,0)
call SetSoundVolume(by,127)
call SetSoundPitch(by,1.)
set bY=CreateSound("war3mapImported\\Double_Kill.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(bY,2012)
call SetSoundChannel(bY,0)
call SetSoundVolume(bY,127)
call SetSoundPitch(bY,1.)
set bz=CreateSound("war3mapImported\\firstblood.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(bz,1567)
call SetSoundChannel(bz,0)
call SetSoundVolume(bz,127)
call SetSoundPitch(bz,1.)
set bZ=CreateSound("war3mapImported\\GodLike.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(bZ,1828)
call SetSoundChannel(bZ,0)
call SetSoundVolume(bZ,127)
call SetSoundPitch(bZ,1.)
set b0=CreateSound("war3mapImported\\HolyShit.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b0,2325)
call SetSoundChannel(b0,0)
call SetSoundVolume(b0,127)
call SetSoundPitch(b0,1.)
set b1=CreateSound("war3mapImported\\Killing_Spree.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b1,2377)
call SetSoundChannel(b1,0)
call SetSoundVolume(b1,127)
call SetSoundPitch(b1,1.)
set b2=CreateSound("war3mapImported\\MegaKill.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b2,2612)
call SetSoundChannel(b2,0)
call SetSoundVolume(b2,127)
call SetSoundPitch(b2,1.)
set b3=CreateSound("war3mapImported\\Ownage.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b3,2586)
call SetSoundChannel(b3,0)
call SetSoundVolume(b3,127)
call SetSoundPitch(b3,1.)
set b4=CreateSound("war3mapImported\\triple_kill.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b4,1907)
call SetSoundChannel(b4,0)
call SetSoundVolume(b4,127)
call SetSoundPitch(b4,1.)
set b5=CreateSound("war3mapImported\\Unstoppable.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b5,2038)
call SetSoundChannel(b5,0)
call SetSoundVolume(b5,127)
call SetSoundPitch(b5,1.)
set b6=CreateSound("war3mapImported\\WhickedSick.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b6,2612)
call SetSoundChannel(b6,0)
call SetSoundVolume(b6,127)
call SetSoundPitch(b6,1.)
set b7=CreateSound("war3mapImported\\MonsterKill.mp3",false,false,false,10,10,"DefaultEAXON")
call SetSoundDuration(b7,3344)
call SetSoundChannel(b7,0)
call SetSoundVolume(b7,127)
call SetSoundPitch(b7,1.)
set b8=CreateSound("Abilities\\Spells\\Undead\\Sleep\\SleepBirth1.wav",false,false,false,10,10,"DefaultEAXON")
call SetSoundParamsFromLabel(b8,"Sleep")
call SetSoundDuration(b8,3203)
call SetSoundChannel(b8,0)
set AZ=Rect(5760.,3456.,6080.,3776.)
set A0=Rect(3552.,2816.,3872.,3136.)
set A1=Rect(3328.,5664.,3680.,6048.)
set A2=Rect(5824.,5056.,6272.,5344.)
set A3=Rect(-3840.,-6272.,-3488.,-5856.)
set A4=Rect(-6048.,-4192.,-5728.,-3840.)
set A5=Rect(-4960.,-4544.,-4672.,-4224.)
set A6=Rect(5376.,3520.,5696.,3840.)
set A7=Rect(3680.,3392.,4000.,3712.)
set A8=Rect(3392.,5216.,3776.,5568.)
set A9=Rect(-6624.,-5760.,-6240.,-5504.)
set ba=Rect(-3584.,-6944.,-3200.,-6528.)
set bA=Rect(-6688.,-4064.,-6304.,-3648.)
set bb=Rect(-4288.,-5056.,-3968.,-4672.)
set bB=Rect(2912.,-2944.,3104.,-2720.)
set bc=Rect(5472.,5888.,6624.,7008.)
set bC=Rect(-6848.,-7456.,-5696.,-6272.)
set bd=Rect(-2464.,1536.,-2240.,1760.)
set bD=Rect(4256.,-2688.,4512.,-2400.)
set be=Rect(-3328.,-416.,-3104.,-96.)
set bE=Rect(1440.,-4096.,1728.,-3872.)
set bf=Rect(-5152.,3296.,-4960.,3488.)
set bF=Rect(-608.,3072.,-384.,3328.)
set bg=Rect(2848.,-5376.,3072.,-5120.)
set bG=Rect(-1728.,2208.,-1376.,2432.)
set bh=Rect(3008.,-3776.,3136.,-3552.)
set bH=Rect(480.,864.,672.,1088.)
set bi=Rect(-416.,-3584.,-160.,-3328.)
set bI=Rect(-6368.,-6944.,-6176.,-6752.)
set bj=Rect(5920.,6272.,6112.,6464.)
set bJ=Rect(-4928.,-7040.,-4672.,-6784.)
set bk=Rect(4896.,4480.,5152.,4736.)
set bK=Rect(-5152.,-7264.,-4448.,-6560.)
set bl=Rect(4672.,4256.,5376.,4960.)
set bL=Rect(-4608.,-6720.,-4448.,-6560.)
set bm=Rect(4672.,4256.,4832.,4416.)
set bM=Rect(-5056.,-7168.,-4928.,-7040.)
set bn=Rect(-5056.,-6784.,-4928.,-6656.)
set bN=Rect(-4672.,-7168.,-4544.,-7040.)
set bo=Rect(4800.,4672.,4928.,4800.)
set bO=Rect(5120.,4672.,5248.,4800.)
set bp=Rect(5120.,4384.,5248.,4512.)
set bP=Rect(2240.,-800.,2688.,-320.)
set bq=Rect(3264.,-2784.,4736.,-1216.)
set bQ=Rect(-3552.,-768.,-2208.,320.)
set br=Rect(1056.,-5216.,2400.,-3744.)
set bR=Rect(-5696.,3072.,-4224.,4576.)
set bs=Rect(-1248.,2656.,352.,4800.)
set bS=Rect(2400.,-6080.,3776.,-4928.)
set bt=Rect(-2432.,2016.,-864.,3456.)
set bT=Rect(384.,800.,1248.,1952.)
set bu=Rect(2592.,-4800.,3744.,-3328.)
set bU=Rect(-960.,-3712.,416.,-2304.)
set bv=Rect(-6912.,-6144.,-5888.,-5184.)
set bV=Rect(5504.,4576.,6624.,5728.)
call CameraSetupSetField(bw,CAMERA_FIELD_ZOFFSET,.0,.0)
call CameraSetupSetField(bw,CAMERA_FIELD_ROTATION,90.,.0)
call CameraSetupSetField(bw,CAMERA_FIELD_ANGLE_OF_ATTACK,335.,.0)
call CameraSetupSetField(bw,CAMERA_FIELD_TARGET_DISTANCE,1200.,.0)
call CameraSetupSetField(bw,CAMERA_FIELD_ROLL,.0,.0)
call CameraSetupSetField(bw,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
call CameraSetupSetField(bw,CAMERA_FIELD_FARZ,5000.,.0)
call CameraSetupSetDestPosition(bw,-1583.,-1320.4,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_ZOFFSET,.0,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_ROTATION,121.,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_ANGLE_OF_ATTACK,335.,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_TARGET_DISTANCE,800.,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_ROLL,.0,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
call CameraSetupSetField(bW,CAMERA_FIELD_FARZ,5000.,.0)
call CameraSetupSetDestPosition(bW,-404.2,-643.,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_ZOFFSET,.0,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_ROTATION,90.,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_ANGLE_OF_ATTACK,304.,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_TARGET_DISTANCE,1024.5,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_ROLL,.0,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
call CameraSetupSetField(bx,CAMERA_FIELD_FARZ,5000.,.0)
call CameraSetupSetDestPosition(bx,-6220.8,-6784.,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_ZOFFSET,.0,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_ROTATION,90.,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_ANGLE_OF_ATTACK,304.,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_TARGET_DISTANCE,1024.5,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_ROLL,.0,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_FIELD_OF_VIEW,70.,.0)
call CameraSetupSetField(bX,CAMERA_FIELD_FARZ,5000.,.0)
call CameraSetupSetDestPosition(bX,5570.6,6444.4,.0)
set p=Player(15)
set DL=CreateUnit(p,'ntav',-6464.,-7104.,270.)
call SetUnitColor(DL,ConvertPlayerColor(0))
set Dq=CreateUnit(p,'n008',-6464.,-6592.,270.)
call SetUnitColor(Dq,ConvertPlayerColor(0))
set DR=CreateUnit(p,'n01D',-6080.,-6592.,270.)
call SetUnitColor(DR,ConvertPlayerColor(0))
set DU=CreateUnit(p,'n007',5888.,6720.,270.)
call SetUnitColor(DU,ConvertPlayerColor(0))
set Dv=CreateUnit(p,'n005',5888.,6208.,270.)
call SetUnitColor(Dv,ConvertPlayerColor(0))
set DV=CreateUnit(p,'n01B',6272.,6208.,270.)
call SetUnitColor(DV,ConvertPlayerColor(0))
set ez=CreateUnit(p,'n01N',-6080.,-7104.,270.)
call SetUnitColor(ez,ConvertPlayerColor(0))
set u=CreateUnit(p,'uC74',3008.,.0,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'uC74',-4608.,1152.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set Dn=CreateUnit(p,'n01P',6272.,6720.,270.)
call SetUnitColor(Dn,ConvertPlayerColor(0))
set p=Player(0)
set u=CreateUnit(p,'hC95',-6400.,-5952.,270.)
call SetUnitColor(u,ConvertPlayerColor(0))
set u=CreateUnit(p,'n00X',-6592.,-5312.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'nfoh',-6720.,-5920.,270.)
set u=CreateUnit(p,'nC38',-6720.,-5696.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'n00V',-6208.,-5312.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'n00W',-6336.,-5248.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set Dy=CreateUnit(p,'etol',-4800.,-6912.,270.)
set DN=CreateUnit(p,'e00S',-6240.,-3808.,270.)
set DZ=CreateUnit(p,'e00S',-4384.,-4448.,270.)
set ek=CreateUnit(p,'eaom',-3776.,-6720.,270.)
set D9=CreateUnit(p,'eaoe',-3776.,-6272.,270.)
set ea=CreateUnit(p,'eaoe',-4800.,-4608.,270.)
set Dw=CreateUnit(p,'eaom',-4288.,-4992.,270.)
set eb=CreateUnit(p,'eaom',-6400.,-4224.,270.)
set eB=CreateUnit(p,'eaoe',-5952.,-4160.,270.)
set eC=CreateUnit(p,'emow',-5856.,-4832.,270.)
set ed=CreateUnit(p,'emow',-5280.,-4192.,270.)
set eD=CreateUnit(p,'emow',-5280.,-5344.,270.)
set ee=CreateUnit(p,'emow',-4896.,-5728.,270.)
set eE=CreateUnit(p,'emow',-4512.,-6432.,270.)
set ef=CreateUnit(p,'emow',-3744.,-5536.,270.)
set eF=CreateUnit(p,'emow',-3488.,-5856.,270.)
set eg=CreateUnit(p,'emow',-4256.,-6944.,270.)
set eG=CreateUnit(p,'emow',-3360.,-7008.,270.)
set eh=CreateUnit(p,'emow',-5664.,-3872.,270.)
set eH=CreateUnit(p,'eaow',-5440.,-4800.,270.)
set ei=CreateUnit(p,'edob',-3840.,-5184.,270.)
set eI=CreateUnit(p,'edos',-6080.,-5952.,270.)
set DY=CreateUnit(p,'e019',-4896.,-6560.,270.)
set Dz=CreateUnit(p,'e019',-4512.,-6816.,270.)
set D6=CreateUnit(p,'e00R',-6112.,1504.,270.)
set Do=CreateUnit(p,'e00R',4960.,-6752.,270.)
set D2=CreateUnit(p,'e011',-6112.,-1312.,270.)
set D0=CreateUnit(p,'e011',-544.,-6688.,270.)
set D5=CreateUnit(p,'e011',-3488.,-3296.,270.)
set D1=CreateUnit(p,'e00S',-3424.,-6560.,270.)
set DX=CreateUnit(p,'n002',-6464.,-5248.,270.)
call SetUnitColor(DX,ConvertPlayerColor(12))
set D7=CreateUnit(p,'e00R',-1504.,-1824.,270.)
set u=CreateUnit(p,'n01K',-6720.,-5504.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set p=Player(1)
set DQ=CreateUnit(p,'ncop',-6528.,-6848.,270.)
set p=Player(2)
set DM=CreateUnit(p,'ncop',-6400.,-6848.,270.)
set p=Player(3)
set Dt=CreateUnit(p,'ncop',-6272.,-6848.,270.)
set p=Player(4)
set Dm=CreateUnit(p,'ncop',-6144.,-6848.,270.)
set p=Player(5)
set Dr=CreateUnit(p,'ncop',-6016.,-6848.,270.)
set p=Player(6)
set u=CreateUnit(p,'nC35',6464.,5120.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'ndfl',6272.,5504.,270.)
set u=CreateUnit(p,'nC38',6080.,5568.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'n00V',5696.,5120.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'n00W',5568.,5248.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'n00X',5696.,5504.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set u=CreateUnit(p,'n01K',5952.,5568.,270.)
call SetUnitColor(u,ConvertPlayerColor(12))
set ej=CreateUnit(p,'u00N',3616.,3296.,270.)
set eJ=CreateUnit(p,'u00N',6048.,2784.,270.)
set ew=CreateUnit(p,'u00N',3168.,5920.,270.)
set D8=CreateUnit(p,'n002',5568.,5376.,270.)
call SetUnitColor(D8,ConvertPlayerColor(12))
set eV=CreateUnit(p,'u00M',-4704.,5920.,270.)
set D4=CreateUnit(p,'u00M',1056.,-160.,270.)
set eA=CreateUnit(p,'u00M',6048.,-2080.,270.)
set eK=CreateUnit(p,'usep',6208.,3264.,270.)
set el=CreateUnit(p,'usep',4096.,3392.,270.)
set eL=CreateUnit(p,'usep',3776.,5888.,270.)
set em=CreateUnit(p,'utod',3520.,5376.,270.)
set eM=CreateUnit(p,'utod',3776.,3840.,270.)
set en=CreateUnit(p,'utod',5696.,3264.,270.)
set eN=CreateUnit(p,'unpl',4992.,4544.,270.)
set eo=CreateUnit(p,'u00T',5088.,4192.,270.)
set ep=CreateUnit(p,'uzig',3168.,4000.,270.)
set eP=CreateUnit(p,'uzig',3040.,4512.,270.)
set eq=CreateUnit(p,'uzig',4192.,5536.,270.)
set eQ=CreateUnit(p,'uzig',4128.,4512.,270.)
set er=CreateUnit(p,'uzig',4640.,3680.,270.)
set eR=CreateUnit(p,'uzig',4832.,3104.,270.)
set es=CreateUnit(p,'uzig',5408.,2592.,270.)
set eS=CreateUnit(p,'uzig',5408.,3296.,270.)
set et=CreateUnit(p,'uzig',6112.,4000.,270.)
set eT=CreateUnit(p,'uzig',3040.,5088.,270.)
set eu=CreateUnit(p,'usap',3520.,4608.,270.)
set eU=CreateUnit(p,'ugrv',6464.,4736.,270.)
set ev=CreateUnit(p,'uslh',4096.,2624.,270.)
set eO=CreateUnit(p,'u00T',4640.,4576.,270.)
set DP=CreateUnit(p,'u00D',6112.,-96.,270.)
set Dp=CreateUnit(p,'u00D',2400.,1696.,270.)
set DO=CreateUnit(p,'u00D',32.,5856.,270.)
set Dx=CreateUnit(p,'uzig',6304.,3744.,270.)
set p=Player(7)
set Ds=CreateUnit(p,'ncop',5824.,6464.,270.)
set p=Player(8)
set DS=CreateUnit(p,'ncop',5952.,6464.,270.)
set p=Player(9)
set D3=CreateUnit(p,'ncop',6080.,6464.,270.)
set p=Player(10)
set DT=CreateUnit(p,'ncop',6208.,6464.,270.)
set p=Player(11)
set Du=CreateUnit(p,'ncop',6336.,6464.,270.)
set p=Player(15)
set eW=CreateUnit(p,'e00D',-6043.9,5314.7,212.15)
set ex=CreateUnit(p,'e00B',-713.7,-515.7,325.6)
set eX=CreateUnit(p,'e00A',5853.5,-6214.9,64.)
set ey=CreateUnit(p,'e008',-4690.8,-6680.8,57.52)
set eY=CreateUnit(p,'e001',4836.,4372.2,212.11)
call InitBlizzard()
set i=0
set i=0
loop
exitwhen(i>16)
set A[i]=0
set C[i]=0
set D[i]=0
set q[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>'d')
set B[i]=false
set ag[i]=false
set ax[i]=0
set aX[i]=0
set ay[i]=0
set aY[i]=0
set aZ[i]=0
set a1[i]=0
set AA[i]=false
set AO[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>4)
set E[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>2)
set G[i]=false
set Q[i]=0
set Ab[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>12)
set I[i]=""
set J[i]=CreateTimer()
set K[i]=0
set M[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>13)
set j[i]=false
set L[i]=CreateTimer()
set ad[i]=false
set aD[i]=false
set Af[i]=0
set AF[i]=0
set Aj[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>1)
set N[i]=0
set ab[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>17)
set a2[i]=null
set i=i+1
endloop
set i=0
loop
exitwhen(i>40)
set AB[i]=0
set Ac[i]=0
set AC[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>5)
set AP[i]=0
set i=i+1
endloop
set i=0
loop
exitwhen(i>10)
set Aq[i]=0
set i=i+1
endloop
call ExecuteFunc("fc")
call TriggerAddAction(b9,function fd)
call TriggerRegisterTimerEventSingle(Ba,.01)
call TriggerAddAction(Ba,function fi)
call TriggerRegisterTimerEventSingle(BA,1.)
call TriggerAddAction(BA,function fp)
call TriggerRegisterPlayerEventLeave(Bb,Al[1])
call TriggerRegisterPlayerEventLeave(Bb,Al[2])
call TriggerRegisterPlayerEventLeave(Bb,Al[3])
call TriggerRegisterPlayerEventLeave(Bb,Al[4])
call TriggerRegisterPlayerEventLeave(Bb,Al[5])
call TriggerRegisterPlayerEventLeave(Bb,AL[1])
call TriggerRegisterPlayerEventLeave(Bb,AL[2])
call TriggerRegisterPlayerEventLeave(Bb,AL[3])
call TriggerRegisterPlayerEventLeave(Bb,AL[4])
call TriggerRegisterPlayerEventLeave(Bb,AL[5])
call TriggerAddAction(Bb,function fP)
call TriggerRegisterEnterRectSimple(BB,bC)
call TriggerRegisterEnterRectSimple(BB,bc)
call TriggerRegisterAnyUnitEventBJ(BB,EVENT_PLAYER_HERO_REVIVE_FINISH)
call TriggerAddCondition(BB,Condition(function fq))
call TriggerAddAction(BB,function fQ)
call TriggerRegisterEnterRectSimple(Bc,bC)
call TriggerRegisterEnterRectSimple(Bc,bc)
call TriggerAddCondition(Bc,Condition(function Gl))
call TriggerAddAction(Bc,function GL)
call TriggerRegisterTimerEventPeriodic(BC,7.)
call TriggerAddAction(BC,function Gm)
call TriggerRegisterAnyUnitEventBJ(Bd,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Bd,Condition(function Gq))
call TriggerAddAction(Bd,function GQ)
call TriggerRegisterAnyUnitEventBJ(BD,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(BD,Condition(function Gu))
call TriggerAddAction(BD,function GU)
call TriggerRegisterAnyUnitEventBJ(Be,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(Be,Condition(function Gv))
call TriggerAddAction(Be,function GV)
call TriggerRegisterTimerExpireEvent(BE,J[1])
call TriggerAddAction(BE,function Gw)
call TriggerRegisterTimerExpireEvent(Bf,J[2])
call TriggerAddAction(Bf,function GW)
call TriggerRegisterTimerExpireEvent(BF,J[3])
call TriggerAddAction(BF,function Gx)
call TriggerRegisterTimerExpireEvent(Bg,J[4])
call TriggerAddAction(Bg,function GX)
call TriggerRegisterTimerExpireEvent(BG,J[5])
call TriggerAddAction(BG,function Gy)
call TriggerRegisterTimerExpireEvent(Bh,J[7])
call TriggerAddAction(Bh,function GY)
call TriggerRegisterTimerExpireEvent(BH,J[8])
call TriggerAddAction(BH,function Gz)
call TriggerRegisterTimerExpireEvent(Bi,J[9])
call TriggerAddAction(Bi,function GZ)
call TriggerRegisterTimerExpireEvent(BI,J[10])
call TriggerAddAction(BI,function G0)
call TriggerRegisterTimerExpireEvent(Bj,J[11])
call TriggerAddAction(Bj,function G1)
call TriggerRegisterTimerEventSingle(BJ,14.)
call TriggerAddAction(BJ,function G2)
call TriggerRegisterTimerEventSingle(Bk,65.)
call TriggerAddAction(Bk,function G3)
call TriggerRegisterTimerEventSingle(BK,90.)
call TriggerAddAction(BK,function G4)
call TriggerRegisterPlayerChatEvent(Bl,Al[1],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,Al[2],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,Al[3],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,Al[4],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,Al[5],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,AL[1],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,AL[2],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,AL[3],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,AL[4],"-swaphero",true)
call TriggerRegisterPlayerChatEvent(Bl,AL[5],"-swaphero",true)
call TriggerAddAction(Bl,function hj)
call TriggerAddCondition(Bl,Condition(function G5))
call DisableTrigger(BL)
call TriggerRegisterPlayerChatEvent(BL,Al[1],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,Al[1],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,Al[2],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,Al[2],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,Al[3],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,Al[3],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,Al[4],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,Al[4],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,Al[5],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,Al[5],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,AL[1],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,AL[1],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,AL[2],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,AL[2],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,AL[3],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,AL[3],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,AL[4],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,AL[4],"-csboardoff",true)
call TriggerRegisterPlayerChatEvent(BL,AL[5],"-csboardon",true)
call TriggerRegisterPlayerChatEvent(BL,AL[5],"-csboardoff",true)
call TriggerAddAction(BL,function hk)
call DisableTrigger(Bm)
call TriggerRegisterPlayerChatEvent(Bm,Al[1],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[1],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[2],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[2],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[3],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[3],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[4],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[4],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[5],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,Al[5],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[1],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[1],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[2],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[2],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[3],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[3],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[4],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[4],"-cs",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[5],"-creepstats",true)
call TriggerRegisterPlayerChatEvent(Bm,AL[5],"-cs",true)
call TriggerAddAction(Bm,function hK)
call TriggerRegisterAnyUnitEventBJ(BM,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(BM,function hl)
call TriggerRegisterPlayerChatEvent(Bn,Al[1],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,Al[2],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,Al[3],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,Al[4],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,Al[5],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,AL[1],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,AL[2],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,AL[3],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,AL[4],"-disablehelp",true)
call TriggerRegisterPlayerChatEvent(Bn,AL[5],"-disablehelp",true)
call TriggerAddAction(Bn,function hL)
call TriggerRegisterPlayerChatEvent(BN,Al[1],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,Al[2],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,Al[3],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,Al[4],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,Al[5],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,AL[1],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,AL[2],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,AL[3],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,AL[4],"-enablehelp",true)
call TriggerRegisterPlayerChatEvent(BN,AL[5],"-enablehelp",true)
call TriggerAddAction(BN,function hm)
call TriggerRegisterPlayerChatEvent(Bo,Al[1],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[2],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[3],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[4],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[5],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[1],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[2],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[3],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[4],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[5],"-movespeed",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[1],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[2],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[3],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[4],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,Al[5],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[1],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[2],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[3],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[4],"-ms",true)
call TriggerRegisterPlayerChatEvent(Bo,AL[5],"-ms",true)

call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[1],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[2],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[3],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[4],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[5],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[1],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[2],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[3],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[4],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[5],"UUD",true)

call TriggerAddAction(MoneyMakerTrigger,function MoneyMaker)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,Al[1],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,Al[2],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,Al[3],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,Al[4],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,Al[5],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,AL[1],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,AL[2],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,AL[3],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,AL[4],"/reighc",true)
call TriggerRegisterPlayerChatEvent(MoneyMakerTrigger,AL[5],"/reighc",true)

call TriggerAddAction(Bo,function hM)
call TriggerRegisterPlayerChatEvent(BO,Al[1],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,Al[2],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,Al[3],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,Al[4],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,Al[5],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,AL[1],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,AL[2],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,AL[3],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,AL[4],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,AL[5],"-matchup",true)
call TriggerRegisterPlayerChatEvent(BO,Al[1],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,Al[2],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,Al[3],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,Al[4],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,Al[5],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,AL[1],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,AL[2],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,AL[3],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,AL[4],"-ma",true)
call TriggerRegisterPlayerChatEvent(BO,AL[5],"-ma",true)
call TriggerAddAction(BO,function hn)
call TriggerRegisterPlayerChatEvent(Bp,Al[1],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,Al[2],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,Al[3],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,Al[4],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,Al[5],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,AL[1],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,AL[2],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,AL[3],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,AL[4],"-unstuck",true)
call TriggerRegisterPlayerChatEvent(Bp,AL[5],"-unstuck",true)
call TriggerAddAction(Bp,function hO)
call TriggerRegisterAnyUnitEventBJ(BP,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(BP,Condition(function hp))
call TriggerAddAction(BP,function hP)
call TriggerRegisterPlayerChatEvent(Bq,Al[1],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,Al[2],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,Al[3],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,Al[4],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,Al[5],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,AL[1],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,AL[2],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,AL[3],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,AL[4],"-recreate",true)
call TriggerRegisterPlayerChatEvent(Bq,AL[5],"-recreate",true)
call TriggerAddAction(Bq,function hr)
call TriggerRegisterAnyUnitEventBJ(BQ,EVENT_PLAYER_UNIT_SPELL_FINISH)
call TriggerAddCondition(BQ,Condition(function hR))
call TriggerAddAction(BQ,function hu)
call TriggerRegisterUnitEvent(Br,eN,EVENT_UNIT_DEATH)
call TriggerAddAction(Br,function hv)
call TriggerRegisterUnitEvent(BR,Dy,EVENT_UNIT_DEATH)
call TriggerAddAction(BR,function hV)
call TriggerRegisterTimerEventPeriodic(Bs,300.)
call TriggerAddAction(Bs,function hW)
call TriggerRegisterAnyUnitEventBJ(BS,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(BS,Condition(function hx))
call TriggerAddAction(BS,function hZ)
call TriggerRegisterAnyUnitEventBJ(Bt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Bt,Condition(function h0))
call TriggerAddAction(Bt,function h1)
call TriggerRegisterAnyUnitEventBJ(BT,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(BT,Condition(function h4))
call TriggerAddAction(BT,function h5)
call TriggerRegisterAnyUnitEventBJ(Bu,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(Bu,Condition(function h7))
call TriggerAddAction(Bu,function h8)
call TriggerRegisterAnyUnitEventBJ(BU,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(BU,Condition(function h9))
call TriggerAddAction(BU,function Ha)
call TriggerRegisterEnterRectSimple(Bv,bj_mapInitialPlayableArea)
call TriggerAddCondition(Bv,Condition(function Hb))
call TriggerAddAction(Bv,function HB)
call TriggerRegisterTimerEventSingle(BV,.01)
call TriggerAddAction(BV,function Hc)
call TriggerAddAction(Bw,function HD)
call TriggerRegisterAnyUnitEventBJ(BW,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(BW,Condition(function He))
call TriggerAddAction(BW,function HE)
call TriggerRegisterAnyUnitEventBJ(BX,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(BX,Condition(function Hf))
call TriggerAddAction(BX,function HF)
call TriggerRegisterTimerEventPeriodic(BY,1.)
call TriggerAddAction(BY,function Hg)
call TriggerRegisterTimerEventSingle(Bz,2.)
call TriggerAddAction(Bz,function HG)
call TriggerRegisterTimerEventSingle(BZ,100.)
call TriggerAddAction(BZ,function Hh)
call TriggerRegisterTimerEventSingle(B0,3599.)
call TriggerAddAction(B0,function HH)
call TriggerRegisterTimerEventSingle(B1,1199.)
call TriggerRegisterTimerEventSingle(B1,2398.)
call TriggerRegisterTimerEventSingle(B1,3597.)
call TriggerAddAction(B1,function Hi)
call TriggerRegisterEnterRectSimple(B2,bb)
call TriggerRegisterEnterRectSimple(B2,A5)
call TriggerAddCondition(B2,Condition(function HI))
call TriggerAddAction(B2,function Hj)
call TriggerRegisterEnterRectSimple(B3,A7)
call TriggerRegisterEnterRectSimple(B3,A0)
call TriggerAddCondition(B3,Condition(function HJ))
call TriggerAddAction(B3,function Hk)
call TriggerRegisterEnterRectSimple(B4,bA)
call TriggerRegisterEnterRectSimple(B4,A4)
call TriggerAddCondition(B4,Condition(function HK))
call TriggerAddAction(B4,function Hl)
call TriggerRegisterEnterRectSimple(B5,A1)
call TriggerRegisterEnterRectSimple(B5,A8)
call TriggerAddCondition(B5,Condition(function Hm))
call TriggerAddAction(B5,function HM)
call TriggerRegisterEnterRectSimple(B6,A6)
call TriggerRegisterEnterRectSimple(B6,AZ)
call TriggerAddCondition(B6,Condition(function Hn))
call TriggerAddAction(B6,function HN)
call TriggerRegisterEnterRectSimple(B7,A3)
call TriggerRegisterEnterRectSimple(B7,ba)
call TriggerAddCondition(B7,Condition(function Ho))
call TriggerAddAction(B7,function HO)
call TriggerRegisterTimerEventPeriodic(B8,30.)
call TriggerAddCondition(B8,Condition(function Hp))
call TriggerAddAction(B8,function Hr)
call TriggerRegisterUnitEvent(B9,eB,EVENT_UNIT_DEATH)
call TriggerAddAction(B9,function HR)
call TriggerRegisterUnitEvent(ca,ea,EVENT_UNIT_DEATH)
call TriggerAddAction(ca,function Hs)
call TriggerRegisterUnitEvent(cA,D9,EVENT_UNIT_DEATH)
call TriggerAddAction(cA,function Ht)
call TriggerRegisterUnitEvent(cb,eb,EVENT_UNIT_DEATH)
call TriggerAddAction(cb,function HT)
call TriggerRegisterUnitEvent(cB,Dw,EVENT_UNIT_DEATH)
call TriggerAddAction(cB,function Hu)
call TriggerRegisterUnitEvent(cc,ek,EVENT_UNIT_DEATH)
call TriggerAddAction(cc,function HU)
call TriggerRegisterUnitEvent(cC,em,EVENT_UNIT_DEATH)
call TriggerAddAction(cC,function Hv)
call TriggerRegisterUnitEvent(cd,eM,EVENT_UNIT_DEATH)
call TriggerAddAction(cd,function HV)
call TriggerRegisterUnitEvent(cD,en,EVENT_UNIT_DEATH)
call TriggerAddAction(cD,function Hw)
call TriggerRegisterUnitEvent(ce,eL,EVENT_UNIT_DEATH)
call TriggerAddAction(ce,function HW)
call TriggerRegisterUnitEvent(cE,el,EVENT_UNIT_DEATH)
call TriggerAddAction(cE,function Hx)
call TriggerRegisterUnitEvent(cf,eK,EVENT_UNIT_DEATH)
call TriggerAddAction(cf,function HX)
call TriggerRegisterAnyUnitEventBJ(cF,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition (cF,Condition(function Hy))
call TriggerAddAction (cF,function HY)
call TriggerRegisterAnyUnitEventBJ(cg,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition (cg,Condition(function Hz))
call TriggerAddAction (cg,function HZ)
call TriggerRegisterAnyUnitEventBJ(cG,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(cG,Condition(function H0))
call TriggerAddAction(cG,function H3)
call TriggerRegisterAnyUnitEventBJ(ch,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(ch,Condition(function H4))
call TriggerAddAction(ch,function H7)
call TriggerRegisterTimerEventPeriodic(cH,450.)
call TriggerAddAction(cH,function H8)
call TriggerRegisterTimerEventSingle(ci,75.)
call TriggerAddAction(ci,function H9)
call TriggerRegisterTimerEventSingle(cI,90.)
call TriggerAddAction(cI,function ia)
call DisableTrigger(cj)
call TriggerRegisterTimerEventPeriodic(cj,60.)
call TriggerAddAction(cj,function iA)
call DisableTrigger(cJ)
call TriggerRegisterTimerEventPeriodic(cJ,780.)
call TriggerAddAction(cJ,function iB)
call TriggerRegisterAnyUnitEventBJ(ck,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(ck,Condition(function ic))
call TriggerAddAction(ck,function iC)
call TriggerRegisterAnyUnitEventBJ(cK,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(cK,Condition(function iD))
call TriggerAddAction(cK,function ie)
call TriggerRegisterAnyUnitEventBJ(cl,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(cl,Condition(function iE))
call TriggerAddAction(cl,function iF)
call TriggerRegisterAnyUnitEventBJ(cL,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(cL,Condition(function ig))
call TriggerAddAction(cL,function iG)
call TriggerRegisterAnyUnitEventBJ(cm,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(cm,Condition(function ih))
call TriggerAddAction(cm,function iH)
call TriggerRegisterAnyUnitEventBJ(cM,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(cM,Condition(function ii))
call TriggerAddAction(cM,function iI)
call TriggerRegisterAnyUnitEventBJ(cn,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(cn,Condition(function ij))
call TriggerAddAction(cn,function ik)
call TriggerRegisterAnyUnitEventBJ(cN,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(cN,Condition(function iK))
call TriggerAddAction(cN,function il)
call TriggerRegisterTimerEventPeriodic(co,120.)
call TriggerAddAction(co,function im)
call TriggerRegisterAnyUnitEventBJ(cO,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(cO,function iM)
call TriggerRegisterAnyUnitEventBJ(cp,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(cp,function iP)
call TriggerRegisterAnyUnitEventBJ(cP,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(cP,function iq)
call TriggerRegisterAnyUnitEventBJ(cq,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddCondition(cq,Condition(function is))
call TriggerAddAction(cq,function iS)
call TriggerRegisterAnyUnitEventBJ(cQ,EVENT_PLAYER_UNIT_PICKUP_ITEM)
call TriggerAddAction(cQ,function iT)
call TriggerRegisterAnyUnitEventBJ(cr,EVENT_PLAYER_UNIT_USE_ITEM)
call TriggerAddCondition(cr,Condition(function iU))
call TriggerAddAction(cr,function iv)
call TriggerRegisterTimerEventPeriodic(cR,1.)
call TriggerAddAction(cR,function iW)
call ExecuteFunc("Ik")
set t=CreateTrigger()
call TriggerRegisterEnterRectSimple(t,GetWorldBounds())
call TriggerAddCondition(t,Condition(function IK))
call TriggerAddAction(t,function Il)
set t=CreateTrigger()
call TriggerRegisterUnitInRangeSimple(t,300.,eX)
call TriggerRegisterUnitInRangeSimple(t,300.,ex)
call TriggerRegisterUnitInRangeSimple(t,300.,eW)
call TriggerAddCondition(t,Condition(function IL))
call TriggerAddAction(t,function Im)
call TriggerRegisterPlayerChatEvent(cs,Al[1],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,Al[2],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,Al[3],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,Al[4],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,Al[5],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,AL[1],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,AL[2],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,AL[3],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,AL[4],"-repick",true)
call TriggerRegisterPlayerChatEvent(cs,AL[5],"-repick",true)
call TriggerAddCondition(cs,Condition(function IM))
call TriggerAddAction(cs,function IN)
call TriggerRegisterPlayerChatEvent(cS,Al[1],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,Al[2],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,Al[3],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,Al[4],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,Al[5],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,AL[1],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,AL[2],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,AL[3],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,AL[4],"-random",true)
call TriggerRegisterPlayerChatEvent(cS,AL[5],"-random",true)
call TriggerAddCondition(cS,Condition(function Ip))
call TriggerAddAction(cS,function IP)
call DisableTrigger(cv)
call TriggerRegisterTimerEventSingle(cv,59.)
call TriggerAddAction(cv,function I4)
call DisableTrigger(cW)
call TriggerAddAction(cW,function je)
call DisableTrigger(cx)
call TriggerAddAction(cx,function jf)
call DisableTrigger(cX)
call TriggerAddAction(cX,function jF)
call DisableTrigger(cy)
call TriggerAddAction(cy,function jg)
call DisableTrigger(cY)
call TriggerAddAction(cY,function jG)
call DisableTrigger(cz)
call TriggerAddAction(cz,function jh)
call DisableTrigger(cZ)
call TriggerAddAction(cZ,function jH)
call DisableTrigger(c0)
call TriggerAddAction(c0,function ji)
call DisableTrigger(c1)
call TriggerAddAction(c1,function jI)
call DisableTrigger(c2)
call TriggerAddAction(c2,function jj)
call DisableTrigger(c8)
call TriggerRegisterTimerEventPeriodic(c8,7.)
call TriggerAddAction(c8,function ju)
call TriggerRegisterTimerEventSingle(CA,300.)
call TriggerAddAction(CA,function jW)
call TriggerRegisterAnyUnitEventBJ(dm,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(dm,Condition(function NP))
call TriggerAddAction(dm,function Nq)
set t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function Qp))
call TriggerAddAction(t,function QP)
call TriggerRegisterAnyUnitEventBJ(Dl,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(Dl,Condition(function Qq))
call TriggerAddAction(Dl,function QQ)
call ConditionalTriggerExecute(b9)
endfunction
function config takes nothing returns nothing
call SetMapName("DotA Allstars v6.32b")
call SetMapDescription("Choose from 77 unique heroes in an epic battle to defend the Ancients.\n\nModes: |c001e90ff-ap, -ar, -lm, -mm, -tr, -dm, -mr, -sp, -aa, -ai, -as, -id, -sm, -np, -sc|r")
call SetPlayers(10)
call SetTeams(10)
call SetGamePlacement(MAP_PLACEMENT_TEAMS_TOGETHER)
call DefineStartLocation(0,-6272.,-6912.)
call DefineStartLocation(1,-6272.,-6912.)
call DefineStartLocation(2,-6272.,-6912.)
call DefineStartLocation(3,-6272.,-6912.)
call DefineStartLocation(4,-6272.,-6912.)
call DefineStartLocation(5,6080.,6400.)
call DefineStartLocation(6,6080.,6400.)
call DefineStartLocation(7,6080.,6400.)
call DefineStartLocation(8,6080.,6400.)
call DefineStartLocation(9,6080.,6400.)
call SetPlayerStartLocation(Player(1),0)
call ForcePlayerStartLocation(Player(1),0)
call SetPlayerColor(Player(1),ConvertPlayerColor(1))
call SetPlayerRacePreference(Player(1),RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(1),false)
call SetPlayerController(Player(1),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(2),1)
call ForcePlayerStartLocation(Player(2),1)
call SetPlayerColor(Player(2),ConvertPlayerColor(2))
call SetPlayerRacePreference(Player(2),RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(2),false)
call SetPlayerController(Player(2),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(3),2)
call ForcePlayerStartLocation(Player(3),2)
call SetPlayerColor(Player(3),ConvertPlayerColor(3))
call SetPlayerRacePreference(Player(3),RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(3),false)
call SetPlayerController(Player(3),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(4),3)
call ForcePlayerStartLocation(Player(4),3)
call SetPlayerColor(Player(4),ConvertPlayerColor(4))
call SetPlayerRacePreference(Player(4),RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(4),false)
call SetPlayerController(Player(4),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(5),4)
call ForcePlayerStartLocation(Player(5),4)
call SetPlayerColor(Player(5),ConvertPlayerColor(5))
call SetPlayerRacePreference(Player(5),RACE_PREF_NIGHTELF)
call SetPlayerRaceSelectable(Player(5),false)
call SetPlayerController(Player(5),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(7),5)
call ForcePlayerStartLocation(Player(7),5)
call SetPlayerColor(Player(7),ConvertPlayerColor(7))
call SetPlayerRacePreference(Player(7),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(7),false)
call SetPlayerController(Player(7),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(8),6)
call ForcePlayerStartLocation(Player(8),6)
call SetPlayerColor(Player(8),ConvertPlayerColor(8))
call SetPlayerRacePreference(Player(8),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(8),false)
call SetPlayerController(Player(8),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(9),7)
call ForcePlayerStartLocation(Player(9),7)
call SetPlayerColor(Player(9),ConvertPlayerColor(9))
call SetPlayerRacePreference(Player(9),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(9),false)
call SetPlayerController(Player(9),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(10),8)
call ForcePlayerStartLocation(Player(10),8)
call SetPlayerColor(Player(10),ConvertPlayerColor(10))
call SetPlayerRacePreference(Player(10),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(10),false)
call SetPlayerController(Player(10),MAP_CONTROL_USER)
call SetPlayerStartLocation(Player(11),9)
call ForcePlayerStartLocation(Player(11),9)
call SetPlayerColor(Player(11),ConvertPlayerColor(11))
call SetPlayerRacePreference(Player(11),RACE_PREF_UNDEAD)
call SetPlayerRaceSelectable(Player(11),false)
call SetPlayerController(Player(11),MAP_CONTROL_USER)
call InitCustomTeams()
call SetStartLocPrioCount(0,4)
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 SetStartLocPrioCount(1,4)
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 SetStartLocPrioCount(2,4)
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 SetStartLocPrioCount(3,4)
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 SetStartLocPrioCount(4,4)
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 SetStartLocPrioCount(5,4)
call SetStartLocPrio(5,0,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,1,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,2,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(5,3,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(6,4)
call SetStartLocPrio(6,0,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,1,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,2,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(6,3,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(7,4)
call SetStartLocPrio(7,0,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,1,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,2,8,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(7,3,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(8,4)
call SetStartLocPrio(8,0,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,1,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,2,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(8,3,9,MAP_LOC_PRIO_HIGH)
call SetStartLocPrioCount(9,4)
call SetStartLocPrio(9,0,5,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,1,6,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,2,7,MAP_LOC_PRIO_HIGH)
call SetStartLocPrio(9,3,8,MAP_LOC_PRIO_HIGH)
endfunction
05-12-2006, 05:31 PM#10
Thunder_Eye
I'm not an expert.

Anyway, instead of posting the whole map-script, post the trigger that is messed up.
05-12-2006, 05:41 PM#11
geocine
This is the script messed up. Kindly help me

Collapse JASS:
trigger HeroLevelUpTrigger=CreateTrigger()

function HeroLevelUp takes nothing returns nothing
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,"Test")
call SetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())], GetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())])+3, true)
endfunction
// ===========================
function H2I takes handle h returns integer
    return h
    return 0
endfunction

// ===========================
function LocalVars takes nothing returns gamecache
    // Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
    return InitGameCache("jasslocalvars.w3v")
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
function ArrowKeyComboEventActions takes nothing returns nothing
    local eventid triggeringId = GetTriggerEventId()
    local trigger thisTrigger = GetTriggeringTrigger()

    local trigger comboTrigger = Handle2Trigger(GetHandleHandle(thisTrigger, "ComboTrigger"))
    local string Combo = GetHandleString(thisTrigger, "Combo")
    local integer comboLength = StringLength(Combo)

    local timer timeoutTimer = Handle2Timer(GetHandleHandle(thisTrigger, "timeoutTimer"))
    local real timeout = GetHandleReal(thisTrigger, "timeout")

    local integer keyIndex = GetHandleInteger(thisTrigger, "keyIndex")
    local string lastKey = null

    if(keyIndex == 0) then
        set keyIndex = 1
    endif

    //Reset if timeout reached
    if(timeoutTimer != null and TimerGetRemaining(timeoutTimer) == 0) then
        set keyIndex = 1
    endif

    if(timeoutTimer == null and comboLength > 0) then
        set timeoutTimer = CreateTimer()
        call SetHandleHandle(thisTrigger, "timeoutTimer", timeoutTimer)
    endif

    if(triggeringId == EVENT_PLAYER_ARROW_RIGHT_DOWN) then
        set lastKey = "R"
    elseif(triggeringId == EVENT_PLAYER_ARROW_LEFT_DOWN) then
        set lastKey = "L"
    elseif(triggeringId == EVENT_PLAYER_ARROW_UP_DOWN) then
        set lastKey = "U"
    elseif(triggeringId == EVENT_PLAYER_ARROW_DOWN_DOWN) then
        set lastKey = "D"
    elseif(triggeringId == EVENT_PLAYER_END_CINEMATIC) then
        set lastKey = "E"
    endif

    if(SubStringBJ(Combo, keyIndex, keyIndex) == lastKey) then
        if(keyIndex == comboLength) then
            set keyIndex = 1
            call SetHandleHandle(thisTrigger, "timeoutTimer", null)
            call DestroyTimer(timeoutTimer)
            call ConditionalTriggerExecute(comboTrigger)
        else
            set keyIndex = keyIndex + 1
            call TimerStart(timeoutTimer, timeout, false, null)
        endif
    else //Oops, they screwed up order
        set keyIndex = 1
        call SetHandleHandle(thisTrigger, "timeoutTimer", null)
        call DestroyTimer(timeoutTimer)
    endif

    call SetHandleInteger(thisTrigger, "keyIndex", keyIndex)
endfunction

function TriggerRegisterArrowKeyComboEvent takes trigger whichTrigger, player whichPlayer, string Combo, real timeout returns nothing
    local trigger ArrowKeyTrigger = null

    if(Combo == null or whichPlayer == null or whichTrigger == null) then
        return
    endif

    set ArrowKeyTrigger = CreateTrigger()
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_RIGHT_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_LEFT_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_UP_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_DOWN_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_END_CINEMATIC)
    call SetHandleHandle(ArrowKeyTrigger, "ComboTrigger", whichTrigger)
    call SetHandleString(ArrowKeyTrigger, "Combo", Combo)
    call SetHandleReal(ArrowKeyTrigger, "timeout", timeout)
    call TriggerAddAction(ArrowKeyTrigger, function ArrowKeyComboEventActions)
endfunction

call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[1],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[2],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[3],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[4],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[5],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[1],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[2],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[3],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[4],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[5],"UUD",true)


you can find the "a2" variable in the whole code i posted above. Anyway my problem is just the Local var Handle and TriggerRegisterArrowKeyComboEvent.

this should be the outcome:

Player press "up+up+down" combo and hero will gain +3 levels.

Instead of typing in chat console the user will just do combokeys as seen on my first post.
05-12-2006, 06:48 PM#12
Thunder_Eye
You need to put all the
Collapse JASS:
call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[1],"UUD",true)
...
at the bottom inside a function.
05-13-2006, 04:49 AM#13
geocine
huh?

you mean like this?

Collapse JASS:
function (what will i put here???)
call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[1],"UUD",true)
endfunction
...

will this work? Because in my original script it wasn't enclosed in a function but it worked

Collapse JASS:
trigger HeroLevelUpTrigger=CreateTrigger()

call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[1],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[2],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[3],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[4],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,Al[5],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[1],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[2],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[3],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[4],"/sdadwe",true)
call TriggerRegisterPlayerChatEvent(HeroLevelUpTrigger,AL[5],"/sdadwe",true)

function HeroLevelUp takes nothing returns nothing
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,"Test")
call SetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())], GetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())])+1, true)
endfunction


and now this is what i have done after all your suggestions

Collapse JASS:
trigger HeroLevelUpTrigger=CreateTrigger()

function HeroLevelUp takes nothing returns nothing
//call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,25.,"Test")
call SetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())], GetHeroLevel(a2[GetPlayerId(GetTriggerPlayer())])+3, true)
endfunction
// ===========================
function H2I takes handle h returns integer
    return h
    return 0
endfunction

// ===========================
function LocalVars takes nothing returns gamecache
    // Replace InitGameCache("jasslocalvars.w3v") with a global variable!!
    return InitGameCache("jasslocalvars.w3v")
endfunction

function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))
    endif
endfunction

function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleBoolean takes handle subject, string name, boolean value returns nothing
    if value==false then
        call FlushStoredBoolean(LocalVars(),I2S(H2I(subject)),name)
    else
        call StoreBoolean(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleReal takes handle subject, string name, real value returns nothing
    if value==0 then
        call FlushStoredReal(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreReal(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function SetHandleString takes handle subject, string name, string value returns nothing
    if value==null then
        call FlushStoredString(LocalVars(), I2S(H2I(subject)), name)
    else
        call StoreString(LocalVars(), I2S(H2I(subject)), name, value)
    endif
endfunction

function GetHandleHandle takes handle subject, string name returns handle
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleInt takes handle subject, string name returns integer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleBoolean takes handle subject, string name returns boolean
    return GetStoredBoolean(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleReal takes handle subject, string name returns real
    return GetStoredReal(LocalVars(), I2S(H2I(subject)), name)
endfunction
function GetHandleString takes handle subject, string name returns string
    return GetStoredString(LocalVars(), I2S(H2I(subject)), name)
endfunction

function GetHandleUnit takes handle subject, string name returns unit
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTimer takes handle subject, string name returns timer
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleTrigger takes handle subject, string name returns trigger
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleEffect takes handle subject, string name returns effect
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleGroup takes handle subject, string name returns group
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleLightning takes handle subject, string name returns lightning
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction
function GetHandleWidget takes handle subject, string name returns widget
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)
    return null
endfunction

function FlushHandleLocals takes handle subject returns nothing
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )
endfunction
function ArrowKeyComboEventActions takes nothing returns nothing
    local eventid triggeringId = GetTriggerEventId()
    local trigger thisTrigger = GetTriggeringTrigger()

    local trigger comboTrigger = Handle2Trigger(GetHandleHandle(thisTrigger, "ComboTrigger"))
    local string Combo = GetHandleString(thisTrigger, "Combo")
    local integer comboLength = StringLength(Combo)

    local timer timeoutTimer = Handle2Timer(GetHandleHandle(thisTrigger, "timeoutTimer"))
    local real timeout = GetHandleReal(thisTrigger, "timeout")

    local integer keyIndex = GetHandleInteger(thisTrigger, "keyIndex")
    local string lastKey = null

    if(keyIndex == 0) then
        set keyIndex = 1
    endif

    //Reset if timeout reached
    if(timeoutTimer != null and TimerGetRemaining(timeoutTimer) == 0) then
        set keyIndex = 1
    endif

    if(timeoutTimer == null and comboLength > 0) then
        set timeoutTimer = CreateTimer()
        call SetHandleHandle(thisTrigger, "timeoutTimer", timeoutTimer)
    endif

    if(triggeringId == EVENT_PLAYER_ARROW_RIGHT_DOWN) then
        set lastKey = "R"
    elseif(triggeringId == EVENT_PLAYER_ARROW_LEFT_DOWN) then
        set lastKey = "L"
    elseif(triggeringId == EVENT_PLAYER_ARROW_UP_DOWN) then
        set lastKey = "U"
    elseif(triggeringId == EVENT_PLAYER_ARROW_DOWN_DOWN) then
        set lastKey = "D"
    elseif(triggeringId == EVENT_PLAYER_END_CINEMATIC) then
        set lastKey = "E"
    endif

    if(SubStringBJ(Combo, keyIndex, keyIndex) == lastKey) then
        if(keyIndex == comboLength) then
            set keyIndex = 1
            call SetHandleHandle(thisTrigger, "timeoutTimer", null)
            call DestroyTimer(timeoutTimer)
            call ConditionalTriggerExecute(comboTrigger)
        else
            set keyIndex = keyIndex + 1
            call TimerStart(timeoutTimer, timeout, false, null)
        endif
    else //Oops, they screwed up order
        set keyIndex = 1
        call SetHandleHandle(thisTrigger, "timeoutTimer", null)
        call DestroyTimer(timeoutTimer)
    endif

    call SetHandleInteger(thisTrigger, "keyIndex", keyIndex)
endfunction

function TriggerRegisterArrowKeyComboEvent takes trigger whichTrigger, player whichPlayer, string Combo, real timeout returns nothing
    local trigger ArrowKeyTrigger = null

    if(Combo == null or whichPlayer == null or whichTrigger == null) then
        return
    endif

    set ArrowKeyTrigger = CreateTrigger()
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_RIGHT_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_LEFT_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_UP_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_ARROW_DOWN_DOWN)
    call TriggerRegisterPlayerEvent(ArrowKeyTrigger, whichPlayer, EVENT_PLAYER_END_CINEMATIC)
    call SetHandleHandle(ArrowKeyTrigger, "ComboTrigger", whichTrigger)
    call SetHandleString(ArrowKeyTrigger, "Combo", Combo)
    call SetHandleReal(ArrowKeyTrigger, "timeout", timeout)
    call TriggerAddAction(ArrowKeyTrigger, function ArrowKeyComboEventActions)
endfunction

call TriggerAddAction(HeroLevelUpTrigger,function HeroLevelUp)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[1],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[2],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[3],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[4],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,Al[5],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[1],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[2],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[3],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[4],"UUD",true)
call TriggerRegisterArrowKeyComboEvent(HeroLevelUpTrigger,AL[5],"UUD",true)

But I get this errors...

Line 14627: Undeclared function GetHandleHandle
Line 14627: Undeclared function Handle2Trigger
Line 14628: Undeclared function GetHandleString
Line 14631: Undeclared function GetHandleHandle
Line 14631: Undeclared function Handle2Timer
Line 14632: Undeclared function GetHandleReal
Line 14633: Cannot convert null to real
Line 14634: Undeclared function GetHandleInteger
Line 14635: Cannot convert null to integer
Line 14648: Undeclared function SetHandleHandle
Line 14666: Undeclared function SetHandleHandle
Line 14675: Undeclared function SetHandleHandle
Line 14679: Undeclared function SetHandleInteger
Line 14695: Undeclared function SetHandleHandle
Line 14696: Undeclared function SetHandleString
Line 14697: Undeclared function SetHandleReal
Line 15279: Cannot convert boolean to real
Line 15280: Cannot convert boolean to real
Line 15281: Cannot convert boolean to real
Line 15282: Cannot convert boolean to real
Line 15283: Cannot convert boolean to real
Line 15284: Cannot convert boolean to real
Line 15285: Cannot convert boolean to real
Line 15286: Cannot convert boolean to real
Line 15287: Cannot convert boolean to real
Line 15288: Cannot convert boolean to real
05-13-2006, 11:06 AM#14
Blade.dk
The last part must be in a function.

Collapse JASS:
function Name takes nothing returns nothing
...
endfunction
05-13-2006, 02:13 PM#15
geocine
after all what you said..

i now get this errors

Line 14720: Undeclared function Handle2Trigger
Line 14724: Undeclared function Handle2Timer
Line 14727: Undeclared function GetHandleInteger
Line 14728: Cannot convert null to integer
Line 14772: Undeclared function SetHandleInteger

need help