scope HuntSystem initializer HS
function RaidGetSpawned takes nothing returns nothing
local boolexpr b = Condition(function HeroAroundOrQuest)
local boolexpr b2
set udg_CP_Point = Location(0.,0.)
loop
set X = GetRandomReal(GetRectMinX(bj_mapInitialPlayableArea), GetRectMaxX(bj_mapInitialPlayableArea))
set Y = GetRandomReal(GetRectMinY(bj_mapInitialPlayableArea), GetRectMaxY(bj_mapInitialPlayableArea))
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
//set X = -4350
//set Y = -1115
//call echo("point walk")
if not IsVisibleToPlayer(X,Y,Player(0)) and not IsVisibleToPlayer(X,Y,Player(6)) and not IsPointBlighted(X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion1,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion2,X,Y)/*
*/ and not RectContainsCoordsJ(gg_rct_LivingRegion3,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion4,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion5,X,Y) /*
*/ and not RectContainsCoordsJ(gg_rct_LivingRegion6,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion7,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion8,X,Y) /*
*/ and not RectContainsCoordsJ(gg_rct_LivingRegion9,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion10,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion11,X,Y) and not RectContainsCoordsJ(gg_rct_LivingRegion12,X,Y) /*
*/ and not RectContainsCoordsJ(gg_rct_RestrictedAreaForRaid,X,Y) then
//call echo("no vision")
if QuestCompleted[1] != true or QuestCompleted[2] != true or QuestCompleted[3] != true or QuestCompleted[4] != true or QuestCompleted[5] != true
//call echo("yeah through")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),2500,b)
set F = FirstOfGroup(P)
if F != null then
//call echo("oh they are around boy")
else
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
//call echo("oh yeah go boy")
loop
set QuestNumber = GetRandomInt(1,5)
exitwhen QuestCompleted[QuestNumber] != true
endloop
//call echo("quest is active")
set b2 = Condition(function RaidAttackFilter)
set T = CreateTimer()
set ID = GetHandleId(T)
if QuestNumber == 1 then
//set I = 'nfrl'
set I2 = 1
//call echo("furb")
RaidCurrentMax++
set RaidActive[RaidCurrentMax] = true
set RaidGroup[RaidCurrentMax] = CreateGroup()
loop
exitwhen I2 > 1 * RaidLVL
if I2 == 1 or I2 == 2 then
set I = 'nfrl'
elseif I2 == 3
set I = 'nfrs'
endif
set X = X + GetRandomReal(-70,70)
set Y = Y + GetRandomReal(-70,70)
set F = CreateUnit(Player(4),I,X,Y,GetRandomReal(0,360))
call SetUnitColor(F,PLAYER_COLOR_LIGHT_GRAY)
call SaveInteger(Hash,GetHandleId(F),StringHash("RaidInteger"),RaidCurrentMax)
call GroupAddUnit(RaidGroup[RaidCurrentMax],F)
//call echo("create")
set I2 = I2 + 1
endloop
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1000,b2) // kda is love
set F = FirstOfGroup(P)
if F != null then
//call echo("start attack nearby unit")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,F2)
endloop
else // they choose to just walk somewhere
//call echo("start they move")
set F2 = FirstOfGroup(RaidGroup[RaidCurrentMax])
loop
set X = GetUnitX(F2) + GetRandomReal(-2500,2500)
set Y = GetUnitY(F2) + GetRandomReal(-2500,2500)
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"move",X,Y)
call GroupRemoveUnit(P2,F2)
endloop
endif
elseif QuestNumber == 2
set I2 = 1
//call echo("trent")
RaidCurrentMax++
set RaidActive[RaidCurrentMax] = true
set RaidGroup[RaidCurrentMax] = CreateGroup()
set RaidActive[RaidCurrentMax] = true
loop
exitwhen I2 > 1 * RaidLVL
if I2 == 1 or I2 == 2 then
set I = 'nenc'
elseif I2 == 3
set I = 'nepl'
endif
set X = X + GetRandomReal(-70,70)
set Y = Y + GetRandomReal(-70,70)
set F = CreateUnit(Player(4),I,X,Y,GetRandomReal(0,360))
call SetUnitColor(F,PLAYER_COLOR_LIGHT_GRAY)
call SaveInteger(Hash,GetHandleId(F),StringHash("RaidInteger"),RaidCurrentMax)
call GroupAddUnit(RaidGroup[RaidCurrentMax],F)
//call echo("tregeate")
set I2 = I2 + 1
endloop
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1000,b2) // kda is love
set F = FirstOfGroup(P)
if F != null then
//call echo("start attack nearby unit")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,F2)
endloop
else // they choose to just walk somewhere
//call echo("start move")
set F2 = FirstOfGroup(RaidGroup[RaidCurrentMax])
loop
set X = GetUnitX(F2) + GetRandomReal(-2500,2500)
set Y = GetUnitY(F2) + GetRandomReal(-2500,2500)
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",X,Y)
call GroupRemoveUnit(P2,F2)
endloop
endif
elseif QuestNumber == 3
set I2 = 1
//call echo("thugs")
RaidCurrentMax++
set RaidActive[RaidCurrentMax] = true
set RaidGroup[RaidCurrentMax] = CreateGroup()
set RaidActive[RaidCurrentMax] = true
loop
exitwhen I2 > 1 * RaidLVL + 1
if I2 == 1 or I2 == 2 then
set I = 'nban'
elseif I2 == 3
set I = 'nbrg'
elseif I2 == 4
set I = 'nrog'
endif
set X = X + GetRandomReal(-70,70)
set Y = Y + GetRandomReal(-70,70)
set F = CreateUnit(Player(4),I,X,Y,GetRandomReal(0,360))
call SetUnitColor(F,PLAYER_COLOR_LIGHT_GRAY)
call SaveInteger(Hash,GetHandleId(F),StringHash("RaidInteger"),RaidCurrentMax)
call GroupAddUnit(RaidGroup[RaidCurrentMax],F)
//call echo("thugscreate")
set I2 = I2 + 1
endloop
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1000,b2) // kda is love
set F = FirstOfGroup(P)
if F != null then
//call echo("start attack nearby unit")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,F2)
endloop
else // they choose to just walk somewhere
//call echo("start move")
set F2 = FirstOfGroup(RaidGroup[RaidCurrentMax])
loop
set X = GetUnitX(F2) + GetRandomReal(-2500,2500)
set Y = GetUnitY(F2) + GetRandomReal(-2500,2500)
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",X,Y)
call GroupRemoveUnit(P2,F2)
endloop
endif
elseif QuestNumber == 4
set I2 = 1
//call echo("crypt")
RaidCurrentMax++
set RaidActive[RaidCurrentMax] = true
set RaidGroup[RaidCurrentMax] = CreateGroup()
set RaidActive[RaidCurrentMax] = true
loop
exitwhen I2 > 1 * RaidLVL + 1
if I2 == 1 or I2 == 2 or I2 == 3 or I2 == 4 then
set I = 'ucry'
endif
set X = X + GetRandomReal(-70,70)
set Y = Y + GetRandomReal(-70,70)
set F = CreateUnit(Player(4),I,X,Y,GetRandomReal(0,360))
call SetUnitColor(F,PLAYER_COLOR_LIGHT_GRAY)
call SaveInteger(Hash,GetHandleId(F),StringHash("RaidInteger"),RaidCurrentMax)
call GroupAddUnit(RaidGroup[RaidCurrentMax],F)
//call echo("create")
set I2 = I2 + 1
endloop
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1000,b2) // kda is love
set F = FirstOfGroup(P)
if F != null then
//call echo("start attack nearby unit")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,F2)
endloop
else // they choose to just walk somewhere
//call echo("start move")
set F2 = FirstOfGroup(RaidGroup[RaidCurrentMax])
loop
set X = GetUnitX(F2) + GetRandomReal(-2500,2500)
set Y = GetUnitY(F2) + GetRandomReal(-2500,2500)
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",X,Y)
call GroupRemoveUnit(P2,F2)
endloop
endif
elseif QuestNumber == 5
set I2 = 1
//call echo("rebel")
RaidCurrentMax++
set RaidActive[RaidCurrentMax] = true
set RaidGroup[RaidCurrentMax] = CreateGroup()
set RaidActive[RaidCurrentMax] = true
loop
exitwhen I2 > 1 * RaidLVL + 1
if I2 == 1 or I2 == 2 then
set I = 'h009'
elseif I2 == 3
set I = 'n002'
elseif I2 == 4 then
set I = 'h00A'
endif
set X = X + GetRandomReal(-70,70)
set Y = Y + GetRandomReal(-70,70)
set F = CreateUnit(Player(4),I,X,Y,GetRandomReal(0,360))
call SetUnitColor(F,PLAYER_COLOR_LIGHT_GRAY)
call SaveInteger(Hash,GetHandleId(F),StringHash("RaidInteger"),RaidCurrentMax)
call GroupAddUnit(RaidGroup[RaidCurrentMax],F)
//call echo("create")
set I2 = I2 + 1
endloop
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1000,b2) // kda is love
set F = FirstOfGroup(P)
if F != null then
//call echo("start attack nearby unit")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,F2)
endloop
else // they choose to just walk somewhere
//call echo("start move")
set F2 = FirstOfGroup(RaidGroup[RaidCurrentMax])
loop
set X = GetUnitX(F2) + GetRandomReal(-2500,2500)
set Y = GetUnitY(F2) + GetRandomReal(-2500,2500)
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true
endloop
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[RaidCurrentMax],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",X,Y)
call GroupRemoveUnit(P2,F2)
endloop
endif
endif
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
//set F = CreateUnit(Player(13),I,X,Y,GetRandomReal(0,360))
//call PingMinimapForForceExJ(HumanForce, X, Y, 3, bj_MINIMAPPINGSTYLE_SIMPLE, 60, 80, 40)
endif
else
//call echo("quest no oh no boy")
call PauseTimer(GetExpiredTimer())
call DestroyTimer(GetExpiredTimer())
endif
else
//call echo("no vision oh no boy")
//call PauseTimer(GetExpiredTimer())
//call DestroyTimer(GetExpiredTimer())
endif
call RemoveLocation(udg_CP_Point)
call GroupRemoveUnit(P,F)
call DestroyBoolExpr(b)
call DestroyBoolExpr(b2)
set b2 = null
set b = null
endfunction
function EveryTenthCSecondInGame takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer idT = GetHandleId(t)
local integer i
local boolean FirstUnitDS
local real r
local unit f
local unit d
//local group randomg
//local unit randomu
local integer i2
local group g
local camerasetup cs
local boolexpr b2
//=====
if not GameOver
set RaidActionCommandInterval = RaidActionCommandInterval - 0.1
if RaidActionCommandInterval <= 0. then // second time
set udg_CP_Point = Location(0.,0.)
set RaidActionCommandInterval = 15.
set I2 = 1
set b2 = Condition(function RaidAttackFilter)
//call echo("we act")
loop
exitwhen I2 > RaidCurrentMax
if RaidActive[I2] != false and RaidCommandIsActive[I2] != true then
//call echo(I2S(I2) + " we do")
set RaidCommandIsActive[I2] = true
set F = FirstOfGroup(RaidGroup[I2])
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),1000,b2) // kda is love
set F = FirstOfGroup(P)
if F != null then
//call echo(GetUnitName(F))
set RaidTargetUnit[I2] = F
set RaidXPoint[I2] = GetUnitX(F)
set RaidYPoint[I2] = GetUnitY(F)
set RaidCommandType[I2] = 1
//call echo("They attack 2 time")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[I2],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",GetUnitX(F),GetUnitY(F))
call GroupRemoveUnit(P2,F2)
endloop
else // they choose to just walk somewhere
set F2 = FirstOfGroup(RaidGroup[I2])
loop
set X = GetUnitX(F2) + GetRandomReal(-2500,2500)
set Y = GetUnitY(F2) + GetRandomReal(-2500,2500)
call MoveLocation(udg_CP_Point,X,Y)
call TriggerExecute( gg_trg_Check_Walkability )
exitwhen udg_CP_PointIsWalkable == true and not RectContainsCoordsJ(gg_rct_RestrictedAreaForRaid,X,Y)
endloop
//call echo("they move 2 time")
//call echo(I2S(I2))
set RaidCommandType[I2] = 2
set RaidXPoint[I2] = X
set RaidYPoint[I2] = Y
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[I2],function GroupAddGroupEnumJ)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call IssuePointOrder(F2,"attack",X,Y)
call GroupRemoveUnit(P2,F2)
endloop
endif
endif
I2++
endloop
//call echo ("end acting")
call RemoveLocation(udg_CP_Point)
call DestroyBoolExpr(b2)
endif
if QuestCompleted[1] != true or QuestCompleted[2] != true or QuestCompleted[3] != true or QuestCompleted[4] != true or QuestCompleted[5] != true
if RaidSpawn > 0. then
set RaidSpawn = RaidSpawn - 0.1
elseif RaidSpawn <= 0. then
//call echo("true")
set RaidBoolean = true
endif
if RaidBoolean == true then
if RaidInterval > 0. then
set RaidInterval = RaidInterval - 0.1
//call echo(R2S(RaidInterval))
elseif RaidInterval <= 0. then
//set RaidBoolean = false
set RaidInterval = 65. //45
call TimerStart(CreateTimer(),RaidIntReal,true,function RaidGetSpawned)
//call echo("go spawn")
endif
endif
endif
//call echo(R2S(timeperm))
set time = time + 0.1
set timeperm = timeperm + 0.1
if PalSurvive == true then
set PalSurviveReal = PalSurviveReal - 0.1
endif
if PalSurviveReal <= 0. then
//call echo("&&&&&&")
call TriggerExecute(gg_trg_PalSurvive)
endif
if timeperm == TESTautoUPGRADEtime and TEST == true then
call SetPlayerState(Player(0),PLAYER_STATE_RESOURCE_GOLD,5000)
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al01' )
call echo("1 upg")
elseif timeperm == TESTautoUPGRADEtime + 40. and TEST == true then
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al02' )
call echo("1 upg")
elseif timeperm == TESTautoUPGRADEtime + 80. and TEST == true then
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al03' )
call echo("1 upg")
elseif timeperm == TESTautoUPGRADEtime + 120. and TEST == true then
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al04' )
call echo("1 upg")
elseif timeperm == TESTautoUPGRADEtime + 160. and TEST == true then
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al05' )
call echo("1 upg")
elseif timeperm == TESTautoUPGRADEtime + 200. and TEST == true then
call IssueImmediateOrderById( gg_unit_halt_0059, 'Al06' )
call echo("1 upg")
endif
if R2I(timeperm) == 120 and LVL2Raid != true then //300
set LVL2Raid = true
//call echo("raid lvl 2")
set RaidLVL = 2
elseif R2I(timeperm) == 240 and LVL3Raid != true //900
set LVL3Raid = true
//call echo("raid lvl 3")
set RaidLVL = 3
endif
if BladeUnit != null
if BladeCd <= 0.
if GetUnitAbilityLevel(BladeUnit,'ANca') == 0
call UnitAddAbility(BladeUnit,'ANca')
endif
else
set BladeCd = BladeCd - 0.1
endif
endif
if SoulPickedUp
if IsUnitInvisible(SoulUnit, Player(PLAYER_NEUTRAL_AGGRESSIVE)) == true
if GetInventoryIndexOfItemTypeJ(SoulUnit, 'gsou') > 0
set bj_lastRemovedItem = GetItemOfTypeFromUnitJ(SoulUnit,'gsou')
call UnitRemoveItem(HERO[I2],bj_lastRemovedItem)
call RemoveItem(bj_lastRemovedItem)
set bj_lastCreatedItem = CreateItem('soul', GetUnitX(SoulUnit), GetUnitY(SoulUnit))
call UnitAddItem(SoulUnit, bj_lastCreatedItem)
endif
else
if GetInventoryIndexOfItemTypeJ(SoulUnit, 'soul') > 0
set bj_lastRemovedItem = GetItemOfTypeFromUnitJ(SoulUnit,'soul')
call UnitRemoveItem(HERO[I2],bj_lastRemovedItem)
call RemoveItem(bj_lastRemovedItem)
set bj_lastCreatedItem = CreateItem('gsou', GetUnitX(SoulUnit), GetUnitY(SoulUnit))
call UnitAddItem(SoulUnit, bj_lastCreatedItem)
endif
endif
endif
if Shadows[6] != null
call SetTextTagPosUnit(LoadTextTagHandle(Hash,GetHandleId(Shadows[6]),4), Shadows[6], 25)
endif
if Shadows[7] != null
call SetTextTagPosUnit(LoadTextTagHandle(Hash,GetHandleId(Shadows[7]),4), Shadows[7], 25)
endif
if Shadows[8] != null
call SetTextTagPosUnit(LoadTextTagHandle(Hash,GetHandleId(Shadows[8]),4), Shadows[8], 25)
endif
if Shadows[9] != null
call SetTextTagPosUnit(LoadTextTagHandle(Hash,GetHandleId(Shadows[9]),4), Shadows[9], 25)
endif
if PalSurviveReal <= 100 and DefendingEnd == false //-600 1000 -1700( when mortars go kill everything )- 1800 actually
if (IsPlayerInForce(GetLocalPlayer(), PlayerForce)) then
call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, 8., "|c00E35782 100 seconds and the game is end! |r |r")
endif
call StartSound(gg_snd_ItemReceived)
set DefendingEnd = true
endif
//call echo(R2S(timeperm))
//set timemin = timemin + 0.1
if ThugsReal > 0. then
set ThugsReal = ThugsReal - 0.1
if ThugsReal == 0. then
if CountUnitsInGroupJ(ThugsRaidGroup) <= 2 then
set I = GetRandomInt(1,2)
set ThugsReal = 6.5
if I == 1 then
set F = CreateUnit(Player(4),'nban',GetRectCenterX(gg_rct_ThugsSpawner1),GetRectCenterY(gg_rct_ThugsSpawner1),260)
call GroupAddUnit(ThugsRaidGroup,F)
else
set F = CreateUnit(Player(4),'nban',GetRectCenterX(gg_rct_ThugsSpawner2),GetRectCenterY(gg_rct_ThugsSpawner2),260)
call GroupAddUnit(ThugsRaidGroup,F)
endif
endif
endif
endif
if FurblogsReal > 0. then
set FurblogsReal = FurblogsReal - 0.1
endif
if RectDeadReal > 0. then // PREVENT TOO MUCH WARNING SOUND
//call echo("rect dead real")
set RectDeadReal = RectDeadReal - 0.1
endif
if MedRectWarnReal > 0. then
set MedRectWarnReal = MedRectWarnReal - 0.1
endif
if CryptSpidersReal > 0. then
set CryptSpidersReal = CryptSpidersReal - 0.1
endif
if RebelsReal > 0. then
set RebelsReal = RebelsReal - 0.1
endif
if timeperm >= 240. and CaptainActivated == false then //240 120
//call echo("CAP IS HERE")
set CaptainActivated = TRUE
call PingMinimapForForceExJ(HumanForce, -1160., 3300, 3, bj_MINIMAPPINGSTYLE_SIMPLE, 40,85, 50)
set i = 0
loop
exitwhen i > 3
if (GetLocalPlayer() == Player(i)) then
call SetCameraQuickPosition(GetUnitX(F), GetUnitY(F))
endif
set i = i + 1
endloop
call MsgForce (HumanForce," |c00E35782-> Work of patrols is established.|r")
//call echo("sdsdsdsd CAPTAIN")
elseif CaptainIsOnCd then
set CaptainCd = CaptainCd - 0.1
if CaptainCd <= 0. then
set CaptainIsOnCd = FALSE
//set CaptainCd = 45.
endif
endif
//set g = CreateGroup()
if CountUnitsInGroupJ(QuestionMarkGroup) > 0
//call echo("ssddddS")
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(QuestionMarkGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
//call echo(GetUnitName(F))
exitwhen F == null
set F2 = LoadUnitHandle(Hash,GetHandleId(F),StringHash("QuestMark"))
//call echo(GetUnitName(F2))
call SetUnitX(F2,GetUnitX(F))
call SetUnitY(F2,GetUnitY(F))
call GroupRemoveUnit(P, F)
endloop
endif
if CountUnitsInGroupJ(AppearingGroup) > 0 then
//call echo("sdd!!")
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(AppearingGroup,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
set R = LoadReal(Hash, GetHandleId(F), StringHash("Appearing_R"))
if R <= 0 then
set R = 15
else
set R = R + 24
endif
call SetUnitVertexColor(F, 255, 255, 255, R2I(R))
if R >= 255 then
call GroupRemoveUnit(AppearingGroup, F)
call RemoveSavedHandle(Hash,GetHandleId(F),StringHash("Appearing_R"))
call PauseUnit(F,false)
else
call SaveReal(Hash, GetHandleId(F), StringHash("Appearing_R"), R)
endif
call GroupRemoveUnit(P, F)
endloop
endif
//call GroupAddUnit(F2,RainFire)
//call SaveReal(Hash,GetHandleId(F2),StringHash("Rain_Detonation"),1.2)
call GroupClear(P) // R A D I A N C E RADIANCE
set bj_groupAddGroupDest = P
call ForGroup(Radiance,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if IsUnitInGroup(f,Paladins) then
set R = LoadReal(Hash,GetHandleId(f),StringHash("Radiance_R"))
if R <= 0 then
call UnitRemoveAbility(f,'A01F')
call UnitRemoveAbility(f,'B00D')
//call echo("end")
call DestroyEffect(LoadEffectHandle(Hash,GetHandleId(f),StringHash("Radiance_eff")))
call RemoveSavedHandle(Hash,GetHandleId(f),StringHash("Radiance_eff"))
call RemoveSavedReal(Hash,GetHandleId(f),StringHash("Radiance_R"))
call GroupRemoveUnit(Radiance,f)
else
set R = R-0.1
//call echo("-R")
call SaveReal(Hash,GetHandleId(f),StringHash("Radiance_R"),R)
set B = Condition(function Radiance_Filter)
call GroupClear(P2)
call GroupEnumUnitsInRange(P2, GetUnitX(f), GetUnitY(f), 400, B)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call UnitDamageTarget(f,F2,5.,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call AddEffectTimeToUnit("Abilities\\Spells\\Other\\ImmolationRed\\ImmolationRedDamage.mdl",F2,"chest",0.1)
//call echo(R2S(r))"Ember Shield I FX 5.mdx"
call GroupRemoveUnit(P2,F2)
endloop
call DestroyBoolExpr(B)
endif
elseif GetUnitTypeId(f) == 'hhes' then
set B = Condition(function Radiance_Filter)
call GroupClear(P2)
call GroupEnumUnitsInRange(P2, GetUnitX(f), GetUnitY(f), 1000, B)
set F2 = GetClosestUnitInGroup(GetUnitX(f), GetUnitY(f), P2)
/*
if GetUnitTypeId(ar) == 'hhes' and not IssueTargetOrder(ar,"creepthunderbolt",at) then
//call echo("yes")
call IssueTargetOrder(ar,"creepthunderbolt",at)
endif */
if not IssueTargetOrder(f,"creepthunderbolt",F2) then
//call echo("yes")
call IssueTargetOrder(f,"creepthunderbolt",F2)
endif
call DestroyBoolExpr(B)
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P) // R A I N RAIN FIRE
set bj_groupAddGroupDest = P
call ForGroup(RainFire,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set R = LoadReal(Hash,GetHandleId(f),StringHash("Rain_Detonation"))
if R <= 0 then
//call echo("DOES END")
set F = LoadUnitHandle(Hash,GetHandleId(f),StringHash("Rain_caster"))
set r = LoadReal(Hash,GetHandleId(f),StringHash("Rain_damage"))
set R2 = LoadReal(Hash,GetHandleId(f),StringHash("Rain_radius"))
call PlaySoundAtPoint("Abilities\\Spells\\Undead\\Curse\\CurseTarget1.wav", GetUnitX(f), GetUnitY(f) )
set B = Condition(function Rain_Filter)
call GroupClear(P2)
call GroupEnumUnitsInRange(P2, GetUnitX(f), GetUnitY(f), R2, B)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
call UnitDamageTarget(F,F2,r,false,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
//call echo(R2S(r))
call GroupRemoveUnit(P2,F2)
endloop
call DestroyBoolExpr(B)
call GroupRemoveUnit(RainFire,f)
call FlushChildHashtable(Hash,GetHandleId(f))
call KillUnit(f)
else
set R = R-0.1
call SaveReal(Hash,GetHandleId(f),StringHash("Rain_Detonation"),R)
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Paladins,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
//Paladins VISIOn
//call echo(GetUnitName(f))
set F2 = LoadUnitHandle(Hash,GetHandleId(f),StringHash("P_Vision"))
if SpyVision[GetPlayerId(GetOwningPlayer(f))] == true and GetInventoryIndexOfItemTypeJ(f, 'tels') <= 0 then
call UnitRemoveAbility(F2,'ALsi')
endif
set X = GetUnitX(f)
set Y = GetUnitY(f)
//call echo(GetUnitName(F2))
call SetUnitX(F2,X)
call SetUnitY(F2,Y)
//call echo(R2S(GetUnitX(f)))
if GetInventoryIndexOfItemTypeJ(f, 'schl') > 0
call SetUnitLife(f,GetUnitLife(f) + 0.15)
call SetUnitState(f,UNIT_STATE_MANA,GetUnitState(f,UNIT_STATE_MANA) + 0.1)
endif
call GroupClear(P2)
call GroupEnumUnitsInRange(P2, GetUnitX(f), GetUnitY(f), 1300, null)
loop
set F = FirstOfGroup(P2)
exitwhen F == null
if UnitTypeNotDummy(F) and IsUnitType(F, UNIT_TYPE_STRUCTURE) and IsPlayerInForce(GetOwningPlayer(F),HumanForce) then //
if LoadReal(Hash, GetHandleId(F), StringHash("STR_r")) <= 0. then
call SaveUnitHandle(Hash, GetHandleId(F), StringHash("STR_u"), CreateUnit(GetOwningPlayer(f), 'e00I', GetUnitX(F), GetUnitY(F), 0))
endif
if GuardTip[GetPlayerId(GetOwningPlayer(f))] != true and timeperm > 140. then
set GuardTip[GetPlayerId(GetOwningPlayer(f))] = true
call MsgP(GetPlayerId(GetOwningPlayer(f)),"|c00EDBDA7Structures nearby your hero gives your additicnal vision and true sight (that can track DreadLords). Note that true sight works on less distance(900 = around 18 metres) than base vision|r", 12.)
endif
call SaveReal(Hash, GetHandleId(F), StringHash("STR_r"), 3.)
if not IsUnitInGroup(F, BuildVision) then
call GroupAddUnit(BuildVision, F)
endif
endif
call GroupRemoveUnit(P2, F)
endloop
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(DreadLords,function GroupAddGroupEnumJ)
// set g = CopyGroup(Paladins)
loop
set f = FirstOfGroup(P)
exitwhen f == null
//Dreadlords VISION
set F2 = LoadUnitHandle(Hash,GetHandleId(f),StringHash("DL_Vision"))
call SetUnitX(F2,GetUnitX(f))
call SetUnitY(F2,GetUnitY(f))
if GetInventoryIndexOfItemTypeJ(f, 'stwa') > 0
call SetUnitState(f,UNIT_STATE_MANA,GetUnitState(f,UNIT_STATE_MANA) + 0.1)
endif
if GetInventoryIndexOfItemTypeJ(f, 'sprn') > 0
call SetUnitLife(f,GetUnitLife(f) + 0.1)
call SetUnitState(f,UNIT_STATE_MANA,GetUnitState(f,UNIT_STATE_MANA) + 0.1)
endif
call GroupRemoveUnit(P, f)
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(BuildVision,function GroupAddGroupEnumJ)
// set g = CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set i2 = GetHandleId(f)
set r = LoadReal(Hash, i2, StringHash("STR_r")) - 0.1
if r <= 0. then
call RemoveUnit(LoadUnitHandle(Hash, i2, StringHash("STR_u")))
call GroupRemoveUnit(BuildVision, f)
call RemoveSavedHandle(Hash, i2, StringHash("STR_u"))
call RemoveSavedReal(Hash, i2, StringHash("STR_r"))
else
call SaveReal(Hash, i2, StringHash("STR_r"), r)
endif
call GroupRemoveUnit(P, f)
endloop
//call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(ReplicsGroup,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("ReplicReal")) - 0.1
if r <= 0. then
call RemoveSavedBoolean(Hash, GetHandleId(f), StringHash("ReplicBoolean"))
call RemoveSavedReal(Hash, GetHandleId(f), StringHash("ReplicReal"))
call GroupRemoveUnit(ReplicsGroup, f)
else
call SaveReal(Hash, GetHandleId(f), StringHash("ReplicReal"), r)
endif
call GroupRemoveUnit(P, f)
endloop
//call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(ShareVisionGroup,function GroupAddGroupEnumJ)
// set g = CopyGroup(ShareVisionGroup)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("SV_r")) - 0.1
set d = LoadUnitHandle(Hash, GetHandleId(f), StringHash("SV_d"))
if r <= 0. then
call DestroyEffect(LoadEffectHandle(Hash, GetHandleId(f), StringHash("SV_e")))
call RemoveSavedHandle(Hash, GetHandleId(f), StringHash("SV_e"))
call RemoveSavedHandle(Hash, GetHandleId(f), StringHash("SV_d"))
call RemoveSavedInteger(Hash,GetHandleId(f),StringHash("SV_i"))
call RemoveSavedReal(Hash, GetHandleId(f), StringHash("SV_r"))
call GroupRemoveUnit(ShareVisionGroup, f)
call RemoveUnit(d)
else
call SaveReal(Hash, GetHandleId(f), StringHash("SV_r"), r)
call SetUnitX(d, GetUnitX(f))
call SetUnitY(d, GetUnitY(f))
endif
call GroupRemoveUnit(P, f)
endloop
//call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(FocusedUnitVision,function GroupAddGroupEnumJ)
//set g = CopyGroup(FocusedUnitVision)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set I = LoadInteger(Hash,GetHandleId(f),StringHash("FocusedUnit[i]_i"))
set d = HuntTargetUnitDummy[I]
if not IsUnitDead(d) then
call SetUnitX(d, GetUnitX(f))
call SetUnitY(d, GetUnitY(f))
endif
call GroupRemoveUnit(P, f)
endloop
// call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Zeal_Casters,function GroupAddGroupEnumJ)
// set g = CopyGroup(Zeal_Casters) // ZEAL zeal group casters
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("Zeal_time")) - 0.1
if r <= 0. then
call GroupRemoveUnit(Zeal_Casters, f)
call UnitRemoveAbility(f, 'A00J')
call UnitRemoveAbility(f, 'A00K')
call UnitRemoveAbility(f, 'B007')
call DestroyEffect(LoadEffectHandle(Hash, GetHandleId(f), StringHash("Zeal_e")))
call RemoveSavedHandle(Hash, GetHandleId(f), StringHash("Zeal_e"))
call RemoveSavedReal(Hash, GetHandleId(f), StringHash("Zeal_time"))
call GroupRemoveUnit(ReplicsGroup, f)
else
if r == 5. then
call SetUnitAbilityLevel(f, 'A00J', GetUnitAbilityLevel(f, 'A00J') + 1)
//call echo(I2S(GetUnitAbilityLevel(f,'A00J')+1))
endif
call SaveReal(Hash, GetHandleId(f), StringHash("Zeal_time"), r)
endif
call GroupRemoveUnit(P, f)
endloop
//call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Sorcerers,function GroupAddGroupEnumJ)
//set g = CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("POL_r")) - 0.1
if r <= 0. then
call RemoveSavedReal(Hash, GetHandleId(f), StringHash("POL_r"))
call GroupRemoveUnit(Sorcerers, f)
else
call SaveReal(Hash, GetHandleId(f), StringHash("POL_r"), r)
endif
call GroupRemoveUnit(P, f)
endloop
// call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(PowerDashHaste,function GroupAddGroupEnumJ)
//set g = CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("CPT_HASTE")) - 0.1
if r <= 0. then
call UnitRemoveAbility(f, 'ACua')
call RemoveSavedReal(Hash, GetHandleId(f), StringHash("CPT_HASTE"))
call GroupRemoveUnit(PowerDashHaste, f)
else
call SaveReal(Hash, GetHandleId(f), StringHash("CPT_HASTE"), r)
endif
call GroupRemoveUnit(P, f)
endloop
//call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(DSgroup,function GroupAddGroupEnumJ)
// set g = CopyGroup(DSgroup)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if GetUnitAbilityLevel(f, 'B005') <= 0 and GetUnitAbilityLevel(f, 'B00C') <= 0 then
set r = LoadReal(Hash, GetHandleId(f), StringHash("DS_trsp")) - 4
call SetUnitVertexColor(f, 200, 200, 200, R2I(r))
if r <= 75 then
call GroupRemoveUnit(DSgroup, f)
call FlushChildHashtable(Hash, GetHandleId(f))
call RemoveUnit(f)
else
call SaveReal(Hash, GetHandleId(f), StringHash("DS_trsp"), r)
endif
else
call SetUnitVertexColor(f, 255, 255, 255, 255)
call SaveReal(Hash, GetHandleId(f), StringHash("DS_trsp"), 255)
endif
call GroupRemoveUnit(P, f)
endloop
// call DestroyGroup(g)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(DSgroupDread,function GroupAddGroupEnumJ)
//set g = CopyGroup(DSgroupDread)
loop
set f = FirstOfGroup(P)
exitwhen f == null
//if GetUnitAbilityLevel(f, 'B005') <= 0 then
set r = LoadReal(Hash, GetHandleId(f), StringHash("DSD_trsp")) - 6
call SetUnitVertexColor(f, 200, 200, 200, R2I(r))
if r <= -70 then
call GroupRemoveUnit(DSgroupDread, f)
call RemoveSavedHandle(Hash, GetHandleId(f), StringHash("DSD_trsp"))
call ShowUnit(f,false)
else
if r == 183 then
call AddEffectTimeToPoint("Abilities\\Spells\\Demon\\DarkConversion\\ZombifyTarget.mdl",GetUnitX(f),GetUnitY(f),6.)
endif
call SaveReal(Hash, GetHandleId(f), StringHash("DSD_trsp"), r)
endif
//else
// call SetUnitVertexColor(f, 255, 255, 255, 255)
// call SaveReal(Hash, GetHandleId(f), StringHash("DSD_trsp"), 255)
//endif
call GroupRemoveUnit(P, f)
endloop
// call DestroyGroup(g)
set timesec = timesec+0.1
//=========================//=========================//=========================
//========================= EVERY SECONS BY TIMESEC ==================================
//=========================//=========================//=========================
if timesec == 1. then // EVERY SEC КАЖДУЮ СЕКУНДУ
RaidInt++
set timesec=0.
set timemin = timemin + 1
I2 = 1
set b2 = Condition(function RaidAttackFilter)
//call echo("does work")
loop // third time
exitwhen I2 > RaidCurrentMax //repeate raid command 3 time
if RaidCommandIsActive[I2] == true and RaidActive[I2] == true then
//set RaidCommandIsActive[I2] = false
//call echo(I2S(I2))
//call echo("work?")
set F = FirstOfGroup(RaidGroup[I2])
//call echo("raid commant tye == " + I2S(RaidCommandType[I2]))
if RaidCommandType[I2] == 1 then
//call echo("command type 1")
call GroupClear(P)
call GroupEnumUnitsInRange(P,GetUnitX(F),GetUnitY(F),700,b2)
//set F2 = FirstOfGroup(P)
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[I2],function GroupAddGroupEnumJ)
if DistanceXY(GetUnitX(F),GetUnitY(F),RaidXPoint[I2],RaidYPoint[I2]) <= 1200 and DistanceXY(GetUnitX(F),GetUnitY(F),RaidXPoint[I2],RaidYPoint[I2]) > 300 then
loop
set F2= FirstOfGroup(P2)
exitwhen F2 == null
if RaidInt == 2 then
call IssuePointOrder(F2,"attack",RaidXPoint[I2],RaidYPoint[I2])
endif
call GroupRemoveUnit(P2,F2)
endloop
elseif DistanceXY(GetUnitX(F),GetUnitY(F),RaidXPoint[I2],RaidYPoint[I2]) < 300 //-->
//call echo("REACHED ATTACK POINT")
set RaidCommandIsActive[I2] = false
loop //-->
set F2= FirstOfGroup(P2)
exitwhen F2 == null
call IssueImmediateOrder(F2,"stop")
call GroupRemoveUnit(P2,F2)
endloop //<--
else
//call echo("Anyway fuck u")
set RaidCommandIsActive[I2] = false
endif //<--
elseif RaidCommandType[I2] == 2 then
//call echo("command type 2")
call GroupClear(P2)
set bj_groupAddGroupDest = P2
call ForGroup(RaidGroup[I2],function GroupAddGroupEnumJ)
if DistanceXY(GetUnitX(F),GetUnitY(F),RaidXPoint[I2],RaidYPoint[I2]) <= 300
//call echo("reached")
set RaidCommandIsActive[I2] = false
loop
set F2= FirstOfGroup(P2)
exitwhen F2 == null
call IssueImmediateOrder(F2,"stop")
call GroupRemoveUnit(P2,F2)
endloop
set RaidCommandIsActive[I2] = false
else //-->
//call echo("still go group " + I2S(I2))
loop //-->
set F2= FirstOfGroup(P2)
exitwhen F2 == null
if RaidInt == 2 then
//call echo("etteck")
call IssuePointOrder(F2,"attack",RaidXPoint[I2],RaidYPoint[I2])
endif
call GroupRemoveUnit(P2,F2)
endloop //<--
endif //<--
endif
endif
I2++
endloop
//call echo("end")
call DestroyBoolExpr(b2)
if RaidInt == 3 then
set RaidInt = 0
//call echo("saddd")
endif
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(AttackingGroup,function GroupAddGroupEnumJ)
// set g= CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set R = LoadReal(Hash,GetHandleId(f),StringHash("Attacking")) - 1.
if R <=0. then
call UnitRemoveAbility(f,'Aasl')
call RemoveSavedReal(Hash,GetHandleId(f),StringHash("Attacking"))
call GroupRemoveUnit(AttackingGroup,f)
else
call SaveReal(Hash,GetHandleId(f),StringHash("Attacking"),R)
endif
call GroupRemoveUnit(P, f)
endloop
// call DestroyGroup(g)
if timemin == 60 then
set timemin = 0
set i = 0
loop
exitwhen i == 10
call AdjustPlayerStateJ( 1, Player(i), PLAYER_STATE_RESOURCE_FOOD_CAP)
set i = i + 1
endloop
endif
set i = 0
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(RageOfTheDamned,function GroupAddGroupEnumJ)
//set g = CopyGroup(RageOfTheDamned)
loop
set f = FirstOfGroup(P)
exitwhen f == null
if GetUnitAbilityLevel(f, 'Buhf') > 0 then
call SetWidgetLife(f, GetWidgetLife(f) + 4)
else
call GroupRemoveUnit(RageOfTheDamned, f)
endif
call GroupRemoveUnit(P, f)
endloop
// call DestroyGroup(g)
loop
exitwhen i == 10 // there are all bots next
if PlayerInGame[i] and CinematicEnd[i] then
if i == 0 or i == 1 or i == 2 or i == 3 then
set cs = gg_cam_GameCam1
else
set cs = gg_cam_GameCam1
endif
if GetLocalPlayer() == Player(i) then
call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, distance[i], 1.00 )
//call (R2S(CameraSetupGetField(cs,CAMERA_FIELD_TARGET_DISTANCE)),0.5)
call SetCameraField(CAMERA_FIELD_ANGLE_OF_ATTACK, CameraSetupGetField(cs, CAMERA_FIELD_ANGLE_OF_ATTACK), 1.00 )
call SetCameraField(CAMERA_FIELD_ROLL, CameraSetupGetField( cs, CAMERA_FIELD_ROLL), 1.00 )
call SetCameraField(CAMERA_FIELD_ROTATION, CameraSetupGetField(cs, CAMERA_FIELD_ROTATION), 1.00 )
endif
endif
set i = i + 1
endloop
set i = 1
loop
exitwhen i > PatrolMax
if not IsUnitDead(PatrolUnit[i]) then
set r = LoadReal(Hash, GetHandleId(PatrolUnit[i]), StringHash("PTtime")) - 1.
if r <= 0. then
call SaveReal(Hash, GetHandleId(PatrolUnit[i]), StringHash("PTtime"), LoadReal(Hash, GetHandleId(PatrolUnit[i]), StringHash("PTtimeSaved")))
set i2 = i * 2
if RectContainsCoordsJ(PatrolRect[i2 - 1], GetUnitX(PatrolUnit[i]), GetUnitY(PatrolUnit[i])) then
call IssuePointOrder(PatrolUnit[i], "attack", GetRectCenterX(PatrolRect[i2]), GetRectCenterY(PatrolRect[i2]))
elseif RectContainsCoordsJ(PatrolRect[i2], GetUnitX(PatrolUnit[i]), GetUnitY(PatrolUnit[i])) then
call IssuePointOrder(PatrolUnit[i], "attack", GetRectCenterX(PatrolRect[i2 - 1]), GetRectCenterY(PatrolRect[i2 - 1]))
else
call IssuePointOrder(PatrolUnit[i], "attack", GetRectCenterX(PatrolRect[i2 - 1]), GetRectCenterY(PatrolRect[i2 - 1]))
endif
else
call SaveReal(Hash, GetHandleId(PatrolUnit[i]), StringHash("PTtime"), r)
endif
endif
set i = i + 1
endloop
// DEFENDOFF
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(DefendOff,function GroupAddGroupEnumJ)
// set g = CopyGroup()
loop
set f = FirstOfGroup(P)
exitwhen f == null
set r = LoadReal(Hash, GetHandleId(f), StringHash("Defend_R")) - 1.
if r <= 0. then
//call echo("end")
call IssueImmediateOrder(f,"undefend")
call RemoveSavedReal(Hash, GetHandleId(f), StringHash("Defend_R"))
call GroupRemoveUnit(DefendOff, f)
else
call SaveReal(Hash, GetHandleId(f), StringHash("Defend_R"), r)
endif
call GroupRemoveUnit(P, f)
endloop
//call DestroyGroup(g)
// GREAT SOURCES AURA
set B = Condition(function GreatSourcesDealAuraEnemyFilter)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(GreatSourcesDealAura,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if F!= null and not IsUnitDead(F) then
call GroupClear(P2)
call GroupEnumUnitsInRange(P2,GetUnitX(F),GetUnitY(F),1800,B)
loop
set F2 = FirstOfGroup(P2)
exitwhen F2 == null
if not IsUnitInGroup(F2,Corruption) and not IsUnitDead(F2) then
call UnitAddAbility(F2,'A00I')
call GroupAddUnit(Corruption,F2)
call UnitDamageTarget(F,F2,30.,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayTarget.mdl",F2,"chest"))
call SaveUnitHandle(Hash,GetHandleId(F2),StringHash("Corruption_origin"),F)
endif
call GroupRemoveUnit(P2, F2)
endloop
endif
call GroupRemoveUnit(P, F)
endloop
call DestroyBoolExpr(B)
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Corruption,function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
set F2 = LoadUnitHandle(Hash,GetHandleId(F),StringHash("Corruption_origin"))
if F != null then
if DistanceXY(GetUnitX(F),GetUnitY(F),GetUnitX(F2),GetUnitY(F2)) <= 1800 and not IsUnitDead(F) then
call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Undead\\DeathandDecay\\DeathandDecayDamage.mdl",F,"head"))
call UnitDamageTarget(F2,F,15.,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
else
//call echo("OUT")
call UnitRemoveAbility(F,'A00I')
call UnitRemoveAbility(F,'BUdd')
call GroupRemoveUnit(Corruption,F)
call RemoveSavedHandle(Hash,GetHandleId(F),StringHash("Corruption_origin"))
endif
endif
call GroupRemoveUnit(P, F)
endloop
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(ReplicsGroupIsOnPoint,function GroupAddGroupEnumJ)
loop
set f = FirstOfGroup(P)
exitwhen f == null
set ID = GetHandleId(f)
set X =LoadReal(Hash,ID,StringHash("RG_OnPoint_X"))
set Y = LoadReal(Hash,ID,StringHash("RG_OnPoint_Y"))
if DistanceXY(X,Y,GetUnitX(f),GetUnitY(f)) < 300 then
call IssueImmediateOrder(f,"stop")
call RemoveSavedReal(Hash,ID,StringHash("RG_OnPoint_X"))
call RemoveSavedReal(Hash,ID,StringHash("RG_OnPoint_Y"))
call GroupRemoveUnit(ReplicsGroupIsOnPoint,f)
elseif GetUnitCurrentOrder(f) != String2OrderId("move") then //not IssuePointOrder(f, "move", X,Y)
call IssuePointOrder(f, "move", X, Y)
endif
call GroupRemoveUnit(P, f)
endloop
set time = 0.
set i = 0
/* set r = LoadReal(Hash, idT, 0)
call SaveReal(Hash, idT, 0, r + 1.) */
set TimeToFixAttack = TimeToFixAttack + 1.
set i = 1
if UDUNITS > 0 then
loop
exitwhen i > UGM
if UndeadGroupIsOn[i] == true then
if IsUnitFocused[i] == false and UndeadGroupEliminated[i] != true then
I++
set F = GroupPickRandomUnitEx(Undead[i]) //grouppickrandomunit
set FocusedUnit[i] = GetClosestUnitInGroup(GetUnitX(F), GetUnitY(F), CilivianzGroup)
if not IsUnitInGroup(FocusedUnit[i],FocusedUnitVision) then
call GroupAddUnit(FocusedUnitVision,FocusedUnit[i])
set HuntTargetUnitDummy[i] = CreateUnit(Player(6),'e001',GetUnitX(FocusedUnit[i]),GetUnitY(FocusedUnit[i]),0)
set S = ""
if IsPlayerInForce(GetLocalPlayer(),UndeadForce) then
set S = "Abilities\\Spells\\NightElf\\shadowstrike\\shadowstrike.mdl" //"HuntersMarkTarget.mdx"
endif
set HuntTargetEffect[i] = AddSpecialEffectTarget(S,FocusedUnit[i],"overhead")
call SaveInteger(Hash,GetHandleId(FocusedUnit[i]),StringHash("FocusedUnit[i]_i"),i)
endif
set UndeadFocusX[i] = GetUnitX(FocusedUnit[i])
set UndeadFocusY[i] = GetUnitY(FocusedUnit[i])
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Undead[i],function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
call IssuePointOrder(F, "attack", UndeadFocusX[i], UndeadFocusY[i])
// endif
call GroupRemoveUnit(P, F)
//set i = i + 1
endloop
//call GroupClear(g)
//call DestroyGroup(g)
//call GroupClear(P)
set IsUnitFocused[i] = true
//call DestroyGroup(P)
elseif IsUnitFocused[i] == true and FocusedUnit[i] != null and UndeadGroupEliminated[i] != true then
I++
set bl = false
//set FirstUnitDS = false
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Undead[i],function GroupAddGroupEnumJ)
// set g = CopyGroup(Undead[i])
loop
set F = FirstOfGroup(P)
exitwhen F == null
if FocusedUnit[i] != null and DistanceXY(GetUnitX(F),GetUnitY(F), UndeadFocusX[i], UndeadFocusY[i]) < 250 then // 851983 then//String2OrderId("attack") then
//call IssueImmediateOrder(F,"stop")
set UndeadFocusX[i] = GetUnitX(FocusedUnit[i])
set UndeadFocusY[i] = GetUnitY(FocusedUnit[i])
set bl = true
elseif TimeToFixAttack == 5. and FocusedUnit[i] != null then
call IssuePointOrder(F, "attack", UndeadFocusX[i] , UndeadFocusY[i])
//call echo("GO bitch")
//elseif vse ravno attack stoit pidor
//call attack
//call IssuePointOrder(F, "attack", UndeadFocusX[i], UndeadFocusY[i]))
//call SaveBoolean(Hash,GetHandleId(F),StringHash("Undead_reached"),true)
//call IssuePointOrder(F, "attack", GetUnitX(FocusedUnit[i]), GetUnitY(FocusedUnit[i]))
//call echo("??? ????????")
endif
call GroupRemoveUnit(P, F)
//set i = i + 1
endloop
if bl == true then
call GroupClear(P)
set bj_groupAddGroupDest = P
call ForGroup(Undead[i],function GroupAddGroupEnumJ)
loop
set F = FirstOfGroup(P)
exitwhen F == null
if FocusedUnit[i] != null then // 851983 then//String2OrderId("attack") then
call IssueImmediateOrder(F,"stop")
call IssuePointOrder(F, "attack", UndeadFocusX[i] , UndeadFocusY[i])
//call SaveBoolean(Hash,GetHandleId(F),StringHash("Undead_reached"),true)
//call IssuePointOrder(F, "attack", GetUnitX(FocusedUnit[i]), GetUnitY(FocusedUnit[i]))
//call echo("??? ????????")
endif
call GroupRemoveUnit(P, F)
//set i = i + 1
endloop
endif
// call DestroyGroup(g)
//call GroupClear(P)
// elseif FocusedUnit[i] == null
// call echo("хуево")
endif
endif
set i = i + 1
endloop
endif
if TimeToFixAttack >= 5. then
set TimeToFixAttack = 0.
endif
//=========================//=========================//=========================
//========================= EVERY SECONS BY TIMESEC -- END ACTIONS ==================================
//=========================//=========================//=========================
endif
endif // game over
//====
set t = null
set g = null
set f = null
set d = null
set cs = null
set b2 = null
//set randomg = null
//set randomu =null
endfunction
function HS_A takes nothing returns nothing
endfunction
//===========================================================================
function HS takes nothing returns nothing
//it's important thing
local integer i
local boolexpr b = Condition(function Cilivians_Expr)
//call echo("0.1")
set distance[0] = 2100 //2300
set distance[1] = 2100
set distance[2] = 2100
set distance[3] = 2100
set distance[6] = 2100
set distance[7] = 2100
set distance[8] = 2100
set distance[9] = 2100
// ======
set i = 1
loop
exitwhen i > UGMmax
set IsUnitFocused[i] = false
set UndeadGroupShouldBeEliminated[i] = false
set UndeadGroupEliminated[i] = false
set UndeadGroupIsOn[i] = false
set i = i + 1
endloop
set Undead[1] = CreateGroup() // ?? ????? ????????? ??? ???????????? = )
set UDUNITS = 0
/* set LIVINGRECTS[1] = gg_rct_WestLowRegion
set LIVINGRECTS[2] = gg_rct_MiddleLowRegion
set LIVINGRECTS[3] = gg_rct_UpperRightPart
set LIVINGRECTS[4] = gg_rct_UpperRightPart2
set LIVINGRECTS[5] = gg_rct_MiddleRightPart
set LIVINGRECTS[6] = gg_rct_LowerRightPart2
set LIVINGRECTS[7] = gg_rct_MiddleRightPart2
set LIVINGRECTS[8] = gg_rct_MiddleUpperRight */
set ISRECTALIVE[1] = true
set ISRECTALIVE[2] = true
set ISRECTALIVE[3] = true
set ISRECTALIVE[4] = true
set ISRECTALIVE[5] = true
set ISRECTALIVE[6] = true
set ISRECTALIVE[7] = true
set ISRECTALIVE[8] = true
set QuestCompleted[1] = false
set QuestCompleted[2] = false
set QuestCompleted[3] = false
set QuestCompleted[4] = false
set QuestCompleted[5] = false
/* set Cilivians[1] = CreateGroup()
set Cilivians[2] = CreateGroup()
set Cilivians[3] = CreateGroup()
set Cilivians[4] = CreateGroup()
call GroupEnumUnitsInRect(Cilivians[1], LIVINGRECTS[1], b)//UnitsInRectOfPlayer(gg_rct_WestLowRegion, Player(5))
call GroupEnumUnitsInRect(Cilivians[2], LIVINGRECTS[2], b)
call GroupEnumUnitsInRect(Cilivians[3], LIVINGRECTS[3], b)
call GroupEnumUnitsInRect(Cilivians[4], LIVINGRECTS[4], b) */
/* здесь нет проверки на охрану, т.е они не будет являться приоритетом фокуса. Время покажет */
/* set P = CopyGroup(Cilivians[1])
loop
set F = FirstOfGroup(P)
exitwhen F == null
set CGM = CGM + 1
call GroupRemoveUnit(P, F)
endloop
call GroupClear(P)
set P = CopyGroup(Cilivians[2])
loop
set F = FirstOfGroup(P)
exitwhen F == null
set CGM = CGM + 1
call GroupRemoveUnit(P, F)
endloop
call GroupClear(P)
set P = CopyGroup(Cilivians[3])
loop
set F = FirstOfGroup(P)
exitwhen F == null
set CGM = CGM + 1
call GroupRemoveUnit(P, F)
endloop
call GroupClear(P)
set P = CopyGroup(Cilivians[4])
loop
set F = FirstOfGroup(P)
exitwhen F == null
set CGM = CGM + 1
call GroupRemoveUnit(P, F)
endloop
*/
/* call GroupAddUnit(Undead[UGM], gg_unit_nzom_0029)
call GroupAddUnit(Undead[UGM], gg_unit_nzom_0028) */
if TEST == true then
call GroupAddUnit(Undead[UGM], gg_unit_Udea_0589)
//call GroupAddUnit(Undead[UGM], gg_unit_Nmag_0725)
//call GroupAddUnit(Undead[UGM], gg_unit_Ulic_0724)
//call GroupAddUnit(Undead[UGM], gg_unit_Ucrl_0723)
set UDUNITS = 1 // because we added 3 zombies to group right now
else
//call GroupAddUnit(Undead[UGM], gg_unit_Udea_0589)
//set UDUNITS = 1
endif
call GroupAddUnit(Paladins, gg_unit_Hpal_0503)
set HERO[0] = gg_unit_Hpal_0503
call GroupAddUnit(Paladins, gg_unit_H001_0245)
set HERO[1] = gg_unit_H001_0245
call GroupAddUnit(Paladins, gg_unit_H002_0715)
set HERO[2] = gg_unit_H002_0715
call GroupAddUnit(Paladins, gg_unit_H003_0717)
set HERO[3] = gg_unit_H003_0717
//call GroupAddUnit(DreadLords, gg_unit_Udre_0043)
set HERO[6] = gg_unit_Udre_0043
//call GroupAddUnit(DreadLords, gg_unit_U000_0551)
set HERO[7] = gg_unit_U000_0551
//call GroupAddUnit(DreadLords, gg_unit_U001_0718)
set HERO[8] = gg_unit_U001_0718
//call GroupAddUnit(DreadLords, gg_unit_U002_0716)
set HERO[9] = gg_unit_U002_0716
if TEST == true then
call GroupAddUnit(DreadLords, gg_unit_Udre_0043)
call ForceAddPlayer(UndeadForce,Player(7))
//call GroupAddUnit(DreadLords, gg_unit_U000_0551)
//call GroupAddUnit(DreadLords, gg_unit_U001_0718)
//call GroupAddUnit(DreadLords, gg_unit_U002_0716)
endif
set i = 0
loop
call SetPlayerAbilityAvailable( Player(i), 'A003', false )
set i = i + 1
exitwhen i == bj_MAX_PLAYER_SLOTS
endloop
call TimerStart(CreateTimer(), 0.1, true, function EveryTenthCSecondInGame)
//=====
call DestroyBoolExpr(b)
set b = null
endfunction
endscope
//Code indented using The_Witcher's Script language Aligner
//Download the newest version and report bugs at www.hiveworkshop.com