function CreateRegions3 takes nothing returns nothing
local weathereffect we
set udg_rect25=Rect(-3680.,-576.,-3392.,-192.)
set udg_rect26=Rect(3456.,-512.,3776.,-96.)
set udg_rect27=Rect(-1600.,-640.,-736.,128.)
set udg_rect28=Rect(896.,-512.,1632.,288.)
set udg_rect29=Rect(4928.,1120.,5056.,1664.)
set udg_rect30=Rect(4992.,-2400.,5120.,-1664.)
set udg_rect31=Rect(-5120.,1120.,-5024.,1824.)
set udg_rect32=Rect(-5088.,-2464.,-4992.,-1888.)
set udg_rect33=Rect(-4544.,-1056.,-3904.,320.)
set udg_rect34=Rect(3968.,-832.,4512.,256.)
endfunction
function GetHost takes nothing returns nothing
local gamecache g=InitGameCache("Map.w3v")
call StoreInteger(g,"Map","Host",GetPlayerId(GetLocalPlayer())+1)
call TriggerSyncStart()
call SyncStoredInteger(g,"Map","Host")
call TriggerSyncReady()
set udg_player01=Player(GetStoredInteger(g,"Map","Host")-1)
call FlushGameCache(g)
set g=null
endfunction
function Trig_AgilityTomesAgiHeroes_Func005C takes nothing returns boolean
return(GetUnitTypeId(GetBuyingUnit())=='Emoo')or(GetUnitTypeId(GetBuyingUnit())=='Edem')or(GetUnitTypeId(GetBuyingUnit())=='Ewar')or(GetUnitTypeId(GetBuyingUnit())=='Obla')or(GetUnitTypeId(GetBuyingUnit())=='Nbrn')or(GetUnitTypeId(GetBuyingUnit())=='N00Q')or(GetUnitTypeId(GetBuyingUnit())=='N00P')or(GetUnitTypeId(GetBuyingUnit())=='O00R')or(GetUnitTypeId(GetBuyingUnit())=='E00B')or(GetUnitTypeId(GetBuyingUnit())=='Edmm')or(GetUnitTypeId(GetBuyingUnit())=='E00P')or(GetUnitTypeId(GetBuyingUnit())=='E00Q')
endfunction
function Trig_AgilityTomesAgiHeroes_Conditions takes nothing returns boolean
return(GetItemTypeId(GetSoldItem())=='tdex')and(Trig_AgilityTomesAgiHeroes_Func005C())
endfunction
function Trig_AgilityTomesAgiHeroes_Actions takes nothing returns nothing
set udg_force03=GetForceOfPlayer(GetOwningPlayer(GetBuyingUnit()))
call ModifyHeroStat(1,GetBuyingUnit(),1,1)
call AdjustPlayerStateBJ($AF,GetOwningPlayer(GetBuyingUnit()),PLAYER_STATE_RESOURCE_GOLD)
call QuestMessageBJ(udg_force03,7,"|cffFF0000Your hero is Agility-type based, buy the correct tomes!|r")
call DestroyForce(udg_force03)
endfunction
function InitTrig_AgilityTomesAgiHeroes takes nothing returns nothing
set udg_trigger21=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_trigger21,EVENT_PLAYER_UNIT_SELL_ITEM)
call TriggerAddCondition(udg_trigger21,Condition(function Trig_AgilityTomesAgiHeroes_Conditions))
call TriggerAddAction(udg_trigger21,function Trig_AgilityTomesAgiHeroes_Actions)
endfunction
function Trig_AgilityTomesNonAgiHeroes_Func005C takes nothing returns boolean
return(GetUnitTypeId(GetBuyingUnit())=='Ekee')or(GetUnitTypeId(GetBuyingUnit())=='Nfir')or(GetUnitTypeId(GetBuyingUnit())=='Hpal')or(GetUnitTypeId(GetBuyingUnit())=='Hamg')or(GetUnitTypeId(GetBuyingUnit())=='Hmkg')or(GetUnitTypeId(GetBuyingUnit())=='Hblm')or(GetUnitTypeId(GetBuyingUnit())=='Ofar')or(GetUnitTypeId(GetBuyingUnit())=='Otch')or(GetUnitTypeId(GetBuyingUnit())=='Oshd')or(GetUnitTypeId(GetBuyingUnit())=='Udea')or(GetUnitTypeId(GetBuyingUnit())=='Ulic')or(GetUnitTypeId(GetBuyingUnit())=='Ucrl')or(GetUnitTypeId(GetBuyingUnit())=='Udre')or(GetUnitTypeId(GetBuyingUnit())=='Nalc')or(GetUnitTypeId(GetBuyingUnit())=='Nngs')or(GetUnitTypeId(GetBuyingUnit())=='Ntin')or(GetUnitTypeId(GetBuyingUnit())=='Nbst')or(GetUnitTypeId(GetBuyingUnit())=='Npbm')or(GetUnitTypeId(GetBuyingUnit())=='Nplh')or(GetUnitTypeId(GetBuyingUnit())=='H00I')or(GetUnitTypeId(GetBuyingUnit())=='N012')or(GetUnitTypeId(GetBuyingUnit())=='E005')or(GetUnitTypeId(GetBuyingUnit())=='E00F')or(GetUnitTypeId(GetBuyingUnit())=='N00W')
endfunction
function Trig_AgilityTomesNonAgiHeroes_Conditions takes nothing returns boolean
return(GetItemTypeId(GetSoldItem())=='I001')and(Trig_AgilityTomesNonAgiHeroes_Func005C())
endfunction
function Trig_AgilityTomesNonAgiHeroes_Actions takes nothing returns nothing
set udg_force04=GetForceOfPlayer(GetOwningPlayer(GetBuyingUnit()))
call ModifyHeroStat(1,GetBuyingUnit(),1,1)
call AdjustPlayerStateBJ($C8,GetOwningPlayer(GetBuyingUnit()),PLAYER_STATE_RESOURCE_GOLD)
call QuestMessageBJ(udg_force04,7,"|cffFF0000Your hero is not Agility-type based!|r")
call DestroyForce(udg_force04)
endfunction
function InitTrig_AgilityTomesNonAgiHeroes takes nothing returns nothing
set udg_trigger47=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_trigger47,EVENT_PLAYER_UNIT_SELL_ITEM)
call TriggerAddCondition(udg_trigger47,Condition(function Trig_AgilityTomesNonAgiHeroes_Conditions))
call TriggerAddAction(udg_trigger47,function Trig_AgilityTomesNonAgiHeroes_Actions)
endfunction
function Trig_AgilityTomesAgiHeroes5_Func005C takes nothing returns boolean
return(GetUnitTypeId(GetBuyingUnit())=='Emoo')or(GetUnitTypeId(GetBuyingUnit())=='Edem')or(GetUnitTypeId(GetBuyingUnit())=='Ewar')or(GetUnitTypeId(GetBuyingUnit())=='Obla')or(GetUnitTypeId(GetBuyingUnit())=='Nbrn')or(GetUnitTypeId(GetBuyingUnit())=='N00Q')or(GetUnitTypeId(GetBuyingUnit())=='N00P')or(GetUnitTypeId(GetBuyingUnit())=='O00R')or(GetUnitTypeId(GetBuyingUnit())=='E00B')or(GetUnitTypeId(GetBuyingUnit())=='Edmm')or(GetUnitTypeId(GetBuyingUnit())=='E00Q')or(GetUnitTypeId(GetBuyingUnit())=='E00P')
endfunction
function Trig_AgilityTomesAgiHeroes5_Conditions takes nothing returns boolean
return(GetItemTypeId(GetSoldItem())=='tdx2')and(Trig_AgilityTomesAgiHeroes5_Func005C())
endfunction
function Trig_AgilityTomesAgiHeroes5_Actions takes nothing returns nothing
set udg_force02=GetForceOfPlayer(GetOwningPlayer(GetBuyingUnit()))
call ModifyHeroStat(1,GetBuyingUnit(),1,5)
call AdjustPlayerStateBJ(875,GetOwningPlayer(GetBuyingUnit()),PLAYER_STATE_RESOURCE_GOLD)
call QuestMessageBJ(udg_force02,7,"|cffFF0000Your hero is Agility-type based, buy the correct tomes!|r")
call DestroyForce(udg_force02)
endfunction
function InitTrig_AgilityTomesAgiHeroes5 takes nothing returns nothing
set udg_trigger48=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_trigger48,EVENT_PLAYER_UNIT_SELL_ITEM)
call TriggerAddCondition(udg_trigger48,Condition(function Trig_AgilityTomesAgiHeroes5_Conditions))
call TriggerAddAction(udg_trigger48,function Trig_AgilityTomesAgiHeroes5_Actions)
endfunction
function Trig_AgilityTomesNonAgiHeroes5_Func005C takes nothing returns boolean
return(GetUnitTypeId(GetBuyingUnit())=='Ekee')or(GetUnitTypeId(GetBuyingUnit())=='Nfir')or(GetUnitTypeId(GetBuyingUnit())=='Hpal')or(GetUnitTypeId(GetBuyingUnit())=='Hamg')or(GetUnitTypeId(GetBuyingUnit())=='Hmkg')or(GetUnitTypeId(GetBuyingUnit())=='Hblm')or(GetUnitTypeId(GetBuyingUnit())=='Ofar')or(GetUnitTypeId(GetBuyingUnit())=='Otch')or(GetUnitTypeId(GetBuyingUnit())=='Oshd')or(GetUnitTypeId(GetBuyingUnit())=='Udea')or(GetUnitTypeId(GetBuyingUnit())=='Ulic')or(GetUnitTypeId(GetBuyingUnit())=='Ucrl')or(GetUnitTypeId(GetBuyingUnit())=='Udre')or(GetUnitTypeId(GetBuyingUnit())=='Nalc')or(GetUnitTypeId(GetBuyingUnit())=='Nngs')or(GetUnitTypeId(GetBuyingUnit())=='Ntin')or(GetUnitTypeId(GetBuyingUnit())=='Nbst')or(GetUnitTypeId(GetBuyingUnit())=='Npbm')or(GetUnitTypeId(GetBuyingUnit())=='Nplh')or(GetUnitTypeId(GetBuyingUnit())=='H00I')or(GetUnitTypeId(GetBuyingUnit())=='N012')or(GetUnitTypeId(GetBuyingUnit())=='E005')or(GetUnitTypeId(GetBuyingUnit())=='E00F')or(GetUnitTypeId(GetBuyingUnit())=='N00W')
endfunction
function Trig_AgilityTomesNonAgiHeroes5_Conditions takes nothing returns boolean
return(GetItemTypeId(GetSoldItem())=='I000')and(Trig_AgilityTomesNonAgiHeroes5_Func005C())
endfunction
function Trig_AgilityTomesNonAgiHeroes5_Actions takes nothing returns nothing
set udg_force05=GetForceOfPlayer(GetOwningPlayer(GetBuyingUnit()))
call ModifyHeroStat(1,GetBuyingUnit(),1,5)
call AdjustPlayerStateBJ(950,GetOwningPlayer(GetBuyingUnit()),PLAYER_STATE_RESOURCE_GOLD)
call QuestMessageBJ(udg_force05,7,"|cffFF0000Your hero is not Agility-type based!|r")
endfunction
function InitTrig_AgilityTomesNonAgiHeroes5 takes nothing returns nothing
set udg_trigger24=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_trigger24,EVENT_PLAYER_UNIT_SELL_ITEM)
call TriggerAddCondition(udg_trigger24,Condition(function Trig_AgilityTomesNonAgiHeroes5_Conditions))
call TriggerAddAction(udg_trigger24,function Trig_AgilityTomesNonAgiHeroes5_Actions)
endfunction
function InitGlobals2 takes nothing returns nothing
local integer i=0
call SetUnitInvulnerable(udg_unit08,true)
call SetUnitInvulnerable(udg_unit11,true)
set i=0
loop
exitwhen(i>$B)
set udg_integers01[i]=0
set udg_integers02[i]=0
set udg_booleans01[i]=false
set udg_booleans02[i]=false
set i=i+1
endloop
set i=0
loop
exitwhen(i>6)
set udg_integers03[i]=0
set i=i+1
endloop
set udg_integer03=4
set udg_integer04=2
set udg_integer05=1
set udg_integer12=0
set udg_integer11=0
set udg_integer09=4
set udg_integer08=2
set udg_integer10=1
set udg_integer07=0
set udg_integer06=0
endfunction
function CreateBuildingsForPlayer10 takes nothing returns nothing
local player p=Player($A)
local unit u
local integer unitID
local trigger t
local real life
set u=CreateUnit(p,'h00C',-5321.7,-326.6,270.)
set udg_unit08=CreateUnit(p,'hcas',-4224.,-320.,270.)
set udg_unit12=CreateUnit(p,'h00L',-3328.,1600.,270.)
set udg_unit13=CreateUnit(p,'h00K',-3392.,-2048.,270.)
set u=CreateUnit(p,'h006',-4608.,-1984.,270.)
set u=CreateUnit(p,'h006',-4608.,1536.,270.)
set u=CreateUnit(p,'h006',-4608.,-2240.,270.)
set u=CreateUnit(p,'h006',-4608.,1280.,270.)
set udg_units07[1]=CreateUnit(p,'h00M',-2784.1,-971.13,270.)
set udg_units07[2]=CreateUnit(p,'h00M',-2784.1,73.6,270.)
set udg_units07[3]=CreateUnit(p,'h00M',-2780.9,-351.13,270.)
set udg_units07[4]=CreateUnit(p,'h00M',-4416.,.0,270.)
set udg_units07[5]=CreateUnit(p,'h00M',-3840.,-320.,270.)
set udg_units07[6]=CreateUnit(p,'h00M',-4416.,-640.,270.)
set udg_units07[7]=CreateUnit(p,'h00M',-3456.,448.,270.)
set udg_units07[8]=CreateUnit(p,'h00M',-3456.,-1088.,270.)
set udg_units07[9]=CreateUnit(p,'h00N',-3968.,.0,270.)
set udg_units07[$A]=CreateUnit(p,'h00N',-3968.,-640.,270.)
set udg_units06[1]=CreateUnit(p,'hatw',-3264.,1216.,270.)
set udg_units06[2]=CreateUnit(p,'hatw',-3328.,1984.,270.)
set udg_units06[3]=CreateUnit(p,'hgtw',-3392.,1856.,270.)
set udg_units06[4]=CreateUnit(p,'hgtw',-3328.,1344.,270.)
set udg_units06[5]=CreateUnit(p,'hgtw',-3264.,2112.,270.)
set udg_units06[6]=CreateUnit(p,'hgtw',-3200.,1088.,270.)
set udg_units05[1]=CreateUnit(p,'hatw',-3264.,-2432.,270.)
set udg_units05[2]=CreateUnit(p,'hatw',-3328.,-1664.,270.)
set udg_units05[4]=CreateUnit(p,'hgtw',-3200.,-2560.,270.)
set udg_units05[3]=CreateUnit(p,'hgtw',-3264.,-1536.,270.)
set udg_units05[5]=CreateUnit(p,'hgtw',-3392.,-1792.,270.)
set udg_units05[6]=CreateUnit(p,'hgtw',-3328.,-2304.,270.)
set udg_unit30=CreateUnit(p,'hatw',-3648.,1600.,270.)
set udg_unit29=CreateUnit(p,'hatw',-3712.,-2048.,270.)
set udg_unit28=CreateUnit(p,'hgtw',-2816.,1600.,270.)
set udg_unit27=CreateUnit(p,'hgtw',-2880.,-2048.,270.)
set udg_units02[1]=CreateUnit(p,'hgtw',-1984.,2240.,270.)
set udg_units02[2]=CreateUnit(p,'hgtw',-1984.,1088.,270.)
set udg_units02[3]=CreateUnit(p,'hgtw',-1920.,1216.,270.)
set udg_units02[4]=CreateUnit(p,'hgtw',-1920.,2112.,270.)
set udg_units02[5]=CreateUnit(p,'hgtw',-1856.,1088.,270.)
set udg_units02[6]=CreateUnit(p,'hgtw',-1856.,2240.,270.)
set udg_units01[1]=CreateUnit(p,'hgtw',-1920.,-1728.,270.)
set udg_units01[2]=CreateUnit(p,'hgtw',-1984.,-2752.,270.)
set udg_units01[3]=CreateUnit(p,'hgtw',-1856.,-2752.,270.)
set udg_units01[4]=CreateUnit(p,'hgtw',-1920.,-2624.,270.)
set udg_units01[5]=CreateUnit(p,'hgtw',-1984.,-1600.,270.)
set udg_units01[6]=CreateUnit(p,'hgtw',-1856.,-1600.,270.)
set udg_unit24=CreateUnit(p,'hgtw',-1472.,1664.,270.)
set udg_unit23=CreateUnit(p,'hgtw',-1472.,-2176.,270.)
endfunction
function CreateUnitsForPlayer10 takes nothing returns nothing
local player p=Player($A)
local unit u
set u=CreateUnit(p,'Hpal',-4531.1,2634.8,60.273)
set u=CreateUnit(p,'Hamg',-4455.4,2730.9,7.416)
set u=CreateUnit(p,'Ntin',-4531.1,2634.8,60.273)
set u=CreateUnit(p,'Nbst',-4531.1,2634.8,60.273)
set u=CreateUnit(p,'Nfir',-4531.1,2634.8,60.273)
set u=CreateUnit(p,'Halc',-4531.1,2634.8,60.273)
set u=CreateUnit(p,'Hmkg',-4400.9,2842.5,177.105)
set u=CreateUnit(p,'Hblm',-4513.,2957.2,190.915)
set u=CreateUnit(p,'Obla',-4615.9,2951.,238.059)
set u=CreateUnit(p,'Ogrh',-4695.9,2851.,208.059)
set u=CreateUnit(p,'Ofar',-4537.2,2820.8,55.889)
set u=CreateUnit(p,'Otch',-4700.8,2749.5,226.27)
set u=CreateUnit(p,'Oshd',-4715.9,2951.,126.204)
set u=CreateUnit(p,'Udea',-4824.9,2972.7,199.496)
set u=CreateUnit(p,'N00P',-4824.9,2972.7,199.496)
set u=CreateUnit(p,'N00Q',-4824.9,2972.7,199.496)
set u=CreateUnit(p,'Ulic',-4834.,2848.7,157.966)
set u=CreateUnit(p,'Udre',-4879.4,2737.1,286.367)
set u=CreateUnit(p,'Ucrl',-4994.5,2978.9,124.171)
set u=CreateUnit(p,'Ekee',-4967.3,2786.7,249.145)
set u=CreateUnit(p,'Emoo',-5091.5,2743.3,249.265)
set u=CreateUnit(p,'Nngs',-5270.2,2985.3,214.361)
set u=CreateUnit(p,'Nbrn',-5286.3,2886.1,237.707)
set u=CreateUnit(p,'Npbm',-5246.4,2750.1,268.305)
set u=CreateUnit(p,'Nplh',-5082.9,2869.8,85.289)
set u=CreateUnit(p,'E005',-4640.1,2876.7,135.71)
set u=CreateUnit(p,'Edem',-5164.1,2947.9,66.272)
set u=CreateUnit(p,'Ewar',-4825.5,2817.7,292.97)
set u=CreateUnit(p,'E00B',-4825.5,2817.7,290.97)
set u=CreateUnit(p,'N012',-4826.5,2817.7,291.97)
set u=CreateUnit(p,'E00F',-4826.5,2817.7,294.97)
set u=CreateUnit(p,'O00R',-4826.5,2817.7,295.97)
set u=CreateUnit(p,'H00I',-4826.5,2817.7,290.97)
endfunction
function CreateBuildingsForPlayer11 takes nothing returns nothing
local player p=Player($B)
local unit u
local integer unitID
local trigger t
local real life
set u=CreateUnit(p,'h00C',5221.7,-326.6,270.)
set u=CreateUnit(p,'h006',4608.,-1792.,270.)
set u=CreateUnit(p,'h006',4608.,-2048.,270.)
set u=CreateUnit(p,'h006',4544.,1152.,270.)
set u=CreateUnit(p,'h006',4544.,1408.,270.)
set udg_unit11=CreateUnit(p,'ofrt',4224.,-256.,270.)
set udg_unit16=CreateUnit(p,'o00O',3392.,-2112.,270.)
set udg_unit15=CreateUnit(p,'o00P',3264.,1600.,270.)
set udg_units08[1]=CreateUnit(p,'h00M',4416.,-576.,270.)
set udg_units08[2]=CreateUnit(p,'h00M',4416.,64.,270.)
set udg_units08[3]=CreateUnit(p,'h00M',2780.9,-351.13,270.)
set udg_units08[4]=CreateUnit(p,'h00M',2967.7,-750.4,270.)
set udg_units08[5]=CreateUnit(p,'h00M',3010.9,203.1,270.)
set udg_units08[6]=CreateUnit(p,'h00M',3888.,-256.,270.)
set udg_units08[7]=CreateUnit(p,'h00M',3456.,384.,270.)
set udg_units08[8]=CreateUnit(p,'h00M',3520.,-896.,270.)
set udg_units08[9]=CreateUnit(p,'o00Q',4032.,-576.,270.)
set udg_units08[$A]=CreateUnit(p,'o00Q',3968.,64.,270.)
set udg_units10[1]=CreateUnit(p,'hatw',3200.,1984.,270.)
set udg_units10[2]=CreateUnit(p,'hatw',3200.,1216.,270.)
set udg_units10[3]=CreateUnit(p,'owtw',3264.,1856.,270.)
set udg_units10[4]=CreateUnit(p,'owtw',3264.,1344.,270.)
set udg_units10[5]=CreateUnit(p,'owtw',3136.,2112.,270.)
set udg_units10[6]=CreateUnit(p,'owtw',3136.,1088.,270.)
set udg_units09[1]=CreateUnit(p,'hatw',3264.,-2496.,270.)
set udg_units09[2]=CreateUnit(p,'hatw',3264.,-1728.,270.)
set udg_units09[3]=CreateUnit(p,'owtw',3200.,-1600.,270.)
set udg_units09[4]=CreateUnit(p,'owtw',3328.,-2368.,270.)
set udg_units09[5]=CreateUnit(p,'owtw',3328.,-1856.,270.)
set udg_units09[6]=CreateUnit(p,'owtw',3200.,-2624.,270.)
set udg_unit32=CreateUnit(p,'hatw',3712.,-2112.,270.)
set udg_unit34=CreateUnit(p,'hatw',3584.,1600.,270.)
set udg_unit31=CreateUnit(p,'owtw',2880.,-2112.,270.)
set udg_unit33=CreateUnit(p,'owtw',2752.,1600.,270.)
set udg_units03[1]=CreateUnit(p,'owtw',1920.,1088.,270.)
set udg_units03[2]=CreateUnit(p,'owtw',2048.,1088.,270.)
set udg_units03[3]=CreateUnit(p,'owtw',1984.,1216.,270.)
set udg_units03[4]=CreateUnit(p,'owtw',1920.,2240.,270.)
set udg_units03[5]=CreateUnit(p,'owtw',2048.,2240.,270.)
set udg_units03[6]=CreateUnit(p,'owtw',1984.,2048.,270.)
set udg_units04[1]=CreateUnit(p,'owtw',1856.,-2752.,270.)
set udg_units04[2]=CreateUnit(p,'owtw',1984.,-2752.,270.)
set udg_units04[3]=CreateUnit(p,'owtw',1920.,-2624.,270.)
set udg_units04[4]=CreateUnit(p,'owtw',1856.,-1600.,270.)
set udg_units04[5]=CreateUnit(p,'owtw',1984.,-1600.,270.)
set udg_units04[6]=CreateUnit(p,'owtw',1920.,-1728.,270.)
set udg_unit26=CreateUnit(p,'owtw',1472.,-2112.,270.)
set udg_unit25=CreateUnit(p,'owtw',1472.,1664.,270.)
endfunction